History

Bug in debugger when printing a vm_alloc Bug in vm_string - get_rune/set_rune Update all instantiations of vm_string to use {} - fixed issues

arr committed 9 years ago

Commit bd1f4931 parent 57e9d245 files · +32 −20Browse files

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

Unified · Split

src/vm/string.cpp+2−2
@@ -397,7 +397,7 @@ word_t vm_string_t::get_length() const · 396 unmodified lines
397 397
398runtime::rune_t vm_string_t::get_rune(word_t index) const398runtime::rune_t vm_string_t::get_rune(word_t index) const
399{399{
400 if (index < 0 && _length <= index)400 if (index < 0 || _length <= index)
401 throw index_out_of_range_memory{ 0, _length - 1, index };401 throw index_out_of_range_memory{ 0, _length - 1, index };
402 402
403 // Determine if local or allocated memory403 // Determine if local or allocated memory
@@ -423,7 +423,7 @@ void vm_string_t::set_rune(word_t index, rune_t value) · 19 unmodified lines
423 throw invalid_utf8{};423 throw invalid_utf8{};
424 424
425 // Index equal to length is allowed to grow the string425 // Index equal to length is allowed to grow the string
426 if (index < 0 && _length <= index)426 if (index < 0 || _length < index)
427 throw index_out_of_range_memory{ 0, _length, index };427 throw index_out_of_range_memory{ 0, _length, index };
428 428
429 // Determine if local or allocated memory429 // Determine if local or allocated memory