We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 21b391c commit bdc4b02Copy full SHA for bdc4b02
2 files changed
Include/objimpl.h
@@ -265,7 +265,7 @@ extern PyGC_Head *_PyGC_generation0;
265
#define _PyGCHead_REFS(g) ((g)->gc.gc_refs >> _PyGC_REFS_SHIFT)
266
#define _PyGCHead_SET_REFS(g, v) do { \
267
(g)->gc.gc_refs = ((g)->gc.gc_refs & ~_PyGC_REFS_MASK) \
268
- | (v << _PyGC_REFS_SHIFT); \
+ | (((size_t)(v)) << _PyGC_REFS_SHIFT); \
269
} while (0)
270
#define _PyGCHead_DECREF(g) ((g)->gc.gc_refs -= 1 << _PyGC_REFS_SHIFT)
271
Misc/NEWS
@@ -8,6 +8,8 @@ What's New in Python 3.4.1?
8
Core and Builtins
9
-----------------
10
11
+- Issue #20929: Add a type cast to avoid shifting a negative number.
12
+
13
- Issue #20731: Properly position in source code files even if they
14
are opened in text mode. Patch by Serhiy Storchaka.
15
0 commit comments