Skip to content

Commit

Permalink
Add internal pointer assert to Power select evaluator
Browse files Browse the repository at this point in the history
The select evaluator in the Power codegen cannot handle select nodes
with children that are internal pointers, since information about the
pinning array pointer would be lost. An assert has been added to verify
that internal pointers are not passed to this evaluator.

Signed-off-by: Ben Thomas <ben@benthomas.ca>
  • Loading branch information
aviansie-ben committed Sep 2, 2020
1 parent 2b9283e commit bc037b1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions compiler/p/codegen/ControlFlowEvaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1770,6 +1770,11 @@ TR::Register *OMR::Power::TreeEvaluator::iselectEvaluator(TR::Node *node, TR::Co
generateTrg1Src3Instruction(cg, iselOp, node, trgReg, trueReg, falseReg, condReg);
}

TR_ASSERT_FATAL_WITH_NODE(
node,
!trueReg->containsInternalPointer() && !falseReg->containsInternalPointer(),
"Select nodes cannot have children that are internal pointers"
);
if (trueReg->containsCollectedReference() || falseReg->containsCollectedReference())
trgReg->setContainsCollectedReference();
}
Expand All @@ -1780,6 +1785,11 @@ TR::Register *OMR::Power::TreeEvaluator::iselectEvaluator(TR::Node *node, TR::Co
trgReg = cg->gprClobberEvaluate(trueNode);
TR::Register *falseReg = cg->evaluate(falseNode);

TR_ASSERT_FATAL_WITH_NODE(
node,
!trgReg->containsInternalPointer() && !falseReg->containsInternalPointer(),
"Select nodes cannot have children that are internal pointers"
);
if (falseReg->containsCollectedReference())
trgReg->setContainsCollectedReference();

Expand Down

0 comments on commit bc037b1

Please sign in to comment.