Commit 5ec99a79 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 BUG=391697 Change-Id: Iee644b875cf68d0ed3dc0b73542efc49ecb23242 Reviewed-on: https://chromium-review.googlesource.com/206822Reviewed-by: 's avatarNicolas Capens <capn@chromium.org> Tested-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarShannon Woods <shannonwoods@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/207832
parent b3319dfe
......@@ -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