Skip to content

Commit

Permalink
JIT: fix assert in assertion prop (#106146)
Browse files Browse the repository at this point in the history
`optAssertionPropGlobal_RelOp` had branch where it was expecting both
op2 and op1 to be locals, but only had verified that op2 was.

Add an extra check.

Fixes #105670
  • Loading branch information
AndyAyersMS authored Aug 8, 2024
1 parent 105bf4d commit 243715e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/coreclr/jit/assertionprop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4409,7 +4409,7 @@ GenTree* Compiler::optAssertionPropGlobal_RelOp(ASSERT_VALARG_TP assertions, Gen
}
}
// If the assertion involves "op2" and "op1" is also a local var, then just morph the tree.
else if (op2->gtOper == GT_LCL_VAR)
else if (op1->OperIs(GT_LCL_VAR) && op2->OperIs(GT_LCL_VAR))
{
#ifdef DEBUG
if (verbose)
Expand Down

0 comments on commit 243715e

Please sign in to comment.