split eval_and_read_lvalue into two functions

This commit is contained in:
Oliver Schneider 2016-10-21 10:31:13 +02:00
parent 24be49f7dd
commit bef879083e
No known key found for this signature in database
GPG Key ID: 56D6EEA0FC67AC46

View File

@ -851,8 +851,12 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> {
}
}
}
let lvalue = self.eval_lvalue(lvalue)?;
self.read_lvalue(lvalue)
}
match self.eval_lvalue(lvalue)? {
fn read_lvalue(&mut self, lvalue: Lvalue<'tcx>) -> EvalResult<'tcx, Value> {
match lvalue {
Lvalue::Ptr { ptr, extra } => {
assert_eq!(extra, LvalueExtra::None);
Ok(Value::ByRef(ptr))