diff options
author | Araq <rumpf_a@web.de> | 2014-01-25 23:03:43 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2014-01-25 23:03:43 +0100 |
commit | 8a7f50889c18283670801f442d6778fdff362c70 (patch) | |
tree | 30461834860009faef02cec22005d862dbd51cc3 /compiler | |
parent | f16881ad162a12833aba7598d65684d9e63600c2 (diff) | |
download | Nim-8a7f50889c18283670801f442d6778fdff362c70.tar.gz |
fixes #838
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/semtypinst.nim | 4 | ||||
-rw-r--r-- | compiler/vm.nim | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/compiler/semtypinst.nim b/compiler/semtypinst.nim index ac14179cd..9c6421315 100644 --- a/compiler/semtypinst.nim +++ b/compiler/semtypinst.nim @@ -116,8 +116,8 @@ proc hasGenericArguments*(n: PNode): bool = (n.sym.kind == skType and n.sym.typ.flags * {tfGenericTypeParam, tfImplicitTypeParam} != {}) else: - for s in n.sons: - if hasGenericArguments(s): return true + for i in 0.. <n.safeLen: + if hasGenericArguments(n.sons[i]): return true return false proc reResolveCallsWithTypedescParams(cl: var TReplTypeVars, n: PNode): PNode = diff --git a/compiler/vm.nim b/compiler/vm.nim index 9ed18d29e..26aab3068 100644 --- a/compiler/vm.nim +++ b/compiler/vm.nim @@ -1057,6 +1057,7 @@ proc fixType(result, n: PNode) {.inline.} = # XXX do it deeply for complex values; there seems to be no simple # solution except to check it deeply here. #if result.typ.isNil: result.typ = n.typ + discard proc execute(c: PCtx, start: int): PNode = var tos = PStackFrame(prc: nil, comesFrom: 0, next: nil) @@ -1118,6 +1119,7 @@ proc evalConstExprAux(module, prc: PSym, n: PNode, mode: TEvalMode): PNode = var c = globalCtx c.mode = mode let start = genExpr(c, n, requiresValue = mode!=emStaticStmt) + if c.code[start].opcode == opcEof: return emptyNode assert c.code[start].opcode != opcEof var tos = PStackFrame(prc: prc, comesFrom: 0, next: nil) newSeq(tos.slots, c.prc.maxSlots) |