mirror of
https://github.com/python/cpython.git
synced 2025-11-25 21:11:09 +00:00
cast negative numbers to size_t before shifting them (#20929)
This commit is contained in:
parent
21b391c956
commit
bdc4b02985
2 changed files with 3 additions and 1 deletions
|
|
@ -265,7 +265,7 @@ extern PyGC_Head *_PyGC_generation0;
|
|||
#define _PyGCHead_REFS(g) ((g)->gc.gc_refs >> _PyGC_REFS_SHIFT)
|
||||
#define _PyGCHead_SET_REFS(g, v) do { \
|
||||
(g)->gc.gc_refs = ((g)->gc.gc_refs & ~_PyGC_REFS_MASK) \
|
||||
| (v << _PyGC_REFS_SHIFT); \
|
||||
| (((size_t)(v)) << _PyGC_REFS_SHIFT); \
|
||||
} while (0)
|
||||
#define _PyGCHead_DECREF(g) ((g)->gc.gc_refs -= 1 << _PyGC_REFS_SHIFT)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue