Skip to content

Commit

Permalink
fix copy pasted code
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Jan 12, 2017
1 parent 927844a commit e7ef118
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/terminator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -407,8 +407,8 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> {

"memrchr" => {
let ptr = args[0].read_ptr(&self.memory)?;
let val = self.value_to_primval(args[1], usize)?.to_u64() as u8;
let num = self.value_to_primval(args[2], usize)?.to_u64();
let val = self.value_to_primval(args[1], usize)?.to_u64()? as u8;
let num = self.value_to_primval(args[2], usize)?.to_u64()?;
if let Some(idx) = self.memory.read_bytes(ptr, num)?.iter().rev().position(|&c| c == val) {
let new_ptr = ptr.offset(num - idx as u64 - 1);
self.write_value(Value::ByVal(PrimVal::Ptr(new_ptr)), dest, dest_ty)?;
Expand Down

0 comments on commit e7ef118

Please sign in to comment.