summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'compiler')
-rwxr-xr-xcompiler/evals.nim8
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/evals.nim b/compiler/evals.nim
index c6e0e947f..d9b03137d 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)