mirror of
git://repo.or.cz/tinycc.git
synced 2026-06-20 03:44:19 +08:00
i386-asm.c: Do bit-check for OP_SEG in asm_opcode
Fix a bug with "call *%%gs:16", which sets the two flags OP_INDIR and OP_SEG in pop->type.
This commit is contained in:
parent
de8c19e1da
commit
9dc59f9c23
@ -722,7 +722,7 @@ ST_FUNC void asm_opcode(TCCState *s1, int opcode)
|
||||
}
|
||||
parse_operand(s1, pop);
|
||||
if (tok == ':') {
|
||||
if (pop->type != OP_SEG || seg_prefix)
|
||||
if (!(pop->type & OP_SEG) || seg_prefix)
|
||||
tcc_error("incorrect prefix");
|
||||
seg_prefix = segment_prefixes[pop->reg];
|
||||
next();
|
||||
@ -852,7 +852,7 @@ again:
|
||||
if (opcode >= TOK_ASM_first && opcode <= TOK_ASM_last) {
|
||||
int b;
|
||||
b = op0_codes[opcode - TOK_ASM_first];
|
||||
if (b & 0xff00)
|
||||
if (b & 0xff00)
|
||||
g(b >> 8);
|
||||
g(b);
|
||||
return;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user