[PATCH] D37044: Fix bug 34051 by handling empty .res files gracefully.
Rui Ueyama via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 23 17:24:26 PDT 2017
ruiu accepted this revision.
ruiu added a comment.
This revision is now accepted and ready to land.
LGTM
================
Comment at: llvm/lib/Object/WindowsResource.cpp:137
+ if (E.isA<EmptyResError>()) {
+ consumeError(std::move(E));
+ return Error::success();
----------------
ecbeckmann wrote:
> ruiu wrote:
> > Does this ignore errors? Crash bug needs to be fixed, but I wonder if an empty file should be considered as a valid input.
> Not an empty file, it still contains PE header magic and an empty, null entry. So it's a valid .res file that just doesn't contain any records, which I could see being valid in some cases. Also, the original cvtres does not crash/throw error on empty .res.
>
>
> A completely empty file would fail upon WindowsResource::createWindowsResource().
Please add that as a comment.
https://reviews.llvm.org/D37044
More information about the llvm-commits
mailing list