mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2024-11-26 23:42:05 +00:00
Fix XIP issue of handling 64-bit const in 32-bit target (#1803)
- Handle i64 const like f64 const - Ensure i64/f64 const is stored on 8-byte aligned address
This commit is contained in:
parent
d827315122
commit
9083334f69
|
@ -2229,11 +2229,11 @@ aot_get_native_symbol_index(AOTCompContext *comp_ctx, const char *symbol)
|
|||
|
||||
if (idx < 0) {
|
||||
if (comp_ctx->pointer_size == sizeof(uint32)
|
||||
&& !strncmp(symbol, "f64#", 4)) {
|
||||
&& (!strncmp(symbol, "f64#", 4) || !strncmp(symbol, "i64#", 4))) {
|
||||
idx = bh_list_length(&comp_ctx->native_symbols);
|
||||
/* Add 4 bytes padding on 32-bit target to make sure that
|
||||
the f64 const is stored on 8-byte aligned address */
|
||||
if ((idx & 1) && !strncmp(comp_ctx->target_arch, "i386", 4)) {
|
||||
if (idx & 1) {
|
||||
if (!insert_native_symbol(comp_ctx, "__ignore", idx)) {
|
||||
return -1;
|
||||
}
|
||||
|
@ -2246,7 +2246,7 @@ aot_get_native_symbol_index(AOTCompContext *comp_ctx, const char *symbol)
|
|||
}
|
||||
|
||||
if (comp_ctx->pointer_size == sizeof(uint32)
|
||||
&& !strncmp(symbol, "f64#", 4)) {
|
||||
&& (!strncmp(symbol, "f64#", 4) || !strncmp(symbol, "i64#", 4))) {
|
||||
/* f64 const occupies 2 pointer slots on 32-bit target */
|
||||
if (!insert_native_symbol(comp_ctx, "__ignore", idx + 1)) {
|
||||
return -1;
|
||||
|
|
Loading…
Reference in New Issue
Block a user