authorgravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2023-06-21 11:12:10-04:00
committergravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2023-06-22 00:24:26-04:00
log1d38817f5d7bf3fec6294bfb112f7f9e609078d5
treea36017fc6a9a07c20bc11f0981c378fe66ac1e2a
parent128fd7dd02ae112cba68d0ad6cc40dc1ce8c34b1

cbe: key lifetime?


1 files changed, 5 insertions(+), 5 deletions(-)

src/codegen/c.zig+5-5
......@@ -1205,7 +1205,7 @@ pub const DeclGen = struct {
12051205 try dg.renderValue(writer, Type.bool, is_null_val, initializer_type);
12061206 try writer.writeAll(" }");
12071207 },
1208 .aggregate => |aggregate| switch (mod.intern_pool.indexToKey(ty.ip_index)) {
1208 .aggregate => switch (mod.intern_pool.indexToKey(ty.ip_index)) {
12091209 .array_type, .vector_type => {
12101210 if (location == .FunctionArgument) {
12111211 try writer.writeByte('(');
......@@ -1278,7 +1278,7 @@ pub const DeclGen = struct {
12781278
12791279 if (!empty) try writer.writeByte(',');
12801280
1281 const field_val = switch (aggregate.storage) {
1281 const field_val = switch (mod.intern_pool.indexToKey(val.ip_index).aggregate.storage) {
12821282 .bytes => |bytes| try mod.intern_pool.get(mod.gpa, .{ .int = .{
12831283 .ty = field_ty,
12841284 .storage = .{ .u64 = bytes[field_i] },
......@@ -1309,7 +1309,7 @@ pub const DeclGen = struct {
13091309 if (!field.ty.hasRuntimeBitsIgnoreComptime(mod)) continue;
13101310
13111311 if (!empty) try writer.writeByte(',');
1312 const field_val = switch (aggregate.storage) {
1312 const field_val = switch (mod.intern_pool.indexToKey(val.ip_index).aggregate.storage) {
13131313 .bytes => |bytes| try mod.intern_pool.get(mod.gpa, .{ .int = .{
13141314 .ty = field.ty.toIntern(),
13151315 .storage = .{ .u64 = bytes[field_i] },
......@@ -1358,7 +1358,7 @@ pub const DeclGen = struct {
13581358 if (field.is_comptime) continue;
13591359 if (!field.ty.hasRuntimeBitsIgnoreComptime(mod)) continue;
13601360
1361 const field_val = switch (aggregate.storage) {
1361 const field_val = switch (mod.intern_pool.indexToKey(val.ip_index).aggregate.storage) {
13621362 .bytes => |bytes| try mod.intern_pool.get(mod.gpa, .{ .int = .{
13631363 .ty = field.ty.toIntern(),
13641364 .storage = .{ .u64 = bytes[field_i] },
......@@ -1400,7 +1400,7 @@ pub const DeclGen = struct {
14001400 try dg.renderType(writer, ty);
14011401 try writer.writeByte(')');
14021402
1403 const field_val = switch (aggregate.storage) {
1403 const field_val = switch (mod.intern_pool.indexToKey(val.ip_index).aggregate.storage) {
14041404 .bytes => |bytes| try mod.intern_pool.get(mod.gpa, .{ .int = .{
14051405 .ty = field.ty.toIntern(),
14061406 .storage = .{ .u64 = bytes[field_i] },