diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/passes/MinifyImportsAndExports.cpp | 2 | ||||
-rw-r--r-- | src/shared-constants.h | 1 | ||||
-rw-r--r-- | src/wasm/wasm-emscripten.cpp | 2 | ||||
-rw-r--r-- | src/wasm/wasm.cpp | 1 |
4 files changed, 4 insertions, 2 deletions
diff --git a/src/passes/MinifyImportsAndExports.cpp b/src/passes/MinifyImportsAndExports.cpp index 043cfb588..d625f7543 100644 --- a/src/passes/MinifyImportsAndExports.cpp +++ b/src/passes/MinifyImportsAndExports.cpp @@ -145,7 +145,7 @@ private: std::map<Name, Name> oldToNew; auto process = [&](Name& name) { // do not minifiy special imports, they must always exist - if (name == MEMORY_BASE || name == TABLE_BASE) { + if (name == MEMORY_BASE || name == TABLE_BASE || name == STACK_POINTER) { return; } auto newName = names.getName(soFar++); diff --git a/src/shared-constants.h b/src/shared-constants.h index 9fb84dbf8..4f64f1cf6 100644 --- a/src/shared-constants.h +++ b/src/shared-constants.h @@ -25,6 +25,7 @@ extern Name GROW_WASM_MEMORY; extern Name WASM_CALL_CTORS; extern Name MEMORY_BASE; extern Name TABLE_BASE; +extern Name STACK_POINTER; extern Name GET_TEMP_RET0; extern Name SET_TEMP_RET0; extern Name NEW_SIZE; diff --git a/src/wasm/wasm-emscripten.cpp b/src/wasm/wasm-emscripten.cpp index 8463354e8..65f877d92 100644 --- a/src/wasm/wasm-emscripten.cpp +++ b/src/wasm/wasm-emscripten.cpp @@ -65,7 +65,7 @@ Global* EmscriptenGlueGenerator::getStackPointerGlobal() { // linker could export it by name? for (auto& g : wasm.globals) { if (g->imported()) { - if (g->base == "__stack_pointer") { + if (g->base == STACK_POINTER) { return g.get(); } } else if (!isExported(wasm, g->name)) { diff --git a/src/wasm/wasm.cpp b/src/wasm/wasm.cpp index e4c9813b3..d0a916072 100644 --- a/src/wasm/wasm.cpp +++ b/src/wasm/wasm.cpp @@ -48,6 +48,7 @@ Name GROW_WASM_MEMORY("__growWasmMemory"); Name WASM_CALL_CTORS("__wasm_call_ctors"); Name MEMORY_BASE("__memory_base"); Name TABLE_BASE("__table_base"); +Name STACK_POINTER("__stack_pointer"); Name GET_TEMP_RET0("getTempRet0"); Name SET_TEMP_RET0("setTempRet0"); Name NEW_SIZE("newSize"); |