Skip to content

Commit

Permalink
pythongh-107450: Remove unnecessary overflow check in parser error ha…
Browse files Browse the repository at this point in the history
…ndler (python#110940)
  • Loading branch information
lysnikolaou authored Oct 16, 2023
1 parent a77180e commit f46333b
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions Parser/pegen_errors.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit f46333b

Please sign in to comment.