summaryrefslogtreecommitdiff
path: root/src/template/wasm2c.declarations.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/template/wasm2c.declarations.c')
-rw-r--r--src/template/wasm2c.declarations.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/template/wasm2c.declarations.c b/src/template/wasm2c.declarations.c
index efe9dbbe..43cd1d1b 100644
--- a/src/template/wasm2c.declarations.c
+++ b/src/template/wasm2c.declarations.c
@@ -58,6 +58,14 @@ static inline void* wasm_rt_segue_read_base() {
}
}
static inline void wasm_rt_segue_write_base(void* base) {
+#if WASM_RT_SEGUE_FREE_SEGMENT
+ if (wasm_rt_last_segment_val == base) {
+ return;
+ }
+
+ wasm_rt_last_segment_val = base;
+#endif
+
if (wasm_rt_fsgsbase_inst_supported) {
__builtin_ia32_wrgsbase64((uintptr_t)base);
} else {