Closed
Bug 1302442
Opened 10 years ago
Closed 9 years ago
[Static Analysis][Uninitialized scalar field] In Codegen.py
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla52
| Tracking | Status | |
|---|---|---|
| firefox51 | --- | fix-optional |
| firefox52 | --- | fixed |
People
(Reporter: andi, Assigned: andi)
References
(Blocks 1 open bug)
Details
(Keywords: coverity, Whiteboard: CID 1372681, CID 1372682, CID 1372683, CID 1372684, CID 1372685, CID 1372686, CID 1372688, CID 1372689, CID 1372690)
Attachments
(1 file)
The Static Analysis tool Coverity detected that there are many uninitialised member variables in classes generated through Codegen.py. For example in SubleCryptoBinding.h:
>>struct RsaPssParams : public Algorithm
>>{
>> uint32_t mSaltLength;
>>
>> RsaPssParams();
>>
>> explicit inline RsaPssParams(const FastDictionaryInitializer& )
>> : Algorithm(FastDictionaryInitializer())
>> {
>> // Do nothing here; this is used by our "Fast" subclass
>> }
We should eliminate from scanning these variables by modifying Codegen.py that for each member variable to add annotation: MOZ_INIT_OUTSIDE_CTOR
| Comment hidden (mozreview-request) |
Comment 2•10 years ago
|
||
Or we can initialize them in the CTOR.
Updated•10 years ago
|
Attachment #8790749 -
Flags: review?(amarchesini) → review?(peterv)
| Assignee | ||
Comment 3•10 years ago
|
||
(In reply to Andrea Marchesini [:baku] from comment #2)
> Or we can initialize them in the CTOR.
I think that's a little bit harder since we don't know the type of the variable only its literal type name.
Comment 4•9 years ago
|
||
| mozreview-review | ||
Comment on attachment 8790749 [details]
Bug 1302442 - Add ignore-initialization-check annotation to class member variables constructed by Codegen.
https://reviewboard.mozilla.org/r/78430/#review78220
You need to change the ClassMember constructor to take a bool that signals whether to add this annotation. Prefixing the type makes the type member incorrect.
Attachment #8790749 -
Flags: review?(peterv) → review-
| Comment hidden (mozreview-request) |
Comment 6•9 years ago
|
||
| mozreview-review | ||
Comment on attachment 8790749 [details]
Bug 1302442 - Add ignore-initialization-check annotation to class member variables constructed by Codegen.
https://reviewboard.mozilla.org/r/78430/#review79238
Attachment #8790749 -
Flags: review?(peterv) → review+
Pushed by bpostelnicu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d28809f3b445
Add ignore-initialization-check annotation to class member variables constructed by Codegen. r=peterv
Comment 8•9 years ago
|
||
| bugherder | ||
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox52:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
Comment 9•9 years ago
|
||
Mark 51 as fix-optional. If it's worth uplifting to 51, feel free to nominate it.
Updated•7 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•