fix bug in bh_vector when extending (#4414)

This commit is contained in:
TianlongLiang 2025-06-26 10:18:24 +08:00 committed by GitHub
parent a7aae9d2cc
commit 5b32130955
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;