close #13071 by adding test: nim cpp -r --gc:arc` segfaults on caught AssertionError (#14323)

This commit is contained in:
Timothee Cour
2020-05-12 10:19:31 -07:00
committed by GitHub
parent de74362213
commit dddfbcf211

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

@@ -0,0 +1,16 @@
discard """
cmd: "nim cpp --gc:arc $file"
"""
block: # issue #13071
type MyExcept = object of CatchableError
proc gun()=
raise newException(MyExcept, "foo:")
proc fun()=
var a = ""
try:
gun()
except Exception as e:
a = e.msg & $e.name # was segfaulting here for `nim cpp --gc:arc`
doAssert a == "foo:MyExcept"
fun()