Skip to content

Commit 9d95c35

Browse files
authored
Apply suggestions from code review
1 parent 035c772 commit 9d95c35

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Python/marshal.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ w_PyLong(const PyLongObject *ob, char flag, WFILE *p)
329329

330330
/* must be a multiple of PyLong_MARSHAL_SHIFT */
331331
assert(layout->bits_per_digit % PyLong_MARSHAL_SHIFT == 0);
332+
assert(layout->bits_per_digit >= PyLong_MARSHAL_SHIFT);
332333

333334
/* other assumptions on PyLongObject internals */
334335
assert(layout->bits_per_digit <= 32);
@@ -996,6 +997,7 @@ r_PyLong(RFILE *p)
996997

997998
/* must be a multiple of PyLong_MARSHAL_SHIFT */
998999
assert(layout->bits_per_digit % PyLong_MARSHAL_SHIFT == 0);
1000+
assert(layout->bits_per_digit >= PyLong_MARSHAL_SHIFT);
9991001

10001002
/* other assumptions on PyLongObject internals */
10011003
assert(layout->bits_per_digit <= 32);

0 commit comments

Comments
 (0)