Skip to content

BlobBuilder.Align(int) seems not working on mono #97172

Open

Description

@buyaa-n

A Field RVA alignment test is failing on mono legs in this PR

That verifies the code section:

_metadataBuilder.AddFieldRelativeVirtualAddress(handle, fieldDataBuilder.Count);
fieldDataBuilder.WriteBytes(field._rvaData!);
fieldDataBuilder.Align(ManagedPEBuilder.MappedFieldDataAlignment);

Not sure if it is bug or expected, I don't see mono specific code in MetadataBuilder nor in BlobBuilder.Align(int)

public void Align(int alignment)
{
int position = Count;
WriteBytes(0, BitArithmetic.Align(position, alignment) - position);
}

Activity

  1. ghost added
    untriaged
    on Jan 18, 2024
  2. lambdageek commented on Jan 18, 2024

    @lambdageek
    Member

    It's probably an issue on the reading side - maybe somewhere in https://github.com/dotnet/runtime/blob/main/src/mono/mono/metadata/class.c#L5580-L5649

  3. added this to the 9.0.0 milestone on Jan 18, 2024
  4. ghost removed
    untriaged
    on Jan 18, 2024
  5. modified the milestones: 9.0.0, Future on Jul 29, 2024
  6. added
    needs-further-triage
    on Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-System.Reflectionneeds-further-triageruntime-mono

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions