mirror of
https://github.com/python/cpython.git
synced 2025-10-15 03:10:29 +00:00
gh-124855: Don't allow the JIT and perf support to be active at the same time (#124856)
This commit is contained in:
parent
2d9d10179f
commit
2d37c719ed
4 changed files with 26 additions and 7 deletions
|
@ -2287,6 +2287,14 @@ sys_activate_stack_trampoline_impl(PyObject *module, const char *backend)
|
|||
/*[clinic end generated code: output=5783cdeb51874b43 input=a12df928758a82b4]*/
|
||||
{
|
||||
#ifdef PY_HAVE_PERF_TRAMPOLINE
|
||||
#ifdef _Py_JIT
|
||||
_PyOptimizerObject* optimizer = _Py_GetOptimizer();
|
||||
if (optimizer != NULL) {
|
||||
PyErr_SetString(PyExc_ValueError, "Cannot activate the perf trampoline if the JIT is active");
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (strcmp(backend, "perf") == 0) {
|
||||
_PyPerf_Callbacks cur_cb;
|
||||
_PyPerfTrampoline_GetCallbacks(&cur_cb);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue