[PATCH] D46510: [llvm-rc] Exclude padding from sizes in versioninfo resources
Martin Storsjö via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun May 6 14:41:03 PDT 2018
mstorsjo created this revision.
mstorsjo added reviewers: zturner, amccarth, mnbvmar.
Normally when writing something that requires padding, we first measure the length of the written payload data, then write padding if necessary.
For a recursive structure like versioninfo, this means that the padding is excluded from the size of the inner element, but included in the size of the enclosing block.
Rc.exe excludes the final padding (but not the padding of earlier children) from all levels of the hierarchy.
To achieve this, don't pad after each block or value, but only before starting the next one. We still pad after completing the toplevel versioninfo resource, so this won't affect other resource types.
Repository:
rL LLVM
https://reviews.llvm.org/D46510
Files:
test/tools/llvm-rc/Inputs/versioninfo-padding.rc
test/tools/llvm-rc/versioninfo-padding.test
tools/llvm-rc/ResourceFileWriter.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46510.145417.patch
Type: text/x-patch
Size: 3789 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180506/d121ab9f/attachment.bin>
More information about the llvm-commits
mailing list