https://github.com/python/cpython/commit/11bb08e4ec7b546d57b0ab7a8f199747bef6e422
commit: 11bb08e4ec7b546d57b0ab7a8f199747bef6e422
branch: main
author: Brandt Bucher <[email protected]>
committer: brandtbucher <[email protected]>
date: 2025-02-12T10:16:43-08:00
summary:
GH-129715: Don't project traces that return to an unknown caller (GH-130024)
files:
A
Misc/NEWS.d/next/Core_and_Builtins/2025-02-11-22-20-21.gh-issue-129715.mopO8n.rst
M Python/instrumentation.c
M Python/optimizer.c
diff --git
a/Misc/NEWS.d/next/Core_and_Builtins/2025-02-11-22-20-21.gh-issue-129715.mopO8n.rst
b/Misc/NEWS.d/next/Core_and_Builtins/2025-02-11-22-20-21.gh-issue-129715.mopO8n.rst
new file mode 100644
index 00000000000000..e71602b06a33ce
--- /dev/null
+++
b/Misc/NEWS.d/next/Core_and_Builtins/2025-02-11-22-20-21.gh-issue-129715.mopO8n.rst
@@ -0,0 +1 @@
+Improve the experimental JIT's handling of returns to unknown callers.
diff --git a/Python/instrumentation.c b/Python/instrumentation.c
index 0e7b4810726434..12fd35f43562ae 100644
--- a/Python/instrumentation.c
+++ b/Python/instrumentation.c
@@ -185,8 +185,7 @@ is_instrumented(int opcode)
{
assert(opcode != 0);
assert(opcode != RESERVED);
- assert(opcode != ENTER_EXECUTOR);
- return opcode >= MIN_INSTRUMENTED_OPCODE;
+ return opcode != ENTER_EXECUTOR && opcode >= MIN_INSTRUMENTED_OPCODE;
}
#ifndef NDEBUG
diff --git a/Python/optimizer.c b/Python/optimizer.c
index bef5728349a612..d86d58d82e391b 100644
--- a/Python/optimizer.c
+++ b/Python/optimizer.c
@@ -671,7 +671,7 @@ translate_bytecode_to_trace(
if (trace_stack_depth == 0) {
DPRINTF(2, "Trace stack underflow\n");
OPT_STAT_INC(trace_stack_underflow);
- goto done;
+ return 0;
}
}
uint32_t orig_oparg = oparg; // For OPARG_TOP/BOTTOM
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]