PresShell::HandleEvent() never initializes its "flags" variable

RESOLVED FIXED in mozilla26

Status

()

defect
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: dholbert, Assigned: billm)

Tracking

Trunk
mozilla26
x86_64
Linux
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Reporter

Description

6 years ago
Newish build warning, with GCC 4.8 on Linux:
{
layout/base/nsPresShell.cpp:6185:48: warning: 'flags' may be used uninitialized in this function [-Wmaybe-uninitialized]
}

This is from this change:
> +      uint32_t flags;
>        if (aEvent->message == NS_TOUCH_START) {
> +        flags |= INPUT_IGNORE_ROOT_SCROLL_FRAME;
http://hg.mozilla.org/mozilla-central/rev/8a68e032ca51#l1.12

from bug 901962 , which kats landed last week.

And the warning is very right, AFAICT -- we're declaring "flags", uninitialized, and then we start orring in some bits.

Presumably we should be declaring it as "uint32_t flags = 0;" right?
Reporter

Updated

6 years ago
Blocks: 904158
Posted patch uninit-flagsSplinter Review
Oddly, this causes scrollbars not to work in e10s.
Assignee: nobody → wmccloskey
Status: NEW → ASSIGNED
Attachment #793241 - Flags: review?(matt.woodrow)
Reporter

Updated

6 years ago
Blocks: 901962
No longer blocks: 904158
Attachment #793241 - Flags: review?(matt.woodrow) → review+
https://hg.mozilla.org/mozilla-central/rev/ce293f97be57
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
Good catch, thanks for the fix!
Uplift?
Comment on attachment 793241 [details] [diff] [review]
uninit-flags

[Approval Request Comment]
Bug caused by (feature/regressing bug #): bug 901962
User impact if declined: possibly random behaviour from an uninitialized variable
Testing completed (on m-c, etc.): on m-c
Risk to taking this patch (and alternatives if risky): very low risk
String or IDL/UUID changes made by this patch: none
Attachment #793241 - Flags: approval-mozilla-beta?
Comment on attachment 793241 [details] [diff] [review]
uninit-flags

We didn't end up approving bug 901962
Attachment #793241 - Flags: approval-mozilla-beta? → approval-mozilla-beta-
You need to log in before you can comment on or make changes to this bug.