Prevent crash when bad shader redeclares built-in array names it is not supposed to redeclare.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@26520 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
parent
8a1a4a7a8b
commit
d7dfe2c2b2
4 changed files with 11 additions and 2 deletions
|
|
@ -2213,6 +2213,11 @@ void TParseContext::declareArray(TSourceLoc loc, TString& identifier, const TTyp
|
|||
if (! symbol) {
|
||||
bool currentScope;
|
||||
symbol = symbolTable.find(identifier, 0, ¤tScope);
|
||||
|
||||
if (symbol && builtInName(identifier) && ! symbolTable.atBuiltInLevel()) {
|
||||
// bad shader (errors already reported) trying to redeclare a built-in name as an array
|
||||
return;
|
||||
}
|
||||
if (symbol == 0 || ! currentScope) {
|
||||
//
|
||||
// Successfully process a new definition.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue