ソースを参照

fix bug in bh_vector when extending (#4414)

TianlongLiang 10 ヶ月 前
コミット
5b32130955
1 ファイル変更2 行追加2 行削除
  1. 2 2
      core/shared/utils/bh_vector.c

+ 2 - 2
core/shared/utils/bh_vector.c

@@ -35,8 +35,8 @@ extend_vector(Vector *vector, size_t length)
     if (length <= vector->max_elems)
         return true;
 
-    if (length < vector->size_elem * 3 / 2)
-        length = vector->size_elem * 3 / 2;
+    if (length < vector->max_elems * 3 / 2)
+        length = vector->max_elems * 3 / 2;
 
     if (!(data = alloc_vector_data(length, vector->size_elem))) {
         return false;