| 222 | // bpo-40421 added PyFrame_GetLasti() to Python 3.11.0b1 |
| 223 | #if PY_VERSION_HEX < 0x030B00B1 && !defined(PYPY_VERSION) |
| 224 | static inline int PyFrame_GetLasti(PyFrameObject *frame) |
| 225 | { |
| 226 | #if PY_VERSION_HEX >= 0x030A00A7 |
| 227 | // bpo-27129: Since Python 3.10.0a7, f_lasti is an instruction offset, |
| 228 | // not a bytes offset anymore. Python uses 16-bit "wordcode" (2 bytes) |
| 229 | // instructions. |
| 230 | if (frame->f_lasti < 0) { |
| 231 | return -1; |
| 232 | } |
| 233 | return frame->f_lasti * 2; |
| 234 | #else |
| 235 | return frame->f_lasti; |
| 236 | #endif |
| 237 | } |
| 238 | #endif |
| 239 | |
| 240 |
nothing calls this directly
no outgoing calls
no test coverage detected