Sema: bad union field access safety

This commit is contained in:
Veikka Tuominen
2022-07-16 16:32:49 +03:00
parent 55fe34100f
commit ff7ec4efb5
15 changed files with 194 additions and 90 deletions

View File

@@ -3404,7 +3404,7 @@ pub const DeclGen = struct {
if (layout.payload_size == 0) {
return lowerValue(dg, .{
.ty = tv.ty.unionTagType().?,
.ty = tv.ty.unionTagTypeSafety().?,
.val = tag_and_val.tag,
});
}
@@ -3446,7 +3446,7 @@ pub const DeclGen = struct {
}
}
const llvm_tag_value = try lowerValue(dg, .{
.ty = tv.ty.unionTagType().?,
.ty = tv.ty.unionTagTypeSafety().?,
.val = tag_and_val.tag,
});
var fields: [3]*const llvm.Value = undefined;