Title: [171108] trunk/Source/_javascript_Core
Revision
171108
Author
mhahnenb...@apple.com
Date
2014-07-15 12:11:57 -0700 (Tue, 15 Jul 2014)

Log Message

ScriptExecutable::forEachCodeBlock can dereference null CodeBlocks
https://bugs.webkit.org/show_bug.cgi?id=134928

Reviewed by Andreas Kling.

* bytecode/CodeBlock.h:
(JSC::ScriptExecutable::forEachCodeBlock): Check for null CodeBlocks before calling forEachRelatedCodeBlock.

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (171107 => 171108)


--- trunk/Source/_javascript_Core/ChangeLog	2014-07-15 18:34:35 UTC (rev 171107)
+++ trunk/Source/_javascript_Core/ChangeLog	2014-07-15 19:11:57 UTC (rev 171108)
@@ -1,3 +1,13 @@
+2014-07-15  Mark Hahnenberg  <mhahnenb...@apple.com>
+
+        ScriptExecutable::forEachCodeBlock can dereference null CodeBlocks
+        https://bugs.webkit.org/show_bug.cgi?id=134928
+
+        Reviewed by Andreas Kling.
+
+        * bytecode/CodeBlock.h:
+        (JSC::ScriptExecutable::forEachCodeBlock): Check for null CodeBlocks before calling forEachRelatedCodeBlock.
+
 2014-07-15  Eva Balazsfalvi  <evab.u-sze...@partner.samsung.com>
 
         Buildfix if LLINT_SLOW_PATH_TRACING is enabled

Modified: trunk/Source/_javascript_Core/bytecode/CodeBlock.h (171107 => 171108)


--- trunk/Source/_javascript_Core/bytecode/CodeBlock.h	2014-07-15 18:34:35 UTC (rev 171107)
+++ trunk/Source/_javascript_Core/bytecode/CodeBlock.h	2014-07-15 19:11:57 UTC (rev 171108)
@@ -1282,12 +1282,14 @@
 {
     switch (type()) {
     case ProgramExecutableType: {
-        jsCast<ProgramExecutable*>(this)->m_programCodeBlock->forEachRelatedCodeBlock(std::forward<Functor>(functor));
+        if (CodeBlock* codeBlock = jsCast<ProgramExecutable*>(this)->m_programCodeBlock.get())
+            codeBlock->forEachRelatedCodeBlock(std::forward<Functor>(functor));
         break;
     }
         
     case EvalExecutableType: {
-        jsCast<EvalExecutable*>(this)->m_evalCodeBlock->forEachRelatedCodeBlock(std::forward<Functor>(functor));
+        if (CodeBlock* codeBlock = jsCast<EvalExecutable*>(this)->m_evalCodeBlock.get())
+            codeBlock->forEachRelatedCodeBlock(std::forward<Functor>(functor));
         break;
     }
         
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to