Index: test/mjsunit/regress/regress-crbug-285355.js |
diff --git a/test/mjsunit/regress/regress-crbug-242870.js b/test/mjsunit/regress/regress-crbug-285355.js |
similarity index 84% |
copy from test/mjsunit/regress/regress-crbug-242870.js |
copy to test/mjsunit/regress/regress-crbug-285355.js |
index 7183375ca811cedc81c870d34e694e98cf727f9b..ebd480a7103f300d726bc66ee1876d9449b05ada 100644 |
--- a/test/mjsunit/regress/regress-crbug-242870.js |
+++ b/test/mjsunit/regress/regress-crbug-285355.js |
@@ -27,17 +27,17 @@ |
// Flags: --allow-natives-syntax |
-var non_const_true = true; |
- |
-function f() { |
- return (non_const_true || true && g()); |
+function inverted_index() { |
+ return ~1; |
} |
-function g() { |
- for (;;) {} |
+%NeverOptimizeFunction(inverted_index); |
+ |
+function crash(array) { |
+ return array[~inverted_index()] = 2; |
} |
-assertTrue(f()); |
-assertTrue(f()); |
-%OptimizeFunctionOnNextCall(f); |
-assertTrue(f()); |
+assertEquals(2, crash(new Array(1))); |
+assertEquals(2, crash(new Array(1))); |
+%OptimizeFunctionOnNextCall(crash) |
+assertEquals(2, crash(new Array(1))); |