Skip to content

Commit

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

This reverts commit 0adb47a.
  • Loading branch information
Araq authored and PMunch committed Mar 28, 2022
1 parent 0fcbd7e commit c9d1474
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 c9d1474

Please sign in to comment.