gh-145064: Fix JIT assertion failure during CALL_ALLOC_AND_ENTER_INIT side exit (GH-145100)

This commit is contained in:
Hai Zhu 2026-02-23 02:46:03 +08:00 committed by GitHub
parent 819ea3ca68
commit fd01372d4e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 51 additions and 1 deletions

View file

@ -995,7 +995,7 @@ _PyJit_TryInitializeTracing(
return 0;
}
PyObject *func = PyStackRef_AsPyObjectBorrow(frame->f_funcobj);
if (func == NULL) {
if (func == NULL || !PyFunction_Check(func)) {
return 0;
}
PyCodeObject *code = _PyFrame_GetCode(frame);