mirror of
https://github.com/nim-lang/Nim.git
synced 2026-05-01 19:44:44 +00:00
19
tests/destructor/tgotoexc_leak.nim
Normal file
19
tests/destructor/tgotoexc_leak.nim
Normal file
@@ -0,0 +1,19 @@
|
||||
discard """
|
||||
output: '''0
|
||||
true'''
|
||||
cmd: "nim c --gc:arc $file"
|
||||
"""
|
||||
|
||||
# bug #22398
|
||||
|
||||
for i in 0 ..< 10_000:
|
||||
try:
|
||||
try:
|
||||
raise newException(ValueError, "")
|
||||
except CatchableError:
|
||||
discard
|
||||
raise newException(ValueError, "") # or raise getCurrentException(), just raise works ok
|
||||
except ValueError:
|
||||
discard
|
||||
echo getOccupiedMem()
|
||||
echo getCurrentException() == nil
|
||||
Reference in New Issue
Block a user