@@ -78,9 +78,6 @@ get_memory_check_bound(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
78
78
return NULL ;
79
79
}
80
80
81
- if (func_ctx -> mem_space_unchanged )
82
- return mem_check_bound ;
83
-
84
81
if (!(mem_check_bound = LLVMBuildLoad2 (
85
82
comp_ctx -> builder ,
86
83
(comp_ctx -> pointer_size == sizeof (uint64 )) ? I64_TYPE : I32_TYPE ,
@@ -164,17 +161,15 @@ aot_check_memory_overflow(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
164
161
}
165
162
166
163
/* Get memory base address and memory data size */
167
- if (func_ctx -> mem_space_unchanged
168
164
#if WASM_ENABLE_SHARED_MEMORY != 0
169
- || is_shared_memory
170
- #endif
171
- ) {
165
+ if (is_shared_memory )
172
166
mem_base_addr = func_ctx -> mem_info [0 ].mem_base_addr ;
173
- }
174
- else {
167
+ else
168
+ #endif
169
+ {
175
170
if (!(mem_base_addr = LLVMBuildLoad2 (
176
171
comp_ctx -> builder , OPQ_PTR_TYPE ,
177
- func_ctx -> mem_info [0 ].mem_base_addr , "mem_base " ))) {
172
+ func_ctx -> mem_info [0 ].mem_base_addr , "mem_base_addr " ))) {
178
173
aot_set_last_error ("llvm build load failed." );
179
174
goto fail ;
180
175
}
@@ -1015,16 +1010,11 @@ get_memory_curr_page_count(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx)
1015
1010
{
1016
1011
LLVMValueRef mem_size ;
1017
1012
1018
- if (func_ctx -> mem_space_unchanged ) {
1019
- mem_size = func_ctx -> mem_info [0 ].mem_cur_page_count_addr ;
1020
- }
1021
- else {
1022
- if (!(mem_size = LLVMBuildLoad2 (
1023
- comp_ctx -> builder , I32_TYPE ,
1024
- func_ctx -> mem_info [0 ].mem_cur_page_count_addr , "mem_size" ))) {
1025
- aot_set_last_error ("llvm build load failed." );
1026
- goto fail ;
1027
- }
1013
+ if (!(mem_size = LLVMBuildLoad2 (
1014
+ comp_ctx -> builder , I32_TYPE ,
1015
+ func_ctx -> mem_info [0 ].mem_cur_page_count , "mem_size" ))) {
1016
+ aot_set_last_error ("llvm build load failed." );
1017
+ goto fail ;
1028
1018
}
1029
1019
1030
1020
return LLVMBuildIntCast (comp_ctx -> builder , mem_size ,
@@ -1165,16 +1155,14 @@ check_bulk_memory_overflow(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
1165
1155
#if WASM_ENABLE_SHARED_MEMORY != 0
1166
1156
bool is_shared_memory = comp_ctx -> comp_data -> memories [0 ].flags & 0x02 ;
1167
1157
1168
- if (func_ctx -> mem_space_unchanged || is_shared_memory ) {
1169
- #else
1170
- if (func_ctx -> mem_space_unchanged ) {
1171
- #endif
1158
+ if (is_shared_memory )
1172
1159
mem_base_addr = func_ctx -> mem_info [0 ].mem_base_addr ;
1173
- }
1174
- else {
1160
+ else
1161
+ #endif
1162
+ {
1175
1163
if (!(mem_base_addr = LLVMBuildLoad2 (
1176
1164
comp_ctx -> builder , OPQ_PTR_TYPE ,
1177
- func_ctx -> mem_info [0 ].mem_base_addr , "mem_base " ))) {
1165
+ func_ctx -> mem_info [0 ].mem_base_addr , "mem_base_addr " ))) {
1178
1166
aot_set_last_error ("llvm build load failed." );
1179
1167
goto fail ;
1180
1168
}
@@ -1206,16 +1194,11 @@ check_bulk_memory_overflow(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
1206
1194
}
1207
1195
}
1208
1196
1209
- if (func_ctx -> mem_space_unchanged ) {
1210
- mem_size = func_ctx -> mem_info [0 ].mem_data_size_addr ;
1211
- }
1212
- else {
1213
- if (!(mem_size = LLVMBuildLoad2 (
1214
- comp_ctx -> builder , I64_TYPE ,
1215
- func_ctx -> mem_info [0 ].mem_data_size_addr , "mem_size" ))) {
1216
- aot_set_last_error ("llvm build load failed." );
1217
- goto fail ;
1218
- }
1197
+ if (!(mem_size = LLVMBuildLoad2 (
1198
+ comp_ctx -> builder , I64_TYPE ,
1199
+ func_ctx -> mem_info [0 ].mem_data_size , "mem_size" ))) {
1200
+ aot_set_last_error ("llvm build load failed." );
1201
+ goto fail ;
1219
1202
}
1220
1203
1221
1204
ADD_BASIC_BLOCK (check_succ , "check_succ" );
0 commit comments