Fix bug 16129: REGRESSION (r27761-r27811): malloc error while visiting http://mysit...
authormrowe@apple.com <mrowe@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 25 Nov 2007 22:14:31 +0000 (22:14 +0000)
committermrowe@apple.com <mrowe@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 25 Nov 2007 22:14:31 +0000 (22:14 +0000)
* pcre/pcre_compile.cpp: Change errorcode to be passed by reference so that any error code is propagated
to our caller like they expect.

Reviewed by Dan Bernstein.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@28018 268f45cc-cd09-0410-ab3c-d52691b4dbfc

JavaScriptCore/ChangeLog
JavaScriptCore/pcre/pcre_compile.cpp
LayoutTests/ChangeLog
LayoutTests/fast/js/regexp-range-out-of-order-expected.txt [new file with mode: 0644]
LayoutTests/fast/js/regexp-range-out-of-order.html [new file with mode: 0644]
LayoutTests/fast/js/resources/regexp-range-out-of-order.js [new file with mode: 0644]

index 4e4351f..b09023e 100644 (file)
@@ -1,3 +1,13 @@
+2007-11-25  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        Fix http://bugs.webkit.org/show_bug.cgi?id=16129
+        Bug 16129: REGRESSION (r27761-r27811): malloc error while visiting http://mysit.es (crashes release build)
+
+        * pcre/pcre_compile.cpp: Change errorcode to be passed by reference so that any error code is propagated
+        to our caller like they expect.
+
 2007-11-23  Kevin Ollivier  <kevino@theolliviers.com>
 
         MSVC7 build fix. (rand_s doesn't exist there)
index 511484f..763b019 100644 (file)
@@ -2413,7 +2413,7 @@ while (*code == OP_ALT);
 return c;
 }
 
-static int calculateCompiledPatternLengthAndFlags(const pcre_char* pattern, int patternLength, JSRegExpIgnoreCaseOption ignoreCase, compile_data& compile_block, ErrorCode errorcode)
+static int calculateCompiledPatternLengthAndFlags(const pcre_char* pattern, int patternLength, JSRegExpIgnoreCaseOption ignoreCase, compile_data& compile_block, ErrorCode& errorcode)
 {
     /* Make a pass over the pattern to compute the
      amount of store required to hold the compiled code. This does not have to be
index 2b3f194..ff1a9a4 100644 (file)
@@ -1,3 +1,14 @@
+2007-11-25  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        Test for http://bugs.webkit.org/show_bug.cgi?id=16129
+        Bug 16129: REGRESSION (r27761-r27811): malloc error while visiting http://mysit.es (crashes release build)
+
+        * fast/js/regexp-range-out-of-order-expected.txt: Added.
+        * fast/js/regexp-range-out-of-order.html: Added.
+        * fast/js/resources/regexp-range-out-of-order.js: Added.
+
 2007-11-25  Nikolas Zimmermann  <zimmermann@kde.org>
 
         Reviewed by Adam Roben.
diff --git a/LayoutTests/fast/js/regexp-range-out-of-order-expected.txt b/LayoutTests/fast/js/regexp-range-out-of-order-expected.txt
new file mode 100644 (file)
index 0000000..8f126e0
--- /dev/null
@@ -0,0 +1,10 @@
+Test for bug 16129: REGRESSION (r27761-r27811): malloc error while visiting http://mysit.es (crashes release build).
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS /^[s{-.[]()]$/ threw exception SyntaxError: Invalid regular expression: range out of order in character class.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/js/regexp-range-out-of-order.html b/LayoutTests/fast/js/regexp-range-out-of-order.html
new file mode 100644 (file)
index 0000000..1fe48fb
--- /dev/null
@@ -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/regexp-range-out-of-order.js"></script>
+<script src="resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/js/resources/regexp-range-out-of-order.js b/LayoutTests/fast/js/resources/regexp-range-out-of-order.js
new file mode 100644 (file)
index 0000000..7f7cb5c
--- /dev/null
@@ -0,0 +1,9 @@
+description(
+
+'Test for <a href="http://bugs.webkit.org/show_bug.cgi?id=16129">bug 16129</a>: REGRESSION (r27761-r27811): malloc error while visiting http://mysit.es (crashes release build).'
+
+);
+
+shouldThrow('/^[\s{-.\[\]\(\)]$/');
+
+var successfullyParsed = true;