diff --git a/core/iwasm/aot/arch/aot_reloc_riscv.c b/core/iwasm/aot/arch/aot_reloc_riscv.c index 7798d55c..d765e0b8 100644 --- a/core/iwasm/aot/arch/aot_reloc_riscv.c +++ b/core/iwasm/aot/arch/aot_reloc_riscv.c @@ -177,7 +177,11 @@ rv_set_val(uint16 *addr, uint32 val) *addr = (val & 0xffff); *(addr + 1) = (val >> 16); +#ifdef __riscv_zifencei __asm__ volatile("fence.i"); +#else + __asm__ volatile("fence"); +#endif } /* Add a val to given address */