summary refs log tree commit diff stats
path: root/compiler/ccgcalls.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2016-01-14 15:01:55 +0100
committerAndreas Rumpf <rumpf_a@web.de>2016-01-14 15:01:55 +0100
commit1124c61c491ab335a7005b98e01cc1632f041ff5 (patch)
tree2876ddecdb36991e1d37e251031a442cc4393b6c /compiler/ccgcalls.nim
parent3838cd0066160c4b009a06125eff0016c12da32d (diff)
parent522f8f1cc60649b982f231d85ca0d1ac34f358d5 (diff)
downloadNim-1124c61c491ab335a7005b98e01cc1632f041ff5.tar.gz
Merge branch 'devel' into new-ll
Diffstat (limited to 'compiler/ccgcalls.nim')
-rw-r--r--compiler/ccgcalls.nim8
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/ccgcalls.nim b/compiler/ccgcalls.nim
index 69cc30413..bd17f85e4 100644
--- a/compiler/ccgcalls.nim
+++ b/compiler/ccgcalls.nim
@@ -118,6 +118,14 @@ proc openArrayLoc(p: BProc, n: PNode): Rope =
         result = "$1->data, $1->$2" % [a.rdLoc, lenField(p)]
     of tyArray, tyArrayConstr:
       result = "$1, $2" % [rdLoc(a), rope(lengthOrd(a.t))]
+    of tyPtr, tyRef:
+      case lastSon(a.t).kind
+      of tyString, tySequence:
+        result = "(*$1)->data, (*$1)->$2" % [a.rdLoc, lenField(p)]
+      of tyArray, tyArrayConstr:
+        result = "$1, $2" % [rdLoc(a), rope(lengthOrd(lastSon(a.t)))]
+      else: 
+        internalError("openArrayLoc: " & typeToString(a.t))
     else: internalError("openArrayLoc: " & typeToString(a.t))
 
 proc genArgStringToCString(p: BProc, n: PNode): Rope {.inline.} =
id='n55' href='#n55'>55 56
57
58