Skip to content

Commit

Permalink
use resize to silence AddressSanitizer bug that wrongfully reported i…
Browse files Browse the repository at this point in the history
…ssues
  • Loading branch information
thomasp85 committed Mar 1, 2024
1 parent cf5d3fa commit 952cd21
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# ragg (development version)

* Silence a bug in clang-ASAN that incorrectly reported sanitiser issues

# ragg 1.2.7

* Fix a stack imbalance bug
Expand Down
14 changes: 7 additions & 7 deletions src/text_renderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,13 +239,13 @@ class TextRenderer {
if (expected_max == 0) {
return;
}
loc_buffer.reserve(expected_max);
id_buffer.reserve(expected_max);
cluster_buffer.reserve(expected_max);
font_buffer.reserve(expected_max);
fallback_buffer.reserve(expected_max);
scaling_buffer.reserve(expected_max);

loc_buffer.resize(expected_max);
id_buffer.resize(expected_max);
cluster_buffer.resize(expected_max);
font_buffer.resize(expected_max);
fallback_buffer.resize(expected_max);
scaling_buffer.resize(expected_max);

int err = textshaping::string_shape(
string,
Expand Down

0 comments on commit 952cd21

Please sign in to comment.