Skip to content

Commit

Permalink
Recommit r371023 "[lib/ObjectYAML] - Stop calling error(1) when mappi…
Browse files Browse the repository at this point in the history
…ng 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

llvm-svn: 371030
  • Loading branch information
George Rimar committed Sep 5, 2019
1 parent cbce3ce commit e7b4d20
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions llvm/lib/ObjectYAML/ELFYAML.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint8_t> denormalize(IO &) {
Expand Down Expand Up @@ -942,7 +941,7 @@ struct NormalizedOther {
return Map;
}

const IO &YamlIO;
IO &YamlIO;
Optional<std::vector<StOtherPiece>> Other;
std::string UnknownFlagsHolder;
};
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/tools/yaml2obj/elf-symbol-stother.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit e7b4d20

Please sign in to comment.