Skip to content

Commit 8d078f1

Browse files
jacobly0andrewrk
authored andcommitted
cbe: fix incomplete array element types
Can't imagine this working, but might as well try until I remember why. Closes ziglang#21439
1 parent 74fbcd2 commit 8d078f1

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/codegen/c/Type.zig

+10-2
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,14 @@ pub const Kind = enum {
728728
.global => .global,
729729
};
730730
}
731+
732+
pub fn asComplete(kind: Kind) Kind {
733+
return switch (kind) {
734+
.forward, .complete => .complete,
735+
.forward_parameter, .parameter => .parameter,
736+
.global => .global,
737+
};
738+
}
731739
};
732740

733741
pub const Info = union(enum) {
@@ -1887,7 +1895,7 @@ pub const Pool = struct {
18871895
elem_type,
18881896
pt,
18891897
mod,
1890-
kind.noParameter(),
1898+
kind.noParameter().asComplete(),
18911899
);
18921900
if (elem_ctype.index == .void) return .void;
18931901
const array_ctype = try pool.getArray(allocator, .{
@@ -1913,7 +1921,7 @@ pub const Pool = struct {
19131921
elem_type,
19141922
pt,
19151923
mod,
1916-
kind.noParameter(),
1924+
kind.noParameter().asComplete(),
19171925
);
19181926
if (elem_ctype.index == .void) return .void;
19191927
const vector_ctype = try pool.getVector(allocator, .{

0 commit comments

Comments
 (0)