Bug 1308057 - retvals should start null, and missing return. - r=ethlin a=gchang
authorJeff Gilbert (:jgilbert) <jgilbert@mozilla.com>
Fri, 30 Sep 2016 14:09:12 -0700
changeset 352950 7b600647e5297aedc06669469f9ea8c1dba52769
parent 352949 c8944ebd2973928a27af69c3caa2ab95445b3406
child 352951 e7f109a5724bdcc473e6350bcb0f54c023c99334
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersethlin, gchang
bugs1308057
milestone52.0a2
Bug 1308057 - retvals should start null, and missing return. - r=ethlin a=gchang 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) {