-
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
Initialize all members of Terminal #14345
Conversation
@@ -37,24 +37,7 @@ static std::wstring _KeyEventsToText(std::deque<std::unique_ptr<IInputEvent>>& i | |||
} | |||
|
|||
#pragma warning(suppress : 26455) // default constructor is throwing, too much effort to rearrange at this time. | |||
Terminal::Terminal() : | |||
_mutableViewport{ Viewport::Empty() }, |
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.
This one didn't get copied over to the header. Should we initialize it there too?
std::unique_ptr<TextBuffer> _mainBuffer; | ||
std::unique_ptr<TextBuffer> _altBuffer; |
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.
std::unique_ptr<TextBuffer> _mainBuffer; | |
std::unique_ptr<TextBuffer> _altBuffer; | |
std::unique_ptr<TextBuffer> _mainBuffer = nullptr; | |
std::unique_ptr<TextBuffer> _altBuffer = nullptr; |
no benefit to initializing these too? At least for consistency.
@@ -356,27 +352,27 @@ class Microsoft::Terminal::Core::Terminal final : | |||
til::point pivot; | |||
}; | |||
std::optional<SelectionAnchors> _selection; |
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.
std::optional<SelectionAnchors> _selection; | |
std::optional<SelectionAnchors> _selection = std::nullopt; |
this one also didn't get carried over from the cpp.
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.
optionals are technically .. ah you probably talked about this
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.
discussed offline. We good.
Hello @lhecker! 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 (
|
The following members were not initialized during construction: * `CursorType _defaultCursorShape` * `bool _suppressApplicationTitle` * `bool _bracketedPasteMode` * `size_t _hyperlinkPatternId` * `SelectionExpansion _multiClickSelectionMode` * `til::CoordType _scrollbackLines` Unlike gcc and clang, MSVC is fairly tame when it comes to removing code tainted by undefined behavior, so the most likely affect this had is that we were reading uninitialized memory. Related to #14129. (cherry picked from commit a798a60) Service-Card-Id: 86826740 Service-Version: 1.15
The following members were not initialized during construction: * `CursorType _defaultCursorShape` * `bool _suppressApplicationTitle` * `bool _bracketedPasteMode` * `size_t _hyperlinkPatternId` * `SelectionExpansion _multiClickSelectionMode` * `til::CoordType _scrollbackLines` Unlike gcc and clang, MSVC is fairly tame when it comes to removing code tainted by undefined behavior, so the most likely affect this had is that we were reading uninitialized memory. Related to #14129. (cherry picked from commit a798a60) Service-Card-Id: 86603221 Service-Version: 1.16
🎉 Handy links: |
🎉 Handy links: |
The following members were not initialized during construction:
CursorType _defaultCursorShape
bool _suppressApplicationTitle
bool _bracketedPasteMode
size_t _hyperlinkPatternId
SelectionExpansion _multiClickSelectionMode
til::CoordType _scrollbackLines
Unlike gcc and clang, MSVC is fairly tame when it comes to removing code
tainted by undefined behavior, so the most likely affect this had is that
we were reading uninitialized memory.
Related to #14129.