Fix inline stacks
This commit is contained in:
parent
c00fae79f8
commit
8dd64598ed
|
|
@ -60,6 +60,11 @@ impl ProgramState {
|
||||||
let Some(stack) = self.call_stacks.get_mut(code) else {
|
let Some(stack) = self.call_stacks.get_mut(code) else {
|
||||||
bail!("missing stack {code:04x}");
|
bail!("missing stack {code:04x}");
|
||||||
};
|
};
|
||||||
|
// just popping the inline frames first
|
||||||
|
while stack
|
||||||
|
.pop_if(|f| matches!(f, StackFrame::Label(_)))
|
||||||
|
.is_some()
|
||||||
|
{}
|
||||||
if stack.pop().is_none() {
|
if stack.pop().is_none() {
|
||||||
bail!("returned from {code:04x} but stack was empty");
|
bail!("returned from {code:04x} but stack was empty");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue