aboutsummaryrefslogtreecommitdiff
path: root/src/check_type.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2020-11-15 18:11:49 +0000
committergingerBill <bill@gingerbill.org>2020-11-15 18:11:49 +0000
commit30d922b05938ccde7e49f027e2e65ca28849b218 (patch)
tree7cc995b136a57cbc1a2fed8e9c0c20ac947fbfdc /src/check_type.cpp
parent3c1c10a1785a97831a69fb6d94356d5cc4989bd6 (diff)
Make `set_procedure_abi_types` use the permanent_allocator
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);
}
}