[PATCH] D44136: [WebAssebmly] Remove reloc ordering constraint
Sam Clegg via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 5 23:17:10 PST 2018
sbc100 updated this revision to Diff 137131.
sbc100 added a comment.
- debugging
Repository:
rL LLVM
https://reviews.llvm.org/D44136
Files:
lib/Object/WasmObjectFile.cpp
Index: lib/Object/WasmObjectFile.cpp
===================================================================
--- lib/Object/WasmObjectFile.cpp
+++ 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.137131.patch
Type: text/x-patch
Size: 1018 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180306/d64e35cb/attachment.bin>
More information about the llvm-commits
mailing list