mirror of
https://github.com/python/cpython.git
synced 2025-10-10 00:43:41 +00:00
gh-108487: Move assert(self != NULL) down beyond DEOPT_IF() (#108510)
This commit is contained in:
parent
4116592b6f
commit
47d7eba889
3 changed files with 3 additions and 2 deletions
|
@ -0,0 +1 @@
|
||||||
|
Move an assert that would cause a spurious crash in a devious case that should only trigger deoptimization.
|
|
@ -3346,9 +3346,9 @@ dummy_func(
|
||||||
inst(CALL_NO_KW_LIST_APPEND, (unused/1, unused/2, callable, self, args[oparg] -- unused)) {
|
inst(CALL_NO_KW_LIST_APPEND, (unused/1, unused/2, callable, self, args[oparg] -- unused)) {
|
||||||
ASSERT_KWNAMES_IS_NULL();
|
ASSERT_KWNAMES_IS_NULL();
|
||||||
assert(oparg == 1);
|
assert(oparg == 1);
|
||||||
assert(self != NULL);
|
|
||||||
PyInterpreterState *interp = tstate->interp;
|
PyInterpreterState *interp = tstate->interp;
|
||||||
DEOPT_IF(callable != interp->callable_cache.list_append, CALL);
|
DEOPT_IF(callable != interp->callable_cache.list_append, CALL);
|
||||||
|
assert(self != NULL);
|
||||||
DEOPT_IF(!PyList_Check(self), CALL);
|
DEOPT_IF(!PyList_Check(self), CALL);
|
||||||
STAT_INC(CALL, hit);
|
STAT_INC(CALL, hit);
|
||||||
if (_PyList_AppendTakeRef((PyListObject *)self, args[0]) < 0) {
|
if (_PyList_AppendTakeRef((PyListObject *)self, args[0]) < 0) {
|
||||||
|
|
2
Python/generated_cases.c.h
generated
2
Python/generated_cases.c.h
generated
|
@ -4412,9 +4412,9 @@
|
||||||
callable = stack_pointer[-2 - oparg];
|
callable = stack_pointer[-2 - oparg];
|
||||||
ASSERT_KWNAMES_IS_NULL();
|
ASSERT_KWNAMES_IS_NULL();
|
||||||
assert(oparg == 1);
|
assert(oparg == 1);
|
||||||
assert(self != NULL);
|
|
||||||
PyInterpreterState *interp = tstate->interp;
|
PyInterpreterState *interp = tstate->interp;
|
||||||
DEOPT_IF(callable != interp->callable_cache.list_append, CALL);
|
DEOPT_IF(callable != interp->callable_cache.list_append, CALL);
|
||||||
|
assert(self != NULL);
|
||||||
DEOPT_IF(!PyList_Check(self), CALL);
|
DEOPT_IF(!PyList_Check(self), CALL);
|
||||||
STAT_INC(CALL, hit);
|
STAT_INC(CALL, hit);
|
||||||
if (_PyList_AppendTakeRef((PyListObject *)self, args[0]) < 0) {
|
if (_PyList_AppendTakeRef((PyListObject *)self, args[0]) < 0) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue