Commit 117186e5 by Jamie Madill

Fix not rewriting else-if blocks.

We would miss expanding the else-if clauses in a chain of selection statements. BUG=346463 Change-Id: I8d16b9f25c97b8f6e7e73ad11bf7dae8e8c57ed7 Reviewed-on: https://chromium-review.googlesource.com/187844Reviewed-by: 's avatarNicolas Capens <nicolascapens@chromium.org> Tested-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/189080Reviewed-by: 's avatarShannon Woods <shannonwoods@chromium.org>
parent 92db5082
......@@ -48,6 +48,14 @@ bool ElseBlockRewriter::visitAggregate(Visit visit, TIntermAggregate *node)
TIntermSelection *selection = statement->getAsSelectionNode();
if (selection && selection->getFalseBlock() != NULL)
{
// Check for if / else if
TIntermSelection *elseIfBranch = selection->getFalseBlock()->getAsSelectionNode();
if (elseIfBranch)
{
selection->replaceChildNode(elseIfBranch, rewriteSelection(elseIfBranch));
delete elseIfBranch;
}
node->getSequence()[statementIndex] = rewriteSelection(selection);
delete selection;
}
......
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