Skip to content

Commit f868efe

Browse files
tommcdonjkotas
andauthored
Allow MethodDesc::GetILHeader to work correctly under rejit scenarios (#118465)
* Allow MethodDesc::GetILHeader to work correctly under rejit scenarios * Apply suggestions from code review * Update src/coreclr/vm/method.cpp --------- Co-authored-by: Jan Kotas <[email protected]>
1 parent 5371f13 commit f868efe

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/coreclr/vm/method.cpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,20 +1188,15 @@ COR_ILMETHOD* MethodDesc::GetILHeader()
11881188
}
11891189
CONTRACTL_END
11901190

1191-
RVA rva = GetRVA();
1192-
if (rva == 0)
1193-
{
1194-
return NULL;
1195-
}
1196-
11971191
Module *pModule = GetModule();
11981192

1199-
// Always pickup overrides like reflection emit, EnC, etc.
1193+
// Always pickup overrides like reflection emit, EnC, etc. irrespective of RVA.
1194+
// Profilers can attach dynamic IL to methods with zero RVA.
12001195
TADDR pIL = pModule->GetDynamicIL(GetMemberDef());
12011196

12021197
if (pIL == (TADDR)NULL)
12031198
{
1204-
pIL = pModule->GetIL(rva);
1199+
pIL = pModule->GetIL(GetRVA());
12051200
}
12061201

12071202
#ifdef _DEBUG_IMPL

0 commit comments

Comments
 (0)