summary refs log tree commit diff stats
path: root/compiler/ccgtrav.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/ccgtrav.nim')
-rw-r--r--compiler/ccgtrav.nim6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/ccgtrav.nim b/compiler/ccgtrav.nim
index 995ed2973..83dda692b 100644
--- a/compiler/ccgtrav.nim
+++ b/compiler/ccgtrav.nim
@@ -110,7 +110,11 @@ proc genTraverseProc(m: BModule, typ: PType, reason: TTypeInfoReason): PRope =
   if typ.kind == tySequence:
     genTraverseProcSeq(c, "a".toRope, typ)
   else:
-    genTraverseProc(c, "(*a)".toRope, typ.sons[0])
+    if skipTypes(typ.sons[0], abstractInst).kind in {tyArrayConstr, tyArray}:
+      # C's arrays are broken beyond repair:
+      genTraverseProc(c, "a".toRope, typ.sons[0])
+    else:
+      genTraverseProc(c, "(*a)".toRope, typ.sons[0])
   
   let generatedProc = ropef("$1 {$n$2$3$4}$n",
         [header, p.s[cpsLocals], p.s[cpsInit], p.s[cpsStmts]])