aboutsummaryrefslogtreecommitdiff
path: root/src/codegen
diff options
context:
space:
mode:
authorJacob Young <jacobly0@users.noreply.github.com>2023-06-21 11:12:10 -0400
committerjacobly0 <jacobly0@users.noreply.github.com>2023-06-22 00:24:26 -0400
commit1d38817f5d7bf3fec6294bfb112f7f9e609078d5 (patch)
treea36017fc6a9a07c20bc11f0981c378fe66ac1e2a /src/codegen
parent128fd7dd02ae112cba68d0ad6cc40dc1ce8c34b1 (diff)
downloadzig-1d38817f5d7bf3fec6294bfb112f7f9e609078d5.tar.gz
zig-1d38817f5d7bf3fec6294bfb112f7f9e609078d5.zip
cbe: key lifetime?
Diffstat (limited to 'src/codegen')
-rw-r--r--src/codegen/c.zig10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/codegen/c.zig b/src/codegen/c.zig
index c6ccba5b2c..8afaae7cfa 100644
--- a/src/codegen/c.zig
+++ b/src/codegen/c.zig
@@ -1205,7 +1205,7 @@ pub const DeclGen = struct {
try dg.renderValue(writer, Type.bool, is_null_val, initializer_type);
try writer.writeAll(" }");
},
- .aggregate => |aggregate| switch (mod.intern_pool.indexToKey(ty.ip_index)) {
+ .aggregate => switch (mod.intern_pool.indexToKey(ty.ip_index)) {
.array_type, .vector_type => {
if (location == .FunctionArgument) {
try writer.writeByte('(');
@@ -1278,7 +1278,7 @@ pub const DeclGen = struct {
if (!empty) try writer.writeByte(',');
- const field_val = switch (aggregate.storage) {
+ const field_val = switch (mod.intern_pool.indexToKey(val.ip_index).aggregate.storage) {
.bytes => |bytes| try mod.intern_pool.get(mod.gpa, .{ .int = .{
.ty = field_ty,
.storage = .{ .u64 = bytes[field_i] },
@@ -1309,7 +1309,7 @@ pub const DeclGen = struct {
if (!field.ty.hasRuntimeBitsIgnoreComptime(mod)) continue;
if (!empty) try writer.writeByte(',');
- const field_val = switch (aggregate.storage) {
+ const field_val = switch (mod.intern_pool.indexToKey(val.ip_index).aggregate.storage) {
.bytes => |bytes| try mod.intern_pool.get(mod.gpa, .{ .int = .{
.ty = field.ty.toIntern(),
.storage = .{ .u64 = bytes[field_i] },
@@ -1358,7 +1358,7 @@ pub const DeclGen = struct {
if (field.is_comptime) continue;
if (!field.ty.hasRuntimeBitsIgnoreComptime(mod)) continue;
- const field_val = switch (aggregate.storage) {
+ const field_val = switch (mod.intern_pool.indexToKey(val.ip_index).aggregate.storage) {
.bytes => |bytes| try mod.intern_pool.get(mod.gpa, .{ .int = .{
.ty = field.ty.toIntern(),
.storage = .{ .u64 = bytes[field_i] },
@@ -1400,7 +1400,7 @@ pub const DeclGen = struct {
try dg.renderType(writer, ty);
try writer.writeByte(')');
- const field_val = switch (aggregate.storage) {
+ const field_val = switch (mod.intern_pool.indexToKey(val.ip_index).aggregate.storage) {
.bytes => |bytes| try mod.intern_pool.get(mod.gpa, .{ .int = .{
.ty = field.ty.toIntern(),
.storage = .{ .u64 = bytes[field_i] },