Closed
Bug 1082963
Opened 10 years ago
Closed 10 years ago
dist/include/ipc/nsGUIEventIPC.h:382:7: warning: variable 'isNull' is used uninitialized whenever '&&' condition is false [-Wsometimes-uninitialized]
Categories
(Core :: DOM: Events, defect)
Tracking
()
RESOLVED
FIXED
mozilla36
People
(Reporter: dholbert, Assigned: gyeh)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
968 bytes,
patch
|
smaug
:
review+
dholbert
:
feedback+
|
Details | Diff | Splinter Review |
New build warning: { dist/include/ipc/nsGUIEventIPC.h:382:7: warning: variable 'isNull' is used uninitialized whenever '&&' condition is false [-Wsometimes-uninitialized] bool isNull; ^ } This is generated code, which looks like this: static bool Read(const Message* aMsg, void** aIter, paramType* aResult) { bool isNull; bool value; bool rv = ReadParam(aMsg, aIter, static_cast<mozilla::WidgetKeyboardEvent*>(aResult)) && ReadParam(aMsg, aIter, &isNull) && ReadParam(aMsg, aIter, &value); aResult->mEmbeddedCancelled = Nullable<bool>(); if (!isNull) { aResult->mEmbeddedCancelled.SetValue(value); } return rv; } The source for this code was added here, in bug 989198: https://hg.mozilla.org/mozilla-central/rev/186743fc6f6d#l4.23 Basically, we need to be checking whether "rv" is true, before we read "isNull". If rv is false, then we might have failed the first ReadParam call, which means we should definitely not be reading isNull.
Reporter | ||
Updated•10 years ago
|
Flags: needinfo?(gyeh)
Assignee | ||
Comment 1•10 years ago
|
||
Good catch, Daniel ;) Let me fix it today. Thanks.
Flags: needinfo?(gyeh)
Assignee | ||
Updated•10 years ago
|
Assignee: nobody → gyeh
Assignee | ||
Comment 2•10 years ago
|
||
Assignee | ||
Comment 3•10 years ago
|
||
Comment on attachment 8505264 [details] [diff] [review] Patch 1(v1): Check rv before reading isNull As Daniel described in bug description, we should check the return value of function ReadParam() before reading the resulted value.
Attachment #8505264 -
Flags: review?(bugs)
Attachment #8505264 -
Flags: feedback?(dholbert)
Reporter | ||
Comment 4•10 years ago
|
||
Comment on attachment 8505264 [details] [diff] [review] Patch 1(v1): Check rv before reading isNull Thanks for the quick turnaround! This seems reasonable to me, and I verified that this makes clang++ satisfied such that it no longer warns about this.
Attachment #8505264 -
Flags: feedback?(dholbert) → feedback+
Updated•10 years ago
|
Attachment #8505264 -
Flags: review?(bugs) → review+
Assignee | ||
Comment 5•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/a7c972407578
Comment 6•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/a7c972407578
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
Comment 7•10 years ago
|
||
Bug 989198 was backed out. Please remember to include this fix when it re-lands.
You need to log in
before you can comment on or make changes to this bug.
Description
•