summaryrefslogtreecommitdiff
path: root/src/c-writer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/c-writer.cc')
-rw-r--r--src/c-writer.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/c-writer.cc b/src/c-writer.cc
index 986ace55..cbffa1d4 100644
--- a/src/c-writer.cc
+++ b/src/c-writer.cc
@@ -2449,7 +2449,9 @@ bool CWriter::IsSingleUnsharedMemory() {
void CWriter::InstallSegueBase(Memory* memory, bool save_old_value) {
NonIndented([&] { Write("#if WASM_RT_USE_SEGUE", Newline()); });
if (save_old_value) {
+ NonIndented([&] { Write("#if !WASM_RT_SEGUE_FREE_SEGMENT", Newline()); });
Write("void* segue_saved_base = wasm_rt_segue_read_base();", Newline());
+ NonIndented([&] { Write("#endif", Newline()); });
}
auto primary_memory =
ExternalInstanceRef(ModuleFieldType::Memory, memory->name);
@@ -2458,7 +2460,9 @@ void CWriter::InstallSegueBase(Memory* memory, bool save_old_value) {
}
void CWriter::RestoreSegueBase() {
- NonIndented([&] { Write("#if WASM_RT_USE_SEGUE", Newline()); });
+ NonIndented([&] {
+ Write("#if WASM_RT_USE_SEGUE && !WASM_RT_SEGUE_FREE_SEGMENT", Newline());
+ });
Write("wasm_rt_segue_write_base(segue_saved_base);", Newline());
NonIndented([&] { Write("#endif", Newline()); });
}