Reject shaders that invoke functions hidden by variable or struct name.

BUG=22
Review URL: http://codereview.appspot.com/1855057

git-svn-id: https://angleproject.googlecode.com/svn/trunk@375 736b8ea6-26fd-11df-bfd4-992fa37f6226
This commit is contained in:
[email protected] committed 2010-08-09 17:16:27 +00:00
1 parent 003e7b135a
commit 0a57618aa9
1 file changed
+10 -7
+10 -7
View File
@@ -913,21 +913,24 @@ bool TParseContext::extensionErrorCheck(int line, const char* extension)
//
const TFunction* TParseContext::findFunction(int line, TFunction* call, bool *builtIn)
{
const TSymbol* symbol = symbolTable.find(call->getMangledName(), builtIn);
// First find by unmangled name to check whether the function name has been
// hidden by a variable name or struct typename.
const TSymbol* symbol = symbolTable.find(call->getName(), builtIn);
if (symbol == 0) {
symbol = symbolTable.find(call->getMangledName(), builtIn);
}
if (symbol == 0) {
if (symbol == 0) {
error(line, "no matching overloaded function found", call->getName().c_str(), "");
return 0;
}
if (! symbol->isFunction()) {
if (!symbol->isFunction()) {
error(line, "function name expected", call->getName().c_str(), "");
return 0;
}
const TFunction* function = static_cast<const TFunction*>(symbol);
return function;
return static_cast<const TFunction*>(symbol);
}
//