Branch: refs/heads/topic/bbannier/real-coercion-overflows
Home:
https://github.com/zeek/spicy
Commit: 7353ff3f70377e54c8d55a0edcf7ce00ee4417c1
https://github.com/zeek/spicy/commit/7353ff3f70377e54c8d55a0edcf7ce00ee4417c1
Author: Benjamin Bannier <
benjamin...@corelight.com>
Date: 2026-06-04 (Thu, 04 Jun 2026)
Changed paths:
M hilti/toolchain/src/compiler/coercer.cc
Log Message:
-----------
Avoid overflows when checking coercion from `real` to integer type
The casts from `double` to integral type could previously trigger UB at
compile time if the `double` value was outside of the range of the
integral type, NaN or infinity. To handle this correctly we add a range
check in this patch. Due to the way comparisons against float NaN and
infinity work they are also handled.
(cherry picked from commit 94f2b4fd27b48cdeaaf1c8ffd294b7127503a846)
To unsubscribe from these emails, change your notification settings at
https://github.com/zeek/spicy/settings/notifications