Closed
Bug 1601103
Opened 5 years ago
Closed 5 years ago
Enable clang-tidy's cppcoreguidelines-pro-type-member-init
Categories
(Developer Infrastructure :: Source Code Analysis, enhancement)
Developer Infrastructure
Source Code Analysis
Tracking
(firefox73 fixed)
RESOLVED
FIXED
mozilla73
Tracking | Status | |
---|---|---|
firefox73 | --- | fixed |
People
(Reporter: jgilbert, Assigned: jgilbert)
Details
Attachments
(1 file)
This would have caught a bug for me.
Assignee | ||
Updated•5 years ago
|
Component: Lint and Formatting → Source Code Analysis
Assignee | ||
Comment 1•5 years ago
|
||
Comment 2•5 years ago
|
||
Many thanks for doing that!
I am curious, which bug it would have caught?
FYI, we have 1180 occurrences of this issue in our code base.
Flags: needinfo?(jgilbert)
Assignee | ||
Comment 3•5 years ago
•
|
||
More or less:
class WebGLContext {
bool mOptionsFrozen;
};
WebGLContext::WebGLContext() {
[...] // many lines
mOptionsFrozen = false; // This line removed by refactor
}
bool WebGLContext::EnsureDefaultFB() {
if (!Resize(mRequestedSize)) {
if (mOptionsFrozen) { // ASAN generates cryptic "unusual bool value" crash here
LoseContext();
}
return false;
}
return true;
}
I did debate myself on what reliability
to give this, and settled on high
, but I can be talked down to medium
.
This is a common thing we do in our C++03-era code, but that we should really stop doing. It's not a huge foot-gun when first writing code, but it's a definite tripwire for refactors.
After landing this I intend to yak-shave all the instances from my modules out.
Flags: needinfo?(jgilbert)
Assignee | ||
Comment 4•5 years ago
|
||
Pushed by jgilbert@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/584510e57b7b
Enable clang-tidy's cppcoreguidelines-pro-type-member-init. r=andi
Comment 6•5 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 5 years ago
status-firefox73:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla73
Updated•3 years ago
|
Product: Firefox Build System → Developer Infrastructure
You need to log in
before you can comment on or make changes to this bug.
Description
•