mirror of
https://github.com/frida/tinycc
synced 2024-11-28 10:33:07 +03:00
tccasm: accept bracketed offset expressions
This commit is contained in:
parent
47b4cf22cd
commit
0d9376da70
12
i386-asm.c
12
i386-asm.c
@ -376,8 +376,20 @@ static void parse_operand(TCCState *s1, Operand *op)
|
|||||||
op->e.v = e.v;
|
op->e.v = e.v;
|
||||||
op->e.sym = e.sym;
|
op->e.sym = e.sym;
|
||||||
} else {
|
} else {
|
||||||
|
next();
|
||||||
|
if (tok == '%') {
|
||||||
|
unget_tok('(');
|
||||||
op->e.v = 0;
|
op->e.v = 0;
|
||||||
op->e.sym = NULL;
|
op->e.sym = NULL;
|
||||||
|
} else {
|
||||||
|
/* bracketed offset expression */
|
||||||
|
asm_expr(s1, &e);
|
||||||
|
if (tok != ')')
|
||||||
|
expect(")");
|
||||||
|
next();
|
||||||
|
op->e.v = e.v;
|
||||||
|
op->e.sym = e.sym;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (tok == '(') {
|
if (tok == '(') {
|
||||||
next();
|
next();
|
||||||
|
@ -122,6 +122,7 @@ addl $0x123, 0x100
|
|||||||
addl $0x123, 0x100(%ebx)
|
addl $0x123, 0x100(%ebx)
|
||||||
addl $0x123, 0x100(%ebx,%edx,2)
|
addl $0x123, 0x100(%ebx,%edx,2)
|
||||||
addl $0x123, 0x100(%esp)
|
addl $0x123, 0x100(%esp)
|
||||||
|
addl $0x123, (3*8)(%esp)
|
||||||
addl $0x123, (%ebp)
|
addl $0x123, (%ebp)
|
||||||
addl $0x123, (%esp)
|
addl $0x123, (%esp)
|
||||||
cmpl $0x123, (%esp)
|
cmpl $0x123, (%esp)
|
||||||
|
Loading…
Reference in New Issue
Block a user