From b4232a672f2d0c80d95d90f943a62956e764683d Mon Sep 17 00:00:00 2001 From: Araq Date: Sun, 24 Feb 2013 13:26:04 +0100 Subject: [PATCH] don't eval wrong code --- compiler/evals.nim | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/compiler/evals.nim b/compiler/evals.nim index c6e0e947ff..d9b03137db 100755 --- a/compiler/evals.nim +++ b/compiler/evals.nim @@ -1495,7 +1495,13 @@ proc myOpen(module: PSym): PPassContext = pushStackFrame(c, newStackFrame()) result = c -proc myProcess(c: PPassContext, n: PNode): PNode = +var oldErrorCount: int + +proc myProcess(c: PPassContext, n: PNode): PNode = + # don't eval errornous code: + if oldErrorCount != msgs.gErrorCounter: + oldErrorCount = msgs.gErrorCounter + return n result = eval(PEvalContext(c), n) const evalPass* = makePass(myOpen, nil, myProcess, myProcess)