diff options
| author | grischka <grischka> | 2009-12-06 17:41:22 +0100 |
|---|---|---|
| committer | grischka <grischka> | 2009-12-06 17:41:22 +0100 |
| commit | e500c9118a49a8ce0e9b8cee87bb1329adfe1af9 (patch) | |
| tree | 7ce9950f0b32a432f62ca241959266bb3dad2f99 /i386-asm.c | |
| parent | 56d6abdb3dfa6dd51934164969123c07296ef6af (diff) | |
| download | tinycc-e500c9118a49a8ce0e9b8cee87bb1329adfe1af9.tar.gz tinycc-e500c9118a49a8ce0e9b8cee87bb1329adfe1af9.tar.bz2 | |
i386-asm: fix imul
With imul the 3rd operand defaults to the 2nd on. The previous
logic left 'op_type[2]' uninitialized which caused the bug to
show up only sometimes.
Diffstat (limited to 'i386-asm.c')
| -rw-r--r-- | i386-asm.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -676,10 +676,11 @@ static void asm_opcode(TCCState *s1, int opcode) g(seg_prefix); v = pa->opcode; - if (v == 0x69 || v == 0x69) { + if ((v == 0x69 || v == 0x6b) && nb_ops == 2) { /* kludge for imul $im, %reg */ nb_ops = 3; ops[2] = ops[1]; + op_type[2] = op_type[1]; } else if (v == 0xcd && ops[0].e.v == 3 && !ops[0].e.sym) { v--; /* int $3 case */ nb_ops = 0; |
