Re:A problem with LLVM's undef
by kzrdude on Wednesday December 30, 2015 @01:54AM
(#10811109)
`undefs` also cause some of the longstanding holes in Rust's safe code abstraction, since an `undef` can defeat array bounds checking.
[ Parent
| on HN ]
Here's a link to the bug in question: https://github.com/rust-lang/rust/issues/10184 , which can be realized by casting floats whose value is beyond a certain threshold to integers and then using them to index. The ultimate fix will probably involve migrating away from using LLVM's provided conversion intrinsics and implementing custom support that doesn't invoke undefined behavior.
Re:A problem with LLVM's undef
by sanjoy_das on Wednesday December 30, 2015 @07:29AM
(#10811801)
Interesting observation -- just because I've checked `%i` is within array bounds, doesn't mean `a[%i]` is safe to access, since `%i` could be `undef` and pass the range check spuriously.