This commit is contained in:
Araq 2015-09-18 11:24:16 +02:00
commit 5b2f54ffa1
4 changed files with 15 additions and 6 deletions

View file

@ -1636,7 +1636,9 @@ proc tryExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode =
# watch out, hacks ahead:
let oldErrorCount = msgs.gErrorCounter
let oldErrorMax = msgs.gErrorMax
inc c.inCompilesContext
let oldCompilesId = c.inCompilesContext
inc c.compilesContextIdGenerator
c.inCompilesContext = c.compilesContextIdGenerator
# do not halt after first error:
msgs.gErrorMax = high(int)
@ -1660,6 +1662,7 @@ proc tryExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode =
except ERecoverableError:
discard
# undo symbol table changes (as far as it's possible):
c.inCompilesContext = oldCompilesId
c.generics = oldGenerics
c.inGenericContext = oldInGenericContext
c.inUnrolledContext = oldInUnrolledContext
@ -1668,7 +1671,6 @@ proc tryExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode =
msgs.setInfoContextLen(oldContextLen)
setLen(gOwners, oldOwnerLen)
c.currentScope = oldScope
dec c.inCompilesContext
errorOutputs = oldErrorOutputs
msgs.gErrorCounter = oldErrorCount
msgs.gErrorMax = oldErrorMax