@@ -221,7 +221,7 @@ class ForwardSubVisitor final : public GenTreeVisitor<ForwardSubVisitor>
221
221
// fgGetStubAddrArg cannot handle complex trees (it calls gtClone)
222
222
//
223
223
bool isCallTarget = false ;
224
- if (parent->IsCall ())
224
+ if ((parent != nullptr ) && parent->IsCall ())
225
225
{
226
226
GenTreeCall* const parentCall = parent->AsCall ();
227
227
isCallTarget = (parentCall->gtCallType == CT_INDIRECT) && (parentCall->gtCallAddr == node);
@@ -319,7 +319,7 @@ class ForwardSubVisitor final : public GenTreeVisitor<ForwardSubVisitor>
319
319
320
320
bool IsCallArg () const
321
321
{
322
- return m_parentNode->IsCall ();
322
+ return (m_parentNode != nullptr ) && m_parentNode->IsCall ();
323
323
}
324
324
325
325
unsigned GetComplexity () const
@@ -749,7 +749,7 @@ bool Compiler::fgForwardSubStatement(Statement* stmt)
749
749
if (fsv.IsCallArg () && fsv.GetNode ()->TypeIs (TYP_STRUCT) &&
750
750
!fwdSubNode->OperIs (GT_BLK, GT_LCL_VAR, GT_LCL_FLD, GT_MKREFANY))
751
751
{
752
- JITDUMP (" use is a struct arg; fwd sub node is not OBJ /LCL_VAR/LCL_FLD/MKREFANY\n " );
752
+ JITDUMP (" use is a struct arg; fwd sub node is not BLK /LCL_VAR/LCL_FLD/MKREFANY\n " );
753
753
return false ;
754
754
}
755
755
@@ -772,7 +772,7 @@ bool Compiler::fgForwardSubStatement(Statement* stmt)
772
772
{
773
773
GenTree* const parentNode = fsv.GetParentNode ();
774
774
775
- if (!parentNode->OperIs (GT_STORE_LCL_VAR))
775
+ if ((parentNode == nullptr ) || !parentNode->OperIs (GT_STORE_LCL_VAR))
776
776
{
777
777
JITDUMP (" multi-reg struct node, parent not STORE_LCL_VAR\n " );
778
778
return false ;
@@ -794,7 +794,8 @@ bool Compiler::fgForwardSubStatement(Statement* stmt)
794
794
// for them on all 32 bit targets is a CQ regression due to some bad
795
795
// interaction between decomposition and RA.
796
796
//
797
- if (compMethodReturnsMultiRegRetType () && fsv.GetParentNode ()->OperIs (GT_RETURN))
797
+ if (compMethodReturnsMultiRegRetType () && (fsv.GetParentNode () != nullptr ) &&
798
+ fsv.GetParentNode ()->OperIs (GT_RETURN))
798
799
{
799
800
#if defined(TARGET_X86)
800
801
if (fwdSubNode->TypeGet () == TYP_LONG)
0 commit comments