Reject non-ASCII characters in shader source at the preprocessor level.
Review URL: http://codereview.appspot.com/4094047
git-svn-id: https://angleproject.googlecode.com/svn/trunk@545 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/compiler/preprocessor/scanner.c b/src/compiler/preprocessor/scanner.c
index 7b399a0..ab7019b 100644
--- a/src/compiler/preprocessor/scanner.c
+++ b/src/compiler/preprocessor/scanner.c
@@ -621,6 +621,12 @@
token = cpp->currentInput->scan(cpp->currentInput, &yylvalpp);
if(check_EOF(token))
return 0;
+ if (token < 0) {
+ // This check may need to be improved to support UTF-8
+ // characters in comments.
+ CPPErrorToInfoLog("preprocessor encountered non-ASCII character in shader source");
+ return 0;
+ }
if (token == '#') {
if (cpp->previous_token == '\n'|| cpp->previous_token == 0) {
token = readCPPline(&yylvalpp);