mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Parser/tokenizer.c (tok_nextc): zap tok->buf after freeing;
rest: abort() -> fatal(); small things
This commit is contained in:
parent
66cb311fba
commit
588633daa2
5 changed files with 18 additions and 15 deletions
|
@ -209,6 +209,7 @@ tok_nextc(tok)
|
|||
tok->lineno++;
|
||||
if (buf == NULL) {
|
||||
free(tok->buf);
|
||||
tok->buf = NULL;
|
||||
free(new);
|
||||
tok->done = E_NOMEM;
|
||||
return EOF;
|
||||
|
@ -309,10 +310,8 @@ tok_backup(tok, c)
|
|||
register int c;
|
||||
{
|
||||
if (c != EOF) {
|
||||
if (--tok->cur < tok->buf) {
|
||||
fprintf(stderr, "tok_backup: begin of buffer\n");
|
||||
abort();
|
||||
}
|
||||
if (--tok->cur < tok->buf)
|
||||
fatal("tok_backup: begin of buffer");
|
||||
if (*tok->cur != c)
|
||||
*tok->cur = c;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue