The default bug view has changed. See this FAQ.

Uninitialized variable in ParamTraits<nsMouseEvent>::Read

RESOLVED FIXED in mozilla17

Status

()

Core
Widget
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: Ehsan, Assigned: Ehsan)

Tracking

Trunk
mozilla17
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
Similar to bug 777734.

../../dist/include/IPC/nsGUIEventIPC.h:140:10: warning: variable 'exit' is used uninitialized whenever '&&' condition is false
      [-Wsometimes-uninitialized]
    rv = ReadParam(aMsg, aIter, static_cast<nsMouseEvent_base*>(aResult)) &&
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../dist/include/IPC/nsGUIEventIPC.h:148:57: note: uninitialized use occurs here
    aResult->exit = static_cast<nsMouseEvent::exitType>(exit);
                                                        ^~~~
../../dist/include/IPC/nsGUIEventIPC.h:140:10: note: remove the '&&' if its condition is always true
    rv = ReadParam(aMsg, aIter, static_cast<nsMouseEvent_base*>(aResult)) &&
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../dist/include/IPC/nsGUIEventIPC.h:140:10: warning: variable 'exit' is used uninitialized whenever '&&' condition is false
      [-Wsometimes-uninitialized]
    rv = ReadParam(aMsg, aIter, static_cast<nsMouseEvent_base*>(aResult)) &&
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../dist/include/IPC/nsGUIEventIPC.h:148:57: note: uninitialized use occurs here
    aResult->exit = static_cast<nsMouseEvent::exitType>(exit);
                                                        ^~~~
../../dist/include/IPC/nsGUIEventIPC.h:140:10: note: remove the '&&' if its condition is always true
    rv = ReadParam(aMsg, aIter, static_cast<nsMouseEvent_base*>(aResult)) &&
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../dist/include/IPC/nsGUIEventIPC.h:140:10: warning: variable 'exit' is used uninitialized whenever '&&' condition is false
      [-Wsometimes-uninitialized]
    rv = ReadParam(aMsg, aIter, static_cast<nsMouseEvent_base*>(aResult)) &&
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../dist/include/IPC/nsGUIEventIPC.h:148:57: note: uninitialized use occurs here
    aResult->exit = static_cast<nsMouseEvent::exitType>(exit);
                                                        ^~~~
../../dist/include/IPC/nsGUIEventIPC.h:140:10: note: remove the '&&' if its condition is always true
    rv = ReadParam(aMsg, aIter, static_cast<nsMouseEvent_base*>(aResult)) &&
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../dist/include/IPC/nsGUIEventIPC.h:140:10: warning: variable 'exit' is used uninitialized whenever '&&' condition is false
      [-Wsometimes-uninitialized]
    rv = ReadParam(aMsg, aIter, static_cast<nsMouseEvent_base*>(aResult)) &&
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../dist/include/IPC/nsGUIEventIPC.h:148:57: note: uninitialized use occurs here
    aResult->exit = static_cast<nsMouseEvent::exitType>(exit);
                                                        ^~~~
../../dist/include/IPC/nsGUIEventIPC.h:140:10: note: remove the '&&' if its condition is always true
    rv = ReadParam(aMsg, aIter, static_cast<nsMouseEvent_base*>(aResult)) &&
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../dist/include/IPC/nsGUIEventIPC.h:139:34: note: initialize the variable 'exit' to silence this warning
    PRUint8 reason, context, exit;
                                 ^
                                  = '\0'

Same for reason and context.
(Assignee)

Comment 1

5 years ago
Created attachment 646212 [details] [diff] [review]
Patch (v1)
Assignee: nobody → ehsan
Status: NEW → ASSIGNED
Attachment #646212 - Flags: review?(jones.chris.g)
Comment on attachment 646212 [details] [diff] [review]
Patch (v1)

r+ for the same reason, to make the warnings shut up.
Attachment #646212 - Flags: review?(jones.chris.g) → review+
(Assignee)

Comment 3

5 years ago
Landed first with the wrong bug #:

https://hg.mozilla.org/integration/mozilla-inbound/rev/3077d21f177b

Then backed it out:

https://hg.mozilla.org/integration/mozilla-inbound/rev/6b4f10c6d5e2

And relanded with the correct bug number:

https://hg.mozilla.org/integration/mozilla-inbound/rev/46ea45da584e
Target Milestone: --- → mozilla17
(Assignee)

Comment 4

5 years ago
https://hg.mozilla.org/mozilla-central/rev/46ea45da584e
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.