diff options
| author | 2023-06-04 11:20:43 +0200 | |
|---|---|---|
| committer | 2023-06-04 11:20:43 +0200 | |
| commit | b295cd602d59888c373819ec3bcd63e12f008702 (patch) | |
| tree | 8e3a6b6c0262451b040659e67164bb85635a2512 /parse.c | |
| parent | 51197251c464a742c5bef5a67c6da222d32b14d3 (diff) | |
bugfix
Diffstat (limited to 'parse.c')
| -rw-r--r-- | parse.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -1763,7 +1763,12 @@ block(struct parser *pr, struct function *fn) error(&span, "cannot initialize '%ty' variable with '%ty'", decl.ty, ini.ty); } - EMITS genstore(fn, decl.ty, mkref(RTMP, decl.id), exprvalue(fn, &ini)); + EMITS { + if (isagg(decl.ty)) + structcopy(fn, mkref(RTMP, decl.id), &ini); + else + genstore(fn, decl.ty, mkref(RTMP, decl.id), exprvalue(fn, &ini)); + } } break; case SCTYPEDEF: break; |