diff options
author | Brandt Bucher <brandtbucher@microsoft.com> | 2023-06-29 20:49:54 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-29 20:49:54 (GMT) |
commit | 7b2d94d87513967b357c658c6e7e1b8c8d02487d (patch) | |
tree | bdd79e2c20b235f3d4c1272c8c8e2f1880bfb129 /Include/internal/pycore_code.h | |
parent | 6e9f83d9aee34192de5d0ef7285be23514911ccd (diff) | |
download | cpython-7b2d94d87513967b357c658c6e7e1b8c8d02487d.zip cpython-7b2d94d87513967b357c658c6e7e1b8c8d02487d.tar.gz cpython-7b2d94d87513967b357c658c6e7e1b8c8d02487d.tar.bz2 |
GH-106008: Make implicit boolean conversions explicit (GH-106003)
Diffstat (limited to 'Include/internal/pycore_code.h')
-rw-r--r-- | Include/internal/pycore_code.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Include/internal/pycore_code.h b/Include/internal/pycore_code.h index 8755cb3..d1829eb 100644 --- a/Include/internal/pycore_code.h +++ b/Include/internal/pycore_code.h @@ -101,6 +101,13 @@ typedef struct { #define INLINE_CACHE_ENTRIES_SEND CACHE_ENTRIES(_PySendCache) +typedef struct { + uint16_t counter; + uint16_t version[2]; +} _PyToBoolCache; + +#define INLINE_CACHE_ENTRIES_TO_BOOL CACHE_ENTRIES(_PyToBoolCache) + // Borrowed references to common callables: struct callable_cache { PyObject *isinstance; @@ -246,6 +253,7 @@ extern void _Py_Specialize_UnpackSequence(PyObject *seq, _Py_CODEUNIT *instr, int oparg); extern void _Py_Specialize_ForIter(PyObject *iter, _Py_CODEUNIT *instr, int oparg); extern void _Py_Specialize_Send(PyObject *receiver, _Py_CODEUNIT *instr); +extern void _Py_Specialize_ToBool(PyObject *value, _Py_CODEUNIT *instr); /* Finalizer function for static codeobjects used in deepfreeze.py */ extern void _PyStaticCode_Fini(PyCodeObject *co); |