Skip to content

Commit 6dd097a

Browse files
committed
fix a bug in shared heap malloc when it's memory64
1 parent b36e27c commit 6dd097a

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

core/iwasm/common/wasm_memory.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -796,10 +796,9 @@ wasm_runtime_shared_heap_malloc(WASMModuleInstanceCommon *module_inst,
796796
*p_native_addr = native_addr;
797797
}
798798

799-
return memory->is_memory64
800-
? shared_heap->start_off_mem64
801-
: shared_heap->start_off_mem32
802-
+ ((uint8 *)native_addr - shared_heap->base_addr);
799+
return (memory->is_memory64 ? shared_heap->start_off_mem64
800+
: shared_heap->start_off_mem32)
801+
+ (uintptr_t)((uint8 *)native_addr - shared_heap->base_addr);
803802
}
804803

805804
void

0 commit comments

Comments
 (0)