| ... | @@ -658,7 +658,7 @@ const Parser = struct { | ... | @@ -658,7 +658,7 @@ const Parser = struct { |
| 658 | const limbs_buffer_len = std.math.big.int.calcSetStringLimbsBufferLen(base, number_text.len); | 658 | const limbs_buffer_len = std.math.big.int.calcSetStringLimbsBufferLen(base, number_text.len); |
| 659 | const limbs_buffer = try self.allocator.alloc(std.math.big.Limb, limbs_buffer_len); | 659 | const limbs_buffer = try self.allocator.alloc(std.math.big.Limb, limbs_buffer_len); |
| 660 | defer self.allocator.free(limbs_buffer); | 660 | defer self.allocator.free(limbs_buffer); |
| 661 | const limb_len = std.math.big.int.calcSetStringLimbsBufferLen(base, number_text.len); | 661 | const limb_len = std.math.big.int.calcSetStringLimbCount(base, number_text.len); |
| 662 | const limbs = try self.arena.allocator.alloc(std.math.big.Limb, limb_len); | 662 | const limbs = try self.arena.allocator.alloc(std.math.big.Limb, limb_len); |
| 663 | var result = BigIntMutable{ .limbs = limbs, .positive = undefined, .len = undefined }; | 663 | var result = BigIntMutable{ .limbs = limbs, .positive = undefined, .len = undefined }; |
| 664 | result.setString(base, number_text, limbs_buffer, self.allocator) catch |err| switch (err) { | 664 | result.setString(base, number_text, limbs_buffer, self.allocator) catch |err| switch (err) { |