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

Unified Diff: test/mjsunit/regress/regress-crbug-142218.js

Issue 10829456: Check that index and length are Smi in bounds check. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Porting changes to ARM and ia32 Created 8 years, 4 months 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 | « src/x64/lithium-codegen-x64.cc ('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-crbug-142218.js
diff --git a/test/mjsunit/regress/regress-2045.js b/test/mjsunit/regress/regress-crbug-142218.js
similarity index 85%
copy from test/mjsunit/regress/regress-2045.js
copy to test/mjsunit/regress/regress-crbug-142218.js
index 822ee1fa4641b4a0ba15eee2c2a2e59411db7d4d..373f83bca34d915ca06cc9c6a52875a30b7ec3e5 100644
--- a/test/mjsunit/regress/regress-2045.js
+++ b/test/mjsunit/regress/regress-crbug-142218.js
@@ -27,23 +27,18 @@
// Flags: --allow-natives-syntax
-function foo() {
- assertEquals(2, arguments.length);
-}
+length = 1 << 16;
+a = new Array(length);
-function bar() {
- G.x;
- return foo.apply(this, arguments);
+function insert_element(key) {
+ a[key] = 42;
}
-function baz() {
- return bar(1, 2);
+insert_element(1);
+%OptimizeFunctionOnNextCall(insert_element);
+insert_element(new Object());
+count = 0;
+for (var i = 0; i < length; i++) {
+ if (a[i] != undefined) count++;
}
-
-G = {x: 0};
-baz();
-baz();
-%OptimizeFunctionOnNextCall(baz);
-baz();
-delete G.x;
-baz();
+assertEquals(1, count);
« no previous file with comments | « src/x64/lithium-codegen-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698