DEC (HL) / (IX+d) dereferences the destination twice
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 12
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Description
The non-register branch of OP.DEC in Z80IL.py reuses the loaded value as the store address:
mem = operand_to_il(oper_type, oper_val, il, 1) # this is a load
tmp = il.sub(1, mem, il.const(1, 1), flags="not_c")
tmp = il.store(1, mem, tmp) # ...used as an address
35 (DEC (HL)) lifts as [[HL].b].b = sub.b{not_c}([HL].b, 1) — it stores to the address formed by the loaded byte.
OP.INC handles the same operand correctly with peel_load=True; DEC should match. 19 sites in one test binary.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in Z80IL.py at the non-register branch of OP.DEC, then compare it with OP.INC, which handles the same operand correctly with peel_load=True. Run the referenced test binary or existing lifting tests and confirm DEC (HL) and DEC (IX+d) store through the intended destination for all 19 sites.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- reverse-engineering
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 82/100