Bug 1248584 - assert firstMonitorStub_ in ICMonitoredStub in order to silence Coverity. r=jandem
authorBogdan Postelnicu <bogdan.postelnicu@softvision.ro>
Tue, 16 Feb 2016 16:23:32 +0200
changeset 331623 1594c41619ffbb23ef02de913fc96236d516cac5
parent 331622 22d0921df35a835486e42e258487bcb1d82567af
child 331624 d320678c4fab4b2fad3f71c11b6e148600172316
push id11020
push userjolesen@mozilla.com
push dateWed, 17 Feb 2016 18:16:38 +0000
reviewersjandem
bugs1248584
milestone47.0a1
Bug 1248584 - assert firstMonitorStub_ in ICMonitoredStub in order to silence Coverity. r=jandem MozReview-Commit-ID: 4hSpodphJL9
js/src/jit/SharedIC.cpp
--- a/js/src/jit/SharedIC.cpp
+++ b/js/src/jit/SharedIC.cpp
@@ -669,16 +669,18 @@ ICTypeMonitor_Fallback::resetMonitorStub
         lastMonitorStubPtrAddr_ = icEntry_->addressOfFirstStub();
     }
 }
 
 ICMonitoredStub::ICMonitoredStub(Kind kind, JitCode* stubCode, ICStub* firstMonitorStub)
   : ICStub(kind, ICStub::Monitored, stubCode),
     firstMonitorStub_(firstMonitorStub)
 {
+    // In order to silence Coverity - null pointer dereference checker
+    MOZ_ASSERT(firstMonitorStub_);
     // If the first monitored stub is a ICTypeMonitor_Fallback stub, then
     // double check that _its_ firstMonitorStub is the same as this one.
     MOZ_ASSERT_IF(firstMonitorStub_->isTypeMonitor_Fallback(),
                   firstMonitorStub_->toTypeMonitor_Fallback()->firstMonitorStub() ==
                      firstMonitorStub_);
 }
 
 bool