[llvm] r246233 - [yaml2obj] Support numeric indexes to create invalid files. Will be used by lld test.

Michael J. Spencer via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 27 16:11:20 PDT 2015


Author: mspencer
Date: Thu Aug 27 18:11:20 2015
New Revision: 246233

URL: http://llvm.org/viewvc/llvm-project?rev=246233&view=rev
Log:
[yaml2obj] Support numeric indexes to create invalid files. Will be used by lld test.

Modified:
    llvm/trunk/tools/yaml2obj/yaml2elf.cpp

Modified: llvm/trunk/tools/yaml2obj/yaml2elf.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/yaml2obj/yaml2elf.cpp?rev=246233&r1=246232&r2=246233&view=diff
==============================================================================
--- llvm/trunk/tools/yaml2obj/yaml2elf.cpp (original)
+++ llvm/trunk/tools/yaml2obj/yaml2elf.cpp Thu Aug 27 18:11:20 2015
@@ -222,9 +222,11 @@ bool ELFState<ELFT>::initSectionHeaders(
 
       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;
 




More information about the llvm-commits mailing list