implements quirky for functions (#24700)

ref https://github.com/nim-lang/Nim/pull/24686

With this PR

```nim
import std/streams

proc foo() =
  var name = newStringStream("2r2")
  raise newException(ValueError, "sh")

try:
  foo()
except:
 discard

echo 123
```
this example no longer leaks

---------

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
(cherry picked from commit 510ac84518)
This commit is contained in:
ringabout
2025-02-19 00:24:41 +08:00
committed by narimiran
parent 5df3bf467e
commit b7eefc31d8
3 changed files with 25 additions and 2 deletions

16
tests/arc/tvalgrind.nim Normal file
View File

@@ -0,0 +1,16 @@
discard """
cmd: "nim c --mm:orc -d:useMalloc $file"
valgrind: "true"
"""
import std/streams
proc foo() =
var name = newStringStream("2r2")
raise newException(ValueError, "sh")
try:
foo()
except:
discard