Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(535)

Unified Diff: test/mjsunit/regress/regress-320948.js

Issue 72813004: Fixed crashes exposed though fuzzing. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix nits Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mjsunit/fuzz-natives-part4.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/regress/regress-320948.js
diff --git a/test/mjsunit/harmony/iteration-syntax.js b/test/mjsunit/regress/regress-320948.js
similarity index 50%
copy from test/mjsunit/harmony/iteration-syntax.js
copy to test/mjsunit/regress/regress-320948.js
index 3bda78ed4e16d312d7f3351a9c60158659f99e1a..734031c35ca90d6e5a90adde73567672914ed5f4 100644
--- a/test/mjsunit/harmony/iteration-syntax.js
+++ b/test/mjsunit/regress/regress-320948.js
@@ -25,46 +25,57 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// Flags: --harmony-iteration --harmony-scoping
+// Flags: --allow-natives-syntax --debug-code
-// Test for-of syntax.
+var one_byte = %NewString(10, true);
+var two_byte = %NewString(10, false);
-"use strict";
+function foo1(s, arg1, arg2) {
+ return %_OneByteSeqStringSetChar(s, arg1, arg2)
+}
+foo1(one_byte, 0, 0);
+assertThrows("{ foo1(4, 0, 0); }");
+assertThrows("{ foo1(one_byte, new Object(), 0); }");
+assertThrows("{ foo1(one_byte, 0, new Object()); }");
+assertThrows("{ foo1(one_byte, 100000, 100; }");
+assertThrows("{ foo1(one_byte, -1, 100; }");
-function f() { for (x of y) { } }
-function f() { for (var x of y) { } }
-function f() { for (let x of y) { } }
+function bar1(s, arg1, arg2) {
+ return %_OneByteSeqStringSetChar(s, arg1, arg2)
+}
-assertThrows("function f() { for (x of) { } }", SyntaxError);
-assertThrows("function f() { for (x of y z) { } }", SyntaxError);
-assertThrows("function f() { for (x of y;) { } }", SyntaxError);
+bar1(one_byte, 0, 0);
+bar1(one_byte, 0, 0);
+bar1(one_byte, 0, 0);
+%OptimizeFunctionOnNextCall(bar1);
+bar1(one_byte, 0, 0);
+assertThrows("{ bar1(4, 0, 0); }");
+assertThrows("{ bar1(one_byte, new Object(), 0); }");
+assertThrows("{ bar1(one_byte, 0, new Object()); }");
+assertThrows("{ bar1(one_byte, 100000, 100; }");
+assertThrows("{ bar1(one_byte, -1, 100; }");
-assertThrows("function f() { for (var x of) { } }", SyntaxError);
-assertThrows("function f() { for (var x of y z) { } }", SyntaxError);
-assertThrows("function f() { for (var x of y;) { } }", SyntaxError);
+function foo2(s, arg1, arg2) {
+ return %_TwoByteSeqStringSetChar(s, arg1, arg2)
+}
+foo2(two_byte, 0, 0);
+assertThrows("{ foo2(4, 0, 0); }");
+assertThrows("{ foo2(two_byte, new Object(), 0); }");
+assertThrows("{ foo2(two_byte, 0, new Object()); }");
+assertThrows("{ foo2(two_byte, 100000, 100; }");
+assertThrows("{ foo2(two_byte, -1, 100; }");
-assertThrows("function f() { for (let x of) { } }", SyntaxError);
-assertThrows("function f() { for (let x of y z) { } }", SyntaxError);
-assertThrows("function f() { for (let x of y;) { } }", SyntaxError);
+function bar2(s, arg1, arg2) {
+ return %_TwoByteSeqStringSetChar(s, arg1, arg2)
+}
-assertThrows("function f() { for (of y) { } }", SyntaxError);
-assertThrows("function f() { for (of of) { } }", SyntaxError);
-assertThrows("function f() { for (var of y) { } }", SyntaxError);
-assertThrows("function f() { for (var of of) { } }", SyntaxError);
-assertThrows("function f() { for (let of y) { } }", SyntaxError);
-assertThrows("function f() { for (let of of) { } }", SyntaxError);
-
-assertThrows("function f() { for (x = 3 of y) { } }", SyntaxError);
-assertThrows("function f() { for (var x = 3 of y) { } }", SyntaxError);
-assertThrows("function f() { for (let x = 3 of y) { } }", SyntaxError);
-
-
-// Alack, this appears to be valid.
-function f() { for (of of y) { } }
-function f() { for (let of of y) { } }
-function f() { for (var of of y) { } }
-
-// This too, of course.
-function f() { for (of in y) { } }
-function f() { for (var of in y) { } }
-function f() { for (let of in y) { } }
+bar2(two_byte, 0, 0);
+bar2(two_byte, 0, 0);
+bar2(two_byte, 0, 0);
+%OptimizeFunctionOnNextCall(bar2);
+bar2(two_byte, 0, 0);
+assertThrows("{ bar2(4, 0, 0); }");
+assertThrows("{ bar2(two_byte, new Object(), 0); }");
+assertThrows("{ bar2(two_byte, 0, new Object()); }");
+assertThrows("{ bar2(two_byte, 100000, 100; }");
+assertThrows("{ bar2(two_byte, -1, 100; }");
« no previous file with comments | « test/mjsunit/fuzz-natives-part4.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698