File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -1241,18 +1241,21 @@ class LocalAddressVisitor final : public GenTreeVisitor<LocalAddressVisitor>
1241
1241
break ;
1242
1242
1243
1243
case GT_CAST:
1244
+ {
1244
1245
assert (TopValue (1 ).Node () == node);
1245
1246
assert (TopValue (0 ).Node () == node->AsCast ()->CastOp ());
1246
1247
1247
- if (!node->TypeIs (TYP_I_IMPL, TYP_BYREF) || node->gtOverflow () || !TopValue (0 ).IsAddress () ||
1248
+ var_types castToType = node->CastToType ();
1249
+ bool isPtrCast = (castToType == TYP_I_IMPL) || (castToType == TYP_U_IMPL) || (castToType == TYP_BYREF);
1250
+ if (!isPtrCast || node->gtOverflow () || !TopValue (0 ).IsAddress () ||
1248
1251
!TopValue (1 ).AddOffset (TopValue (0 ), 0 ))
1249
1252
{
1250
1253
EscapeValue (TopValue (0 ), node);
1251
1254
}
1252
1255
1253
1256
PopValue ();
1254
1257
break ;
1255
-
1258
+ }
1256
1259
case GT_CALL:
1257
1260
while (TopValue (0 ).Node () != node)
1258
1261
{
You can’t perform that action at this time.
0 commit comments