Bug 1246054 - Fix an erroneous nsNPObjWrapper assertion. r=froydnj. a=al
authorNicholas Nethercote <nnethercote@mozilla.com>
Fri, 05 Feb 2016 16:36:05 +1100
changeset 312975 f0d2911a9a4e
parent 312974 f0641ff126c2
child 312976 cb8ee60c69f4
push id1040
push userraliiev@mozilla.com
push date2016-02-29 17:11 +0000
treeherdermozilla-release@8c3167321162 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj, al
bugs1246054
milestone45.0
Bug 1246054 - Fix an erroneous nsNPObjWrapper assertion. r=froydnj. a=al
dom/plugins/base/nsJSNPRuntime.cpp
--- a/dom/plugins/base/nsJSNPRuntime.cpp
+++ b/dom/plugins/base/nsJSNPRuntime.cpp
@@ -1932,18 +1932,19 @@ nsNPObjWrapper::GetNewOrUsed(NPP npp, JS
   // No existing JSObject, create one.
 
   JS::Rooted<JSObject*> obj(cx, ::JS_NewObject(cx, js::Jsvalify(&sNPObjectJSWrapperClass)));
 
   if (generation != sNPObjWrappers->Generation()) {
       // Reload entry if the JS_NewObject call caused a GC and reallocated
       // the table (see bug 445229). This is guaranteed to succeed.
 
-      NS_ASSERTION(sNPObjWrappers->Search(npobj),
-                   "Hashtable didn't find what we just added?");
+      entry =
+         static_cast<NPObjWrapperHashEntry*>(sNPObjWrappers->Search(npobj));
+      NS_ASSERTION(entry, "Hashtable didn't find what we just added?");
   }
 
   if (!obj) {
     // OOM? Remove the stale entry from the hash.
 
     sNPObjWrappers->RawRemove(entry);
 
     return nullptr;