Skip to content

Commit a39c51c

Browse files
committed
Sema: fix UAF in coerceInMemoryAllowed
1 parent 47c58cb commit a39c51c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Sema.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21246,8 +21246,8 @@ fn coerceInMemoryAllowed(
2124621246
if (child != .ok) {
2124721247
return InMemoryCoercionResult{ .optional_child = .{
2124821248
.child = try child.dupe(sema.arena),
21249-
.actual = src_child_type,
21250-
.wanted = dest_child_type,
21249+
.actual = try src_child_type.copy(sema.arena),
21250+
.wanted = try dest_child_type.copy(sema.arena),
2125121251
} };
2125221252
}
2125321253

0 commit comments

Comments
 (0)