File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -276,8 +276,9 @@ PyAPI_FUNC(int) _PyLineTable_NextAddressRange(PyCodeAddressRange *range);
276276extern int _PyLineTable_PreviousAddressRange (PyCodeAddressRange * range );
277277
278278// Similar to PyCode_Addr2Line(), but return -1 if the code object is invalid
279- // and can be called without an attached tstate.
280- // Used by dump_frame() in Python/traceback.c.
279+ // and can be called without an attached tstate. Used by dump_frame() in
280+ // Python/traceback.c. The function uses heuristics to detect freed memory,
281+ // it's not 100% reliable.
281282extern int _PyCode_SafeAddr2Line (PyCodeObject * co , int addr );
282283
283284
Original file line number Diff line number Diff line change @@ -25,7 +25,8 @@ static inline PyCodeObject *_PyFrame_GetCode(_PyInterpreterFrame *f) {
2525}
2626
2727// Similar to _PyFrame_GetCode(), but return NULL if the frame is invalid or
28- // freed. Used by dump_frame() in Python/traceback.c.
28+ // freed. Used by dump_frame() in Python/traceback.c. The function uses
29+ // heuristics to detect freed memory, it's not 100% reliable.
2930static inline PyCodeObject *
3031_PyFrame_SafeGetCode (_PyInterpreterFrame * f )
3132{
@@ -66,9 +67,9 @@ _PyFrame_GetBytecode(_PyInterpreterFrame *f)
6667#endif
6768}
6869
69- // Similar to PyUnstable_InterpreterFrame_GetLasti(), but return NULL
70- // if the frame is invalid or freed.
71- // Used by dump_frame() in Python/traceback.c .
70+ // Similar to PyUnstable_InterpreterFrame_GetLasti(), but return NULL if the
71+ // frame is invalid or freed. Used by dump_frame() in Python/traceback.c. The
72+ // function uses heuristics to detect freed memory, it's not 100% reliable .
7273static inline int
7374_PyFrame_SafeGetLasti (struct _PyInterpreterFrame * f )
7475{
You can’t perform that action at this time.
0 commit comments