Skip to content

Commit 850c0ab

Browse files
authored
Fix a debug-assert in assertionprop.cpp (#113147)
1 parent 4729bf9 commit 850c0ab

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/coreclr/jit/assertionprop.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -915,7 +915,8 @@ void Compiler::optPrintAssertion(AssertionDsc* curAssertion, AssertionIndex asse
915915
}
916916
else
917917
{
918-
var_types op1Type = lvaGetDesc(curAssertion->op1.lcl.lclNum)->lvType;
918+
var_types op1Type = curAssertion->op1.kind == O1K_VN ? vnStore->TypeOfVN(curAssertion->op1.vn)
919+
: lvaGetRealType(curAssertion->op1.lcl.lclNum);
919920
if (op1Type == TYP_REF)
920921
{
921922
if (curAssertion->op2.u1.iconVal == 0)
@@ -3436,10 +3437,6 @@ GenTree* Compiler::optConstantAssertionProp(AssertionDsc* curAssertion,
34363437
// and insert casts in morph, which would be problematic to track
34373438
// here).
34383439
assert(tree->TypeGet() == lvaGetDesc(lclNum)->TypeGet());
3439-
// Assertions for small-typed locals should have been normalized
3440-
// when the assertion was created.
3441-
assert(!varTypeIsSmall(tree) || (curAssertion->op2.u1.iconVal ==
3442-
optCastConstantSmall(curAssertion->op2.u1.iconVal, tree->TypeGet())));
34433440

34443441
if (curAssertion->op2.HasIconFlag())
34453442
{

0 commit comments

Comments
 (0)