From 008d04d3d55f9245ce4b9ebe552522b981e12f55 Mon Sep 17 00:00:00 2001 From: George Rimar Date: Thu, 5 Sep 2019 08:52:26 +0000 Subject: [PATCH] Recommit r371023 "[lib/ObjectYAML] - Stop calling error(1) when mapping the st_other field of a symbol." Fix: added missing return "return 0;" Original commit message: This eliminates one of the error(1) call in this lib. It is different from the others because happens on a fields mapping stage and can be easily fixed. Differential revision: https://reviews.llvm.org/D67150 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371030 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/ObjectYAML/ELFYAML.cpp | 9 ++++----- test/tools/yaml2obj/elf-symbol-stother.yaml | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/ObjectYAML/ELFYAML.cpp b/lib/ObjectYAML/ELFYAML.cpp index a81d27eed6b..30d4c0505a9 100644 --- a/lib/ObjectYAML/ELFYAML.cpp +++ b/lib/ObjectYAML/ELFYAML.cpp @@ -894,10 +894,9 @@ struct NormalizedOther { if (to_integer(Name, Val)) return Val; - llvm::WithColor::error() - << "an unknown value is used for symbol's 'Other' field: " << Name - << ".\n"; - exit(1); + YamlIO.setError("an unknown value is used for symbol's 'Other' field: " + + Name); + return 0; } Optional denormalize(IO &) { @@ -942,7 +941,7 @@ struct NormalizedOther { return Map; } - const IO &YamlIO; + IO &YamlIO; Optional> Other; std::string UnknownFlagsHolder; }; diff --git a/test/tools/yaml2obj/elf-symbol-stother.yaml b/test/tools/yaml2obj/elf-symbol-stother.yaml index da771d690df..997a4b0be55 100644 --- a/test/tools/yaml2obj/elf-symbol-stother.yaml +++ b/test/tools/yaml2obj/elf-symbol-stother.yaml @@ -4,7 +4,7 @@ ## to a different machine type to what is specified by the YAML. # RUN: not yaml2obj --docnum=1 2>&1 %s | FileCheck %s --check-prefix=ERR -# ERR: error: an unknown value is used for symbol's 'Other' field: STO_MIPS_OPTIONAL. +# ERR: error: an unknown value is used for symbol's 'Other' field: STO_MIPS_OPTIONAL --- !ELF FileHeader: -- 2.11.4.GIT