Skip to content

[cDAC] fix some DacDbi bugs#126974

Open
rcj1 wants to merge 5 commits intodotnet:mainfrom
rcj1:fix-some-bugs
Open

[cDAC] fix some DacDbi bugs#126974
rcj1 wants to merge 5 commits intodotnet:mainfrom
rcj1:fix-some-bugs

Conversation

@rcj1
Copy link
Copy Markdown
Contributor

@rcj1 rcj1 commented Apr 15, 2026

  • Correctly implement IsValueType to look for ValueType flag on MethodTables
  • Fix validation in HasTypeParams - DAC was returning the value of a flag, cDAC was returning 1/0. Fixed native impl to return 1/0.

@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag
See info in area-owners.md if you want to be subscribed.

Copilot AI review requested due to automatic review settings April 16, 2026 01:24
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes correctness issues in the cDAC RuntimeTypeSystem/DacDbi surface by aligning value-type detection with CoreCLR MethodTable flags and normalizing a generic-variable check to return a strict boolean value.

Changes:

  • Update DacDbiImpl.IsValueType to use the RuntimeTypeSystem’s value-type classification instead of signature element type.
  • Add IRuntimeTypeSystem.IsValueType(TypeHandle) and implement it in RuntimeTypeSystem_1 based on MethodTable category flags (and TypeDesc element type).
  • Fix CoreCLR MethodTable::ContainsGenericVariables to return BOOL (0/1) rather than the raw flag value.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/DacDbiImpl.cs Switches value-type query to the new RuntimeTypeSystem API for correct classification.
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/RuntimeTypeSystemHelpers/MethodTableFlags_1.cs Adds Category_ValueType_Mask and IsValueType helper aligned with CoreCLR flag semantics.
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/RuntimeTypeSystem_1.cs Implements IsValueType(TypeHandle) using MethodTable flags / TypeDesc element type.
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Contracts/IRuntimeTypeSystem.cs Extends the contract interface with IsValueType.
src/coreclr/vm/methodtable.h Normalizes ContainsGenericVariables to return a strict BOOL value.
docs/design/datacontracts/RuntimeTypeSystem.md Documents the new IsValueType API and related flags.

Comment thread docs/design/datacontracts/RuntimeTypeSystem.md
Copilot AI review requested due to automatic review settings April 16, 2026 20:35
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

@rcj1
Copy link
Copy Markdown
Contributor Author

rcj1 commented Apr 17, 2026

@copilot resolve the merge conflicts in this pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants