mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-08 13:03:39 +00:00
compiler: saturate float-to-int conversions
This works around some UB in LLVM, where an out-of-bounds conversion would produce a poison value. The selected behavior is saturating, except that NaN is mapped to the minimum value.
This commit is contained in:
Vendored
+1
-1
@@ -11,7 +11,7 @@
|
||||
+3.333333e-001
|
||||
+6.666667e-001
|
||||
+6.666667e-001
|
||||
3 5 -2 -11
|
||||
3 5 -2 -11 0 255 -128 127 0 -128
|
||||
+5.300000e+001 -8.000000e+000 +2.000000e+001
|
||||
(+6.666667e-001+1.200000e+000i)
|
||||
+6.666667e-001
|
||||
|
||||
Reference in New Issue
Block a user