cranelift-interpreter: Propagate traps across calls (#6156)
* cranelift-interpreter: Propagate traps from call's * cranelift-interpreter: Make `unwrap_return` only available in tests This is a footgun for normal use in the interpreter (#6156) but it still has uses in the tests, so enable it only there.
This commit is contained in:
@@ -1397,6 +1397,7 @@ pub enum ControlFlow<'a, V> {
|
||||
impl<'a, V> ControlFlow<'a, V> {
|
||||
/// For convenience, we can unwrap the [ControlFlow] state assuming that it is a
|
||||
/// [ControlFlow::Return], panicking otherwise.
|
||||
#[cfg(test)]
|
||||
pub fn unwrap_return(self) -> Vec<V> {
|
||||
if let ControlFlow::Return(values) = self {
|
||||
values.into_vec()
|
||||
@@ -1407,6 +1408,7 @@ impl<'a, V> ControlFlow<'a, V> {
|
||||
|
||||
/// For convenience, we can unwrap the [ControlFlow] state assuming that it is a
|
||||
/// [ControlFlow::Trap], panicking otherwise.
|
||||
#[cfg(test)]
|
||||
pub fn unwrap_trap(self) -> CraneliftTrap {
|
||||
if let ControlFlow::Trap(trap) = self {
|
||||
trap
|
||||
|
||||
Reference in New Issue
Block a user