aboutsummaryrefslogtreecommitdiff
path: root/src/Sema.zig
diff options
context:
space:
mode:
authorJacob Young <jacobly0@users.noreply.github.com>2023-06-01 01:44:39 -0400
committerAndrew Kelley <andrew@ziglang.org>2023-06-10 20:47:58 -0700
commit0777e98bfe89eadeaa0e34a2ad07cf61cdf5b26a (patch)
tree66a0bf465658a81c55d5b15bd3a9a368fec52b3a /src/Sema.zig
parenta3b3ac0ea482fc76684ee7d0a9b98306ebbd942c (diff)
downloadzig-0777e98bfe89eadeaa0e34a2ad07cf61cdf5b26a.tar.gz
zig-0777e98bfe89eadeaa0e34a2ad07cf61cdf5b26a.zip
Sema: disable repeated aggregate storage use with mismatching sentinel
The InternPool implementation was not written to support this, but that could be changed and this check removed in the future.
Diffstat (limited to 'src/Sema.zig')
-rw-r--r--src/Sema.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Sema.zig b/src/Sema.zig
index 0cc657ba01..a0d7c483d9 100644
--- a/src/Sema.zig
+++ b/src/Sema.zig
@@ -13094,7 +13094,7 @@ fn zirArrayMul(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai
const val = v: {
// Optimization for the common pattern of a single element repeated N times, such
// as zero-filling a byte array.
- if (lhs_len == 1) {
+ if (lhs_len == 1 and lhs_info.sentinel == null) {
const elem_val = try lhs_sub_val.elemValue(mod, 0);
break :v try mod.intern(.{ .aggregate = .{
.ty = result_ty.toIntern(),