-
Notifications
You must be signed in to change notification settings - Fork 586
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
Minor discrepancy between SetOffset() and WriteTo() #63
Comments
Are you changing if not, do you have a sample that triggers this condition? |
For example, if the reserved
;
I understand that almost noone modifies the header this way and I expect this behaviour to be resolved as "Won't Fix"; I just wanted to let you know. |
You've modified the writer code so instead of writing StorageFlags,Reserved2,heaps.Count, you now only write heaps.Count? How does the CLR know this and correctly parses the new header without the 2 bytes before the heap count field? Is there a new flag I don't know about or forgot? |
The CLR can't parse it, I work on my own runtime. I should have mentioned it before. |
This header will always be 4-byte aligned so there's only a problem if you change the size of the header so the heaps aren't 4-byte aligned, as you did in your modified code. I'll close this as a Won't-Fix 😎 but it should be trivial for you to fix it for your custom header. |
In class MetaDataHeader, SetOffset() uses actual offset when aligning strings but WriteTo() aligns the strings using the string length instead of the actual offset. This can lead to exception being thrown from VerifyWriteTo() when the MetaDataHeader items change and computing the alignment differs between SetOffset() and WriteTo().
The text was updated successfully, but these errors were encountered: