Skip to content

Commit

Permalink
[cdac] Remove GetMethodDescData fallback to legacy DAC (#110702)
Browse files Browse the repository at this point in the history
- Make cDAC `GetMethodDescData` implementation stop delegating to the legacy DAC as a fallback.
- Debug.Assert cDAC/DAC hresults on failure
  • Loading branch information
elinor-fung authored Dec 16, 2024
1 parent da7e06c commit d108be1
Show file tree
Hide file tree
Showing 3 changed files with 196 additions and 153 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ public TypeHandle GetTypeHandle(TargetPointer typeHandlePointer)

if ((addressLowBits != TypeHandleBits.MethodTable) && (addressLowBits != TypeHandleBits.TypeDesc))
{
throw new InvalidOperationException("Invalid type handle pointer");
throw new ArgumentException("Invalid type handle pointer", nameof(typeHandlePointer));
}

// if we already validated this address, return a handle
Expand Down Expand Up @@ -306,7 +306,7 @@ public TypeHandle GetTypeHandle(TargetPointer typeHandlePointer)
// Otherwse, get ready to validate
if (!_typeValidation.TryValidateMethodTablePointer(methodTablePointer))
{
throw new InvalidOperationException("Invalid method table pointer");
throw new ArgumentException("Invalid method table pointer", nameof(typeHandlePointer));
}
// ok, we validated it, cache the data and add the MethodTable_1 struct to the dictionary
Data.MethodTable trustedMethodTableData = _target.ProcessedData.GetOrAdd<Data.MethodTable>(methodTablePointer);
Expand Down Expand Up @@ -636,7 +636,7 @@ public MethodDescHandle GetMethodDescHandle(TargetPointer methodDescPointer)

if (!_methodValidation.ValidateMethodDescPointer(methodDescPointer, out TargetPointer methodDescChunkPointer))
{
throw new InvalidOperationException("Invalid method desc pointer");
throw new ArgumentException("Invalid method desc pointer", nameof(methodDescPointer));
}

// ok, we validated it, cache the data and add the MethodDesc struct to the dictionary
Expand Down
Loading

0 comments on commit d108be1

Please sign in to comment.