Skip to content

Commit 918b364

Browse files
authored
[instantiation linking] Optimize aot func inst list (bytecodealliance#4018)
1 parent b18cb3b commit 918b364

23 files changed

+1369
-443
lines changed

core/iwasm/aot/aot_loader.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ load_native_symbol_section(const uint8 *buf, const uint8 *buf_end,
668668
goto fail;
669669
}
670670

671-
for (i = cnt - 1; i >= 0; i--) {
671+
for (i = (int32)cnt - 1; i >= 0; i--) {
672672
read_string(p, p_end, symbol);
673673
if (!strlen(symbol))
674674
continue;
@@ -3840,7 +3840,7 @@ load_relocation_section(const uint8 *buf, const uint8 *buf_end,
38403840
/* The layout is: literal size + literal + code (with plt table) */
38413841
uint8 *mmap_addr = module->literal - sizeof(uint32);
38423842
uint32 total_size =
3843-
sizeof(uint32) + module->literal_size + module->code_size;
3843+
(uint32)sizeof(uint32) + module->literal_size + module->code_size;
38443844
os_mprotect(mmap_addr, total_size, map_prot);
38453845
}
38463846

@@ -4529,7 +4529,7 @@ aot_unload(AOTModule *module)
45294529
/* The layout is: literal size + literal + code (with plt table) */
45304530
uint8 *mmap_addr = module->literal - sizeof(uint32);
45314531
uint32 total_size =
4532-
sizeof(uint32) + module->literal_size + module->code_size;
4532+
(uint32)sizeof(uint32) + module->literal_size + module->code_size;
45334533
os_munmap(mmap_addr, total_size);
45344534
}
45354535

0 commit comments

Comments
 (0)