panicsteve / unarmed

Plain C adaptation of Paul Guyot's ARM disassembler from the Einstein project
6 stars 0 forks source link

Bug with insn_stkblktrans #1

Open pguyot opened 9 years ago

pguyot commented 9 years ago

I've just been badly bitten by a bug with insn_stkblktrans (which seems to exist upstream, I mean in NetBSD).

define insn_stkblktrans(x) insn_stack_block_transfers[(x >> 23) & 3]

The same suffix is used with the given two bits, whether it's a load or a store. Yet, the stack-based suffixes depend on the operation direction. Cf ARM-ARM, page A5-48:

stack-based-modes

I suggest simply dropping this and using non-stack addressing modes, (i.e. replace insn_stkblktrans with insn_blktrans).

pguyot commented 9 years ago

Bug has been just fixed upstream (that was fast !) http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=49520 http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/arm/arm/disassem.c.diff?r1=1.25&r2=1.26&f=h