Skip to content

Commit

Permalink
Use the Python frame safely in _pythonCallstack (#89997)
Browse files Browse the repository at this point in the history
  • Loading branch information
charlie-wt committed Dec 6, 2022
1 parent be6ac74 commit 59b4f3b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion torch/csrc/jit/python/python_tracer.cpp
Expand Up @@ -27,7 +27,7 @@ namespace tracer {
std::vector<StackEntry> _pythonCallstack() {
pybind11::gil_scoped_acquire gil;
PyFrameObject* frame = PyEval_GetFrame();
Py_INCREF(frame);
Py_XINCREF(frame);
std::vector<StackEntry> entries;

while (nullptr != frame) {
Expand Down

0 comments on commit 59b4f3b

Please sign in to comment.