From: Michael J. Spencer Date: Thu, 27 Aug 2015 23:11:20 +0000 (+0000) Subject: [yaml2obj] Support numeric indexes to create invalid files. Will be used by lld test. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=82f1bf2f60f6c88a6ca3259f8727cbd414a6ec4e;p=oota-llvm.git [yaml2obj] Support numeric indexes to create invalid files. Will be used by lld test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246233 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/yaml2obj/yaml2elf.cpp b/tools/yaml2obj/yaml2elf.cpp index a247f48c053..849f202b126 100644 --- a/tools/yaml2obj/yaml2elf.cpp +++ b/tools/yaml2obj/yaml2elf.cpp @@ -222,9 +222,11 @@ bool ELFState::initSectionHeaders(std::vector &SHeaders, unsigned Index; if (SN2I.lookup(S->Info, Index)) { - errs() << "error: Unknown section referenced: '" << S->Info - << "' at YAML section '" << S->Name << "'.\n"; - return false; + if (S->Info.getAsInteger(0, Index)) { + errs() << "error: Unknown section referenced: '" << S->Info + << "' at YAML section '" << S->Name << "'.\n"; + return false; + } } SHeader.sh_info = Index;