forked from OSchip/llvm-project
[WebAssembly] Use stable sort when sorting ctore functions
Patch by Nicholas Wilson! llvm-svn: 325656
This commit is contained in:
parent
94a940d2b4
commit
29b8feb615
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue