aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2021-04-01 16:00:31 +0100
committerGitHub <noreply@github.com>2021-04-01 16:00:31 +0100
commitfcb55c0037baab6f98f91ee38ce84b6f874f034a (patch)
tree29e1499f2f77ad8a4c76d5484517f46ac4fe8313 /Objects/codeobject.c
parentbpo-43688: Fix Py_LIMITED_API version of xxlimited (GH-25135) (diff)
downloadcpython-fcb55c0037baab6f98f91ee38ce84b6f874f034a.tar.gz
cpython-fcb55c0037baab6f98f91ee38ce84b6f874f034a.tar.bz2
cpython-fcb55c0037baab6f98f91ee38ce84b6f874f034a.zip
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
Diffstat (limited to 'Objects/codeobject.c')
-rw-r--r--Objects/codeobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/codeobject.c b/Objects/codeobject.c
index 69cb31c1aba..9bb49f108be 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));