diff options
author | Araq <rumpf_a@web.de> | 2019-01-22 14:32:00 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2019-01-23 22:03:15 +0100 |
commit | 40d1c7d43a6459aedf1c64a7f5e145ebbe4badcb (patch) | |
tree | 72ea3994e177b7bea9ec8c9764fc920f2995383b /lib/system | |
parent | 400b4e4e0ea33ef3d7ad94c503c5e00001dec536 (diff) | |
download | Nim-40d1c7d43a6459aedf1c64a7f5e145ebbe4badcb.tar.gz |
OutOfMemError is never raised so there is no need to check for it (produce less code)
Diffstat (limited to 'lib/system')
-rw-r--r-- | lib/system/excpt.nim | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/lib/system/excpt.nim b/lib/system/excpt.nim index e9d251bb4..2f41ad1e3 100644 --- a/lib/system/excpt.nim +++ b/lib/system/excpt.nim @@ -347,24 +347,17 @@ proc raiseExceptionAux(e: ref Exception) = if globalRaiseHook != nil: if not globalRaiseHook(e): return when defined(cpp) and not defined(noCppExceptions): - if e[] of OutOfMemError: - showErrorMessage(e.name) - quitOrDebug() - else: - pushCurrentException(e) - raiseCounter.inc - if raiseCounter == 0: - raiseCounter.inc # skip zero at overflow - e.raiseId = raiseCounter - {.emit: "`e`->raise();".} + pushCurrentException(e) + raiseCounter.inc + if raiseCounter == 0: + raiseCounter.inc # skip zero at overflow + e.raiseId = raiseCounter + {.emit: "`e`->raise();".} else: if excHandler != nil: if not excHandler.hasRaiseAction or excHandler.raiseAction(e): pushCurrentException(e) c_longjmp(excHandler.context, 1) - elif e[] of OutOfMemError: - showErrorMessage(e.name) - quitOrDebug() else: when hasSomeStackTrace: var buf = newStringOfCap(2000) |