Bug 211354 - Use default initializers and default constructors in WebEvent.h
Summary: Use default initializers and default constructors in WebEvent.h
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: David Kilzer (:ddkilzer)
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-05-03 10:56 PDT by David Kilzer (:ddkilzer)
Modified: 2020-05-03 14:43 PDT (History)
4 users (show)

See Also:


Attachments
Patch v1 (4.65 KB, patch)
2020-05-03 11:01 PDT, David Kilzer (:ddkilzer)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Kilzer (:ddkilzer) 2020-05-03 10:56:10 PDT
Use default initializers and default constructors in WebEvent.h.

Initially found by the clang static analyzer:

class WebPlatformTouchPoint {

    WebPlatformTouchPoint() { }
        ← 2 uninitialized fields at the end of the constructor call

private:
    unsigned m_identifier;
             ^ uninitialized field 'this->m_identifier'
    WebCore::IntPoint m_location;
    uint32_t m_phase;
             ^ uninitialized field 'this->m_phase'

};
Comment 1 David Kilzer (:ddkilzer) 2020-05-03 11:01:11 PDT
Created attachment 398321 [details]
Patch v1
Comment 2 Daniel Bates 2020-05-03 12:02:34 PDT
Comment on attachment 398321 [details]
Patch v1

Patch looks good. A good future investigation is to identify if the default constructors are needed. If not, remove them and look for ways to reduce default initializers to minimum set because they have a cost.
Comment 3 EWS 2020-05-03 14:42:28 PDT
Committed r261066: <https://trac.webkit.org/changeset/261066>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 398321 [details].
Comment 4 Radar WebKit Bug Importer 2020-05-03 14:43:16 PDT
<rdar://problem/62816793>