summary refs log tree commit diff stats
path: root/compiler/vm.nim
diff options
context:
space:
mode:
authorJames Osborn <osborn@alcf.anl.gov>2016-05-04 00:21:22 -0500
committerJames Osborn <osborn@alcf.anl.gov>2016-05-04 00:24:44 -0500
commit0356f53b5619782c650f56a6842cbaf91a82137d (patch)
treec005b1330f99920e8bd219bf288e66f5aba8a0c7 /compiler/vm.nim
parentc89397f821f1269b6cf7ab99b376c147bd3ad442 (diff)
downloadNim-0356f53b5619782c650f56a6842cbaf91a82137d.tar.gz
getTypeInst and getTypeImpl mostly working now and added test
Diffstat (limited to 'compiler/vm.nim')
-rw-r--r--compiler/vm.nim9
1 files changed, 8 insertions, 1 deletions
diff --git a/compiler/vm.nim b/compiler/vm.nim
index ee58b6d48..cddb57f17 100644
--- a/compiler/vm.nim
+++ b/compiler/vm.nim
@@ -1200,13 +1200,20 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
             regs[ra].intVal = ord(regs[rb].node.typ.kind)
           #else:
           #  stackTrace(c, tos, pc, errGenerated, "node has no type")
-        else:
+        of 2:
           # getTypeInst opcode:
           ensureKind(rkNode)
           if regs[rb].kind == rkNode and regs[rb].node.typ != nil:
             regs[ra].node = opMapTypeInstToAst(regs[rb].node.typ, c.debug[pc])
           else:
             stackTrace(c, tos, pc, errGenerated, "node has no type")
+        else:
+          # getTypeImpl opcode:
+          ensureKind(rkNode)
+          if regs[rb].kind == rkNode and regs[rb].node.typ != nil:
+            regs[ra].node = opMapTypeImplToAst(regs[rb].node.typ, c.debug[pc])
+          else:
+            stackTrace(c, tos, pc, errGenerated, "node has no type")
     of opcNStrVal:
       decodeB(rkNode)
       createStr regs[ra]