Revert "[DWP][DWARF] Detect and error on debug info offset overflow"
authorAlexander Yermolovich <ayermolo@fb.com>
Fri, 22 Jul 2022 20:02:08 +0000 (13:02 -0700)
committerAlexander Yermolovich <ayermolo@fb.com>
Fri, 22 Jul 2022 20:02:08 +0000 (13:02 -0700)
This reverts commit 417738d3a66cc65f3fc58ab9535c17fac1ddaff1.

llvm/lib/DWP/DWP.cpp

index 4a2053b..44e39c0 100644 (file)
@@ -18,7 +18,6 @@
 #include "llvm/Object/Decompressor.h"
 #include "llvm/Object/ELFObjectFile.h"
 #include "llvm/Support/MemoryBuffer.h"
-#include <limits>
 
 using namespace llvm;
 using namespace llvm::object;
@@ -680,9 +679,6 @@ Error write(MCStreamer &Out, ArrayRef<std::string> Inputs) {
               continue;
           }
           Out.emitBytes(Info.substr(UnitOffset - C.Length, C.Length));
-          if (std::numeric_limits<uint32_t>::max() - InfoSectionOffset < C.Length)
-            return make_error<DWPError>("Debug Info offset greater then 4GB.");
-
           InfoSectionOffset += C.Length;
         }
       }