GH-106008: Make implicit boolean conversions explicit (GH-106003)

This commit is contained in:
Brandt Bucher 2023-06-29 13:49:54 -07:00 committed by GitHub
parent 6e9f83d9ae
commit 7b2d94d875
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 1728 additions and 1152 deletions

View file

@ -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);