[3.13] gh-141579: Fix perf_jit backend in sys.activate_stack_trampoline() (GH-141580) (#141582)

This commit is contained in:
Pablo Galindo Salgado 2025-11-15 03:17:49 +00:00 committed by GitHub
parent fb7ae3fe83
commit 7e1a0dbc07
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 28 additions and 8 deletions

View file

@ -2381,14 +2381,14 @@ sys_activate_stack_trampoline_impl(PyObject *module, const char *backend)
return NULL;
}
}
else if (strcmp(backend, "perf_jit") == 0) {
_PyPerf_Callbacks cur_cb;
_PyPerfTrampoline_GetCallbacks(&cur_cb);
if (cur_cb.write_state != _Py_perfmap_jit_callbacks.write_state) {
if (_PyPerfTrampoline_SetCallbacks(&_Py_perfmap_jit_callbacks) < 0 ) {
PyErr_SetString(PyExc_ValueError, "can't activate perf jit trampoline");
return NULL;
}
}
else if (strcmp(backend, "perf_jit") == 0) {
_PyPerf_Callbacks cur_cb;
_PyPerfTrampoline_GetCallbacks(&cur_cb);
if (cur_cb.write_state != _Py_perfmap_jit_callbacks.write_state) {
if (_PyPerfTrampoline_SetCallbacks(&_Py_perfmap_jit_callbacks) < 0 ) {
PyErr_SetString(PyExc_ValueError, "can't activate perf jit trampoline");
return NULL;
}
}
}