64-bit width LogicValue
s can be incorrect if their integer value is larger than the maximum positive int
value in Dart
#212
Labels
bug
Something isn't working
Describe the bug
Doing things like grabbing a 64-bit slice of a
_BigLogicValue
or constructing aLogicValue
usingofBigInt
with width 64 with a value that could be interpreted as a negative signedint
can cause clamping behavior inBigInt.toInt()
. This causes wrong operation results in a number of cases.To Reproduce
One example that reproduces the issue (this fails):
Expected behavior
Large 64-bit int values are treated as unsigned during conversions
Actual behavior
Sometimes int values are treated as signed and clamped
Additional: Dart SDK info
No response
Additional: pubspec.yaml
No response
Additional: Context
This type of behavior could occur in a number of places, so it's important to consider everywhere it might occur.
The text was updated successfully, but these errors were encountered: