diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/passes/Memory64Lowering.cpp | 16 | ||||
-rw-r--r-- | src/wasm/wasm-emscripten.cpp | 4 |
2 files changed, 15 insertions, 5 deletions
diff --git a/src/passes/Memory64Lowering.cpp b/src/passes/Memory64Lowering.cpp index c376ed6c6..95dbf4f17 100644 --- a/src/passes/Memory64Lowering.cpp +++ b/src/passes/Memory64Lowering.cpp @@ -90,11 +90,21 @@ struct Memory64Lowering : public WalkerPass<PostWalker<Memory64Lowering>> { wrapAddress64(curr->size); } + void visitAtomicRMW(AtomicRMW* curr) { wrapAddress64(curr->ptr); } + + void visitAtomicCmpxchg(AtomicCmpxchg* curr) { wrapAddress64(curr->ptr); } + + void visitAtomicWait(AtomicWait* curr) { wrapAddress64(curr->ptr); } + + void visitAtomicNotify(AtomicNotify* curr) { wrapAddress64(curr->ptr); } + void visitMemory(Memory* memory) { for (auto& segment : memory->segments) { - auto* c = segment.offset->cast<Const>(); - c->value = Literal(static_cast<uint32_t>(c->value.geti64())); - c->type = Type::i32; + if (!segment.isPassive) { + auto* c = segment.offset->cast<Const>(); + c->value = Literal(static_cast<uint32_t>(c->value.geti64())); + c->type = Type::i32; + } } // This is visited last. memory->indexType = Type::i32; diff --git a/src/wasm/wasm-emscripten.cpp b/src/wasm/wasm-emscripten.cpp index 5eed4d4c4..7e56ef849 100644 --- a/src/wasm/wasm-emscripten.cpp +++ b/src/wasm/wasm-emscripten.cpp @@ -148,7 +148,7 @@ private: Fatal() << "Cannot get offset of passive segment initialized " "multiple times"; } - offsets[curr->segment] = dest->value.geti32(); + offsets[curr->segment] = dest->value.getInteger(); } } searcher(passiveOffsets); searcher.walkModule(&wasm); @@ -514,7 +514,7 @@ void EmscriptenGlueGenerator::separateDataSegments(Output* outfile, if (!seg.offset->is<Const>()) { Fatal() << "separating relocatable segments not implemented"; } - size_t offset = seg.offset->cast<Const>()->value.geti32(); + size_t offset = seg.offset->cast<Const>()->value.getInteger(); offset -= base; size_t fill = offset - lastEnd; if (fill > 0) { |