Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Avoid undefined behavior from reading uninitialized data
  • Loading branch information
Amanieu committed Apr 15, 2016
commit 62cedef3ee7021ce0fc476c2a96ebc9aa0e90515
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