-
Notifications
You must be signed in to change notification settings - Fork 397
Open
Labels
UnsoundInformational / UnsoundInformational / Unsound
Description
https://lib.rs/crates/fast-floats
The crate exposes the fadd_fast
(and similar) intrinsics to safe code behind the operator traits:
https://docs.rs/fast-floats/0.1.2/src/fast_floats/lib.rs.html#93-101
This is unsound because using NAN as an argument to one of those intrinsics produces poison
:
https://llvm.org/docs/LangRef.html#fast-math-flags
Which can then be used to produce UB by using it "as an instruction operand that has any values that trigger undefined behavior":
https://llvm.org/docs/LangRef.html#poisonvalues
And one can directly create a NAN FF32
in safe code:
https://docs.rs/fast-floats/0.1.2/src/fast_floats/lib.rs.html#61
(As well as in other ways, like creating FF32
s with 0.0
and dividing them.)
Metadata
Metadata
Assignees
Labels
UnsoundInformational / UnsoundInformational / Unsound