Catch these tokens in the compiler, for badly-formed preprocessor source code.
authorRyan C. Gordon <icculus@icculus.org>
Thu, 25 Feb 2010 02:25:42 -0500
changeset 868 8e2034c3f175
parent 867 f5f491d2b82b
child 869 5bd359b047f3
Catch these tokens in the compiler, for badly-formed preprocessor source code.
mojoshader_compiler.c
--- a/mojoshader_compiler.c	Wed Feb 24 21:23:58 2010 -0500
+++ b/mojoshader_compiler.c	Thu Feb 25 02:25:42 2010 -0500
@@ -2461,6 +2461,9 @@
         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");