tgotoexc_leak.nim 389 B

1234567891011121314151617181920
  1. discard """
  2. output: '''0
  3. true'''
  4. cmd: "nim c --gc:arc $file"
  5. """
  6. # bug #22398
  7. for i in 0 ..< 10_000:
  8. try:
  9. try:
  10. raise newException(ValueError, "")
  11. except CatchableError:
  12. discard
  13. raise newException(ValueError, "") # or raise getCurrentException(), just raise works ok
  14. except ValueError:
  15. discard
  16. echo getOccupiedMem()
  17. echo getCurrentException() == nil