Bug 919781 - Fix use of uninitialized cx introduced by bug 917798 r=sfink

This commit is contained in:
Jon Coppeard 2013-09-26 16:02:16 +01:00
parent d94c4d06d8
commit cf010d389f

View File

@ -544,11 +544,10 @@ JSDValue*
jsd_GetException(JSDContext* jsdc, JSDThreadState* jsdthreadstate) jsd_GetException(JSDContext* jsdc, JSDThreadState* jsdthreadstate)
{ {
JSContext* cx; JSContext* cx;
JS::RootedValue val(cx);
if(!(cx = _getContextForThreadState(jsdc, jsdthreadstate))) if(!(cx = _getContextForThreadState(jsdc, jsdthreadstate)))
return nullptr; return nullptr;
JS::RootedValue val(cx);
if(JS_GetPendingException(cx, &val)) if(JS_GetPendingException(cx, &val))
return jsd_NewValue(jsdc, val); return jsd_NewValue(jsdc, val);
return nullptr; return nullptr;