Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure MetadataEnumResult is sufficiently updated by MetaDataImport::… #56756

Merged
merged 1 commit into from
Aug 3, 2021

Commits on Aug 3, 2021

  1. Ensure MetadataEnumResult is sufficiently updated by MetaDataImport::…

    …Enum
    
    `MetadataEnumResult` has a fixed inline buffer for returning small results
    and a pointer to allow it to return larger ones. The indexer for this
    checks the pointer and if non-null assumes that's the current set of
    values.
    
    But if a `MetadataEnumResult` is re-used within a loop, values written to it
    by `MetaDataImport::Enum` may bleed from one loop iteration to the next
    if the iterations first get a large result and then a small one.
    
    One case where this could happen was in libraries PGO tests, where PGO data
    encouraged the jit to inline `MemberInfoCache<T>.PopulateProperties(Filter,...)`
    into `MemberInfoCache<T>.PopulateProperties(Filter)`.
    
    Note this also is a conseqeunce of skipping zero init locals; without that
    the struct would have been zeroed each loop iteration.
    
    Fixes dotnet#56655.
    AndyAyersMS committed Aug 3, 2021
    Configuration menu
    Copy the full SHA
    482eae0 View commit details
    Browse the repository at this point in the history