You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
detour_sign_extend is implemented incorrectly #296
But the sign computation is incorrect here. The result should be the following: left upper bits of sign and then bits lower bits of value. But m1 is shifted left by left bits in the current implementation, so we will use bits bits of the sign. It's an error.
The proper sign computation should be
constINT64 sign = (wide < 0) ? (m1 << bits) : 0;
As an example, you can consider the following case that I met:
value is 0xffea2e4, bits is 28.
The expected result is 0xfffffffffffea2e4: 64 - 28 = 36 upper bits of the sign and then 28 bits of the value.
The actual result of the current implementation is 0xfffffff00ffea2e4 , that is obviously wrong.
Activity