Skip to content

Commit

Permalink
Merge pull request #201 from Amanieu/volatile
Browse files Browse the repository at this point in the history
Fix undefined behavior in regex_macros
  • Loading branch information
BurntSushi committed Apr 15, 2016
2 parents 66ad2c4 + 62cedef commit bf6bc5f
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 bf6bc5f

Please sign in to comment.