This fixes expressions like ld a0, s0, -24 that regressed in d87801bd50abb04be894628338164537d88654dc
Unified · Split
| @@ -189,7 +189,7 @@ static void parse_operand(TCCState *s1, Operand *op) · 188 unmodified lines | ||
| 189 | 189 | op->e = e; |
| 190 | 190 | /* compare against unsigned 12-bit maximum */ |
| 191 | 191 | if (!op->e.sym) { |
| 192 | − if (op->e.v < 0x1000) | |
| 192 | + if ((int) op->e.v >= -0x1000 && (int) op->e.v < 0x1000) | |
| 193 | 193 | op->type = OP_IM12S; |
| 194 | 194 | } else if (op->e.sym->type.t & (VT_EXTERN | VT_STATIC)) { |
| 195 | 195 | label.type.t = VT_VOID | VT_STATIC; |