From fcb55c0037baab6f98f91ee38ce84b6f874f034a Mon Sep 17 00:00:00 2001 From: Mark Shannon Date: Thu, 1 Apr 2021 16:00:31 +0100 Subject: bpo-27129: Use instruction offsets, not byte offsets, in bytecode and internally. (GH-25069) * Use instruction offset, rather than bytecode offset. Streamlines interpreter dispatch a bit, and removes most EXTENDED_ARGs for jumps. * Change some uses of PyCode_Addr2Line to PyFrame_GetLineNumber --- Objects/codeobject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Objects/codeobject.c') diff --git a/Objects/codeobject.c b/Objects/codeobject.c index 69cb31c1ab..9bb49f108b 100644 --- a/Objects/codeobject.c +++ b/Objects/codeobject.c @@ -1246,7 +1246,7 @@ PyTypeObject PyCode_Type = { int PyCode_Addr2Line(PyCodeObject *co, int addrq) { - if (addrq == -1) { + if (addrq < 0) { return co->co_firstlineno; } assert(addrq >= 0 && addrq < PyBytes_GET_SIZE(co->co_code)); -- cgit v1.2.1