mescc: Tinycc support: bugfix *foo = bar.

* module/language/c99/compiler.mes (base->ident-address): Typo, fixes (non-char*)*x = y.
* scaffold/tests/77-pointer-assign.c (test): Test it.
This commit is contained in:
Jan Nieuwenhuizen 2017-07-28 15:45:22 +02:00
parent 2e0c1c0aff
commit 17e0e0cab7
2 changed files with 3 additions and 4 deletions

View file

@ -395,7 +395,7 @@
4))) 4)))
(wrap-as (append (i386:local->accu (local:id local)) (wrap-as (append (i386:local->accu (local:id local))
(if (= size 1) (i386:byte-base->accu-address) (if (= size 1) (i386:byte-base->accu-address)
(i386:byte-base->accu-address))))) (i386:base->accu-address)))))
(let ((size 4)) ;; FIXME (let ((size 4)) ;; FIXME
(wrap-as (append (i386:label-mem->accu `(#:address ,o)) (wrap-as (append (i386:label-mem->accu `(#:address ,o))
(if (= size 1) (i386:byte-base->accu-address) (if (= size 1) (i386:byte-base->accu-address)

View file

@ -57,9 +57,8 @@ test ()
eputs ("f.bar:"); eputs (itoa (f.bar)); eputs ("\n"); eputs ("f.bar:"); eputs (itoa (f.bar)); eputs ("\n");
if (f.bar != 0x11223344) return 1; if (f.bar != 0x11223344) return 1;
add2 (&f.bar); add2 (&f.bar);
// FIXME eputs ("f.bar:"); eputs (itoa (f.bar)); eputs ("\n");
// eputs ("f.bar:"); eputs (itoa (f.bar)); eputs ("\n"); if (f.bar != 0x22334455) return 2;
// if (f.bar != 0x22334455) return 2;
return 0; return 0;
} }