Commit 55d0be04 by kbr@chromium.org

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
parent 0f4cefe9
...@@ -621,6 +621,12 @@ int yylex_CPP(char* buf, int maxSize) ...@@ -621,6 +621,12 @@ int yylex_CPP(char* buf, int maxSize)
token = cpp->currentInput->scan(cpp->currentInput, &yylvalpp); token = cpp->currentInput->scan(cpp->currentInput, &yylvalpp);
if(check_EOF(token)) if(check_EOF(token))
return 0; 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 (token == '#') {
if (cpp->previous_token == '\n'|| cpp->previous_token == 0) { if (cpp->previous_token == '\n'|| cpp->previous_token == 0) {
token = readCPPline(&yylvalpp); token = readCPPline(&yylvalpp);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment