fixes #26189; compiler SIGSEGV with --exceptions:setjmp in try/except/finally (#26194)

fixes #26189
This commit is contained in:
ringabout
2026-09-09 22:25:29 +08:00
committed by GitHub
parent 903e962dc0
commit a89f442f96
2 changed files with 25 additions and 1 deletions

View File

@@ -0,0 +1,20 @@
discard """
cmd: "nim c --exceptions:setjmp $file"
exitcode: 1
output: '''
t26189.nim(20) t26189
t26189.nim(18) trigger
Error: unhandled exception: rollback failed [CatchableError]
'''
"""
# Regression test for compiler recursion while generating a raise in finally.
proc trigger() =
try:
discard
except Exception as exc:
raise exc
finally:
raise newException(CatchableError, "rollback failed")
trigger()