diff options
| author | Thomas Preud'homme <robotux@celest.fr> | 2013-09-24 15:32:52 +0200 |
|---|---|---|
| committer | Thomas Preud'homme <robotux@celest.fr> | 2013-09-24 15:37:11 +0200 |
| commit | a1a691a030d065bf234f8a476e3b958e43b1b7c5 (patch) | |
| tree | 6c6eb3082e03cd6247e3c036a18d0c4b9fd233f5 /i386-asm.c | |
| parent | 45b35a3d66ee95e2526bf609cc88c4b4b21ac175 (diff) | |
| download | tinycc-a1a691a030d065bf234f8a476e3b958e43b1b7c5.tar.gz tinycc-a1a691a030d065bf234f8a476e3b958e43b1b7c5.tar.bz2 | |
Detect correct instruction with incorrect operands
Display a different warning when an instruction is recognized by tcc but
the operands found do not correspond to the constraints of the
instruction.
Diffstat (limited to 'i386-asm.c')
| -rw-r--r-- | i386-asm.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -27,6 +27,7 @@ #define TOK_ASM_first TOK_ASM_clc #define TOK_ASM_last TOK_ASM_emms +#define TOK_ASM_alllast TOK_ASM_pxor #define OPC_JMP 0x01 /* jmp operand */ #define OPC_B 0x02 /* only used with OPC_WL */ @@ -715,6 +716,9 @@ ST_FUNC void asm_opcode(TCCState *s1, int opcode) g(b >> 8); g(b); return; + } else if (opcode <= TOK_ASM_alllast) { + tcc_error("bad operand with opcode '%s'", + get_tok_str(opcode, NULL)); } else { tcc_error("unknown opcode '%s'", get_tok_str(opcode, NULL)); |
