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

Mapping Field Relation of Length fails in MarshalTo #224

Open
AronRubin opened this issue Sep 14, 2022 · 0 comments
Open

Mapping Field Relation of Length fails in MarshalTo #224

AronRubin opened this issue Sep 14, 2022 · 0 comments

Comments

@AronRubin
Copy link

AronRubin commented Sep 14, 2022

A rule like the following generates the correct code except for a missing "@ref."

Generates:

        internal unsafe void __MarshalTo(ref __Native @ref)
        {
            @ref.SizeOfStructure = sizeof(__Native);
            @ref.MetadataType = MetadataType;
            MetadataSize = Metadata.Length;
            fixed (void* __from = &Metadata[0], __to = &@ref.Metadata)
                SharpGen.Runtime.MemoryHelpers.CopyMemory(__to, __from, 256U * 1U);
        }

Should be:

        internal unsafe void __MarshalTo(ref __Native @ref)
        {
            @ref.SizeOfStructure = sizeof(__Native);
            @ref.MetadataType = MetadataType;
            @ref.MetadataSize = Metadata.Length;
            fixed (void* __from = &Metadata[0], __to = &@ref.Metadata)
                SharpGen.Runtime.MemoryHelpers.CopyMemory(__to, __from, 256U * 1U);
        }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant