Skip to content

Commit

Permalink
Avoid undefined behavior from reading uninitialized data
Browse files Browse the repository at this point in the history
  • Loading branch information
Amanieu committed Apr 15, 2016
1 parent 2ab7be3 commit 62cedef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion regex_macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ fn exec<'t>(

#[inline]
fn contains(&self, pc: usize) -> bool {
let s = self.sparse[pc];
let s = unsafe { ::std::ptr::read_volatile(&self.sparse[pc]) };
s < self.size && self.dense[s].pc == pc
}

Expand Down

0 comments on commit 62cedef

Please sign in to comment.