Skip to content

Commit

Permalink
Fix up after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
markshannon committed Dec 12, 2024
1 parent 2e752fc commit d23ae47
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 33 deletions.
4 changes: 2 additions & 2 deletions Include/internal/pycore_opcode_metadata.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Include/internal/pycore_stackref.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,11 @@ static const _PyStackRef PyStackRef_NULL = { .bits = PyStackRef_NULL_BITS };
#ifdef Py_DEBUG

static inline void PyStackRef_CheckValid(_PyStackRef ref) {
assert(ref.bits != 0);
int tag = ref.bits & Py_TAG_BITS;
PyObject *obj = BITS_TO_PTR_MASKED(ref);
switch (tag) {
case 0:
break;
case Py_TAG_REFCNT:
/* Can be immortal if object was made immortal after reference came into existence */
assert(obj != NULL && obj != Py_True && obj != Py_False && obj != Py_None);
Expand Down Expand Up @@ -346,7 +346,7 @@ PyStackRef_DUP(_PyStackRef ref)
{
assert(!PyStackRef_IsNull(ref));
if (!PyStackRef_HasCount(ref)) {
Py_INCREF(BITS_TO_PTR(ref));
Py_INCREF_MORTAL(BITS_TO_PTR(ref));
}
return ref;
}
Expand Down
2 changes: 1 addition & 1 deletion Include/internal/pycore_uop_metadata.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Include/refcount.h
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ PyAPI_FUNC(void) _Py_DecRef(PyObject *);
#ifndef Py_GIL_DISABLED
static inline Py_ALWAYS_INLINE void Py_INCREF_MORTAL(PyObject *op)
{
assert(!_Py_IsImmortal(op));
assert(!_Py_IsStaticImmortal(op));
op->ob_refcnt++;
_Py_INCREF_STAT_INC();
#if defined(Py_REF_DEBUG) && !defined(Py_LIMITED_API)
Expand Down
7 changes: 3 additions & 4 deletions Python/bytecodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -4312,17 +4312,16 @@ dummy_func(
assert(Py_TYPE(callable_o) == &PyFunction_Type);
int code_flags = ((PyCodeObject*)PyFunction_GET_CODE(callable_o))->co_flags;
PyObject *locals = code_flags & CO_OPTIMIZED ? NULL : Py_NewRef(PyFunction_GET_GLOBALS(callable_o));
new_frame = _PyEvalFramePushAndInit(
_PyInterpreterFrame *temp = _PyEvalFramePushAndInit(
tstate, callable[0], locals,
args, positional_args, kwnames_o, frame
);
PyStackRef_CLOSE(kwnames);
// The frame has stolen all the arguments from the stack,
// so there is no need to clean them up.
SYNC_SP();
if (new_frame == NULL) {
ERROR_NO_POP();
}
ERROR_IF(temp == NULL, error);
new_frame = temp;
}

op(_CHECK_FUNCTION_VERSION_KW, (func_version/2, callable[1], self_or_null[1], unused[oparg], kwnames -- callable[1], self_or_null[1], unused[oparg], kwnames)) {
Expand Down
4 changes: 3 additions & 1 deletion Python/ceval.c
Original file line number Diff line number Diff line change
Expand Up @@ -1500,7 +1500,9 @@ initialize_locals(PyThreadState *tstate, PyFunctionObject *func,
{
PyCodeObject *co = (PyCodeObject*)func->func_code;
const Py_ssize_t total_args = co->co_argcount + co->co_kwonlyargcount;

for (Py_ssize_t i = 0; i < argcount; i++) {
PyStackRef_CheckValid(args[i]);
}
/* Create a dictionary for keyword parameters (**kwags) */
PyObject *kwdict;
Py_ssize_t i;
Expand Down
13 changes: 7 additions & 6 deletions Python/executor_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 8 additions & 16 deletions Python/generated_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d23ae47

Please sign in to comment.