From a6daaf2a132efbb1965b4502ff8a8cf3b5afed0e Mon Sep 17 00:00:00 2001 From: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> Date: Thu, 21 Jul 2022 21:49:49 +0800 Subject: Fix PyCode_Addr2Location when addrq < 0 (GH-95091) --- Objects/codeobject.c | 1 + 1 file changed, 1 insertion(+) (limited to 'Objects/codeobject.c') diff --git a/Objects/codeobject.c b/Objects/codeobject.c index d4fa0e38ae..76e430ae1c 100644 --- a/Objects/codeobject.c +++ b/Objects/codeobject.c @@ -971,6 +971,7 @@ PyCode_Addr2Location(PyCodeObject *co, int addrq, if (addrq < 0) { *start_line = *end_line = co->co_firstlineno; *start_column = *end_column = 0; + return 1; } assert(addrq >= 0 && addrq < _PyCode_NBYTES(co)); PyCodeAddressRange bounds; -- cgit v1.2.1