Bug 919781 - Fix use of uninitialized cx introduced by bug 917798 r=sfink
authorJon Coppeard <jcoppeard@mozilla.com>
Thu, 26 Sep 2013 16:02:16 +0100
changeset 162635 6c62cd976bba90c89a0917b10ef3e3d8ec6984fb
parent 162634 3055b4a7824574a663eaca20b4d9b8b1d4985b66
child 162636 63db6c5e2b7a9552b68b57ba37a2e38bf106a05c
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink
bugs919781, 917798
milestone27.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 919781 - Fix use of uninitialized cx introduced by bug 917798 r=sfink
js/jsd/jsd_stak.cpp
--- a/js/jsd/jsd_stak.cpp
+++ b/js/jsd/jsd_stak.cpp
@@ -539,21 +539,20 @@ static JSContext*
         return jsdthreadstate->context;
     return nullptr;
 }
 
 JSDValue*
 jsd_GetException(JSDContext* jsdc, JSDThreadState* jsdthreadstate)
 {
     JSContext* cx;
-    JS::RootedValue val(cx);
-
     if(!(cx = _getContextForThreadState(jsdc, jsdthreadstate)))
         return nullptr;
 
+    JS::RootedValue val(cx);
     if(JS_GetPendingException(cx, &val))
         return jsd_NewValue(jsdc, val);
     return nullptr;
 }
 
 bool
 jsd_SetException(JSDContext* jsdc, JSDThreadState* jsdthreadstate,
                  JSDValue* jsdval)