From 540f66cb096077ea377d7184d7d74bb15df023bf Mon Sep 17 00:00:00 2001 From: Araq Date: Fri, 20 Feb 2015 16:50:57 +0100 Subject: [PATCH] fixes #2167 --- compiler/semcall.nim | 3 ++- compiler/types.nim | 2 +- compiler/vm.nim | 12 +++++++++--- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/compiler/semcall.nim b/compiler/semcall.nim index 43fd5fb864..9077f34e97 100644 --- a/compiler/semcall.nim +++ b/compiler/semcall.nim @@ -72,8 +72,9 @@ proc pickBestCandidate(c: PContext, headSymbol: PNode, if cmp < 0: best = z # x is better than the best so far elif cmp == 0: alt = z # x is as good as the best so far else: discard - #if sym.name.s == "shl" and (n.info ?? "net.nim"): + #if sym.name.s == "*" and (n.info ?? "temp5.nim"): # echo "Matches ", n.info, " ", typeToString(sym.typ) + # debug sym # writeMatches(z) sym = nextOverloadIter(o, c, headSymbol) diff --git a/compiler/types.nim b/compiler/types.nim index 3ace332267..0f156f7bdf 100644 --- a/compiler/types.nim +++ b/compiler/types.nim @@ -796,7 +796,7 @@ template ifFastObjectTypeCheckFailed(a, b: PType, body: stmt) {.immediate.} = else: # expensive structural equality test; however due to the way generic and # objects work, if one of the types does **not** contain tfFromGeneric, - # they cannot be equal. The check ``a.sym.Id == b.sym.Id`` checks + # they cannot be equal. The check ``a.sym.id == b.sym.id`` checks # for the same origin and is essential because we don't want "pure" # structural type equivalence: # diff --git a/compiler/vm.nim b/compiler/vm.nim index 090498f109..f7e7fd2af9 100644 --- a/compiler/vm.nim +++ b/compiler/vm.nim @@ -1087,14 +1087,20 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg = of opcNAdd: decodeBC(rkNode) var u = regs[rb].node - u.add(regs[rc].node) + if u.kind notin {nkEmpty..nkNilLit}: + u.add(regs[rc].node) + else: + stackTrace(c, tos, pc, errGenerated, "cannot add to node kind: " & $u.kind) regs[ra].node = u of opcNAddMultiple: decodeBC(rkNode) let x = regs[rc].node var u = regs[rb].node - # XXX can be optimized: - for i in 0..