mescc: Tinycc support: ((unsigned char*)str)[i].
* module/language/c99/compiler.mes (expr->accu*): Consider size of expr array deref. * scaffold/tests/7d-cast-char.c: Test it.
This commit is contained in:
parent
949e320622
commit
d64a304a83
|
@ -1176,7 +1176,9 @@
|
|||
|
||||
((array-ref ,index ,array)
|
||||
(let* ((info ((expr->accu info) index))
|
||||
(size 4) ;; FIXME
|
||||
(ptr (expr->pointer info array))
|
||||
(size (if (= ptr 1) (expr->size info array)
|
||||
4))
|
||||
(info (append-text info (wrap-as (append (i386:accu->base)
|
||||
(if (eq? size 1) '()
|
||||
(append
|
||||
|
|
|
@ -29,5 +29,10 @@ test ()
|
|||
int i = ((unsigned char *)s)[0];
|
||||
if (i != 'i') return 2;
|
||||
|
||||
c = s[1];
|
||||
if (c != 'n') return 3;
|
||||
i = ((unsigned char *)s)[1];
|
||||
if (i != 'n') return 3;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue