[zeek/spicy] 112d59: Avoid overflows when checking coercion from `real`...

0 views
Skip to first unread message

Benjamin Bannier

unread,
Jun 4, 2026, 10:47:45 AM (yesterday) Jun 4
to spicy-...@zeek.org
Branch: refs/heads/topic/bbannier/real-coercion-overflows
Home: https://github.com/zeek/spicy
Commit: 112d59f0ded2b4347396542916cc0325a1c6ca03
https://github.com/zeek/spicy/commit/112d59f0ded2b4347396542916cc0325a1c6ca03
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.



To unsubscribe from these emails, change your notification settings at https://github.com/zeek/spicy/settings/notifications
Reply all
Reply to author
Forward
0 new messages