prevent eval crashes due to PContext-dependent ops not being available in evalConstExpr

This commit is contained in:
Zahary Karadjov 2013-08-25 18:11:05 +03:00
commit 89086a8e19
4 changed files with 40 additions and 42 deletions

View file

@ -1144,7 +1144,7 @@ proc semPragmaBlock(c: PContext, n: PNode): PNode =
proc semStaticStmt(c: PContext, n: PNode): PNode =
let a = semStmt(c, n.sons[0])
result = evalStaticExpr(c.module, a, c.p.owner)
result = evalStaticExpr(c, c.module, a, c.p.owner)
if result.isNil:
LocalError(n.info, errCannotInterpretNodeX, renderTree(n))
result = emptyNode