Skip to content

Commit 595c146

Browse files
dont emit anything if destination type has zero bits
1 parent f2dcfe0 commit 595c146

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Sema.zig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26256,6 +26256,9 @@ fn zirMemcpy(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!void
2625626256
}
2625726257

2625826258
const dest_elem_ty = dest_ty.elemType2(zcu);
26259+
if (!dest_elem_ty.hasRuntimeBits(zcu)) {
26260+
return;
26261+
}
2625926262
const src_elem_ty = src_ty.elemType2(zcu);
2626026263
if (.ok != try sema.coerceInMemoryAllowed(block, dest_elem_ty, src_elem_ty, true, target, dest_src, src_src, null)) {
2626126264
return sema.fail(block, src, "TODO: lower @memcpy to a for loop because the element types have different ABI sizes", .{});

0 commit comments

Comments
 (0)