fixes #14240 [backport:1.2] (#14757)

This commit is contained in:
Andreas Rumpf 2020-06-22 14:11:13 +02:00 • committed by GitHub
commit 451129de42
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 9 deletions

View file

@ -688,6 +688,7 @@ proc genBreakStmt(p: BProc, t: PNode) =
proc raiseExit(p: BProc) = proc raiseExit(p: BProc) =
assert p.config.exc == excGoto assert p.config.exc == excGoto
if nimErrorFlagDisabled notin p.flags:
p.flags.incl nimErrorFlagAccessed p.flags.incl nimErrorFlagAccessed
if p.nestedTryStmts.len == 0: if p.nestedTryStmts.len == 0:
p.flags.incl beforeRetNeeded p.flags.incl beforeRetNeeded

View file

@ -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)

View file

@ -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