Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit eb31c35

Browse files
authored
Use correct basic block to check legality of PInvoke callsite for inlining (#18620)
It is the same logic as used in other similar places
1 parent 80fdb42 commit eb31c35

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/jit/importer.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19061,7 +19061,9 @@ void Compiler::impMarkInlineCandidate(GenTree* callNode,
1906119061

1906219062
if (methAttr & CORINFO_FLG_PINVOKE)
1906319063
{
19064-
if (!impCanPInvokeInlineCallSite(compCurBB))
19064+
// See comment in impCheckForPInvokeCall
19065+
BasicBlock* block = compIsForInlining() ? impInlineInfo->iciBlock : compCurBB;
19066+
if (!impCanPInvokeInlineCallSite(block))
1906519067
{
1906619068
inlineResult.NoteFatal(InlineObservation::CALLSITE_PINVOKE_EH);
1906719069
return;

0 commit comments

Comments
 (0)