Skip to content

Commit

Permalink
Bug 1131965. Cherry pick ANGLE fix for conformance crash
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jrmuizel committed Mar 10, 2015
1 parent 39171f8 commit 94d5a40
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions gfx/angle/src/commit.h
Original file line number Diff line number Diff line change
@@ -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"
8 changes: 5 additions & 3 deletions gfx/angle/src/compiler/translator/ParseContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 94d5a40

Please sign in to comment.