Add missing scope release to functionProtoFuncToString
authorkeith_miller@apple.com <keith_miller@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Apr 2018 20:31:25 +0000 (20:31 +0000)
committerkeith_miller@apple.com <keith_miller@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Apr 2018 20:31:25 +0000 (20:31 +0000)
https://bugs.webkit.org/show_bug.cgi?id=184995

Reviewed by Saam Barati.

JSTests:

* stress/function-toString-arrow.js: Added.
(async):

Source/JavaScriptCore:

* runtime/FunctionPrototype.cpp:
(JSC::functionProtoFuncToString):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231015 268f45cc-cd09-0410-ab3c-d52691b4dbfc

JSTests/ChangeLog
JSTests/stress/function-toString-arrow.js [new file with mode: 0644]
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/FunctionPrototype.cpp

index 6629c69..61dbcbf 100644 (file)
@@ -1,3 +1,13 @@
+2018-04-25  Keith Miller  <keith_miller@apple.com>
+
+        Add missing scope release to functionProtoFuncToString
+        https://bugs.webkit.org/show_bug.cgi?id=184995
+
+        Reviewed by Saam Barati.
+
+        * stress/function-toString-arrow.js: Added.
+        (async):
+
 2018-04-24  Keith Miller  <keith_miller@apple.com>
 
         fromCharCode is missing some exception checks
diff --git a/JSTests/stress/function-toString-arrow.js b/JSTests/stress/function-toString-arrow.js
new file mode 100644 (file)
index 0000000..9a0f7d3
--- /dev/null
@@ -0,0 +1 @@
+(async () => {}).toString();
index a1437ce..6431338 100644 (file)
@@ -1,3 +1,13 @@
+2018-04-25  Keith Miller  <keith_miller@apple.com>
+
+        Add missing scope release to functionProtoFuncToString
+        https://bugs.webkit.org/show_bug.cgi?id=184995
+
+        Reviewed by Saam Barati.
+
+        * runtime/FunctionPrototype.cpp:
+        (JSC::functionProtoFuncToString):
+
 2018-04-25  Yusuke Suzuki  <utatane.tea@gmail.com>
 
         REGRESSION(r230748) [GTK][ARM] no matching function for call to 'JSC::CCallHelpers::swap(JSC::ARMRegisters::FPRegisterID&, JSC::ARMRegisters::FPRegisterID&)'
index 7ca6923..a39539b 100644 (file)
@@ -104,6 +104,7 @@ EncodedJSValue JSC_HOST_CALL functionProtoFuncToString(ExecState* exec)
             StringView source = executable->source().provider()->getRange(
                 executable->parametersStartOffset(),
                 executable->parametersStartOffset() + executable->source().length());
+            scope.release();
             return JSValue::encode(jsMakeNontrivialString(exec, functionHeader, function->name(vm), source));
         }