diff options
| author | 2025-10-10 22:34:17 +0200 | |
|---|---|---|
| committer | 2025-10-10 22:34:17 +0200 | |
| commit | 0fb2b5712cc98ea993f37bd86eeed89fddc5d6d9 (patch) | |
| tree | de9fce7ad0212b54c3de3a72dbe67038e8dd7936 /c.c | |
| parent | 0cb0dd0d23386a6a6ff4e981bb633b9e34a87c65 (diff) | |
bugfixes
Diffstat (limited to 'c.c')
| -rw-r--r-- | c.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -3659,8 +3659,7 @@ localdecl(struct comp *cm, struct function *fn, bool forini) goto Err; } EMITS { - /*actual alloca filled in later (for inferred array size decls)*/ - decl.id = addinstr(fn, mkinstr(Oalloca1, KPTR, mkref(RICON, -1))).i; + decl.id = addinstr(fn, mkalloca(typesize(decl.ty), typealign(decl.ty))).i; } Initz: if (st.varini) { @@ -3685,7 +3684,7 @@ localdecl(struct comp *cm, struct function *fn, bool forini) d->ty, ini.ty); } EMITS { - if (ini.t == EINIT || ini.t == ESTRLIT) + if (ini.t == EINIT || (d->ty.t == TYARRAY && ini.t == ESTRLIT)) geninit(fn, d->ty, mkref(RTMP, decl.id), &ini); else if (isagg(d->ty)) structcopy(fn, d->ty, mkref(RTMP, decl.id), exprvalue(fn, &ini)); |