From b18b0c3261f6de8d4752933ddfe958260de28e16 Mon Sep 17 00:00:00 2001 From: Andy Ayers Date: Thu, 8 Aug 2024 10:25:39 -0700 Subject: [PATCH] JIT: fix assert in assertion prop '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 --- src/coreclr/jit/assertionprop.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/jit/assertionprop.cpp b/src/coreclr/jit/assertionprop.cpp index 67a4559545dfbe..db1ea44806787f 100644 --- a/src/coreclr/jit/assertionprop.cpp +++ b/src/coreclr/jit/assertionprop.cpp @@ -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)