-
Notifications
You must be signed in to change notification settings - Fork 8.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[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! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When Resharper comes out for VS 2022, we should all buy it together.
It has a clang-tidy integration that actually works. 😐
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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::_blockRange
not being initialized, thus pointing to random memory. In most cases, we initialize it properly inRuntimeClassInitialize
, however, the copying version ofRuntimeClassInitialize
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
Validation Steps Performed
Test failed before the change, but passes after the change.