Skip to content

Commit 0e107cd

Browse files
Weaken assert around folding constants (#103026)
I ran into this assert with native AOT. It seems to be too strong - we are not allowed to fold IconHandle constants with prejit.
1 parent a7c88a2 commit 0e107cd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/coreclr/jit/morph.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -9426,7 +9426,8 @@ GenTree* Compiler::fgMorphSmpOp(GenTree* tree, MorphAddrContext* mac, bool* optA
94269426
}
94279427

94289428
/* Any constant cases should have been folded earlier */
9429-
noway_assert(!op1->OperIsConst() || opts.OptimizationDisabled() || optValnumCSE_phase);
9429+
noway_assert(!op1->OperIsConst() || op1->IsIconHandle() || opts.OptimizationDisabled() ||
9430+
optValnumCSE_phase);
94309431
break;
94319432

94329433
case GT_CKFINITE:

0 commit comments

Comments
 (0)