[zeek/spicy] 9ceb56: Avoid overflows when checking coercion from `real`...

0 views
Skip to first unread message

Benjamin Bannier

unread,
7:39 AM (12 hours ago) 7:39 AM
to spicy-...@zeek.org
Branch: refs/heads/topic/bbannier/real-coercion-overflows
Home: https://github.com/zeek/spicy
Commit: 9ceb56ce7ab05d86b766c052d4823d98dcc06c1e
https://github.com/zeek/spicy/commit/9ceb56ce7ab05d86b766c052d4823d98dcc06c1e
Author: Benjamin Bannier <benjamin...@corelight.com>
Date: 2026-06-05 (Fri, 05 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