Skip to content

Commit

Permalink
Revert "system/excpt: check if the exception is not nil before pop (#…
Browse files Browse the repository at this point in the history
…18247)" (#18265)

This reverts commit 0adb47a.
  • Loading branch information
Araq authored Jun 17, 2021
1 parent 969cb97 commit fd8b797
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
5 changes: 2 additions & 3 deletions lib/system/excpt.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
7 changes: 0 additions & 7 deletions tests/exception/tsetexceptions.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit fd8b797

Please sign in to comment.