Bug 1248584 - assert firstMonitorStub_ in ICMonitoredStub in order to silence Coverity. r?jandem draft
authorBogdan Postelnicu <bogdan.postelnicu@softvision.ro>
Tue, 16 Feb 2016 16:23:32 +0200
changeset 331238 c9b53332083e78246c1a836bf9ade76a4a0bd040
parent 331237 6ea654cad929c9bedd8a4161a182b6189fbeae6a
child 514338 48aa226ff4a7ad439da5d1bbf268563482b6df35
push id10938
push userBogdan.Postelnicu@softvision.ro
push dateTue, 16 Feb 2016 15:52:05 +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