Using Option::breakOnThrow() shouldn't crash while printing a null CodeBlock.
authormark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Dec 2016 19:45:46 +0000 (19:45 +0000)
committermark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Dec 2016 19:45:46 +0000 (19:45 +0000)
https://bugs.webkit.org/show_bug.cgi?id=166466

Reviewed by Keith Miller.

* runtime/VM.cpp:
(JSC::VM::throwException):

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

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/VM.cpp

index a8e82c8..b7d4161 100644 (file)
@@ -1,5 +1,15 @@
 2016-12-23  Mark Lam  <mark.lam@apple.com>
 
+        Using Option::breakOnThrow() shouldn't crash while printing a null CodeBlock.
+        https://bugs.webkit.org/show_bug.cgi?id=166466
+
+        Reviewed by Keith Miller.
+
+        * runtime/VM.cpp:
+        (JSC::VM::throwException):
+
+2016-12-23  Mark Lam  <mark.lam@apple.com>
+
         Enhance LLInt tracing to dump the codeBlock signature instead of just a pointer where appropriate.
         https://bugs.webkit.org/show_bug.cgi?id=166465
 
index 213fcae..6e8f0b2 100644 (file)
@@ -595,7 +595,12 @@ void VM::clearSourceProviderCaches()
 void VM::throwException(ExecState* exec, Exception* exception)
 {
     if (Options::breakOnThrow()) {
-        dataLog("In call frame ", RawPointer(exec), " for code block ", *exec->codeBlock(), "\n");
+        CodeBlock* codeBlock = exec->codeBlock();
+        dataLog("Throwing exception in call frame ", RawPointer(exec), " for code block ");
+        if (codeBlock)
+            dataLog(*codeBlock, "\n");
+        else
+            dataLog("<nullptr>\n");
         CRASH();
     }