Skip to content

Commit

Permalink
Copy node's children early in OMR::Node::copyValidProperties
Browse files Browse the repository at this point in the history
   - copy node's children early in case the node has typeless opcode
  • Loading branch information
gita-omr committed Jul 20, 2021
1 parent b530a23 commit dfb3cce
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions compiler/il/OMRNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,9 +385,13 @@ OMR::Node::copyValidProperties(TR::Node *fromNode, TR::Node *toNode)
// Some parts of the code rely on getDataType, which can assert if
// toNode's opcode before copying has the HasNoDataType property and
// fromNode's opcode does not have the HasNoDataType property
// Also, copy all children in case the node does not have a data type
// and it has to be computed from its children
UnionPropertyA_Type fromUnionPropertyA_Type = fromNode->getUnionPropertyA_Type();
UnionPropertyA_Type toUnionPropertyA_Type = toNode->getUnionPropertyA_Type();

toNode->copyChildren(fromNode);

if (fromUnionPropertyA_Type == toUnionPropertyA_Type)
{
switch (fromUnionPropertyA_Type)
Expand Down Expand Up @@ -462,8 +466,6 @@ OMR::Node::copyValidProperties(TR::Node *fromNode, TR::Node *toNode)
toNode->setFlags(fromNode->getFlags()); // do not clear hasNodeExtension
#endif

toNode->copyChildren(fromNode);

// DONE:
// OMR::Base
// _opCode
Expand Down

0 comments on commit dfb3cce

Please sign in to comment.