[PATCH] D51065: [WebAssembly] Ensure relocation entries are ordered by offset
Nicholas Wilson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 22 01:43:10 PDT 2018
ncw accepted this revision.
ncw added a comment.
This revision is now accepted and ready to land.
Looks good to me. I think something similar to this was included in one of my previous patches, and just got lost somewhere.
I'm busy on other things at work, so I've had to put Wasm to the side for the last few months, but I'm hoping to get back to polishing and submitting some more stuff - when I'm able!
================
Comment at: lib/MC/WasmObjectWriter.cpp:906-910
+ llvm::sort(Relocs.begin(), Relocs.end(),
+ [](const WasmRelocationEntry &A, const WasmRelocationEntry &B) {
+ return (A.Offset + A.FixupSection->getSectionOffset()) <
+ (B.Offset + B.FixupSection->getSectionOffset());
+ });
----------------
Should this be stable_sort? (I think LLVM is trying to remove uses of the unstable/non-deterministic version.)
Alternatively could assert that it's sorted, since it seems in practice that it is (and the assert would make sure that stays the case).
Repository:
rL LLVM
https://reviews.llvm.org/D51065
More information about the llvm-commits
mailing list