History

Fix bug in string constructor. Update test used to expose the issue.

arr committed 10 years ago

Commit 7c21b771 parent 42602f03 files · +3 −3Browse files

Showing the changes to src/vm/string.cpp (1 of 3 files). Show all

Unified · Split

src/vm/string.cpp+1−1
@@ -231,7 +231,7 @@ vm_string_t::vm_string_t(const vm_string_t &s1, const vm_string_t &s2) · 230 unmodified lines
231231 , _encoded_str{ nullptr }
232232 , _is_alloc{ true }
233233 , _length{ s1._length + s2._length }
234− , _length_max{ s1._length + s2._length }
234+ , _length_max{ compute_max_length(s1._length + s2._length) }
235235 , _mem{}
236236 {
237237 _mem.alloc = calloc_memory<uint8_t>(_length_max * _character_size);