Skip to content
This repository has been archived by the owner on Oct 21, 2022. It is now read-only.

make unsafe usages more safe #19

Merged
merged 1 commit into from
May 31, 2017
Merged

Conversation

rphmeier
Copy link
Contributor

@rphmeier rphmeier commented May 31, 2017

Most of the unsafe calls to transmute could be removed with a simple as cast.

The unsafe casts from bytes to floats were actually wrong because they didn't mask out sNAN, which could lead to trap/UB when interpreting programs with carefully crafted constants. More discussion here: rust-lang/rust#39271

We should set a goal for 0 unsafe code within this crate: it should be possible once the methods in the above PR are stabilized.

@NikVolf NikVolf merged commit 2527571 into paritytech:master May 31, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants