Revert "system/excpt: check if the exception is not nil before pop (#18247)" (#18265)

This reverts commit 0adb47aa15.
This commit is contained in:
Andreas Rumpf 2021-06-17 08:20:10 +02:00 • committed by GitHub
commit fd8b79707c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 10 deletions

View file

@ -135,7 +135,6 @@ proc pushCurrentException(e: sink(ref Exception)) {.compilerRtl, inl.} =
#showErrorMessage2 "A" #showErrorMessage2 "A"
proc popCurrentException {.compilerRtl, inl.} = proc popCurrentException {.compilerRtl, inl.} =
if currException != nil:
currException = currException.up currException = currException.up
#showErrorMessage2 "B" #showErrorMessage2 "B"

View file

@ -6,10 +6,3 @@ let ex = newException(CatchableError, "test")
setCurrentException(ex) setCurrentException(ex)
doAssert getCurrentException().msg == ex.msg doAssert getCurrentException().msg == ex.msg
doAssert getCurrentExceptionMsg() == ex.msg doAssert getCurrentExceptionMsg() == ex.msg
setCurrentException(nil)
try:
raise newException(CatchableError, "test2")
except:
setCurrentException(nil)
doAssert getCurrentException() == nil