diff options
author | Timothee Cour <timothee.cour2@gmail.com> | 2020-05-12 10:19:31 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-12 19:19:31 +0200 |
commit | dddfbcf211cd46453b78a9d207347a158311f85e (patch) | |
tree | d455b3e4eff3e97cdfdb9f2141e22ee03b31f5b2 | |
parent | de74362213baeb28d52c05c71cd9b8389ae69060 (diff) | |
download | Nim-dddfbcf211cd46453b78a9d207347a158311f85e.tar.gz |
close #13071 by adding test: nim cpp -r --gc:arc` segfaults on caught AssertionError (#14323)
-rw-r--r-- | tests/arc/texceptions.nim | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/arc/texceptions.nim b/tests/arc/texceptions.nim new file mode 100644 index 000000000..c55b463fc --- /dev/null +++ b/tests/arc/texceptions.nim @@ -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() |