Skip to content

Commit aa4ddf0

Browse files
committed
Cast before shifting
1 parent 8d3c3ea commit aa4ddf0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Include/internal/pycore_stackref.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,8 @@ static inline intptr_t
257257
PyStackRef_UntagInt(_PyStackRef i)
258258
{
259259
assert((i.bits & Py_INT_TAG) == Py_INT_TAG);
260-
return Py_ARITHMETIC_RIGHT_SHIFT(intptr_t, i.bits, 2);
260+
intptr_t val = (intptr_t)i.bits;
261+
return Py_ARITHMETIC_RIGHT_SHIFT(intptr_t, val, 2);
261262
}
262263

263264

0 commit comments

Comments
 (0)