Просмотр исходного кода

Fix app heap migrate issue and aot compilation warning (#368)

Wenyong Huang 5 лет назад
Родитель
Сommit
c8df3f6eed
2 измененных файлов с 2 добавлено и 2 удалено
  1. 1 1
      core/iwasm/compilation/aot_emit_const.c
  2. 1 1
      core/shared/mem-alloc/ems/ems_kfc.c

+ 1 - 1
core/iwasm/compilation/aot_emit_const.c

@@ -45,7 +45,7 @@ aot_compile_op_f32_const(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
       int32 i32_const;
       int32 i32_const;
       memcpy(&i32_const, &f32_const, sizeof(int32));
       memcpy(&i32_const, &f32_const, sizeof(int32));
       if (!(alloca = LLVMBuildAlloca(comp_ctx->builder,
       if (!(alloca = LLVMBuildAlloca(comp_ctx->builder,
-                                     INT32_PTR_TYPE, "i32_ptr"))) {
+                                     I32_TYPE, "i32_ptr"))) {
           aot_set_last_error("llvm build alloca failed.");
           aot_set_last_error("llvm build alloca failed.");
           return false;
           return false;
       }
       }

+ 1 - 1
core/shared/mem-alloc/ems/ems_kfc.c

@@ -131,7 +131,7 @@ gc_migrate(gc_handle_t handle, gc_handle_t handle_old)
         size = hmu_get_size(cur);
         size = hmu_get_size(cur);
         bh_assert(size > 0);
         bh_assert(size > 0);
 
 
-        if (!HMU_IS_FC_NORMAL(size)) {
+        if (hmu_get_ut(cur) == HMU_FC && !HMU_IS_FC_NORMAL(size)) {
             tree_node = (hmu_tree_node_t *)cur;
             tree_node = (hmu_tree_node_t *)cur;
             adjust_ptr((uint8**)&tree_node->left, offset);
             adjust_ptr((uint8**)&tree_node->left, offset);
             adjust_ptr((uint8**)&tree_node->right, offset);
             adjust_ptr((uint8**)&tree_node->right, offset);