Skip to content
Snippets Groups Projects
Commit df3e5d2b authored by Damien George's avatar Damien George
Browse files

py/mpz: Use assert to verify mpz does not have a fixed digit buffer.

parent 48874942
No related branches found
No related tags found
No related merge requests found
......@@ -734,11 +734,9 @@ STATIC void mpz_need_dig(mpz_t *z, mp_uint_t need) {
}
if (z->dig == NULL || z->alloc < need) {
if (z->fixed_dig) {
// cannot reallocate fixed buffers
assert(0);
return;
}
// if z has fixed digit buffer there's not much we can do as the caller will
// be expecting a buffer with at least "need" bytes (but it shouldn't happen)
assert(!z->fixed_dig);
z->dig = m_renew(mpz_dig_t, z->dig, z->alloc, need);
z->alloc = need;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment