Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Prev Previous commit
Next Next commit
tighten guard
  • Loading branch information
eendebakpt committed Jan 29, 2025
commit 32c68aefa4d5095030b1aef87de42d95da8fc979
2 changes: 1 addition & 1 deletion Python/specialize.c
Original file line number Diff line number Diff line change
Expand Up @@ -2475,7 +2475,7 @@ shift_guard(PyObject *lhs, PyObject *rhs)

// rshift with value larger the the number of bits is undefined in C
// for lshift we do not want to overflow, but we always have at least 16 bits available
return (is_compactlong(lhs) && is_compactnonnegativelong(rhs) && (_PyLong_CompactValue((PyLongObject *)rhs) <= 16) );
return (is_compactlong(lhs) && is_compactnonnegativelong(rhs) && (_PyLong_CompactValue((PyLongObject *)rhs) <= 12) );
}

#define BITWISE_LONGS_ACTION(NAME, OP) \
Expand Down