diff options
author | Araq <rumpf_a@web.de> | 2013-02-24 13:26:04 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2013-02-24 13:26:04 +0100 |
commit | b4232a672f2d0c80d95d90f943a62956e764683d (patch) | |
tree | 099cc73a5354c5a84ba67348e5758cbfe8aa1197 | |
parent | c87e1c96ad1c22c3d051bbf7254e7a92360116b6 (diff) | |
download | Nim-b4232a672f2d0c80d95d90f943a62956e764683d.tar.gz |
don't eval wrong code
-rwxr-xr-x | compiler/evals.nim | 8 |
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) |