[PATCH] D44136: [WebAssebmly] Remove reloc ordering constraint

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 5 23:17:14 PST 2018


This revision was not accepted when it landed; it landed in state "Needs Review".
This revision was automatically updated to reflect the committed changes.
Closed by commit rL326765: [WebAssebmly] Remove reloc ordering constraint (authored by sbc, committed by ).

Repository:
  rL LLVM

https://reviews.llvm.org/D44136

Files:
  llvm/trunk/lib/Object/WasmObjectFile.cpp


Index: llvm/trunk/lib/Object/WasmObjectFile.cpp
===================================================================
--- llvm/trunk/lib/Object/WasmObjectFile.cpp
+++ llvm/trunk/lib/Object/WasmObjectFile.cpp
@@ -554,7 +554,6 @@
     return make_error<GenericBinaryError>("Invalid section code",
                                           object_error::parse_failed);
   uint32_t RelocCount = readVaruint32(Ptr);
-  uint32_t LastOffset = 0;
   uint32_t EndOffset = Section->Content.size();
   while (RelocCount--) {
     wasm::WasmRelocation Reloc = {};
@@ -600,10 +599,9 @@
     if (Reloc.Type == wasm::R_WEBASSEMBLY_TABLE_INDEX_I32 ||
         Reloc.Type == wasm::R_WEBASSEMBLY_MEMORY_ADDR_I32)
       Size = 4;
-    if (Reloc.Offset < LastOffset || Reloc.Offset + Size > EndOffset)
+    if (Reloc.Offset + Size > EndOffset)
       return make_error<GenericBinaryError>("Bad relocation offset",
                                             object_error::parse_failed);
-    LastOffset = Reloc.Offset;
 
     Section->Relocations.push_back(Reloc);
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44136.137132.patch
Type: text/x-patch
Size: 1051 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180306/1815909d/attachment.bin>


More information about the llvm-commits mailing list