Reviewed by Chris.
<rdar://problem/
4092136> reproducible crash in KJS::kjs_fast_realloc loading maps.google.com
* kjs/string_object.cpp:
(StringObjectFuncImp::call): Allocate adopted ustring buffer properly.
WebCore:
New test case for <rdar://problem/
4092136> reproducible crash in KJS::kjs_fast_realloc loading maps.google.com
* layout-tests/fast/js/string-from-char-code-expected.txt: Added.
* layout-tests/fast/js/string-from-char-code.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@9059
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2005-04-26 Maciej Stachowiak <mjs@apple.com>
+
+ Reviewed by Chris.
+
+ <rdar://problem/4092136> reproducible crash in KJS::kjs_fast_realloc loading maps.google.com
+
+ * kjs/string_object.cpp:
+ (StringObjectFuncImp::call): Allocate adopted ustring buffer properly.
+
2005-04-22 Darin Adler <darin@apple.com>
Reviewed by Maciej.
{
UString s;
if (args.size()) {
- UChar *buf = new UChar[args.size()];
+ UChar *buf = static_cast<UChar *>(kjs_fast_malloc(args.size() * sizeof(UChar)));
UChar *p = buf;
ListIterator it = args.begin();
while (it != args.end()) {
--- /dev/null
+layer at (0,0) size 800x600
+ RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x600
+ RenderBlock {HTML} at (0,0) size 800x600
+ RenderBody {BODY} at (8,8) size 784x584
+ RenderText {TEXT} at (0,0) size 422x18
+ text run at (0,0) width 422: "This test should not crash and should display an X on the next line:"
+ RenderBR {BR} at (0,0) size 0x0
+ RenderText {TEXT} at (0,18) size 12x18
+ text run at (0,18) width 12: "X"
+ RenderBR {BR} at (0,0) size 0x0
--- /dev/null
+<html>
+<body>
+This test should not crash and should display an X on the next line:<br>
+<script>
+document.write(String.fromCharCode(88));
+document.write('<br>');
+</script>
+</body>
\ No newline at end of file
+2005-04-26 Maciej Stachowiak <mjs@apple.com>
+
+ New test case for <rdar://problem/4092136> reproducible crash in KJS::kjs_fast_realloc loading maps.google.com
+
+ * layout-tests/fast/js/string-from-char-code-expected.txt: Added.
+ * layout-tests/fast/js/string-from-char-code.html: Added.
+
2005-04-26 Darin Adler <darin@apple.com>
Reviewed by John.