diff options
author | Sam Clegg <sbc@chromium.org> | 2018-02-21 00:34:34 +0000 |
---|---|---|
committer | Sam Clegg <sbc@chromium.org> | 2018-02-21 00:34:34 +0000 |
commit | 29b8feb615c9850f43b9ed5efb83e4ebed72d4da (patch) | |
tree | 710bccb68524e50ac25a40b18cfe6bf6fcdd494f | |
parent | 94a940d2b4094dc4b98a59367a72be8bbd270de7 (diff) | |
download | bcm5719-llvm-29b8feb615c9850f43b9ed5efb83e4ebed72d4da.tar.gz bcm5719-llvm-29b8feb615c9850f43b9ed5efb83e4ebed72d4da.zip |
[WebAssembly] Use stable sort when sorting ctore functions
Patch by Nicholas Wilson!
llvm-svn: 325656
-rw-r--r-- | lld/wasm/Writer.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lld/wasm/Writer.cpp b/lld/wasm/Writer.cpp index ffb987ea5b7..6ffce929bb0 100644 --- a/lld/wasm/Writer.cpp +++ b/lld/wasm/Writer.cpp @@ -871,10 +871,10 @@ void Writer::calculateInitFunctions() { } // Sort in order of priority (lowest first) so that they are called // in the correct order. - std::sort(InitFunctions.begin(), InitFunctions.end(), - [](const WasmInitFunc &L, const WasmInitFunc &R) { - return L.Priority < R.Priority; - }); + std::stable_sort(InitFunctions.begin(), InitFunctions.end(), + [](const WasmInitFunc &L, const WasmInitFunc &R) { + return L.Priority < R.Priority; + }); } void Writer::run() { |