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 | 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; |