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 {...@@ -1205,7 +1205,7 @@ pub const DeclGen = struct {
1205 try dg.renderValue(writer, Type.bool, is_null_val, initializer_type);1205 try dg.renderValue(writer, Type.bool, is_null_val, initializer_type);
1206 try writer.writeAll(" }");1206 try writer.writeAll(" }");
1207 },1207 },
1208 .aggregate => |aggregate| switch (mod.intern_pool.indexToKey(ty.ip_index)) {1208 .aggregate => switch (mod.intern_pool.indexToKey(ty.ip_index)) {
1209 .array_type, .vector_type => {1209 .array_type, .vector_type => {
1210 if (location == .FunctionArgument) {1210 if (location == .FunctionArgument) {
1211 try writer.writeByte('(');1211 try writer.writeByte('(');
...@@ -1278,7 +1278,7 @@ pub const DeclGen = struct {...@@ -1278,7 +1278,7 @@ pub const DeclGen = struct {
12781278
1279 if (!empty) try writer.writeByte(',');1279 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) {
1282 .bytes => |bytes| try mod.intern_pool.get(mod.gpa, .{ .int = .{1282 .bytes => |bytes| try mod.intern_pool.get(mod.gpa, .{ .int = .{
1283 .ty = field_ty,1283 .ty = field_ty,
1284 .storage = .{ .u64 = bytes[field_i] },1284 .storage = .{ .u64 = bytes[field_i] },
...@@ -1309,7 +1309,7 @@ pub const DeclGen = struct {...@@ -1309,7 +1309,7 @@ pub const DeclGen = struct {
1309 if (!field.ty.hasRuntimeBitsIgnoreComptime(mod)) continue;1309 if (!field.ty.hasRuntimeBitsIgnoreComptime(mod)) continue;
13101310
1311 if (!empty) try writer.writeByte(',');1311 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) {
1313 .bytes => |bytes| try mod.intern_pool.get(mod.gpa, .{ .int = .{1313 .bytes => |bytes| try mod.intern_pool.get(mod.gpa, .{ .int = .{
1314 .ty = field.ty.toIntern(),1314 .ty = field.ty.toIntern(),
1315 .storage = .{ .u64 = bytes[field_i] },1315 .storage = .{ .u64 = bytes[field_i] },
...@@ -1358,7 +1358,7 @@ pub const DeclGen = struct {...@@ -1358,7 +1358,7 @@ pub const DeclGen = struct {
1358 if (field.is_comptime) continue;1358 if (field.is_comptime) continue;
1359 if (!field.ty.hasRuntimeBitsIgnoreComptime(mod)) continue;1359 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) {
1362 .bytes => |bytes| try mod.intern_pool.get(mod.gpa, .{ .int = .{1362 .bytes => |bytes| try mod.intern_pool.get(mod.gpa, .{ .int = .{
1363 .ty = field.ty.toIntern(),1363 .ty = field.ty.toIntern(),
1364 .storage = .{ .u64 = bytes[field_i] },1364 .storage = .{ .u64 = bytes[field_i] },
...@@ -1400,7 +1400,7 @@ pub const DeclGen = struct {...@@ -1400,7 +1400,7 @@ pub const DeclGen = struct {
1400 try dg.renderType(writer, ty);1400 try dg.renderType(writer, ty);
1401 try writer.writeByte(')');1401 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) {
1404 .bytes => |bytes| try mod.intern_pool.get(mod.gpa, .{ .int = .{1404 .bytes => |bytes| try mod.intern_pool.get(mod.gpa, .{ .int = .{
1405 .ty = field.ty.toIntern(),1405 .ty = field.ty.toIntern(),
1406 .storage = .{ .u64 = bytes[field_i] },1406 .storage = .{ .u64 = bytes[field_i] },