Skip to content

Commit 32ead17

Browse files
committed
Tagged ints
1 parent 40988a0 commit 32ead17

32 files changed

Lines changed: 3152 additions & 3175 deletions

Include/internal/pycore_cell.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ extern "C" {
1818
static inline PyObject *
1919
PyCell_SwapTakeRef(PyCellObject *cell, PyObject *value)
2020
{
21+
assert(((uintptr_t)value) > 1000000 || ((uintptr_t)value) < -10000000);
2122
PyObject *old_value;
2223
Py_BEGIN_CRITICAL_SECTION(cell);
2324
old_value = cell->ob_ref;

Include/internal/pycore_ceval.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ PyAPI_FUNC(void) _PyEval_LoadGlobalStackRef(PyObject *globals, PyObject *builtin
294294
PyAPI_FUNC(PyObject *) _PyEval_GetAwaitable(PyObject *iterable, int oparg);
295295
PyAPI_FUNC(PyObject *) _PyEval_LoadName(PyThreadState *tstate, _PyInterpreterFrame *frame, PyObject *name);
296296
PyAPI_FUNC(int)
297-
_Py_Check_ArgsIterable(PyThreadState *tstate, PyObject *func, PyObject *args);
297+
_Py_Check_ArgsIterable(PyThreadState *tstate, _PyStackRef func, _PyStackRef args);
298298

299299
/*
300300
* Indicate whether a special method of given 'oparg' can use the (improved)

Include/internal/pycore_interpframe.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ extern "C" {
1919

2020
static inline PyCodeObject *_PyFrame_GetCode(_PyInterpreterFrame *f) {
2121
assert(!PyStackRef_IsNull(f->f_executable));
22-
PyObject *executable = PyStackRef_AsPyObjectBorrow(f->f_executable);
22+
PyObject *executable = PyStackRef_AsPyObjectBorrowNonInt(f->f_executable);
2323
assert(PyCode_Check(executable));
2424
return (PyCodeObject *)executable;
2525
}
@@ -38,7 +38,7 @@ _PyFrame_GetBytecode(_PyInterpreterFrame *f)
3838
}
3939

4040
static inline PyFunctionObject *_PyFrame_GetFunction(_PyInterpreterFrame *f) {
41-
PyObject *func = PyStackRef_AsPyObjectBorrow(f->f_funcobj);
41+
PyObject *func = PyStackRef_AsPyObjectBorrowNonInt(f->f_funcobj);
4242
assert(PyFunction_Check(func));
4343
return (PyFunctionObject *)func;
4444
}
@@ -131,7 +131,7 @@ _PyFrame_Initialize(
131131
frame->previous = previous;
132132
frame->f_funcobj = func;
133133
frame->f_executable = PyStackRef_FromPyObjectNew(code);
134-
PyFunctionObject *func_obj = (PyFunctionObject *)PyStackRef_AsPyObjectBorrow(func);
134+
PyFunctionObject *func_obj = (PyFunctionObject *)PyStackRef_AsPyObjectBorrowNonInt(func);
135135
frame->f_builtins = func_obj->func_builtins;
136136
frame->f_globals = func_obj->func_globals;
137137
frame->f_locals = locals;
@@ -290,7 +290,7 @@ static inline _PyInterpreterFrame *
290290
_PyFrame_PushUnchecked(PyThreadState *tstate, _PyStackRef func, int null_locals_from, _PyInterpreterFrame * previous)
291291
{
292292
CALL_STAT_INC(frames_pushed);
293-
PyFunctionObject *func_obj = (PyFunctionObject *)PyStackRef_AsPyObjectBorrow(func);
293+
PyFunctionObject *func_obj = (PyFunctionObject *)PyStackRef_AsPyObjectBorrowNonInt(func);
294294
PyCodeObject *code = (PyCodeObject *)func_obj->func_code;
295295
_PyInterpreterFrame *new_frame = (_PyInterpreterFrame *)tstate->datastack_top;
296296
tstate->datastack_top += code->co_framesize;

Include/internal/pycore_long.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ _PyLong_CheckExactAndCompact(PyObject *op)
318318
return PyLong_CheckExact(op) && _PyLong_IsCompact((const PyLongObject *)op);
319319
}
320320

321+
321322
#ifdef __cplusplus
322323
}
323324
#endif

Include/internal/pycore_opcode_metadata.h

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)