Skip to content

Commit 9563909

Browse files
set alignment 4 when loading multi return value (#3955)
set alignment 4 when loading multi return value for all call opcodes
1 parent 1fb0862 commit 9563909

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

core/iwasm/compilation/aot_emit_function.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1832,6 +1832,7 @@ aot_compile_op_call(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
18321832
aot_set_last_error("llvm build load failed.");
18331833
goto fail;
18341834
}
1835+
LLVMSetAlignment(ext_ret, 4);
18351836
PUSH(ext_ret, ext_ret_types[i]);
18361837
}
18371838
}
@@ -2068,6 +2069,7 @@ call_aot_call_indirect_func(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
20682069
aot_set_last_error("llvm build load failed.");
20692070
return false;
20702071
}
2072+
LLVMSetAlignment(value_rets[i], 4);
20712073
cell_num += wasm_value_type_cell_num_internal(wasm_ret_types[i],
20722074
comp_ctx->pointer_size);
20732075
}
@@ -2699,6 +2701,7 @@ aot_compile_op_call_indirect(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
26992701
aot_set_last_error("llvm build load failed.");
27002702
goto fail;
27012703
}
2704+
LLVMSetAlignment(ext_ret, 4);
27022705
LLVMAddIncoming(result_phis[i], &ext_ret, &block_curr, 1);
27032706
}
27042707
}
@@ -3130,6 +3133,7 @@ aot_compile_op_call_ref(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
31303133
aot_set_last_error("llvm build load failed.");
31313134
goto fail;
31323135
}
3136+
LLVMSetAlignment(ext_ret, 4);
31333137
LLVMAddIncoming(result_phis[i], &ext_ret, &block_curr, 1);
31343138
}
31353139
}
@@ -3205,6 +3209,7 @@ aot_compile_op_call_ref(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
32053209
aot_set_last_error("llvm build load failed.");
32063210
goto fail;
32073211
}
3212+
LLVMSetAlignment(ext_ret, 4);
32083213
LLVMAddIncoming(result_phis[i], &ext_ret, &block_curr, 1);
32093214
}
32103215
}

0 commit comments

Comments
 (0)