Skip to content

Commit d23ae47

Browse files
committed
Fix up after merge
1 parent 2e752fc commit d23ae47

File tree

8 files changed

+27
-33
lines changed

8 files changed

+27
-33
lines changed

Include/internal/pycore_opcode_metadata.h

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

Include/internal/pycore_stackref.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,11 +226,11 @@ static const _PyStackRef PyStackRef_NULL = { .bits = PyStackRef_NULL_BITS };
226226
#ifdef Py_DEBUG
227227

228228
static inline void PyStackRef_CheckValid(_PyStackRef ref) {
229+
assert(ref.bits != 0);
229230
int tag = ref.bits & Py_TAG_BITS;
230231
PyObject *obj = BITS_TO_PTR_MASKED(ref);
231232
switch (tag) {
232233
case 0:
233-
break;
234234
case Py_TAG_REFCNT:
235235
/* Can be immortal if object was made immortal after reference came into existence */
236236
assert(obj != NULL && obj != Py_True && obj != Py_False && obj != Py_None);
@@ -346,7 +346,7 @@ PyStackRef_DUP(_PyStackRef ref)
346346
{
347347
assert(!PyStackRef_IsNull(ref));
348348
if (!PyStackRef_HasCount(ref)) {
349-
Py_INCREF(BITS_TO_PTR(ref));
349+
Py_INCREF_MORTAL(BITS_TO_PTR(ref));
350350
}
351351
return ref;
352352
}

Include/internal/pycore_uop_metadata.h

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/refcount.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ PyAPI_FUNC(void) _Py_DecRef(PyObject *);
245245
#ifndef Py_GIL_DISABLED
246246
static inline Py_ALWAYS_INLINE void Py_INCREF_MORTAL(PyObject *op)
247247
{
248-
assert(!_Py_IsImmortal(op));
248+
assert(!_Py_IsStaticImmortal(op));
249249
op->ob_refcnt++;
250250
_Py_INCREF_STAT_INC();
251251
#if defined(Py_REF_DEBUG) && !defined(Py_LIMITED_API)

Python/bytecodes.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4312,17 +4312,16 @@ dummy_func(
43124312
assert(Py_TYPE(callable_o) == &PyFunction_Type);
43134313
int code_flags = ((PyCodeObject*)PyFunction_GET_CODE(callable_o))->co_flags;
43144314
PyObject *locals = code_flags & CO_OPTIMIZED ? NULL : Py_NewRef(PyFunction_GET_GLOBALS(callable_o));
4315-
new_frame = _PyEvalFramePushAndInit(
4315+
_PyInterpreterFrame *temp = _PyEvalFramePushAndInit(
43164316
tstate, callable[0], locals,
43174317
args, positional_args, kwnames_o, frame
43184318
);
43194319
PyStackRef_CLOSE(kwnames);
43204320
// The frame has stolen all the arguments from the stack,
43214321
// so there is no need to clean them up.
43224322
SYNC_SP();
4323-
if (new_frame == NULL) {
4324-
ERROR_NO_POP();
4325-
}
4323+
ERROR_IF(temp == NULL, error);
4324+
new_frame = temp;
43264325
}
43274326

43284327
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)) {

Python/ceval.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1500,7 +1500,9 @@ initialize_locals(PyThreadState *tstate, PyFunctionObject *func,
15001500
{
15011501
PyCodeObject *co = (PyCodeObject*)func->func_code;
15021502
const Py_ssize_t total_args = co->co_argcount + co->co_kwonlyargcount;
1503-
1503+
for (Py_ssize_t i = 0; i < argcount; i++) {
1504+
PyStackRef_CheckValid(args[i]);
1505+
}
15041506
/* Create a dictionary for keyword parameters (**kwags) */
15051507
PyObject *kwdict;
15061508
Py_ssize_t i;

Python/executor_cases.c.h

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

Python/generated_cases.c.h

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

0 commit comments

Comments
 (0)