History

riscv64-asm.c: fix assembly instruction with negative immediate offsets.

This fixes expressions like ld a0, s0, -24 that regressed in d87801bd50abb04be894628338164537d88654dc

Andrius Štikonas committed 2 years ago

Commit 04365dd1 parent 61206561 file · +1 −1Browse files

Unified · Split

riscv64-asm.c+1−1
@@ -189,7 +189,7 @@ static void parse_operand(TCCState *s1, Operand *op) · 188 unmodified lines
189189 op->e = e;
190190 /* compare against unsigned 12-bit maximum */
191191 if (!op->e.sym) {
192− if (op->e.v < 0x1000)
192+ if ((int) op->e.v >= -0x1000 && (int) op->e.v < 0x1000)
193193 op->type = OP_IM12S;
194194 } else if (op->e.sym->type.t & (VT_EXTERN | VT_STATIC)) {
195195 label.type.t = VT_VOID | VT_STATIC;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t