From 72269577f3a225572c804664030cbba04cdc6cf5 Mon Sep 17 00:00:00 2001 From: Annabelle Huo Date: Thu, 10 Jun 2021 18:14:53 -0400 Subject: [PATCH] Fix accessing NULL lhs or rhs when printing VP in trace Signed-off-by: Annabelle Huo --- compiler/optimizer/VPHandlers.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/compiler/optimizer/VPHandlers.cpp b/compiler/optimizer/VPHandlers.cpp index c051e448284..4c0b7732d1e 100644 --- a/compiler/optimizer/VPHandlers.cpp +++ b/compiler/optimizer/VPHandlers.cpp @@ -9735,10 +9735,16 @@ static TR::Node *constrainIfcmpeqne(OMR::ValuePropagation *vp, TR::Node *node, b if (vp->trace()) { - traceMsg(vp->comp(), "P2O: Considering a candidate at %p. Object Constraint : ", node); - lhs->print(vp); - traceMsg(vp->comp(), " , Guard constraint : "); - rhs->print(vp); + if (lhs) + { + traceMsg(vp->comp(), "P2O: Considering a candidate at %p. Object Constraint : ", node); + lhs->print(vp); + } + if (rhs) + { + traceMsg(vp->comp(), " , Guard constraint : "); + rhs->print(vp); + } traceMsg(vp->comp(), "\n"); }