From: Jan Kotas Date: Sun, 24 Jun 2018 03:20:58 +0000 (-0700) Subject: Use correct basic block to check legality of PInvoke callsite for inlining (dotnet... X-Git-Tag: submit/tizen/20210909.063632~11030^2~4527 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f71fdded1df06dd30dc6d6439f178fc5e4f3266a;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Use correct basic block to check legality of PInvoke callsite for inlining (dotnet/coreclr#18620) It is the same logic as used in other similar places Commit migrated from https://github.com/dotnet/coreclr/commit/eb31c358b27182dae487406a3247dfe995beb40f --- diff --git a/src/coreclr/src/jit/importer.cpp b/src/coreclr/src/jit/importer.cpp index b236c97..fe30580 100644 --- a/src/coreclr/src/jit/importer.cpp +++ b/src/coreclr/src/jit/importer.cpp @@ -19061,7 +19061,9 @@ void Compiler::impMarkInlineCandidate(GenTree* callNode, if (methAttr & CORINFO_FLG_PINVOKE) { - if (!impCanPInvokeInlineCallSite(compCurBB)) + // See comment in impCheckForPInvokeCall + BasicBlock* block = compIsForInlining() ? impInlineInfo->iciBlock : compCurBB; + if (!impCanPInvokeInlineCallSite(block)) { inlineResult.NoteFatal(InlineObservation::CALLSITE_PINVOKE_EH); return;