History

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.

Stefan committed 1 year ago

Commit 9dc59f91 parent de8c19e1 file · +2 −2Browse files

Unified · Split

i386-asm.c+2−2
@@ -722,7 +722,7 @@ ST_FUNC void asm_opcode(TCCState *s1, int opcode) · 721 unmodified lines
722 }722 }
723 parse_operand(s1, pop);723 parse_operand(s1, pop);
724 if (tok == ':') {724 if (tok == ':') {
725 if (pop->type != OP_SEG || seg_prefix)725 if (!(pop->type & OP_SEG) || seg_prefix)
726 tcc_error("incorrect prefix");726 tcc_error("incorrect prefix");
727 seg_prefix = segment_prefixes[pop->reg];727 seg_prefix = segment_prefixes[pop->reg];
728 next();728 next();
@@ -852,7 +852,7 @@ again: · 123 unmodified lines
852 if (opcode >= TOK_ASM_first && opcode <= TOK_ASM_last) {852 if (opcode >= TOK_ASM_first && opcode <= TOK_ASM_last) {
853 int b;853 int b;
854 b = op0_codes[opcode - TOK_ASM_first];854 b = op0_codes[opcode - TOK_ASM_first];
855 if (b & 0xff00) 855 if (b & 0xff00)
856 g(b >> 8);856 g(b >> 8);
857 g(b);857 g(b);
858 return;858 return;

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