Commit 334aa1f3 by alokp@chromium.org

Handled case where selection nodes that use ternary operators are part of a…

Handled case where selection nodes that use ternary operators are part of a sequence. Usually they are part of an assignment. BUG=4 TEST=OpenGL ES 2.0 conformance tests, specifically operators test. Review URL: http://codereview.appspot.com/1643043 git-svn-id: https://angleproject.googlecode.com/svn/trunk@335 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 7d3849bd
...@@ -47,18 +47,18 @@ TString arrayBrackets(const TType& type) ...@@ -47,18 +47,18 @@ TString arrayBrackets(const TType& type)
} }
bool isSingleStatement(TIntermNode* node) { bool isSingleStatement(TIntermNode* node) {
const TIntermAggregate* aggregate = node->getAsAggregate(); if (const TIntermAggregate* aggregate = node->getAsAggregate())
if (aggregate != NULL)
{ {
if ((aggregate->getOp() == EOpFunction) || return (aggregate->getOp() != EOpFunction) &&
(aggregate->getOp() == EOpSequence)) (aggregate->getOp() != EOpSequence);
return false;
} }
else if (node->getAsSelectionNode() != NULL) else if (const TIntermSelection* selection = node->getAsSelectionNode())
{ {
return false; // Ternary operators are usually part of an assignment operator.
// This handles those rare cases in which they are all by themselves.
return selection->usesTernaryOperator();
} }
else if (node->getAsLoopNode() != NULL) else if (node->getAsLoopNode())
{ {
return false; return false;
} }
......
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