aboutsummaryrefslogtreecommitdiff
path: root/src/codegen/llvm.zig
diff options
context:
space:
mode:
authorJacob Young <jacobly0@users.noreply.github.com>2023-06-01 19:48:36 -0400
committerAndrew Kelley <andrew@ziglang.org>2023-06-10 20:47:58 -0700
commit8299ddfe4ff506b45cfd58b2a6eb048d8be05b9e (patch)
tree856e6d939f9f4c4527377683813c0ecba081679e /src/codegen/llvm.zig
parent9b48fc2833be409902f4d3256d2d921f4f924e0d (diff)
downloadzig-8299ddfe4ff506b45cfd58b2a6eb048d8be05b9e.tar.gz
zig-8299ddfe4ff506b45cfd58b2a6eb048d8be05b9e.zip
InternPool: fix more key lifetime issues
Reminder to look into deleting `get` and make keys less pointery and more long lived.
Diffstat (limited to 'src/codegen/llvm.zig')
-rw-r--r--src/codegen/llvm.zig11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig
index a727b23fcc..be6ca714a6 100644
--- a/src/codegen/llvm.zig
+++ b/src/codegen/llvm.zig
@@ -2331,14 +2331,15 @@ pub const Object = struct {
try param_di_types.append(try o.lowerDebugType(ptr_ty, .full));
}
- for (mod.typeToFunc(ty).?.param_types) |param_ty| {
- if (!param_ty.toType().hasRuntimeBitsIgnoreComptime(mod)) continue;
+ for (0..mod.typeToFunc(ty).?.param_types.len) |i| {
+ const param_ty = mod.typeToFunc(ty).?.param_types[i].toType();
+ if (!param_ty.hasRuntimeBitsIgnoreComptime(mod)) continue;
- if (isByRef(param_ty.toType(), mod)) {
- const ptr_ty = try mod.singleMutPtrType(param_ty.toType());
+ if (isByRef(param_ty, mod)) {
+ const ptr_ty = try mod.singleMutPtrType(param_ty);
try param_di_types.append(try o.lowerDebugType(ptr_ty, .full));
} else {
- try param_di_types.append(try o.lowerDebugType(param_ty.toType(), .full));
+ try param_di_types.append(try o.lowerDebugType(param_ty, .full));
}
}