diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2021-06-17 08:20:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-17 08:20:10 +0200 |
commit | fd8b79707c1b936ed1ba42892f5e06f846e2816b (patch) | |
tree | 32d4dbaa29e027e1f643adf290f8100089945b03 | |
parent | 969cb97c0a9f045a2fb31866fc804cdf1b2698dd (diff) | |
download | Nim-fd8b79707c1b936ed1ba42892f5e06f846e2816b.tar.gz |
Revert "system/excpt: check if the exception is not nil before pop (#18247)" (#18265)
This reverts commit 0adb47aa15e242983c8251d85367c0fe45fc5f12.
-rw-r--r-- | lib/system/excpt.nim | 5 | ||||
-rw-r--r-- | tests/exception/tsetexceptions.nim | 7 |
2 files changed, 2 insertions, 10 deletions
diff --git a/lib/system/excpt.nim b/lib/system/excpt.nim index 72225cf96..5b7d4d49f 100644 --- a/lib/system/excpt.nim +++ b/lib/system/excpt.nim @@ -135,9 +135,8 @@ proc pushCurrentException(e: sink(ref Exception)) {.compilerRtl, inl.} = #showErrorMessage2 "A" proc popCurrentException {.compilerRtl, inl.} = - if currException != nil: - currException = currException.up - #showErrorMessage2 "B" + currException = currException.up + #showErrorMessage2 "B" proc popCurrentExceptionEx(id: uint) {.compilerRtl.} = discard "only for bootstrapping compatbility" diff --git a/tests/exception/tsetexceptions.nim b/tests/exception/tsetexceptions.nim index 386a6ae4c..557fc1898 100644 --- a/tests/exception/tsetexceptions.nim +++ b/tests/exception/tsetexceptions.nim @@ -6,10 +6,3 @@ let ex = newException(CatchableError, "test") setCurrentException(ex) doAssert getCurrentException().msg == ex.msg doAssert getCurrentExceptionMsg() == ex.msg -setCurrentException(nil) - -try: - raise newException(CatchableError, "test2") -except: - setCurrentException(nil) -doAssert getCurrentException() == nil |