Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Parser/pegen.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,11 +406,14 @@ _PyPegen_lookahead_with_int(int positive, Token *(func)(Parser *, int), Parser *
return (res != NULL) == positive;
}

int
// gh-111178: Use _Py_NO_SANITIZE_UNDEFINED to disable sanitizer checks on
// undefined behavior (UBsan) in this function, rather than changing 'func'
// callback API.
int _Py_NO_SANITIZE_UNDEFINED
_PyPegen_lookahead(int positive, void *(func)(Parser *), Parser *p)
{
int mark = p->mark;
void *res = (void*)func(p);
void *res = func(p);
p->mark = mark;
return (res != NULL) == positive;
}
Expand Down
Loading