-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix unspecified behavior in LLVM and UB in Rust.
Lexical itself used a high-level vector which is then directly cast to a String using uninitialized memory under the hood. Since the behavior never relied on the values of the reads, this wasn't ever seen as an issue, however, anything besides using `ptr::write` can invoke UB which lexical-core and lower-level APIs do not always use: they often use index (read-write) assignment. This initializes the underlying buffer of the vector to avoid any risk of potential UB.
- Loading branch information
1 parent
462a2a2
commit 38a916e
Showing
2 changed files
with
82 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters