Fix handling of post increment: Either the first or second operand

is the register with the memory address, and it's that register's
value we need to increment or decrement.

MFC after: 3 days
This commit is contained in:
Marcel Moolenaar 2005-01-27 06:01:44 +00:00
parent 29bf6af890
commit b71bca0f84
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=140891

View file

@ -240,7 +240,10 @@ fixup(struct asm_inst *i, mcontext_t *mc, uint64_t va)
postinc = (i->i_oper[3].o_type == ASM_OPER_IMM)
? i->i_oper[3].o_value : 0;
if (postinc != 0) {
reg = greg_ptr(mc, (int)i->i_oper[3].o_value);
if (i->i_oper[1].o_type == ASM_OPER_MEM)
reg = greg_ptr(mc, (int)i->i_oper[1].o_value);
else
reg = greg_ptr(mc, (int)i->i_oper[2].o_value);
if (reg == NULL)
return (EINVAL);
postinc += rdreg(reg);