mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Fix BigInt leaking
This commit is contained in:
@@ -6946,6 +6946,7 @@ gb_internal bool check_builtin_procedure(CheckerContext *c, Operand *operand, As
|
|||||||
array_sort(enum_constants, enum_constant_entity_cmp);
|
array_sort(enum_constants, enum_constant_entity_cmp);
|
||||||
|
|
||||||
BigInt minus_one = big_int_make_i64(-1);
|
BigInt minus_one = big_int_make_i64(-1);
|
||||||
|
defer (big_int_dealloc(&minus_one));
|
||||||
BigInt diff = {};
|
BigInt diff = {};
|
||||||
|
|
||||||
bool contiguous = true;
|
bool contiguous = true;
|
||||||
@@ -6956,6 +6957,7 @@ gb_internal bool check_builtin_procedure(CheckerContext *c, Operand *operand, As
|
|||||||
BigInt curr = enum_constants[i]->Constant.value.value_integer;
|
BigInt curr = enum_constants[i]->Constant.value.value_integer;
|
||||||
BigInt next = enum_constants[i + 1]->Constant.value.value_integer;
|
BigInt next = enum_constants[i + 1]->Constant.value.value_integer;
|
||||||
big_int_sub(&diff, &curr, &next);
|
big_int_sub(&diff, &curr, &next);
|
||||||
|
defer (big_int_dealloc(&diff));
|
||||||
|
|
||||||
if (!big_int_is_zero(&diff) && big_int_cmp(&diff, &minus_one) != 0) {
|
if (!big_int_is_zero(&diff) && big_int_cmp(&diff, &minus_one) != 0) {
|
||||||
contiguous = false;
|
contiguous = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user