Bug 801344 - Make sure that JSRuntime::initSelfHosting never returns an uninitialized value; r=till
authorEhsan Akhgari <ehsan@mozilla.com>
Sun, 14 Oct 2012 11:12:03 -0400
changeset 110358 43f597d00b4bc7e8ff0083ea5f222bf8d8e5858e
parent 110357 e3239845f9d2222b5e385247ba19eefecc5ad2ae
child 110359 779b6ddfb11838873084b8f79ff01cfbf232c399
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewerstill
bugs801344
milestone19.0a1
Bug 801344 - Make sure that JSRuntime::initSelfHosting never returns an uninitialized value; r=till
js/src/jscntxt.cpp
--- a/js/src/jscntxt.cpp
+++ b/js/src/jscntxt.cpp
@@ -349,17 +349,17 @@ JSRuntime::initSelfHosting(JSContext *cx
 
     /*
      * Set a temporary error reporter printing to stderr because it is too
      * early in the startup process for any other reporter to be registered
      * and we don't want errors in self-hosted code to be silently swallowed.
      */
     JSErrorReporter oldReporter = JS_SetErrorReporter(cx, selfHosting_ErrorReporter);
     Value rv;
-    bool ok;
+    bool ok = false;
 
     char *filename = getenv("MOZ_SELFHOSTEDJS");
     if (filename) {
         RootedScript script(cx, Compile(cx, shg, options, filename));
         if (script)
             ok = Execute(cx, script, *shg.get(), &rv);
     } else {
         const char *src = selfhosted::raw_sources;