aboutsummaryrefslogtreecommitdiff
path: root/core/math/big/internal.odin
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2025-11-27 09:10:03 +0000
committergingerBill <gingerBill@users.noreply.github.com>2025-11-27 09:10:03 +0000
commit53876907c61faaadf68ae8b8140ed55df3f691d3 (patch)
tree5b68b4e4a1ce2d8da9ad82985a9c795f5a05d911 /core/math/big/internal.odin
parent49634246c5853dceb770161bea3742b9171b7a0f (diff)
Handle `Allocator_Error` correctly in `core:math/big`
Diffstat (limited to 'core/math/big/internal.odin')
-rw-r--r--core/math/big/internal.odin6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/math/big/internal.odin b/core/math/big/internal.odin
index b3e23da8c..723bb0b8d 100644
--- a/core/math/big/internal.odin
+++ b/core/math/big/internal.odin
@@ -2177,7 +2177,11 @@ internal_int_grow :: proc(a: ^Int, digits: int, allow_shrink := false, allocator
If not yet initialized, initialize the `digit` backing with the allocator we were passed.
*/
if cap == 0 {
- a.digit = make([dynamic]DIGIT, needed, allocator)
+ mem_err: mem.Allocator_Error
+ a.digit, mem_err = make([dynamic]DIGIT, needed, allocator)
+ if mem_err != nil {
+ return cast(Error)mem_err
+ }
} else if cap < needed {
/*
`[dynamic]DIGIT` already knows what allocator was used for it, so resize will do the right thing.