From 82f1bf2f60f6c88a6ca3259f8727cbd414a6ec4e Mon Sep 17 00:00:00 2001 From: "Michael J. Spencer" Date: Thu, 27 Aug 2015 23:11:20 +0000 Subject: [PATCH] [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 --- tools/yaml2obj/yaml2elf.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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; -- 2.34.1