show match
This commit is contained in:
parent
e8cc132972
commit
29c771cf70
|
@ -3,3 +3,4 @@
|
||||||
**/*.rs.bk
|
**/*.rs.bk
|
||||||
Cargo.lock
|
Cargo.lock
|
||||||
spec/target
|
spec/target
|
||||||
|
.idea
|
||||||
|
|
|
@ -1012,14 +1012,23 @@ fn compute_drop_keep(
|
||||||
start_value_stack_height,
|
start_value_stack_height,
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
if (actual_value_stack_height as u32 - start_value_stack_height as u32) < keep as u32 {
|
|
||||||
return Err(Error(format!(
|
match keep {
|
||||||
"Stack underflow detected: asked to keep {:?} values, but there are only {}",
|
isa::Keep::Single => {
|
||||||
keep,
|
if actual_value_stack_height < start_value_stack_height + 1 {
|
||||||
actual_value_stack_height as u32 - start_value_stack_height as u32,
|
return Err(Error(format!(
|
||||||
)));
|
"Stack underflow detected: asked to keep {:?} values, but there are only {}",
|
||||||
|
keep,
|
||||||
|
actual_value_stack_height as u32 - start_value_stack_height as u32,
|
||||||
|
)));
|
||||||
|
}
|
||||||
|
|
||||||
|
(actual_value_stack_height - start_value_stack_height - 1) as u32
|
||||||
|
},
|
||||||
|
isa::Keep::None => {
|
||||||
|
(actual_value_stack_height - start_value_stack_height) as u32
|
||||||
|
}
|
||||||
}
|
}
|
||||||
(actual_value_stack_height as u32 - start_value_stack_height as u32) - keep as u32
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Ok(isa::DropKeep { drop, keep })
|
Ok(isa::DropKeep { drop, keep })
|
||||||
|
|
Loading…
Reference in New Issue