diff options
author | Benjamin Peterson <benjamin@python.org> | 2014-03-15 01:15:29 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2014-03-15 01:15:29 (GMT) |
commit | bdc4b02985e5d50301c554cb58b7f0ad24b1f68b (patch) | |
tree | d520a00812426dd1d9868649bec7976e43a75df1 /Include | |
parent | 21b391c956c22246b137248e9cadf4cd436f1ac5 (diff) | |
download | cpython-bdc4b02985e5d50301c554cb58b7f0ad24b1f68b.zip cpython-bdc4b02985e5d50301c554cb58b7f0ad24b1f68b.tar.gz cpython-bdc4b02985e5d50301c554cb58b7f0ad24b1f68b.tar.bz2 |
cast negative numbers to size_t before shifting them (#20929)
Diffstat (limited to 'Include')
-rw-r--r-- | Include/objimpl.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Include/objimpl.h b/Include/objimpl.h index 9a27ec3..3f21b70 100644 --- a/Include/objimpl.h +++ b/Include/objimpl.h @@ -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) |