diff --git a/src/debug/tracers/transformers/int_stack.ts b/src/debug/tracers/transformers/int_stack.ts index 7d81708..db663b6 100644 --- a/src/debug/tracers/transformers/int_stack.ts +++ b/src/debug/tracers/transformers/int_stack.ts @@ -104,6 +104,15 @@ export async function addInternalFrame< const lastStep = trace[trace.length - 1]; + // If we are ending execution, and still have leftover internal frames, then internal frame decoding + // is probably broken. + if (state.op.opcode === OPCODES.STOP) { + const curExtFrame = topExtFrame(state.stack); + + curExtFrame.internalFramesBroken = + curExtFrame.internalFramesBroken || curExtFrame.internalFrames.length > 1; + } + // External call/return - no change to internal stack if (lastStep.depth !== state.depth) { if (lastStep.op.opcode === OPCODES.RETURN) {