Fix a bug with "call *%%gs:16", which sets the two flags OP_INDIR and OP_SEG in pop->type.
Unified · Split
| @@ -722,7 +722,7 @@ ST_FUNC void asm_opcode(TCCState *s1, int opcode) · 721 unmodified lines | ||
| 722 | 722 | } |
| 723 | 723 | parse_operand(s1, pop); |
| 724 | 724 | if (tok == ':') { |
| 725 | − if (pop->type != OP_SEG || seg_prefix) | |
| 725 | + if (!(pop->type & OP_SEG) || seg_prefix) | |
| 726 | 726 | tcc_error("incorrect prefix"); |
| 727 | 727 | seg_prefix = segment_prefixes[pop->reg]; |
| 728 | 728 | next(); |
| @@ -852,7 +852,7 @@ again: · 123 unmodified lines | ||
| 852 | 852 | if (opcode >= TOK_ASM_first && opcode <= TOK_ASM_last) { |
| 853 | 853 | int b; |
| 854 | 854 | b = op0_codes[opcode - TOK_ASM_first]; |
| 855 | − if (b & 0xff00) | |
| 855 | + if (b & 0xff00) | |
| 856 | 856 | g(b >> 8); |
| 857 | 857 | g(b); |
| 858 | 858 | return; |