Skip to content

Commit 54c8d6d

Browse files
committed
Suppress tailcall flag if target is a non-marshaled pinvoke (tail calling a marshaled pinvoke should work since the stub is IL)
1 parent 579bd79 commit 54c8d6d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/coreclr/interpreter/compiler.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3551,6 +3551,10 @@ void InterpCompiler::EmitCall(CORINFO_RESOLVED_TOKEN* pConstrainedToken, bool re
35513551
}
35523552
else
35533553
{
3554+
// Tail call target needs to be IL
3555+
if (tailcall && isPInvoke && !isMarshaledPInvoke)
3556+
tailcall = false;
3557+
35543558
// Normal call
35553559
InterpOpcode opcode;
35563560
if (isDelegateInvoke)
@@ -3560,7 +3564,6 @@ void InterpCompiler::EmitCall(CORINFO_RESOLVED_TOKEN* pConstrainedToken, bool re
35603564
}
35613565
else if (tailcall)
35623566
{
3563-
assert(!isPInvoke && !isMarshaledPInvoke);
35643567
opcode = INTOP_CALL_TAIL;
35653568
}
35663569
else

0 commit comments

Comments
 (0)