aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSamTebbs33 <samuel.tebbs@gmail.com>2019-07-05 00:00:12 +0100
committerAndrew Kelley <andrew@ziglang.org>2019-07-06 17:02:17 -0400
commitb118806c69e44029a7af9c9b8bdfa9cdcd280260 (patch)
treea76bb5a3b4d9d3c407a81d6c7924b9f338cb293a /src
parent21c60922e3514ca15fa505efb380fb37fde8d62a (diff)
downloadzig-b118806c69e44029a7af9c9b8bdfa9cdcd280260.tar.gz
zig-b118806c69e44029a7af9c9b8bdfa9cdcd280260.zip
Add implicit cast for *[N]T to [*c]T
Diffstat (limited to 'src')
-rw-r--r--src/ir.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ir.cpp b/src/ir.cpp
index 23035fa66d..f0ac2f8eaf 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -12773,9 +12773,9 @@ static IrInstruction *ir_analyze_cast(IrAnalyze *ira, IrInstruction *source_inst
}
}
- // *[N]T to [*]T
+ // *[N]T to [*]T and [*c]T
if (wanted_type->id == ZigTypeIdPointer &&
- wanted_type->data.pointer.ptr_len == PtrLenUnknown &&
+ (wanted_type->data.pointer.ptr_len == PtrLenUnknown || wanted_type->data.pointer.ptr_len == PtrLenC) &&
actual_type->id == ZigTypeIdPointer &&
actual_type->data.pointer.ptr_len == PtrLenSingle &&
actual_type->data.pointer.child_type->id == ZigTypeIdArray)