parent
8df20276c9
commit
451129de42
3 changed files with 12 additions and 9 deletions
|
|
@ -688,14 +688,15 @@ proc genBreakStmt(p: BProc, t: PNode) =
|
||||||
|
|
||||||
proc raiseExit(p: BProc) =
|
proc raiseExit(p: BProc) =
|
||||||
assert p.config.exc == excGoto
|
assert p.config.exc == excGoto
|
||||||
p.flags.incl nimErrorFlagAccessed
|
if nimErrorFlagDisabled notin p.flags:
|
||||||
if p.nestedTryStmts.len == 0:
|
p.flags.incl nimErrorFlagAccessed
|
||||||
p.flags.incl beforeRetNeeded
|
if p.nestedTryStmts.len == 0:
|
||||||
# easy case, simply goto 'ret':
|
p.flags.incl beforeRetNeeded
|
||||||
lineCg(p, cpsStmts, "if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;$n", [])
|
# easy case, simply goto 'ret':
|
||||||
else:
|
lineCg(p, cpsStmts, "if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;$n", [])
|
||||||
lineCg(p, cpsStmts, "if (NIM_UNLIKELY(*nimErr_)) goto LA$1_;$n",
|
else:
|
||||||
[p.nestedTryStmts[^1].label])
|
lineCg(p, cpsStmts, "if (NIM_UNLIKELY(*nimErr_)) goto LA$1_;$n",
|
||||||
|
[p.nestedTryStmts[^1].label])
|
||||||
|
|
||||||
proc finallyActions(p: BProc) =
|
proc finallyActions(p: BProc) =
|
||||||
if p.config.exc != excGoto and p.nestedTryStmts.len > 0 and p.nestedTryStmts[^1].inExcept:
|
if p.config.exc != excGoto and p.nestedTryStmts.len > 0 and p.nestedTryStmts[^1].inExcept:
|
||||||
|
|
|
||||||
|
|
@ -682,6 +682,7 @@ proc loadDynamicLib(m: BModule, lib: PLib) =
|
||||||
else:
|
else:
|
||||||
var p = newProc(nil, m)
|
var p = newProc(nil, m)
|
||||||
p.options = p.options - {optStackTrace}
|
p.options = p.options - {optStackTrace}
|
||||||
|
p.flags.incl nimErrorFlagDisabled
|
||||||
var dest: TLoc
|
var dest: TLoc
|
||||||
initLoc(dest, locTemp, lib.path, OnStack)
|
initLoc(dest, locTemp, lib.path, OnStack)
|
||||||
dest.r = getTempName(m)
|
dest.r = getTempName(m)
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,8 @@ type
|
||||||
hasCurFramePointer,
|
hasCurFramePointer,
|
||||||
noSafePoints,
|
noSafePoints,
|
||||||
nimErrorFlagAccessed,
|
nimErrorFlagAccessed,
|
||||||
nimErrorFlagDeclared
|
nimErrorFlagDeclared,
|
||||||
|
nimErrorFlagDisabled
|
||||||
|
|
||||||
TCProc = object # represents C proc that is currently generated
|
TCProc = object # represents C proc that is currently generated
|
||||||
prc*: PSym # the Nim proc that this C proc belongs to
|
prc*: PSym # the Nim proc that this C proc belongs to
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue