Closed
Description
nim c --gc:arc --exceptions:{setjmp,goto} incorrectly handles raise; nim cpp --gc:arc
is ok
Example
type MyExcept = object of CatchableError
proc gun()=
try:
raise newException(MyExcept, "some msg")
except Exception as e:
echo "caught in gun"
raise e
proc fun()=
try:
gun()
except Exception as e:
echo "caught in fun"
echo ("caught", e.msg, e.name)
finally:
echo "in finally"
fun()
Current Output
nim c --gc:arc --exceptions:setjmp main.nim
nim c --gc:arc --exceptions:goto main.nim
in finally
/Users/timothee/git_clone/nim/timn/tests/nim/all/t0900.nim(74) t0900
/Users/timothee/git_clone/nim/timn/tests/nim/all/t0900.nim(68) fun
/Users/timothee/git_clone/nim/timn/tests/nim/all/t0900.nim(61) gun
Error: unhandled exception: some msg [MyExcept]
Expected Output
nim c main.nim
nim cpp main.nim
nim cpp --gc:arc main.nim
caught in gun
caught in fun
("caught", "some msg", "MyExcept")
in finally
Additional Information
- recent devel 5e9ebe9