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

Skip to content

Commit 70ad42a

Browse files
committed
handle case of negative shift
1 parent 98015ac commit 70ad42a

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

Lib/test/test_opcache.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,6 +1425,7 @@ def binary_op_bitwise_extend():
14251425
self.assert_specialized(binary_op_bitwise_extend, "BINARY_OP_EXTEND")
14261426
self.assert_no_opcode(binary_op_bitwise_extend, "BINARY_OP")
14271427

1428+
# check that after specialization of >> we handle negative shifts
14281429
for idx in range(100):
14291430
a, b = 2, 1
14301431
if idx == 99:

Python/specialize.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2463,7 +2463,7 @@ compactlongs_guard(PyObject *lhs, PyObject *rhs)
24632463
static int
24642464
compactlong_compactnonnegativelong_guard(PyObject *lhs, PyObject *rhs)
24652465
{
2466-
return (is_compactlong(lhs) && is_compactnonnegativelong(rhs);
2466+
return (is_compactlong(lhs) && is_compactnonnegativelong(rhs));
24672467
}
24682468

24692469
#define BITWISE_LONGS_ACTION(NAME, OP) \

0 commit comments

Comments
 (0)