mirror of
https://github.com/TinyCC/tinycc.git
synced 2025-11-16 12:34:45 +00:00
riscv64-asm.c: fix assembly instruction with negative immediate offsets.
This fixes expressions like ld a0, s0, -24 that regressed in
d87801bd50
This commit is contained in:
@@ -189,7 +189,7 @@ static void parse_operand(TCCState *s1, Operand *op)
|
||||
op->e = e;
|
||||
/* compare against unsigned 12-bit maximum */
|
||||
if (!op->e.sym) {
|
||||
if (op->e.v < 0x1000)
|
||||
if ((int) op->e.v >= -0x1000 && (int) op->e.v < 0x1000)
|
||||
op->type = OP_IM12S;
|
||||
} else if (op->e.sym->type.t & (VT_EXTERN | VT_STATIC)) {
|
||||
label.type.t = VT_VOID | VT_STATIC;
|
||||
|
||||
Reference in New Issue
Block a user