Skip to content

Commit

Permalink
Fixed crash in lexer on empty input stream.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Feb 24, 2009
1 parent 915a7cd commit d09bcaa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 5 additions & 1 deletion mojoshader_lexer.c
Expand Up @@ -1245,7 +1245,11 @@ Token preprocessor_lexer(IncludeState *s)
}
}
yy206:
{ cursor=(const uchar*)s->source; goto scanner_loop; }
{
token = cursor = (const uchar *) s->source;
limit = cursor + s->bytes_left;
goto scanner_loop;
}
yy207:
++YYCURSOR;
yych = *YYCURSOR;
Expand Down
7 changes: 6 additions & 1 deletion mojoshader_lexer.re
Expand Up @@ -212,7 +212,12 @@ ppdirective:
PP "endif" { RET(TOKEN_PP_ENDIF); }
PP "error" { RET(TOKEN_PP_ERROR); }
WHITESPACE { goto ppdirective; }
ANY { cursor=(const uchar*)s->source; goto scanner_loop; }
ANY {
token = cursor = (const uchar *) s->source;
limit = cursor + s->bytes_left;
goto scanner_loop;
}
*/

bad_chars:
Expand Down

0 comments on commit d09bcaa

Please sign in to comment.