Allow variable number of directories, as allowed by the
specification. NumberOfRvaAndSize will default to 16 if not specified,
as in the past.
Author: Alfonso Sánchez-Beato <alfonso.sanchez-beato@canonical.com>
Differential D108825
[yaml2obj] Allow variable number of directories alfonsosanchezbeato on Aug 27 2021, 8:38 AM. Authored by
Details Allow variable number of directories, as allowed by the Author: Alfonso Sánchez-Beato <alfonso.sanchez-beato@canonical.com>
Diff Detail
Event TimelineComment Actions @mstorsjo, do you have any particular thoughts on this patch at all?
Comment Actions Comments addressed. I've added tests as described, including a new yaml as NumberOfRvaAndSize = [[VAR=<none>]] does not seem to work. Comment Actions That's unfortunate, and seems to be an artefact of how the header properties are used internally (they need to be of type Optional<T> to work with <none>). That sounds like something that could be improved in COFF yaml2obj in the future, but not right now. (Also, it should have been NumberOfRvaAndSize: [[VAR=<none>]] FWIW).
Comment Actions Diff updated, now there is only one yaml with two documents and I have editted the loop and suggested.
Comment Actions Just a few nits remaining, otherwise looks pretty good.
Comment Actions I've just pushed this. Please pay attention to any build bot failure emails you get, to see if they were caused by this change. |
I find the fused postincrement here a bit possibly confusing - e.g. with NumberOfRvaAndSize = 1, after the loop you would have written one entry, but end up with NumDir = 2. By doing a separate increment after the conditional, the variable would stay better in sync with reality.