GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bpo-34400: Fix more undefined behavior in parsetok.c (GH-8833) · python/cpython@985dcd4

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • Parser
    • parsetok.c
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎Parser/parsetok.c‎

Copy file name to clipboardExpand all lines: Parser/parsetok.c
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,11 +252,13 @@ parsetok(struct tok_state *tok, grammar *g, int start, perrdetail *err_ret,
252252
}
253253
}
254254
#endif
255-
if (a >= tok->line_start)
255+
if (a != NULL && a >= tok->line_start) {
256256
col_offset = Py_SAFE_DOWNCAST(a - tok->line_start,
257257
intptr_t, int);
258-
else
258+
}
259+
else {
259260
col_offset = -1;
261+
}
260262

261263
if ((err_ret->error =
262264
PyParser_AddToken(ps, (int)type, str,

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.