mirror of
https://github.com/python/cpython.git
synced 2025-07-12 13:55:34 +00:00
[3.12] gh-108487: Change assert that should've been DEOPT_IF (#108509)
* Remove assert that should've been DEOPT_IF The assert(method != NULL) in CALL_NO_KW_LIST_APPEND is wrong -- this condition should lead to a deoptimization, and indeed there is a DEOPT_IF two lines later that will trigger if method == NULL. This would crash in a devious repro scenario (first seen live in boto3 tests) when compiled with assertions enabled. In a production version there is no crash, so impact is limited. (The crash also appears in main; I will prepare a separate PR.) * Add back a different assert(self != NULL) * 📜🤖 Added by blurb_it. --------- Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
This commit is contained in:
parent
208741cc30
commit
bbdd8895a5
3 changed files with 3 additions and 2 deletions
2
Python/generated_cases.c.h
generated
2
Python/generated_cases.c.h
generated
|
@ -4248,9 +4248,9 @@
|
|||
#line 2993 "Python/bytecodes.c"
|
||||
assert(kwnames == NULL);
|
||||
assert(oparg == 1);
|
||||
assert(method != NULL);
|
||||
PyInterpreterState *interp = _PyInterpreterState_GET();
|
||||
DEOPT_IF(method != interp->callable_cache.list_append, CALL);
|
||||
assert(self != NULL);
|
||||
DEOPT_IF(!PyList_Check(self), CALL);
|
||||
STAT_INC(CALL, hit);
|
||||
if (_PyList_AppendTakeRef((PyListObject *)self, args[0]) < 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue