excpt.nim: code cleanup, don't produce nimFrame in -d:release mode
This commit is contained in:
parent
40d1c7d43a
commit
c4d2cb9ea6
1 changed files with 13 additions and 19 deletions
|
|
@ -446,10 +446,9 @@ when not defined(gcDestructors):
|
||||||
## a ``seq``. This is not yet available for the JS backend.
|
## a ``seq``. This is not yet available for the JS backend.
|
||||||
shallowCopy(result, e.trace)
|
shallowCopy(result, e.trace)
|
||||||
|
|
||||||
when defined(nimRequiresNimFrame):
|
const nimCallDepthLimit {.intdefine.} = 2000
|
||||||
const nimCallDepthLimit {.intdefine.} = 2000
|
|
||||||
|
|
||||||
proc callDepthLimitReached() {.noinline.} =
|
proc callDepthLimitReached() {.noinline.} =
|
||||||
writeStackTrace()
|
writeStackTrace()
|
||||||
showErrorMessage("Error: call depth limit reached in a debug build (" &
|
showErrorMessage("Error: call depth limit reached in a debug build (" &
|
||||||
$nimCallDepthLimit & " function calls). You can change it with " &
|
$nimCallDepthLimit & " function calls). You can change it with " &
|
||||||
|
|
@ -457,16 +456,11 @@ when defined(nimRequiresNimFrame):
|
||||||
"recursions instead.\n")
|
"recursions instead.\n")
|
||||||
quitOrDebug()
|
quitOrDebug()
|
||||||
|
|
||||||
proc nimFrame(s: PFrame) {.compilerRtl, inl, exportc: "nimFrame".} =
|
proc nimFrame(s: PFrame) {.compilerRtl, inl.} =
|
||||||
s.calldepth = if framePtr == nil: 0 else: framePtr.calldepth+1
|
s.calldepth = if framePtr == nil: 0 else: framePtr.calldepth+1
|
||||||
s.prev = framePtr
|
s.prev = framePtr
|
||||||
framePtr = s
|
framePtr = s
|
||||||
if s.calldepth == nimCallDepthLimit: callDepthLimitReached()
|
if s.calldepth == nimCallDepthLimit: callDepthLimitReached()
|
||||||
else:
|
|
||||||
proc pushFrame(s: PFrame) {.compilerRtl, inl, exportc: "nimFrame".} =
|
|
||||||
# XXX only for backwards compatibility
|
|
||||||
s.prev = framePtr
|
|
||||||
framePtr = s
|
|
||||||
|
|
||||||
when defined(endb):
|
when defined(endb):
|
||||||
var
|
var
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue