From: John Kessenich Date: Sat, 17 Sep 2016 03:16:04 +0000 (-0600) Subject: HLSL: Fix bug in previous checkin when non-flattened objects are not simple l-values. X-Git-Tag: upstream/11.4.0~1504 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fcea302dbc647e32b5e0c59c9e9b523f0efd96f0;p=platform%2Fupstream%2Fglslang.git HLSL: Fix bug in previous checkin when non-flattened objects are not simple l-values. --- diff --git a/hlsl/hlslParseHelper.cpp b/hlsl/hlslParseHelper.cpp index b274653..894b385 100755 --- a/hlsl/hlslParseHelper.cpp +++ b/hlsl/hlslParseHelper.cpp @@ -1063,13 +1063,17 @@ TIntermTyped* HlslParseContext::handleAssign(const TSourceLoc& loc, TOperator op return subTree; }; - - const auto& leftVariables = flattenMap[left->getAsSymbolNode()->getId()]; - const auto& rightVariables = flattenMap[right->getAsSymbolNode()->getId()]; + + TVector* leftVariables = nullptr; + TVector* rightVariables = nullptr; + if (flattenLeft) + leftVariables = &flattenMap[left->getAsSymbolNode()->getId()]; + if (flattenRight) + rightVariables = &flattenMap[right->getAsSymbolNode()->getId()]; TIntermAggregate* assignList = nullptr; for (int member = 0; member < (int)members.size(); ++member) { - TIntermTyped* subRight = getMember(flattenRight, right, rightVariables, member); - TIntermTyped* subLeft = getMember(flattenLeft, left, leftVariables, member); + TIntermTyped* subRight = getMember(flattenRight, right, *rightVariables, member); + TIntermTyped* subLeft = getMember(flattenLeft, left, *leftVariables, member); assignList = intermediate.growAggregate(assignList, intermediate.addAssign(op, subLeft, subRight, loc)); } assignList->setOperator(EOpSequence);