summary refs log tree commit diff stats
path: root/compiler/vm.nim
diff options
context:
space:
mode:
authorAdam Strzelecki <ono@java.pl>2015-06-09 23:57:41 +0200
committerAdam Strzelecki <ono@java.pl>2015-06-10 18:07:21 +0200
commit6ecce2941e3c05822dffb8ea80715225f9053855 (patch)
tree87bcfb5d210e9f934626b90b88eeac7f701c0593 /compiler/vm.nim
parent6c256ddcaef0c92b94d1a3e61f4e56cf7d017b50 (diff)
downloadNim-6ecce2941e3c05822dffb8ea80715225f9053855.tar.gz
macros: exprStructuralEquivalent for EqNimrodNode
Previously NimNode comparison in macros way returning false for anything else
than nil literal.
Diffstat (limited to 'compiler/vm.nim')
-rw-r--r--compiler/vm.nim6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/vm.nim b/compiler/vm.nim
index e49bed522..9f0d0bfce 100644
--- a/compiler/vm.nim
+++ b/compiler/vm.nim
@@ -682,11 +682,15 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
     of opcLtu:
       decodeBC(rkInt)
       regs[ra].intVal = ord(regs[rb].intVal <% regs[rc].intVal)
-    of opcEqRef, opcEqNimrodNode:
+    of opcEqRef:
       decodeBC(rkInt)
       regs[ra].intVal = ord((regs[rb].node.kind == nkNilLit and
                              regs[rc].node.kind == nkNilLit) or
                              regs[rb].node == regs[rc].node)
+    of opcEqNimrodNode:
+      decodeBC(rkInt)
+      regs[ra].intVal =
+        ord(exprStructuralEquivalent(regs[rb].node, regs[rc].node))
     of opcXor:
       decodeBC(rkInt)
       regs[ra].intVal = ord(regs[rb].intVal != regs[rc].intVal)