Skip to content

Commit 446060a

Browse files
authored
Fix AV in IsTailCall by checking for NULL trace address (#123640)
* Fixes potential AV in IsTailCall caused by NULL trace address
1 parent 0411fe1 commit 446060a

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/coreclr/debug/ee/controller.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5831,10 +5831,15 @@ static bool IsTailCall(const BYTE * ip, ControllerStackInfo* info, TailCallFunct
58315831
return false;
58325832
}
58335833

5834-
MethodDesc* pTargetMD =
5835-
trace.GetTraceType() == TRACE_UNJITTED_METHOD
5836-
? trace.GetMethodDesc()
5837-
: g_pEEInterface->GetNativeCodeMethodDesc(trace.GetAddress());
5834+
MethodDesc* pTargetMD = NULL;
5835+
if (trace.GetTraceType() == TRACE_UNJITTED_METHOD)
5836+
{
5837+
pTargetMD = trace.GetMethodDesc();
5838+
}
5839+
else if (trace.GetAddress() != (PCODE)NULL)
5840+
{
5841+
pTargetMD = g_pEEInterface->GetNativeCodeMethodDesc(trace.GetAddress());
5842+
}
58385843

58395844
if (type == TailCallFunctionType::StoreTailCallArgs)
58405845
{

0 commit comments

Comments
 (0)