summary refs log tree commit diff stats
path: root/compiler/ccgexprs.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2014-04-09 00:33:51 +0200
committerAraq <rumpf_a@web.de>2014-04-09 00:33:51 +0200
commit4196757de768e5832d740e87164d0597e5f95363 (patch)
treedbc2494ad68c64c2781dfa2c5738274131aebdcf /compiler/ccgexprs.nim
parent3e25d5f24747c324a5a0f0deb555611166c96209 (diff)
downloadNim-4196757de768e5832d740e87164d0597e5f95363.tar.gz
implemented region pointers
Diffstat (limited to 'compiler/ccgexprs.nim')
-rw-r--r--compiler/ccgexprs.nim8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim
index a4ba412a4..eda0d23bc 100644
--- a/compiler/ccgexprs.nim
+++ b/compiler/ccgexprs.nim
@@ -780,7 +780,7 @@ proc genSeqElem(p: BProc, e: PNode, d: var TLoc) =
   initLocExpr(p, e.sons[1], b)
   var ty = skipTypes(a.t, abstractVarRange)
   if ty.kind in {tyRef, tyPtr}:
-    ty = skipTypes(ty.sons[0], abstractVarRange) # emit range check:
+    ty = skipTypes(ty.lastSon, abstractVarRange) # emit range check:
   if optBoundsCheck in p.options:
     if ty.kind == tyString:
       linefmt(p, cpsStmts,
@@ -1121,7 +1121,7 @@ proc genOf(p: BProc, x: PNode, typ: PType, d: var TLoc) =
   while t.kind in {tyVar, tyPtr, tyRef}:
     if t.kind != tyVar: nilCheck = r
     r = rfmt(nil, "(*$1)", r)
-    t = skipTypes(t.sons[0], typedescInst)
+    t = skipTypes(t.lastSon, typedescInst)
   if gCmd != cmdCompileToCpp:
     while (t.kind == tyObject) and (t.sons[0] != nil):
       app(r, ~".Sup")
@@ -1737,7 +1737,7 @@ proc upConv(p: BProc, n: PNode, d: var TLoc) =
     while t.kind in {tyVar, tyPtr, tyRef}:
       if t.kind != tyVar: nilCheck = r
       r = ropef("(*$1)", [r])
-      t = skipTypes(t.sons[0], abstractInst)
+      t = skipTypes(t.lastSon, abstractInst)
     if gCmd != cmdCompileToCpp:
       while t.kind == tyObject and t.sons[0] != nil:
         app(r, ".Sup")
@@ -1885,7 +1885,7 @@ proc expr(p: BProc, n: PNode, d: var TLoc) =
   of nkHiddenAddr, nkAddr: genAddr(p, n, d)
   of nkBracketExpr:
     var ty = skipTypes(n.sons[0].typ, abstractVarRange)
-    if ty.kind in {tyRef, tyPtr}: ty = skipTypes(ty.sons[0], abstractVarRange)
+    if ty.kind in {tyRef, tyPtr}: ty = skipTypes(ty.lastSon, abstractVarRange)
     case ty.kind
     of tyArray, tyArrayConstr: genArrayElem(p, n, d)
     of tyOpenArray, tyVarargs: genOpenArrayElem(p, n, d)