aboutsummaryrefslogtreecommitdiff
path: root/src/check_type.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/check_type.cpp')
-rw-r--r--src/check_type.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/check_type.cpp b/src/check_type.cpp
index ace1ef898..6c9e82aa1 100644
--- a/src/check_type.cpp
+++ b/src/check_type.cpp
@@ -1390,7 +1390,7 @@ Type *determine_type_from_polymorphic(CheckerContext *ctx, Type *poly_type, Oper
if (is_polymorphic_type_assignable(ctx, poly_type, operand.type, false, modify_type)) {
if (show_error) {
- set_procedure_abi_types(ctx->allocator, poly_type);
+ set_procedure_abi_types(poly_type);
}
return poly_type;
}
@@ -2508,7 +2508,7 @@ bool abi_compat_return_by_pointer(gbAllocator a, ProcCallingConvention cc, Type
return false;
}
-void set_procedure_abi_types(gbAllocator allocator, Type *type) {
+void set_procedure_abi_types(Type *type) {
type = base_type(type);
if (type->kind != Type_Proc) {
return;
@@ -2518,6 +2518,8 @@ void set_procedure_abi_types(gbAllocator allocator, Type *type) {
return;
}
+ gbAllocator allocator = permanent_allocator();
+
u32 flags = type->flags;
type->flags |= TypeFlag_InProcessOfCheckingABI;
@@ -2550,13 +2552,13 @@ void set_procedure_abi_types(gbAllocator allocator, Type *type) {
for (i32 i = 0; i < type->Proc.param_count; i++) {
Entity *e = type->Proc.params->Tuple.variables[i];
if (e->kind == Entity_Variable) {
- set_procedure_abi_types(allocator, e->type);
+ set_procedure_abi_types(e->type);
}
}
for (i32 i = 0; i < type->Proc.result_count; i++) {
Entity *e = type->Proc.results->Tuple.variables[i];
if (e->kind == Entity_Variable) {
- set_procedure_abi_types(allocator, e->type);
+ set_procedure_abi_types(e->type);
}
}