From a8ded16f56afd880a9a6459fe5ce55a8667d9b3e Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Wed, 16 Dec 2020 17:38:48 -0800 Subject: Add comment a followup to #3424. NFC. (#3449) --- src/passes/SafeHeap.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/passes/SafeHeap.cpp b/src/passes/SafeHeap.cpp index 9d2b250f5..2eed23256 100644 --- a/src/passes/SafeHeap.cpp +++ b/src/passes/SafeHeap.cpp @@ -81,6 +81,10 @@ struct AccessInstrumenter : public WalkerPass> { AccessInstrumenter(Name getSbrkPtr) : getSbrkPtr(getSbrkPtr) {} void visitLoad(Load* curr) { + // As well as the getSbrkPtr function we also avoid insturmenting the + // module start function. This is because this function is used in + // shared memory builds to load the passive memory segments, which in + // turn means that value of sbrk() is not available. if (getFunction()->name == getModule()->start || getFunction()->name == getSbrkPtr || curr->type == Type::unreachable) { return; -- cgit v1.2.3