Bug 1131965. Cherry pick ANGLE fix for conformance crash

This cherrypicks 21c1e4566726c9397a840dc5331e40a8d0ca9511
from upstream ANGLE which fixes a crash when running:
/conformance/glsl/bugs/undefined-index-should-not-crash.html

--HG--
extra : rebase_source : d1801b3ac1ab5e8d364ea7de024187a4d8ff221e
This commit is contained in:
Jeff Muizelaar 2015-03-10 10:59:17 -04:00
parent 39171f8939
commit 94d5a406a9
2 changed files with 7 additions and 5 deletions

View File

@ -1,3 +1,3 @@
#define ANGLE_COMMIT_HASH "040a674b6d67"
#define ANGLE_COMMIT_HASH "736200d4a356"
#define ANGLE_COMMIT_HASH_SIZE 12
#define ANGLE_COMMIT_DATE "2015-02-18 11:50:36 -0500"
#define ANGLE_COMMIT_DATE "2015-03-10 10:54:46 -0400"

View File

@ -2028,9 +2028,11 @@ TIntermTyped* TParseContext::addIndexExpression(TIntermTyped *baseExpression, co
recover();
}
if (indexExpression->getQualifier() == EvqConst)
TIntermConstantUnion *indexConstantUnion = indexExpression->getAsConstantUnion();
if (indexExpression->getQualifier() == EvqConst && indexConstantUnion)
{
int index = indexExpression->getAsConstantUnion()->getIConst(0);
int index = indexConstantUnion->getIConst(0);
if (index < 0)
{
std::stringstream infoStream;
@ -2091,7 +2093,7 @@ TIntermTyped* TParseContext::addIndexExpression(TIntermTyped *baseExpression, co
index = baseExpression->getType().getNominalSize() - 1;
}
indexExpression->getAsConstantUnion()->getUnionArrayPointer()->setIConst(index);
indexConstantUnion->getUnionArrayPointer()->setIConst(index);
indexedExpression = intermediate.addIndex(EOpIndexDirect, baseExpression, indexExpression, location);
}
}