Skip to content

Commit

Permalink
fix GetMethodDescChunkPointerMayThrow
Browse files Browse the repository at this point in the history
  • Loading branch information
lambdageek committed Jul 15, 2024
1 parent 4bd7ca4 commit 8a59452
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -220,12 +220,12 @@ private TargetPointer GetClassThrowing(NonValidated.MethodTable methodTable)

private TargetPointer GetMethodDescChunkPointerMayThrow(TargetPointer methodDescPointer, Data.MethodDesc umd)
{
ulong? methodDescSize = _target.GetTypeInfo(DataType.MethodDesc).Size;
if (!methodDescSize.HasValue)
ulong? methodDescChunkSize = _target.GetTypeInfo(DataType.MethodDescChunk).Size;
if (!methodDescChunkSize.HasValue)
{
throw new InvalidOperationException("Target has no definite MethodDesc size");
throw new InvalidOperationException("Target has no definite MethodDescChunk size");
}
ulong chunkAddress = (ulong)methodDescPointer - methodDescSize.Value - umd.ChunkIndex * MethodDescAlignment;
ulong chunkAddress = (ulong)methodDescPointer - methodDescChunkSize.Value - umd.ChunkIndex * MethodDescAlignment;
return new TargetPointer(chunkAddress);
}

Expand Down

0 comments on commit 8a59452

Please sign in to comment.