mirror of
https://github.com/zeek/zeek.git
synced 2025-10-15 13:08:20 +00:00

* Instead of creating a NegExpr for negation of a literal/constant, a ConstExpr is now created directly. * For negation of integer literals, there's now an additional check for whether the integer would be outside the range of possible 'int' values. This can also help prevent the undefined behavior due to overflow as a result of trying to represent the minimum 'int' value of -9223372036854775808 as a literal in a script -- the unsigned value is cast to signed yielding INT64_MIN, then INT64_MIN is negated.
2 lines
354 B
Text
2 lines
354 B
Text
error in /home/jon/pro/zeek/zeek/testing/btest/.tmp/language.int-negation-range/int-negation-range.zeek, line 8: literal is outside range of 'int' values (-9223372036854775809)
|
|
error in /home/jon/pro/zeek/zeek/testing/btest/.tmp/language.int-negation-range/int-negation-range.zeek, line 9: literal is outside range of 'int' values (-9223372036854775810)
|