-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Description
cmp rax, 0
jnz elsewhere
loop_header:
cmp rax, 10
jz loop_break
inc rax
jmp loop_header
loop_footer:
...
Here, we would like to identify that rax in the loop and rax before the loop are separate variables. ConditionConstantPropagation is supposed to do this, but it can only replace variable access expressions with constants. Here, the next time the vvar is used after the condition is inside the loop where it changes between iterations.
Proposed solution: create an artificial node between the branch and the constant successor where we assign a new vvar to the constant, and then replace all dominated uses of the condition vvar with the new vvar.
Steps to reproduce the bug
decompile wget lookup_host. r14d is branched on at 418F92 and used at 418FD3.
Environment
don't worry about it <3
Additional context
No response