diff --git a/Parser/parsetok.c b/Parser/parsetok.c index b9c9fe8fa8c..a1580e6751e 100644 --- a/Parser/parsetok.c +++ b/Parser/parsetok.c @@ -252,11 +252,13 @@ parsetok(struct tok_state *tok, grammar *g, int start, perrdetail *err_ret, } } #endif - if (a >= tok->line_start) + if (a != NULL && a >= tok->line_start) { col_offset = Py_SAFE_DOWNCAST(a - tok->line_start, intptr_t, int); - else + } + else { col_offset = -1; + } if ((err_ret->error = PyParser_AddToken(ps, (int)type, str,