[PATCH] D83479: [COFF] Error on unexpected .pdata size
Hans Wennborg via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 13 04:39:10 PDT 2020
hans marked 6 inline comments as done.
hans added inline comments.
================
Comment at: lld/COFF/Writer.cpp:1868
+ if ((end - begin) % sizeof(Entry) != 0) {
+ fatal("unexpected .pdata size: " + std::to_string(end - begin) +
+ " is not a multiple of " + std::to_string(sizeof(Entry)));
----------------
MaskRay wrote:
> Nit: `Twine(end-begin)`
>
> ... to avoid a temporary std::string.
Thanks! That's nicer.
================
Comment at: lld/test/COFF/pdata-arm64-bad.yaml:1
+# RUN: yaml2obj < %s > %t.obj
+#
----------------
MaskRay wrote:
> `yaml2obj %s -o %t.obj`
>
> Drop the `#` on the empty line.
Actually, I'll drop the empty line :)
================
Comment at: lld/test/COFF/pdata-arm64-bad.yaml:5
+
+# This file is like pdata-arm64.yaml, except that .pdata has been extended with
+# 4 bytes. This can happen due to for example bad assembler input. Check that
----------------
MaskRay wrote:
> The yaml can be further simplified.
It could be simplified a lot and still hit the error case here, but to ensure that the rest of the file makes sense, I'd prefer to keep it as it is: just a small modification to the known good pdata-arm64.yaml file.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D83479/new/
https://reviews.llvm.org/D83479
More information about the llvm-commits
mailing list