Skip to content

Commit 24761a7

Browse files
committed
fix interpreter source traceback
1 parent 5345d80 commit 24761a7

File tree

2 files changed

+1002
-850
lines changed

2 files changed

+1002
-850
lines changed

src/kirin/interp/abc.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,12 @@ def new_frame(
264264
self.state.push_frame(frame)
265265
try:
266266
yield frame
267-
finally:
267+
except BaseException:
268+
# NOTE: Don't pop frames on exception so that eval_context
269+
# can capture the full frame chain for the stack trace.
270+
# The state is re-initialized on the next eval_context call.
271+
raise
272+
else:
268273
self.state.pop_frame()
269274

270275
def frame_eval(

0 commit comments

Comments
 (0)