Closed Bug 1340835 Opened 3 years ago Closed 3 years ago

uninitialized variables in nsMsgSearchValidityTable::ValidateTerms

Categories

(MailNews Core :: Search, defect)

x86_64
Linux
defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 54.0

People

(Reporter: aceman, Assigned: aceman)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Gcc 5 thinks some variables in nsMsgSearchValidityTable::ValidateTerms() may be used uninitialized:

mailnews/base/search/src/nsMsgSearchAdapter.cpp: In member function ‘virtual nsresult nsMsgSearchValidityTable::ValidateTerms(nsIArray*)’:
mailnews/base/search/src/nsMsgSearchAdapter.cpp:840:18: warning: ‘enabled’ may be used uninitialized in this function [-Wmaybe-uninitialized]
     if (!enabled || !available)
                  ^
mailnews/base/search/src/nsMsgSearchAdapter.cpp:840:18: warning: ‘available’ may be used uninitialized in this function [-Wmaybe-uninitialized]
mailnews/base/search/src/nsMsgSearchAdapter.cpp:845:13: warning: ‘validNotShown’ may be used uninitialized in this function [-Wmaybe-uninitialized]
             if (!validNotShown)
             ^

Some of the last compile warnings in mailnews. May hit us in the future when all warnings become errors.
Attached patch patchSplinter Review
Do not access the variables if their setting functions failed.

Try run: https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=71eae703822eae0a188e39f9f96fdf3c3c04b45c
Attachment #8838896 - Flags: review?(rkent)
Comment on attachment 8838896 [details] [diff] [review]
patch

Review of attachment 8838896 [details] [diff] [review]:
-----------------------------------------------------------------

LGTM
Attachment #8838896 - Flags: review?(rkent) → review+
Thanks.
Keywords: checkin-needed
https://hg.mozilla.org/comm-central/rev/4bcbe883f3f2a5bb6f58943a30d95ba37041c934
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 54.0
You need to log in before you can comment on or make changes to this bug.