diff options
author | aliceli1 <aliceli1@bbb929c8-8fbe-4397-9dbb-9b2b20218538> | 2007-01-27 02:31:28 +0000 |
---|---|---|
committer | aliceli1 <aliceli1@bbb929c8-8fbe-4397-9dbb-9b2b20218538> | 2007-01-27 02:31:28 +0000 |
commit | ca474a19d5f48155d2cefa30a32ea8349dab20d3 (patch) | |
tree | e3e8e3bffd276549ddb870ded0054cd582f35aec /third_party/WebKit/LayoutTests/fast | |
parent | 1e020c40b7e42b82dbf5f8ecab7d2f02d5cb516e (diff) | |
download | chromium_src-ca474a19d5f48155d2cefa30a32ea8349dab20d3.zip chromium_src-ca474a19d5f48155d2cefa30a32ea8349dab20d3.tar.gz chromium_src-ca474a19d5f48155d2cefa30a32ea8349dab20d3.tar.bz2 |
JavaScriptCore:
Reviewed by Maciej.
Fix for Repeated string concatenation results in OOM crash
http://bugs.webkit.org/show_bug.cgi?id=11131
* kjs/operations.cpp:
(KJS::add): Throw exception if string addition result is null
* kjs/ustring.cpp:
(KJS::UString::UString): Don't call memcpy when malloc failed
LayoutTests:
Reviewed by Maciej.
Test for "Repeated string concatenation results in OOM crash"
http://bugs.webkit.org/show_bug.cgi?id=11131
* fast/js/resources/string-concatenate-outofmemory.js: Added.
* fast/js/string-concatenate-outofmemory-expected.txt: Added.
* fast/js/string-concatenate-outofmemory.html: Added.
git-svn-id: svn://svn.chromium.org/blink/trunk@19178 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Diffstat (limited to 'third_party/WebKit/LayoutTests/fast')
3 files changed, 30 insertions, 0 deletions
diff --git a/third_party/WebKit/LayoutTests/fast/js/resources/string-concatenate-outofmemory.js b/third_party/WebKit/LayoutTests/fast/js/resources/string-concatenate-outofmemory.js new file mode 100644 index 0000000..a3b4e7e --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/js/resources/string-concatenate-outofmemory.js @@ -0,0 +1,7 @@ +description( +'This test checks if repeated string concatenation causes an exception (and not a crash). From WebKit Bug <a href="http://bugs.webkit.org/show_bug.cgi?id=11131">Repeated string concatenation results in OOM crash</a>.' +); + +shouldThrow('s = "a"; while (1) { s += s; }', '"Error: Out of memory"'); + +var successfullyParsed = true; diff --git a/third_party/WebKit/LayoutTests/fast/js/string-concatenate-outofmemory-expected.txt b/third_party/WebKit/LayoutTests/fast/js/string-concatenate-outofmemory-expected.txt new file mode 100644 index 0000000..595555b --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/js/string-concatenate-outofmemory-expected.txt @@ -0,0 +1,10 @@ +This test checks if repeated string concatenation causes an exception (and not a crash). From WebKit Bug Repeated string concatenation results in OOM crash. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS s = "a"; while (1) { s += s; } threw exception Error: Out of memory. +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/third_party/WebKit/LayoutTests/fast/js/string-concatenate-outofmemory.html b/third_party/WebKit/LayoutTests/fast/js/string-concatenate-outofmemory.html new file mode 100644 index 0000000..df3dc0c --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/js/string-concatenate-outofmemory.html @@ -0,0 +1,13 @@ +<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> +<html> +<head> +<link rel="stylesheet" href="resources/js-test-style.css"> +<script src="resources/js-test-pre.js"></script> +</head> +<body> +<p id="description"></p> +<div id="console"></div> +<script src="resources/string-concatenate-outofmemory.js"></script> +<script src="resources/js-test-post.js"></script> +</body> +</html> |