Last Comment Bug 777792 - Uninitialized variable in ParamTraits<nsMouseEvent>::Read
: Uninitialized variable in ParamTraits<nsMouseEvent>::Read
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Widget (show other bugs)
: Trunk
: x86_64 Linux
: -- normal (vote)
: mozilla17
Assigned To: :Ehsan Akhgari (busy, don't ask for review please)
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-26 10:53 PDT by :Ehsan Akhgari (busy, don't ask for review please)
Modified: 2012-07-27 09:00 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch (v1) (1.02 KB, patch)
2012-07-26 10:54 PDT, :Ehsan Akhgari (busy, don't ask for review please)
cjones.bugs: review+
Details | Diff | Review

Description :Ehsan Akhgari (busy, don't ask for review please) 2012-07-26 10:53:23 PDT
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.
Comment 1 :Ehsan Akhgari (busy, don't ask for review please) 2012-07-26 10:54:37 PDT
Created attachment 646212 [details] [diff] [review]
Patch (v1)
Comment 2 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-07-26 11:29:46 PDT
Comment on attachment 646212 [details] [diff] [review]
Patch (v1)

r+ for the same reason, to make the warnings shut up.
Comment 3 :Ehsan Akhgari (busy, don't ask for review please) 2012-07-26 12:25:33 PDT
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
Comment 4 :Ehsan Akhgari (busy, don't ask for review please) 2012-07-27 09:00:35 PDT
https://hg.mozilla.org/mozilla-central/rev/46ea45da584e

Note You need to log in before you can comment on or make changes to this bug.