Skip to content

Commit 9126c95

Browse files
K0u1egodlygeek
authored andcommitted
Fix tail-call frame matching for Python 3.14
Signed-Off-By: Chunyang Wang <wangchunyang.26@bytedance.com>
1 parent 5c594dc commit 9126c95

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

‎news/372.bugfix.rst‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix native stack merging for Python 3.14 tail-call interpreter builds whose
2+
``_TAIL_CALL_`` symbols do not have a ``.llvm.`` suffix.

‎src/pystack/_pystack/native_frame.cpp‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,8 @@ is_eval_frame(const std::string& symbol, std::pair<int, int> python_version)
1919
if (symbol.find("_PyEval_EvalFrameDefault") != std::string::npos) {
2020
return true;
2121
}
22-
// Python 3.14 tail call interpreter uses LLVM-generated functions
23-
if (starts_with(symbol, "_TAIL_CALL_") && symbol.find(".llvm.") != std::string::npos) {
24-
return true;
25-
}
26-
// Python 3.15+ tail call interpreter drops the .llvm. suffix
27-
if (python_version >= std::make_pair(3, 15) and starts_with(symbol, "_TAIL_CALL_")) {
22+
// Match the _TAIL_CALL_ prefix for Python 3.14+.
23+
if (python_version >= std::make_pair(3, 14) and starts_with(symbol, "_TAIL_CALL_")) {
2824
return true;
2925
}
3026
return false;

0 commit comments

Comments
 (0)