diff options
| author | 2023-06-19 22:33:35 +0200 | |
|---|---|---|
| committer | 2023-06-19 22:33:35 +0200 | |
| commit | 61367525aea8f3f11c29e628fe49768dda959cef (patch) | |
| tree | 7f3f428b40086c20ebc2e7aa54f49b4394b6e820 /c.c | |
| parent | 88bf0602d09bebbf18213fbf02821e9f63b964a8 (diff) | |
backend: compile comparison instrs and branches
Diffstat (limited to 'c.c')
| -rw-r--r-- | c.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1513,7 +1513,7 @@ compileexpr(struct function *fn, const struct expr *ex, bool discard) Cmp: ty = cvtarith(sub[0].ty, sub[1].ty); if (!ty.t) ty.t = TYPTR; - if (isunsigned(ty) && in_range(ins.op, Olth, Olte)) + if (isunsigned(ty) && in_range(ins.op, Olth, Ogte)) ins.op += Oulth - Olth; ins.l = compileexpr(fn, &sub[0], discard); ins.r = compileexpr(fn, &sub[1], discard); @@ -1928,7 +1928,8 @@ localdecl(struct comp *cm, struct function *fn, bool forini) } Err: if (!put) putdecl(cm, &decl); - } + } else if (forini) + error(&decl.span, "non-variable declaration in 'for' loop initializer"); } while (st.more); } |