diff --git a/module/language/c99/compiler.mes b/module/language/c99/compiler.mes index a5ce8b58..73a94488 100644 --- a/module/language/c99/compiler.mes +++ b/module/language/c99/compiler.mes @@ -570,7 +570,7 @@ (let* ((info ((expr->accu* info) o)) (type0 (ident->type info struct0)) (type1 (field-type info type0 field0)) - (struct? (and (pair? type1) (equal? (car type1) "tag"))) + (struct? (memq (type:type (ast-type->type info type0)) '(struct union))) (ptr (field-pointer info type0 field0)) (size (ast-type->size info type1))) (if (= ptr -3) info @@ -583,7 +583,7 @@ (let* ((info ((expr->accu* info) o)) (type0 (ident->type info struct0)) (type1 (field-type info type0 field0)) - (struct? (and (pair? type1) (equal? (car type1) "tag"))) + (struct? (memq (type:type (ast-type->type info type0)) '(struct union))) (ptr (field-pointer info type0 field0)) (size (ast-type->size info type1))) (append-text info (wrap-as (append (if (and (= ptr -2) struct?) (i386:mem->accu) '()) diff --git a/scaffold/tests/7c-dynarray.c b/scaffold/tests/7c-dynarray.c index 71fe72a4..b11196aa 100644 --- a/scaffold/tests/7c-dynarray.c +++ b/scaffold/tests/7c-dynarray.c @@ -46,14 +46,16 @@ add (void *ptab, int *nb_ptr, void *data) *nb_ptr = nb; } -struct file { +typedef struct file { char name[4]; -}; +} file_struct; struct state { + int bla; char **paths; int path_count; struct file **files; + //file_struct **files; int file_count; };