Bug 1415086 - Fixing a out-of-scope issue for a string in Worklet code, r=qdot
authorAndrea Marchesini <amarchesini@mozilla.com>
Wed, 08 Nov 2017 00:58:11 +0100
changeset 443868 90a7bc300af375c80574266857e3ce46c30c6697
parent 443867 23f86a1ac424051004163f370b80d7b7bc5a35dd
child 443953 891b6831d29bdfc80fc14434185bfd7c975e45dd
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersqdot
bugs1415086
milestone58.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 1415086 - Fixing a out-of-scope issue for a string in Worklet code, r=qdot
dom/worklet/Worklet.cpp
--- a/dom/worklet/Worklet.cpp
+++ b/dom/worklet/Worklet.cpp
@@ -196,19 +196,21 @@ public:
 
     AutoEntryScript aes(globalScope, "Worklet");
     JSContext* cx = aes.cx();
 
     JS::Rooted<JSObject*> globalObj(cx, globalScope->GetGlobalJSObject());
 
     (void) new XPCWrappedNativeScope(cx, globalObj);
 
+    NS_ConvertUTF16toUTF8 url(mURL);
+
     JS::CompileOptions compileOptions(cx);
     compileOptions.setIntroductionType("Worklet");
-    compileOptions.setFileAndLine(NS_ConvertUTF16toUTF8(mURL).get(), 0);
+    compileOptions.setFileAndLine(url.get(), 0);
     compileOptions.setVersion(JSVERSION_DEFAULT);
     compileOptions.setIsRunOnce(true);
     compileOptions.setNoScriptRval(true);
 
     JSAutoCompartment comp(cx, globalObj);
 
     JS::Rooted<JS::Value> unused(cx);
     if (!JS::Evaluate(cx, compileOptions, buffer, &unused)) {