Bail out before running the query

This commit is contained in:
Oliver Scherer 2019-12-23 17:33:09 +01:00
parent b97abd0761
commit 2e66f85111

View File

@ -40,15 +40,16 @@ impl<'mir, 'tcx> InterpCx<'mir, 'tcx, CompileTimeInterpreter<'mir, 'tcx>> {
return Ok(false);
}
let gid = GlobalId { instance, promoted: None };
let place = self.const_eval_raw(gid)?;
let dest = match ret {
Some((dest, _)) => dest,
// Don't memoize diverging function calls.
None => return Ok(false),
};
let gid = GlobalId { instance, promoted: None };
let place = self.const_eval_raw(gid)?;
self.copy_op(place.into(), dest)?;
self.return_to_block(ret.map(|r| r.1))?;