solemnwarning / rehex

Reverse Engineers' Hex Editor
https://rehex.solemnwarning.net/
GNU General Public License v2.0
2.31k stars 116 forks source link

intX_t behaving as uintX_t variants #160

Closed mdaniel closed 2 years ago

mdaniel commented 2 years ago

Given:

local int8_t i; // same for int16_t int32_t but NOT int64_t
for (i = 2; i >= 0; i--) {
    Printf("inner(%d)\n", i);
    if (i > 100) break;
}

without that break, it would never terminate since it emits

inner(2)
inner(1)
inner(0)
inner(255)

Thankfully(?), local char i behaves the same, so it seems to be mostly systemic to the non unsigned types (except int64_t does actually behave correctly, emitting inner(-1))

solemnwarning commented 2 years ago

I thiiiink I fixed it... new tests are passing anyway!