summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHeejin Ahn <aheejin@gmail.com>2020-11-24 09:56:30 -0800
committerGitHub <noreply@github.com>2020-11-24 09:56:30 -0800
commit38ee7e9c17f97ffe546d8ebd4345750b009d41c3 (patch)
tree6bf7ce29f68183135c3b2b95af712a33a5aa176f /src
parentb2d797f1f9f1192b8f4d2664f76a8d0b9278a0ef (diff)
downloadbinaryen-38ee7e9c17f97ffe546d8ebd4345750b009d41c3.tar.gz
binaryen-38ee7e9c17f97ffe546d8ebd4345750b009d41c3.tar.bz2
binaryen-38ee7e9c17f97ffe546d8ebd4345750b009d41c3.zip
Let EnforceStackLimits have pointers to Globals (NFC) (#3397)
These can be simply raw pointers, given that they are stored in modules using `unique_ptr`s.
Diffstat (limited to 'src')
-rw-r--r--src/passes/StackCheck.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/passes/StackCheck.cpp b/src/passes/StackCheck.cpp
index eb63aacbc..c25d70635 100644
--- a/src/passes/StackCheck.cpp
+++ b/src/passes/StackCheck.cpp
@@ -74,8 +74,8 @@ static void generateSetStackLimitFunctions(Module& module) {
struct EnforceStackLimits : public WalkerPass<PostWalker<EnforceStackLimits>> {
EnforceStackLimits(const Global* stackPointer,
- const std::unique_ptr<Global>& stackBase,
- const std::unique_ptr<Global>& stackLimit,
+ const Global* stackBase,
+ const Global* stackLimit,
Builder& builder,
Name handler)
: stackPointer(stackPointer), stackBase(stackBase), stackLimit(stackLimit),
@@ -128,8 +128,8 @@ struct EnforceStackLimits : public WalkerPass<PostWalker<EnforceStackLimits>> {
private:
const Global* stackPointer;
- const std::unique_ptr<Global>& stackBase;
- const std::unique_ptr<Global>& stackLimit;
+ const Global* stackBase;
+ const Global* stackLimit;
Builder& builder;
Name handler;
};
@@ -161,7 +161,8 @@ struct StackCheck : public Pass {
builder.makeConst(int32_t(0)),
Builder::Mutable);
PassRunner innerRunner(module);
- EnforceStackLimits(stackPointer, stackBase, stackLimit, builder, handler)
+ EnforceStackLimits(
+ stackPointer, stackBase.get(), stackLimit.get(), builder, handler)
.run(&innerRunner, module);
module->addGlobal(std::move(stackBase));
module->addGlobal(std::move(stackLimit));