aboutsummaryrefslogtreecommitdiff
path: root/src/check_builtin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/check_builtin.cpp')
-rw-r--r--src/check_builtin.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/check_builtin.cpp b/src/check_builtin.cpp
index 70848cec6..041e89afd 100644
--- a/src/check_builtin.cpp
+++ b/src/check_builtin.cpp
@@ -6941,8 +6941,8 @@ gb_internal bool check_builtin_procedure(CheckerContext *c, Operand *operand, As
return false;
}
- // sort enum fields in place in ascending order
- Array<Entity *> enum_constants = type->Enum.fields;
+ auto enum_constants = array_make<Entity *>(temporary_allocator(), type->Enum.fields.count);
+ array_copy(&enum_constants, type->Enum.fields, 0);
array_sort(enum_constants, enum_constant_entity_cmp);
BigInt minus_one = big_int_make_i64(-1);