@@ -242,7 +242,6 @@ bool Compiler::fgExpandRuntimeLookupsForCall(BasicBlock** pBlock, Statement* stm
242
242
}
243
243
244
244
GenTree* ctxTree = call->gtArgs .GetArgByIndex (0 )->GetNode ();
245
- GenTree* sigNode = call->gtArgs .GetArgByIndex (1 )->GetNode ();
246
245
247
246
// Prepare slotPtr tree (TODO: consider sharing this part with impRuntimeLookup)
248
247
GenTree* slotPtrTree = gtCloneExpr (ctxTree);
@@ -442,6 +441,23 @@ bool Compiler::fgExpandRuntimeLookupsForCall(BasicBlock** pBlock, Statement* stm
442
441
fallbackBb->inheritWeightPercentage (nullcheckBb, 20 );
443
442
}
444
443
444
+ if (prevBb->HasFlag (BBF_IMPORTED))
445
+ {
446
+ nullcheckBb->RemoveFlags (BBF_INTERNAL);
447
+ nullcheckBb->SetFlags (BBF_IMPORTED);
448
+
449
+ fastPathBb->RemoveFlags (BBF_INTERNAL);
450
+ fastPathBb->SetFlags (BBF_IMPORTED);
451
+
452
+ if (needsSizeCheck)
453
+ {
454
+ sizeCheckBb->RemoveFlags (BBF_INTERNAL);
455
+ sizeCheckBb->SetFlags (BBF_IMPORTED);
456
+ }
457
+
458
+ assert (block->HasFlag (BBF_IMPORTED));
459
+ }
460
+
445
461
// All blocks are expected to be in the same EH region
446
462
assert (BasicBlock::sameEHRegion (prevBb, block));
447
463
assert (BasicBlock::sameEHRegion (prevBb, nullcheckBb));
@@ -1546,6 +1562,14 @@ bool Compiler::fgExpandStaticInitForCall(BasicBlock** pBlock, Statement* stmt, G
1546
1562
isInitedBb->inheritWeight (prevBb);
1547
1563
helperCallBb->inheritWeightPercentage (isInitedBb, 0 );
1548
1564
1565
+ if (prevBb->HasFlag (BBF_IMPORTED))
1566
+ {
1567
+ isInitedBb->RemoveFlags (BBF_INTERNAL);
1568
+ isInitedBb->SetFlags (BBF_IMPORTED);
1569
+
1570
+ assert (block->HasFlag (BBF_IMPORTED));
1571
+ }
1572
+
1549
1573
// All blocks are expected to be in the same EH region
1550
1574
assert (BasicBlock::sameEHRegion (prevBb, block));
1551
1575
assert (BasicBlock::sameEHRegion (prevBb, isInitedBb));
0 commit comments