claripy
claripy copied to clipboard
strided intervals: min_int() returns a negative value
In strided intervals, the maximum and minimum values for a given width are returned by four functions, depending on how you want to interpret the bits.
For unsigned interpretation there are min_int()
and max_int()
.
For signed interpretation there are signed_min_int()
and signed_max_int()
.
Here they are all tested for 32-bit width:
StridedInterval.min_int(32) # -0x80000000 <-- ERROR
StridedInterval.max_int(32) # 0xffffffff <-- OK
StridedInterval.signed_max_int(32) # 0x7fffffff <-- OK
StridedInterval.signed_min_int(32) # -0x80000000 <-- OK
Observed behavior: The unsigned version for 32-bit width returns that the minimum value is -134217728 or -0x80000000.
Expected behavior: It should return 0, the truly minimum value in unsigned interpretation.