]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-107450: Remove unnecessary overflow check in parser error handler (#110940)
authorLysandros Nikolaou <lisandrosnik@gmail.com>
Mon, 16 Oct 2023 20:41:01 +0000 (22:41 +0200)
committerGitHub <noreply@github.com>
Mon, 16 Oct 2023 20:41:01 +0000 (22:41 +0200)
Parser/pegen_errors.c

index 057bf5515199352dace046b0cb2e19fd8398122c..e2bc3b91c80718856657ab1539e1228f1da748c4 100644 (file)
@@ -240,12 +240,6 @@ _PyPegen_raise_error(Parser *p, PyObject *errtype, int use_mark, const char *err
             col_offset = 0;
         } else {
             const char* start = p->tok->buf  ? p->tok->line_start : p->tok->buf;
-            if (p->tok->cur - start > INT_MAX) {
-                PyErr_SetString(PyExc_OverflowError,
-                    "Parser column offset overflow - source line is too big");
-                p->error_indicator = 1;
-                return NULL;
-            }
             col_offset = Py_SAFE_DOWNCAST(p->tok->cur - start, intptr_t, int);
         }
     } else {