Return Ok(false) instead of throwing when handling a diverging intrinsic

This commit is contained in:
Aaron Hill 2019-11-06 14:13:57 -05:00
parent 68d9853985
commit c0b972abfa
No known key found for this signature in database
GPG Key ID: B4087E510E98B164

View File

@ -95,11 +95,10 @@ pub fn emulate_intrinsic(
) -> InterpResult<'tcx, bool> {
let substs = instance.substs;
// The intrinsic itself cannot diverge, so if we got here without a return
// place... (can happen e.g., for transmute returning `!`)
// We currently do not handle any diverging intrinsics.
let dest = match dest {
Some(dest) => dest,
None => throw_ub!(Unreachable)
None => return Ok(false)
};
let intrinsic_name = &*self.tcx.item_name(instance.def_id()).as_str();