Add TranslationState::in_unreachable_code().
Move an unreachable code test and sanity check into this method.
This commit is contained in:
@@ -200,4 +200,14 @@ impl TranslationState {
|
||||
reachable: false,
|
||||
});
|
||||
}
|
||||
|
||||
/// Test if the translation state is currently in unreachable code.
|
||||
pub fn in_unreachable_code(&self) -> bool {
|
||||
if self.real_unreachable_stack_depth > 0 {
|
||||
true
|
||||
} else {
|
||||
debug_assert_eq!(self.phantom_unreachable_stack_depth, 0, "in reachable code");
|
||||
false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user