[PATCH] D75527: [yaml2obj] - Add `ELFYAML::YAMLInt` to fix how we parse a relocation `Addend` key.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 13 04:24:30 PDT 2020


grimar added inline comments.


================
Comment at: llvm/test/tools/yaml2obj/ELF/relocation-addend.yaml:139
+# RUN: not yaml2obj %s -D ADDEND=1234Q5 2>&1 | FileCheck %s --check-prefix=ERR
+# RUN: not yaml2obj %s -D ADDEND=-1234Q5 2>&1 | FileCheck %s --check-prefix=ERR
+# RUN: not yaml2obj %s -D ADDEND=foo 2>&1 | FileCheck %s --check-prefix=ERR
----------------
jhenderson wrote:
> Maybe also worth testing '-' on its own, and '--1234'.
> Maybe also worth testing '-'

This helped to catch an assert, thanks! It turned out that on such input we have an empty `Scalar`
(because of the error state) in `ScalarTraits<ELFYAML::YAMLInt>::input` and that was not handled properly
before.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75527/new/

https://reviews.llvm.org/D75527





More information about the llvm-commits mailing list