Skip to content

Commit

Permalink
Catch these tokens in the compiler, for badly-formed preprocessor sou…
Browse files Browse the repository at this point in the history
…rce code.
  • Loading branch information
icculus committed Feb 25, 2010
1 parent 97aaea0 commit 0165a8c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mojoshader_compiler.c
Expand Up @@ -2461,6 +2461,9 @@ static void parse_source(Context *ctx, const char *filename,
fname = preprocessor_sourcepos(pp, &ctx->sourceline);
ctx->sourcefile = fname ? stringcache(ctx->strcache, fname) : 0;

if ((tokenval == TOKEN_HASH) || (tokenval == TOKEN_HASHHASH))
tokenval = TOKEN_BAD_CHARS;

if (tokenval == TOKEN_BAD_CHARS)
{
fail(ctx, "Bad characters in source file");
Expand Down

0 comments on commit 0165a8c

Please sign in to comment.