Skip to content

Commit 7517e32

Browse files
committed
fix GetMethodDescChunkPointerMayThrow
1 parent c31bdcf commit 7517e32

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/native/managed/cdacreader/src/Contracts/RuntimeTypeSystem_1.NonValidated.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,12 +220,12 @@ private TargetPointer GetClassThrowing(NonValidated.MethodTable methodTable)
220220

221221
private TargetPointer GetMethodDescChunkPointerMayThrow(TargetPointer methodDescPointer, Data.MethodDesc umd)
222222
{
223-
ulong? methodDescSize = _target.GetTypeInfo(DataType.MethodDesc).Size;
224-
if (!methodDescSize.HasValue)
223+
ulong? methodDescChunkSize = _target.GetTypeInfo(DataType.MethodDescChunk).Size;
224+
if (!methodDescChunkSize.HasValue)
225225
{
226-
throw new InvalidOperationException("Target has no definite MethodDesc size");
226+
throw new InvalidOperationException("Target has no definite MethodDescChunk size");
227227
}
228-
ulong chunkAddress = (ulong)methodDescPointer - methodDescSize.Value - umd.ChunkIndex * MethodDescAlignment;
228+
ulong chunkAddress = (ulong)methodDescPointer - methodDescChunkSize.Value - umd.ChunkIndex * MethodDescAlignment;
229229
return new TargetPointer(chunkAddress);
230230
}
231231

0 commit comments

Comments
 (0)