<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[207785] trunk/Source/JavaScriptCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/207785">207785</a></dd>
<dt>Author</dt> <dd>achristensen@apple.com</dd>
<dt>Date</dt> <dd>2016-10-24 15:51:59 -0700 (Mon, 24 Oct 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>JSONParse should not crash with null Strings
https://bugs.webkit.org/show_bug.cgi?id=163918
&lt;rdar://problem/28834095&gt;

Reviewed by Michael Saboff.

When JSONParse is called with a null String, it calls String::is8bit, which dereferences a null pointer.
This is happening with new work in the Fetch API, but callers of JSONParse should not have to check
if the String is null.

* API/tests/JSONParseTest.cpp: Added.
(testJSONParse):
* API/tests/JSONParseTest.h: Added.
* API/tests/testapi.c:
(main):
Test parsing null Strings.  They should have the same result as parsing empty Strings.
* JavaScriptCore.xcodeproj/project.pbxproj:
* runtime/JSONObject.cpp:
(JSC::JSONParse):
Check for null Strings.
* shell/PlatformWin.cmake:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreAPIteststestapic">trunk/Source/JavaScriptCore/API/tests/testapi.c</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj">trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSONObjectcpp">trunk/Source/JavaScriptCore/runtime/JSONObject.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreshellPlatformWincmake">trunk/Source/JavaScriptCore/shell/PlatformWin.cmake</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreAPItestsJSONParseTestcpp">trunk/Source/JavaScriptCore/API/tests/JSONParseTest.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreAPItestsJSONParseTesth">trunk/Source/JavaScriptCore/API/tests/JSONParseTest.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreAPItestsJSONParseTestcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/API/tests/JSONParseTest.cpp (0 => 207785)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/API/tests/JSONParseTest.cpp                                (rev 0)
+++ trunk/Source/JavaScriptCore/API/tests/JSONParseTest.cpp        2016-10-24 22:51:59 UTC (rev 207785)
</span><span class="lines">@@ -0,0 +1,69 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;JSONParseTest.h&quot;
+
+#include &quot;JSCInlines.h&quot;
+#include &quot;JSGlobalObject.h&quot;
+#include &quot;JSONObject.h&quot;
+#include &quot;VM.h&quot;
+#include &lt;wtf/RefPtr.h&gt;
+
+using namespace JSC;
+
+int testJSONParse()
+{
+    bool failed = false;
+
+    RefPtr&lt;VM&gt; vm = VM::create();
+
+    JSLockHolder locker(vm.get());
+    JSGlobalObject* globalObject = JSGlobalObject::create(*vm, JSGlobalObject::createStructure(*vm, jsNull()));
+
+    ExecState* exec = globalObject-&gt;globalExec();
+    JSValue v0 = JSONParse(exec, &quot;&quot;);
+    JSValue v1 = JSONParse(exec, &quot;#$%^&quot;);
+    JSValue v2 = JSONParse(exec, String());
+    UChar emptyUCharArray[1] = { '\0' };
+    JSValue v3 = JSONParse(exec, String(emptyUCharArray, 0));
+    JSValue v4;
+    JSValue v5 = JSONParse(exec, &quot;123&quot;);
+
+    failed = failed || (v0 != v1);
+    failed = failed || (v1 != v2);
+    failed = failed || (v2 != v3);
+    failed = failed || (v3 != v4);
+    failed = failed || (v4 == v5);
+
+    vm = nullptr;
+
+    if (failed)
+        printf(&quot;FAIL: JSONParse String test.\n&quot;);
+    else
+        printf(&quot;PASS: JSONParse String test.\n&quot;);
+
+    return failed;
+}
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreAPItestsJSONParseTesth"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/API/tests/JSONParseTest.h (0 => 207785)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/API/tests/JSONParseTest.h                                (rev 0)
+++ trunk/Source/JavaScriptCore/API/tests/JSONParseTest.h        2016-10-24 22:51:59 UTC (rev 207785)
</span><span class="lines">@@ -0,0 +1,36 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#ifdef __cplusplus
+extern &quot;C&quot; {
+#endif
+    
+int testJSONParse();
+    
+#ifdef __cplusplus
+} /* extern &quot;C&quot; */
+#endif
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreAPIteststestapic"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/API/tests/testapi.c (207784 => 207785)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/API/tests/testapi.c        2016-10-24 22:09:29 UTC (rev 207784)
+++ trunk/Source/JavaScriptCore/API/tests/testapi.c        2016-10-24 22:51:59 UTC (rev 207785)
</span><span class="lines">@@ -44,6 +44,7 @@
</span><span class="cx"> #include &quot;ExecutionTimeLimitTest.h&quot;
</span><span class="cx"> #include &quot;FunctionOverridesTest.h&quot;
</span><span class="cx"> #include &quot;GlobalContextWithFinalizerTest.h&quot;
</span><ins>+#include &quot;JSONParseTest.h&quot;
</ins><span class="cx"> #include &quot;PingPongStackOverflowTest.h&quot;
</span><span class="cx"> #include &quot;TypedArrayCTest.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -1129,8 +1130,6 @@
</span><span class="cx">     testObjectiveCAPI();
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-
-
</del><span class="cx">     const char *scriptPath = &quot;testapi.js&quot;;
</span><span class="cx">     if (argc &gt; 1) {
</span><span class="cx">         scriptPath = argv[1];
</span><span class="lines">@@ -1889,6 +1888,7 @@
</span><span class="cx">     failed = testFunctionOverrides() || failed;
</span><span class="cx">     failed = testGlobalContextWithFinalizer() || failed;
</span><span class="cx">     failed = testPingPongStackOverflow() || failed;
</span><ins>+    failed = testJSONParse() || failed;
</ins><span class="cx"> 
</span><span class="cx">     // Clear out local variables pointing at JSObjectRefs to allow their values to be collected
</span><span class="cx">     function = NULL;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (207784 => 207785)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2016-10-24 22:09:29 UTC (rev 207784)
+++ trunk/Source/JavaScriptCore/ChangeLog        2016-10-24 22:51:59 UTC (rev 207785)
</span><span class="lines">@@ -1,3 +1,27 @@
</span><ins>+2016-10-24  Alex Christensen  &lt;achristensen@webkit.org&gt;
+
+        JSONParse should not crash with null Strings
+        https://bugs.webkit.org/show_bug.cgi?id=163918
+        &lt;rdar://problem/28834095&gt;
+
+        Reviewed by Michael Saboff.
+
+        When JSONParse is called with a null String, it calls String::is8bit, which dereferences a null pointer.
+        This is happening with new work in the Fetch API, but callers of JSONParse should not have to check
+        if the String is null.
+
+        * API/tests/JSONParseTest.cpp: Added.
+        (testJSONParse):
+        * API/tests/JSONParseTest.h: Added.
+        * API/tests/testapi.c:
+        (main):
+        Test parsing null Strings.  They should have the same result as parsing empty Strings.
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * runtime/JSONObject.cpp:
+        (JSC::JSONParse):
+        Check for null Strings.
+        * shell/PlatformWin.cmake:
+
</ins><span class="cx"> 2016-10-24  Devin Rousso  &lt;dcrousso+webkit@gmail.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: Scope chain shouldn't show empty Closure sections
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj (207784 => 207785)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2016-10-24 22:09:29 UTC (rev 207784)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2016-10-24 22:51:59 UTC (rev 207785)
</span><span class="lines">@@ -1243,6 +1243,7 @@
</span><span class="cx">                 53FA2AE31CF380390022711D /* LLIntPrototypeLoadAdaptiveStructureWatchpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 53FA2AE21CF380390022711D /* LLIntPrototypeLoadAdaptiveStructureWatchpoint.cpp */; };
</span><span class="cx">                 53FD04D31D7AB277003287D3 /* WasmCallingConvention.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 53FD04D11D7AB187003287D3 /* WasmCallingConvention.cpp */; };
</span><span class="cx">                 53FD04D41D7AB291003287D3 /* WasmCallingConvention.h in Headers */ = {isa = PBXBuildFile; fileRef = 53FD04D21D7AB187003287D3 /* WasmCallingConvention.h */; };
</span><ins>+                5C4E8E961DBEBE620036F1FC /* JSONParseTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5C4E8E941DBEBDA20036F1FC /* JSONParseTest.cpp */; };
</ins><span class="cx">                 5D5D8AD10E0D0EBE00F9C692 /* libedit.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5D5D8AD00E0D0EBE00F9C692 /* libedit.dylib */; };
</span><span class="cx">                 5DBB151B131D0B310056AD36 /* testapi.js in Copy Support Script */ = {isa = PBXBuildFile; fileRef = 14D857740A4696C80032146C /* testapi.js */; };
</span><span class="cx">                 5DBB1525131D0BD70056AD36 /* minidom.js in Copy Support Script */ = {isa = PBXBuildFile; fileRef = 1412110D0A48788700480255 /* minidom.js */; };
</span><span class="lines">@@ -3548,6 +3549,8 @@
</span><span class="cx">                 53FA2AE21CF380390022711D /* LLIntPrototypeLoadAdaptiveStructureWatchpoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LLIntPrototypeLoadAdaptiveStructureWatchpoint.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 53FD04D11D7AB187003287D3 /* WasmCallingConvention.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WasmCallingConvention.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 53FD04D21D7AB187003287D3 /* WasmCallingConvention.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WasmCallingConvention.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                5C4E8E941DBEBDA20036F1FC /* JSONParseTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSONParseTest.cpp; path = API/tests/JSONParseTest.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                5C4E8E951DBEBDA20036F1FC /* JSONParseTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSONParseTest.h; path = API/tests/JSONParseTest.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 5D5D8AD00E0D0EBE00F9C692 /* libedit.dylib */ = {isa = PBXFileReference; lastKnownFileType = &quot;compiled.mach-o.dylib&quot;; name = libedit.dylib; path = /usr/lib/libedit.dylib; sourceTree = &quot;&lt;absolute&gt;&quot;; };
</span><span class="cx">                 5DAFD6CB146B686300FBEFB4 /* JSC.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = JSC.xcconfig; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 5DDDF44614FEE72200B4FB4D /* LLIntDesiredOffsets.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LLIntDesiredOffsets.h; path = LLIntOffsets/LLIntDesiredOffsets.h; sourceTree = BUILT_PRODUCTS_DIR; };
</span><span class="lines">@@ -5283,6 +5286,8 @@
</span><span class="cx">                                 FE0D4A081ABA2437002F54BF /* GlobalContextWithFinalizerTest.h */,
</span><span class="cx">                                 C2181FC018A948FB0025A235 /* JSExportTests.h */,
</span><span class="cx">                                 C2181FC118A948FB0025A235 /* JSExportTests.mm */,
</span><ins>+                                5C4E8E941DBEBDA20036F1FC /* JSONParseTest.cpp */,
+                                5C4E8E951DBEBDA20036F1FC /* JSONParseTest.h */,
</ins><span class="cx">                                 144005170A531CB50005F061 /* minidom */,
</span><span class="cx">                                 FEDA50D41B97F442009A3B4F /* PingPongStackOverflowTest.cpp */,
</span><span class="cx">                                 FEDA50D51B97F4D9009A3B4F /* PingPongStackOverflowTest.h */,
</span><span class="lines">@@ -9195,6 +9200,7 @@
</span><span class="cx">                                 C29ECB031804D0ED00D2CBB4 /* CurrentThisInsideBlockGetterTest.mm in Sources */,
</span><span class="cx">                                 C20328201981979D0088B499 /* CustomGlobalObjectClassTest.c in Sources */,
</span><span class="cx">                                 C288B2DE18A54D3E007BE40B /* DateTests.mm in Sources */,
</span><ins>+                                5C4E8E961DBEBE620036F1FC /* JSONParseTest.cpp in Sources */,
</ins><span class="cx">                                 FE0D4A061AB8DD0A002F54BF /* ExecutionTimeLimitTest.cpp in Sources */,
</span><span class="cx">                                 FE0D4A091ABA2437002F54BF /* GlobalContextWithFinalizerTest.cpp in Sources */,
</span><span class="cx">                                 C2181FC218A948FB0025A235 /* JSExportTests.mm in Sources */,
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSONObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSONObject.cpp (207784 => 207785)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSONObject.cpp        2016-10-24 22:09:29 UTC (rev 207784)
+++ trunk/Source/JavaScriptCore/runtime/JSONObject.cpp        2016-10-24 22:51:59 UTC (rev 207785)
</span><span class="lines">@@ -791,6 +791,9 @@
</span><span class="cx"> {
</span><span class="cx">     LocalScope scope(exec-&gt;vm());
</span><span class="cx"> 
</span><ins>+    if (json.isNull())
+        return JSValue();
+
</ins><span class="cx">     if (json.is8Bit()) {
</span><span class="cx">         LiteralParser&lt;LChar&gt; jsonParser(exec, json.characters8(), json.length(), StrictJSON);
</span><span class="cx">         return jsonParser.tryLiteralParse();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreshellPlatformWincmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/shell/PlatformWin.cmake (207784 => 207785)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/shell/PlatformWin.cmake        2016-10-24 22:09:29 UTC (rev 207784)
+++ trunk/Source/JavaScriptCore/shell/PlatformWin.cmake        2016-10-24 22:51:59 UTC (rev 207785)
</span><span class="lines">@@ -31,9 +31,10 @@
</span><span class="cx">     ../API/tests/ExecutionTimeLimitTest.cpp
</span><span class="cx">     ../API/tests/FunctionOverridesTest.cpp
</span><span class="cx">     ../API/tests/GlobalContextWithFinalizerTest.cpp
</span><ins>+    ../API/tests/JSONParseTest.cpp
</ins><span class="cx">     ../API/tests/PingPongStackOverflowTest.cpp
</span><span class="cx">     ../API/tests/testapi.c
</span><del>-   ../API/tests/TypedArrayCTest.cpp
</del><ins>+    ../API/tests/TypedArrayCTest.cpp
</ins><span class="cx"> )
</span><span class="cx"> set_source_files_properties(../API/tests/CustomGlobalObjectClassTest.c PROPERTIES COMPILE_FLAGS &quot;/TP /MT&quot;)
</span><span class="cx"> set_source_files_properties(../API/tests/testapi.c PROPERTIES COMPILE_FLAGS &quot;/TP /MT&quot;)
</span></span></pre>
</div>
</div>

</body>
</html>