Skip to content

Commit

Permalink
Fix bigint resize
Browse files Browse the repository at this point in the history
  • Loading branch information
danielaparker committed Jul 21, 2023
1 parent 3498366 commit e368bc5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions include/jsoncons/bigint.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -509,9 +509,11 @@ class basic_bigint : protected detail::basic_bigint_base<Allocator>
size_type len_old = common_stor_.length_;
reserve(n);
common_stor_.length_ = n;
if ( common_stor_.length_ > len_old )

uint64_t* a = data();
for (size_type i = len_old; i < common_stor_.length_; ++i)
{
memset( data()+len_old, 0, (common_stor_.length_ - len_old)*sizeof(uint64_t) );
a[i] = 0;
}
}

Expand Down

0 comments on commit e368bc5

Please sign in to comment.