summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2018-09-23 23:08:35 +0200
committerGitHub <noreply@github.com>2018-09-23 23:08:35 +0200
commitfedd695d76e621bfbbaca4bbc8f66996a0a732a4 (patch)
tree6b82f41e4fec287bdbf8f23c90144a356e2b3211 /compiler
parent179791aa9a3d7e47883b07852025776cf5e7b9aa (diff)
parentfb54f394e8c9a8ca07b8eb952b8f9eaa1ce66005 (diff)
downloadNim-fedd695d76e621bfbbaca4bbc8f66996a0a732a4.tar.gz
Merge pull request #9046 from LemonBoy/fix-9043
Fix for VM codegen with static[T] types
Diffstat (limited to 'compiler')
-rw-r--r--compiler/vmgen.nim6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/vmgen.nim b/compiler/vmgen.nim
index b6b5bf4f2..e612d7a2a 100644
--- a/compiler/vmgen.nim
+++ b/compiler/vmgen.nim
@@ -1529,7 +1529,7 @@ proc genRdVar(c: PCtx; n: PNode; dest: var TDest; flags: TGenFlags) =
 
 template needsRegLoad(): untyped =
   {gfNode, gfNodeAddr} * flags == {} and
-    fitsRegister(n.typ.skipTypes({tyVar, tyLent}))
+    fitsRegister(n.typ.skipTypes({tyVar, tyLent, tyStatic}))
 
 proc genArrAccess2(c: PCtx; n: PNode; dest: var TDest; opc: TOpcode;
                    flags: TGenFlags) =
@@ -1590,7 +1590,7 @@ proc getNullValueAux(obj: PNode, result: PNode; conf: ConfigRef) =
   else: globalError(conf, result.info, "cannot create null element for: " & $obj)
 
 proc getNullValue(typ: PType, info: TLineInfo; conf: ConfigRef): PNode =
-  var t = skipTypes(typ, abstractRange-{tyTypeDesc})
+  var t = skipTypes(typ, abstractRange+{tyStatic}-{tyTypeDesc})
   case t.kind
   of tyBool, tyEnum, tyChar, tyInt..tyInt64:
     result = newNodeIT(nkIntLit, info, t)
@@ -1602,7 +1602,7 @@ proc getNullValue(typ: PType, info: TLineInfo; conf: ConfigRef): PNode =
     result = newNodeIT(nkStrLit, info, t)
     result.strVal = ""
   of tyVar, tyLent, tyPointer, tyPtr, tyExpr,
-     tyStmt, tyTypeDesc, tyStatic, tyRef, tyNil:
+     tyStmt, tyTypeDesc, tyRef, tyNil:
     result = newNodeIT(nkNilLit, info, t)
   of tyProc:
     if t.callConv != ccClosure: