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

Side by Side Diff: test/mjsunit/regress/regress-bce-underflow.js

Issue 1023123003: Ensure we don't overflow in BCE (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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 unified diff | Download patch
« no previous file with comments | « src/hydrogen-bce.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Flags: --allow-natives-syntax
6
7 function f(a, i, bool) {
8 var result;
9 if (bool) {
10 // Make sure i - -0x80000000 doesn't overflow in BCE, missing a check for
11 // x-0 later on.
12 result = f2(a, 0x7fffffff, i, i, -0x80000000);
13 } else {
14 result = f2(a, -3, 4, i, 0);
15 }
16 return result;
17 }
18
19 function f2(a, c, x, i, d) {
20 return a[x + c] + a[x - 0] + a[i - d];
21 }
22
23
24 var a = [];
25 var i = 0;
26 a.push(i++);
27 a.push(i++);
28 a.push(i++);
29 a.push(i++);
30 a.push(i++);
31 f(a, 0, false);
32 f(a, 0, false);
33 f(a, 0, false);
34 %OptimizeFunctionOnNextCall(f);
35 %DebugPrint(f(a, -0x7fffffff, true));
OLDNEW
« no previous file with comments | « src/hydrogen-bce.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698