Handle more JSON stringify OOM
authorjfbastien@apple.com <jfbastien@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 Apr 2018 23:18:23 +0000 (23:18 +0000)
committerjfbastien@apple.com <jfbastien@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 Apr 2018 23:18:23 +0000 (23:18 +0000)
commit2d2fd6d7f03dde61f292b9fb11cabdfdb6239c52
tree8e16909702bf07470c0abf699a9b83da7ece97ad
parent302b6a316f5b2a08892005b390d3d0686a90e22c
Handle more JSON stringify OOM
https://bugs.webkit.org/show_bug.cgi?id=184846
<rdar://problem/39390672>

Reviewed by Mark Lam.

JSTests:

* stress/json-stringified-overflow-2.js: Added. Same as the one
below, but with a bigger input which will trigger a different code
path.
(catch):
* stress/json-stringified-overflow.js: Modify the test to only
catch OOM on stringification. not on string creation.

Source/WTF:

JSON stringification can OOM easily. Here's another case.

* wtf/text/StringBuilderJSON.cpp:
(WTF::StringBuilder::appendQuotedJSONString):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230863 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JSTests/ChangeLog
JSTests/stress/json-stringified-overflow-2.js [new file with mode: 0644]
JSTests/stress/json-stringified-overflow.js
Source/WTF/ChangeLog
Source/WTF/wtf/text/StringBuilderJSON.cpp