Commit a300988e by alokp@chromium.org

Check for reserved prefixes (gl_, webgl_, and _webgl_) in struct and field…

Check for reserved prefixes (gl_, webgl_, and _webgl_) in struct and field names. GLES2 and WebGL both require this for all identifiers - variable, function, struct, and field names. ANGLE was only validating variable and function names. BUG=11 Review URL: http://codereview.appspot.com/1856046 git-svn-id: https://angleproject.googlecode.com/svn/trunk@347 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 613ef31a
......@@ -1749,6 +1749,9 @@ type_specifier_nonarray
struct_specifier
: STRUCT IDENTIFIER LEFT_BRACE struct_declaration_list RIGHT_BRACE {
if (parseContext->reservedErrorCheck($2.line, *$2.string))
parseContext->recover();
TType* structure = new TType($4, *$2.string);
TVariable* userTypeDef = new TVariable($2.string, *structure, true);
if (! parseContext->symbolTable.insert(*userTypeDef)) {
......@@ -1821,11 +1824,17 @@ struct_declarator_list
struct_declarator
: IDENTIFIER {
if (parseContext->reservedErrorCheck($1.line, *$1.string))
parseContext->recover();
$$.type = new TType(EbtVoid, EbpUndefined);
$$.line = $1.line;
$$.type->setFieldName(*$1.string);
}
| IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET {
if (parseContext->reservedErrorCheck($1.line, *$1.string))
parseContext->recover();
$$.type = new TType(EbtVoid, EbpUndefined);
$$.line = $1.line;
$$.type->setFieldName(*$1.string);
......
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