about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-06-19 08:13:18 +0000
committerbors <bors@rust-lang.org>2024-06-19 08:13:18 +0000
commitcbbdf1e8b1e96cd022028bfd7be87ea1c54778c4 (patch)
treec90f2387ec9f2d366339ca5a3ded343b47ba619a /compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp
parentcf50b298bfbc90f9645abc0f6ef7d363aac9f41e (diff)
parent9ce8a96755aa56bd73c74f106195ac5abf97fd67 (diff)
downloadrust-cbbdf1e8b1e96cd022028bfd7be87ea1c54778c4.tar.gz
rust-cbbdf1e8b1e96cd022028bfd7be87ea1c54778c4.zip
Auto merge of #17426 - roife:fix-issue-17420, r=Veykril
fix: handle character boundaries for wide chars in extend_selection

fix #17420.

When calling 'extend_selection' within a string, r-a attempts to locate the current word at the cursor. This is done by finding the first char before the cursor which is not a letter, digit, or underscore.

The position of this character is referred to as `start_idx`, and the word is considered to start from `start_idx + 1`. However, for wide characters, `start_idx + 1` is not character boundaries, which leading to panic. We should use `ceil_char_boundary` to ensure that the idx is always on character boundaries.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp')
0 files changed, 0 insertions, 0 deletions