[PATCH] D44349: [WebAssembly] Verify contents of relocations target before writing in

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 10 17:39:23 PST 2018


sbc100 added inline comments.


================
Comment at: wasm/InputFiles.cpp:133
+  // verifying the existing table index relocations
+  TableEntries.resize(WasmObj->functionTypes().size());
+  for (const WasmElemSegment &Seg : WasmObj->elements()) {
----------------
ncw wrote:
> Can't you take the address of imported functions - yet functionTypes only contains the defined ones?
> 
> Something doesn't seem quite right about these indexes, but I'd have to play around with a couple of examples to be sure. I think the code that //uses// TableEntries above is correct (ie ElementIndex is the right thing to use).
You are right.. i was trying to calculate the max function index here but I failed.  I will try again :)


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D44349





More information about the llvm-commits mailing list