gh-107450: Remove unnecessary overflow check in parser error handler (#110940)

This commit is contained in:
Lysandros Nikolaou 2023-10-16 22:41:01 +02:00 committed by GitHub
parent a77180e663
commit f46333b9f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View 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 {