Bug 1308057 - retvals should start null, and missing return. - r=ethlin
authorJeff Gilbert (:jgilbert) <jgilbert@mozilla.com>
Fri, 30 Sep 2016 14:09:12 -0700
changeset 367481 e8992921aab56ad2a02ea5c1f383c629b9aa0250
parent 367480 7bba645e82e80f590d8d2cccd315c693117d59b1
child 367482 0d8ce263df30cb6942f574c142e770ed6ab99b0c
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersethlin
bugs1308057
milestone52.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1308057 - retvals should start null, and missing return. - r=ethlin MozReview-Commit-ID: FEOoKQBy7Hk
dom/canvas/WebGLExtensionDisjointTimerQuery.cpp
--- a/dom/canvas/WebGLExtensionDisjointTimerQuery.cpp
+++ b/dom/canvas/WebGLExtensionDisjointTimerQuery.cpp
@@ -144,16 +144,17 @@ WebGLExtensionDisjointTimerQuery::QueryC
     query->QueueAvailablity();
 }
 
 void
 WebGLExtensionDisjointTimerQuery::GetQueryEXT(JSContext* cx, GLenum target,
                                               GLenum pname,
                                               JS::MutableHandle<JS::Value> retval)
 {
+    retval.setNull();
     if (mIsLost)
         return;
 
     mContext->MakeContextCurrent();
     switch (pname) {
     case LOCAL_GL_CURRENT_QUERY_EXT:
         if (target != LOCAL_GL_TIME_ELAPSED_EXT) {
             mContext->ErrorInvalidEnumInfo("getQueryEXT: Invalid query target.",
@@ -195,25 +196,27 @@ WebGLExtensionDisjointTimerQuery::GetQue
 }
 
 void
 WebGLExtensionDisjointTimerQuery::GetQueryObjectEXT(JSContext* cx,
                                                     WebGLTimerQuery* query,
                                                     GLenum pname,
                                                     JS::MutableHandle<JS::Value> retval)
 {
+    retval.setNull();
     if (mIsLost)
         return;
 
     if (!mContext->ValidateObject("getQueryObjectEXT", query))
         return;
 
     if (query == mActiveQuery.get()) {
         mContext->ErrorInvalidOperation("getQueryObjectEXT: Query must not be"
                                         " active.");
+        return;
     }
 
     mContext->MakeContextCurrent();
     // XXX: Note that the query result *may change* within the same task!
     // This does not follow the specification, which states that all calls
     // checking query results must return the same value until the event loop
     // is empty.
     switch (pname) {