diff options
Diffstat (limited to 'coverage/ctracer/util.h')
-rw-r--r-- | coverage/ctracer/util.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/coverage/ctracer/util.h b/coverage/ctracer/util.h index ff139329..58fa1d49 100644 --- a/coverage/ctracer/util.h +++ b/coverage/ctracer/util.h @@ -12,9 +12,15 @@ #undef COLLECT_STATS /* Collect counters: stats are printed when tracer is stopped. */ #undef DO_NOTHING /* Define this to make the tracer do nothing. */ +#if PY_VERSION_HEX >= 0x030B00A0 +// 3.11 moved f_lasti into an internal structure. This is totally the wrong way +// to make this work, but it's all I've got until https://bugs.python.org/issue40421 +// is resolved. +#include <internal/pycore_frame.h> +#define MyFrame_lasti(f) ((f)->f_frame->f_lasti * 2) +#elif PY_VERSION_HEX >= 0x030A00A7 // The f_lasti field changed meaning in 3.10.0a7. It had been bytes, but // now is instructions, so we need to adjust it to use it as a byte index. -#if PY_VERSION_HEX >= 0x030A00A7 #define MyFrame_lasti(f) ((f)->f_lasti * 2) #else #define MyFrame_lasti(f) ((f)->f_lasti) |