Skip to content

Commit 237b8b9

Browse files
Update Objects/longobject.c
Co-authored-by: Yan Yanchii <[email protected]>
1 parent 955bb37 commit 237b8b9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Objects/longobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,14 @@ maybe_small_long(PyLongObject *v)
117117

118118
#define PYLONG_FROM_SIGNED(INT_TYPE, ival) \
119119
do { \
120-
unsigned INT_TYPE abs_ival, t; \
121120
if (IS_SMALL_INT(ival)) { \
122121
return get_small_int((sdigit)(ival)); \
123122
} \
124123
if (-(INT_TYPE)PyLong_MASK <= (ival) && (ival) <= (INT_TYPE)PyLong_MASK) { \
125124
return _PyLong_FromMedium((sdigit)(ival)); \
126125
} \
127126
/* Count digits (at least two - smaller cases were handled above). */ \
127+
unsigned INT_TYPE abs_ival, t; \
128128
abs_ival = (ival) < 0 ? 0U-(unsigned INT_TYPE)(ival) : (unsigned INT_TYPE)(ival); \
129129
/* Do shift in two steps to avoid possible undefined behavior. */ \
130130
t = abs_ival >> PyLong_SHIFT >> PyLong_SHIFT; \

0 commit comments

Comments
 (0)