summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2020-12-04 14:37:34 -0800
committerGitHub <noreply@github.com>2020-12-04 14:37:34 -0800
commitb501c243b0f0949438e98336c86e1942725fcbda (patch)
tree816ee309203bac48839819ac2edee41d25b0a20d /src
parentef8c9f6d06b29fe2c7fe63236d709e3278a55041 (diff)
downloadbinaryen-b501c243b0f0949438e98336c86e1942725fcbda.tar.gz
binaryen-b501c243b0f0949438e98336c86e1942725fcbda.tar.bz2
binaryen-b501c243b0f0949438e98336c86e1942725fcbda.zip
Remove legacy DYNAMICTOP_PTR support from SafeHeap (#3425)
Diffstat (limited to 'src')
-rw-r--r--src/passes/SafeHeap.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/passes/SafeHeap.cpp b/src/passes/SafeHeap.cpp
index a0006c973..9d2b250f5 100644
--- a/src/passes/SafeHeap.cpp
+++ b/src/passes/SafeHeap.cpp
@@ -30,7 +30,6 @@
namespace wasm {
-static const Name DYNAMICTOP_PTR_IMPORT("DYNAMICTOP_PTR");
static const Name GET_SBRK_PTR("emscripten_get_sbrk_ptr");
static const Name SBRK("sbrk");
static const Name SEGFAULT_IMPORT("segfault");
@@ -124,11 +123,7 @@ struct SafeHeap : public Pass {
void addImports(Module* module) {
ImportInfo info(*module);
auto indexType = module->memory.indexType;
- // Older emscripten imports env.DYNAMICTOP_PTR.
- // Newer emscripten imports or exports emscripten_get_sbrk_ptr().
- if (auto* existing = info.getImportedGlobal(ENV, DYNAMICTOP_PTR_IMPORT)) {
- dynamicTopPtr = existing->name;
- } else if (auto* existing = info.getImportedFunction(ENV, GET_SBRK_PTR)) {
+ if (auto* existing = info.getImportedFunction(ENV, GET_SBRK_PTR)) {
getSbrkPtr = existing->name;
} else if (auto* existing = module->getExportOrNull(GET_SBRK_PTR)) {
getSbrkPtr = existing->value;