[A11y] Initialize and copy _blockRange in UIA Clone#10544
Conversation
|
Careful with the terminology. RuntimeClassInitialize isn't actually a "constructor" in the C++ sense specifically! |
Fixed! |
lhecker
left a comment
There was a problem hiding this comment.
When Resharper comes out for VS 2022, we should all buy it together.
It has a clang-tidy integration that actually works. 😐
miniksa
left a comment
There was a problem hiding this comment.
Waiting for pending comments to be complete.
|
Hello @DHowett! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
## Summary of the Pull Request #7960 was caused by `UiaTextRangeBase::_blockRange` not being initialized, thus pointing to random memory. In most cases, we initialize it properly in `RuntimeClassInitialize`, however, the copying version of `RuntimeClassInitialize` doesn't actually copy it over, resulting in it still containing random memory. NVDA (and other screen readers) occasionally use `Clone` (really just the copy initializer), resulting in this bug occurring randomly. ## PR Checklist * [X] Closes #7960 * [X] Tests added/passed ## Validation Steps Performed Test failed before the change, but passes after the change. (cherry picked from commit 79a18f0)
## Summary of the Pull Request #7960 was caused by `UiaTextRangeBase::_blockRange` not being initialized, thus pointing to random memory. In most cases, we initialize it properly in `RuntimeClassInitialize`, however, the copying version of `RuntimeClassInitialize` doesn't actually copy it over, resulting in it still containing random memory. NVDA (and other screen readers) occasionally use `Clone` (really just the copy initializer), resulting in this bug occurring randomly. ## PR Checklist * [X] Closes #7960 * [X] Tests added/passed ## Validation Steps Performed Test failed before the change, but passes after the change. (cherry picked from commit 79a18f0)
|
🎉 Handy links: |
|
🎉 Handy links: |
Summary of the Pull Request
#7960 was caused by
UiaTextRangeBase::_blockRangenot being initialized, thus pointing to random memory. In most cases, we initialize it properly inRuntimeClassInitialize, however, the copying version ofRuntimeClassInitializedoesn't actually copy it over, resulting in it still containing random memory.NVDA (and other screen readers) occasionally use
Clone(really just the copy initializer), resulting in this bug occurring randomly.PR Checklist
Validation Steps Performed
Test failed before the change, but passes after the change.