system.onRaise improvements
This commit is contained in:
parent
865d9cc6e6
commit
e54425b068
3 changed files with 133 additions and 114 deletions
|
|
@ -51,8 +51,8 @@ proc popFrame {.compilerRtl, inl.} =
|
|||
proc setFrame(s: PFrame) {.compilerRtl, inl.} =
|
||||
framePtr = s
|
||||
|
||||
proc pushSafePoint(s: PSafePoint) {.compilerRtl, inl.} =
|
||||
s.raiseAction = nil
|
||||
proc pushSafePoint(s: PSafePoint) {.compilerRtl, inl.} =
|
||||
s.hasRaiseAction = false
|
||||
s.prev = excHandler
|
||||
excHandler = s
|
||||
|
||||
|
|
@ -199,7 +199,7 @@ proc raiseExceptionAux(e: ref E_Base) =
|
|||
if globalRaiseHook != nil:
|
||||
if not globalRaiseHook(e): return
|
||||
if excHandler != nil:
|
||||
if isNil(excHandler.raiseAction) or excHandler.raiseAction(e):
|
||||
if not excHandler.hasRaiseAction or excHandler.raiseAction(e):
|
||||
pushCurrentException(e)
|
||||
c_longjmp(excHandler.context, 1)
|
||||
elif e[] of EOutOfMemory:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue