Last Comment Bug 777191 - Fix warning about uninitialized variable in DefineIDBInterfaceConstants()
: Fix warning about uninitialized variable in DefineIDBInterfaceConstants()
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: DOM: IndexedDB (show other bugs)
: Trunk
: ARM Android
: -- normal (vote)
: mozilla17
Assigned To: Chris Peterson [:cpeterson]
:
Mentors:
Depends on: 735094
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-24 18:07 PDT by Chris Peterson [:cpeterson]
Modified: 2012-07-25 08:09 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
affected
affected
affected
fixed


Attachments
fix-uninitialized-interface-warning.patch (986 bytes, patch)
2012-07-24 18:07 PDT, Chris Peterson [:cpeterson]
khuey: review+
Details | Diff | Splinter Review

Description Chris Peterson [:cpeterson] 2012-07-24 18:07:58 PDT
Created attachment 645610 [details] [diff] [review]
fix-uninitialized-interface-warning.patch

mozilla/central/dom/base/nsDOMClassInfo.cpp: In function 'nsresult DefineIDBInterfaceConstants(JSContext*, JSObject*, const nsIID*)':
mozilla/central/dom/base/nsDOMClassInfo.cpp:6013: warning: 'interface' may be used uninitialized in this function
Comment 1 Kyle Huey [:khuey] (khuey@mozilla.com) 2012-07-24 18:09:29 PDT
Does that actually fix the warning?  Is GCC smart enough to realize that MOZ_NOT_REACHED doesn't return?  What about in opt builds?
Comment 2 Chris Peterson [:cpeterson] 2012-07-24 18:18:19 PDT
This patch fixes the warning for my local --enable-optimize build.

MOZ_NOT_REACHED is not a nop in opt builds. It calls __builtin_unreachable() or abort(), depending on your compiler.
Comment 3 Kyle Huey [:khuey] (khuey@mozilla.com) 2012-07-24 18:31:32 PDT
Ah, it's different than NS_NOTREACHED then.

/me grumbles about having all these different things.
Comment 4 Kyle Huey [:khuey] (khuey@mozilla.com) 2012-07-24 18:31:46 PDT
Comment on attachment 645610 [details] [diff] [review]
fix-uninitialized-interface-warning.patch

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

::: dom/base/nsDOMClassInfo.cpp
@@ +6005,5 @@
>      interface = IDBConstant::IDBRequest;
>    }
>    else if (aIID->Equals(NS_GET_IID(nsIIDBTransaction))) {
>      interface = IDBConstant::IDBTransaction;
> +  } else {

}
else {
Comment 5 Chris Peterson [:cpeterson] 2012-07-24 21:23:02 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/6ff0749529a6
Comment 6 Ed Morley [:emorley] 2012-07-25 08:09:53 PDT
https://hg.mozilla.org/mozilla-central/rev/6ff0749529a6

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