Version and Platform:
- Binary Ninja Version: 6.0.10501-dev
- Edition: Ultimate
- OS: OSX
- OS Version: 26.5.2
- CPU Architecture: M3
Bug Description:
Merging two variables used as i in consecutive for loops results in semantically incorrect code when merging in the wrong order. When merging the second variable into the first, it loses that variable's first initialization. There might be another bug here that the initialization is not inside the for loop's initialization slot. Merging the second variable into the first seems to work how I expect it to.
Steps To Reproduce:
- Merge
i_1 in the second for loop with i from the first
- See error
Expected Behavior:
I expect to see the initialization of i to zero before/inside the first for loop regardless of variable merge order (or for this behavior to be documented plus a warning when merging in the incorrect order, and probably not labeling them as sound merges).
Screenshots/Video Recording:
i merged with i_1, correctly clears value to zero before each loop

i_1 merged with i, doesn't initialize i to zero

Binary:
phoenix index traces logarithmically
Version and Platform:
Bug Description:
Merging two variables used as
iin consecutive for loops results in semantically incorrect code when merging in the wrong order. When merging the second variable into the first, it loses that variable's first initialization. There might be another bug here that the initialization is not inside the for loop's initialization slot. Merging the second variable into the first seems to work how I expect it to.Steps To Reproduce:
i_1in the second for loop withifrom the firstExpected Behavior:
I expect to see the initialization of
ito zero before/inside the first for loop regardless of variable merge order (or for this behavior to be documented plus a warning when merging in the incorrect order, and probably not labeling them as sound merges).Screenshots/Video Recording:

imerged withi_1, correctly clears value to zero before each loopi_1merged withi, doesn't initializeito zeroBinary:
phoenix index traces logarithmically