diff options
author | shadchin <shadchin@yandex-team.com> | 2025-06-13 00:05:26 +0300 |
---|---|---|
committer | shadchin <shadchin@yandex-team.com> | 2025-06-13 00:35:30 +0300 |
commit | 796b9088366b10b4cd42885101fc20c0b5709b07 (patch) | |
tree | f287eacb0b95ffd7cabf95b16cafb4788645dc38 /contrib/tools/python3/Python/assemble.c | |
parent | c72bca862651e507d2ff4980ef7f4ff7267a7227 (diff) | |
download | ydb-796b9088366b10b4cd42885101fc20c0b5709b07.tar.gz |
Update Python 3 to 3.12.10
commit_hash:dd2398e159fe1d72ea6b12da52fccc933a41a785
Diffstat (limited to 'contrib/tools/python3/Python/assemble.c')
-rw-r--r-- | contrib/tools/python3/Python/assemble.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/contrib/tools/python3/Python/assemble.c b/contrib/tools/python3/Python/assemble.c index 8789d8ef978..6a68482c36e 100644 --- a/contrib/tools/python3/Python/assemble.c +++ b/contrib/tools/python3/Python/assemble.c @@ -1,11 +1,10 @@ -#include <stdbool.h> - #include "Python.h" #include "pycore_code.h" // write_location_entry_start() #include "pycore_compile.h" #include "pycore_opcode.h" // _PyOpcode_Caches[] and opcode category macros #include "pycore_pymem.h" // _PyMem_IsPtrFreed() +#include <stdbool.h> #define DEFAULT_CODE_SIZE 128 #define DEFAULT_LNOTAB_SIZE 16 @@ -269,17 +268,15 @@ write_location_info_entry(struct assembler* a, location loc, int isize) assert(len > THEORETICAL_MAX_ENTRY_SIZE); RETURN_IF_ERROR(_PyBytes_Resize(&a->a_linetable, len*2)); } - if (loc.lineno < 0) { + if (loc.lineno == NO_LOCATION.lineno) { write_location_info_none(a, isize); return SUCCESS; } int line_delta = loc.lineno - a->a_lineno; int column = loc.col_offset; int end_column = loc.end_col_offset; - assert(column >= -1); - assert(end_column >= -1); if (column < 0 || end_column < 0) { - if (loc.end_lineno == loc.lineno || loc.end_lineno == -1) { + if (loc.end_lineno == loc.lineno || loc.end_lineno < 0) { write_location_info_no_column(a, isize, line_delta); a->a_lineno = loc.lineno; return SUCCESS; |