Title: [161229] branches/jsCStack/Source/_javascript_Core
Revision
161229
Author
mark....@apple.com
Date
2014-01-02 14:43:57 -0800 (Thu, 02 Jan 2014)

Log Message

CStack: Interpreter::executeCall() should check for exceptions after calling callToNativeFunction().
https://bugs.webkit.org/show_bug.cgi?id=126405.

Not yet reviewed.

* interpreter/Interpreter.cpp:
(JSC::Interpreter::executeCall):
- executeCall() was expecting to return a non-null JSValue but neglected
  to check if an exception was thrown during a call to callToNativeFunction.
  We now check if an exception was thrown, and if so, we set the result to
  jsNull() the same way that JITCode::execute() does.

Modified Paths

Diff

Modified: branches/jsCStack/Source/_javascript_Core/ChangeLog (161228 => 161229)


--- branches/jsCStack/Source/_javascript_Core/ChangeLog	2014-01-02 22:35:58 UTC (rev 161228)
+++ branches/jsCStack/Source/_javascript_Core/ChangeLog	2014-01-02 22:43:57 UTC (rev 161229)
@@ -1,3 +1,17 @@
+2014-01-02  Mark Lam  <mark....@apple.com>
+
+        CStack: Interpreter::executeCall() should check for exceptions after calling callToNativeFunction().
+        https://bugs.webkit.org/show_bug.cgi?id=126405.
+
+        Not yet reviewed.
+
+        * interpreter/Interpreter.cpp:
+        (JSC::Interpreter::executeCall):
+        - executeCall() was expecting to return a non-null JSValue but neglected
+          to check if an exception was thrown during a call to callToNativeFunction.
+          We now check if an exception was thrown, and if so, we set the result to
+          jsNull() the same that JITCode::execute() does.
+
 2014-01-02  Filip Pizlo  <fpi...@apple.com>
 
         Address review feedback in https://bugs.webkit.org/show_bug.cgi?id=126387#c3

Modified: branches/jsCStack/Source/_javascript_Core/interpreter/Interpreter.cpp (161228 => 161229)


--- branches/jsCStack/Source/_javascript_Core/interpreter/Interpreter.cpp	2014-01-02 22:35:58 UTC (rev 161228)
+++ branches/jsCStack/Source/_javascript_Core/interpreter/Interpreter.cpp	2014-01-02 22:43:57 UTC (rev 161229)
@@ -966,8 +966,11 @@
         // Execute the code:
         if (isJSCall)
             result = callData.js.functionExecutable->generatedJITCodeForCall()->execute(&vm, &protoCallFrame);
-        else
+        else {
             result = JSValue::decode(callToNativeFunction(reinterpret_cast<void*>(callData.native.function), &vm, &protoCallFrame));
+            if (callFrame->hadException())
+                result = jsNull();
+        }
     }
 
     if (LegacyProfiler* profiler = vm.enabledProfiler())
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to