Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 // Test stack reconstruction after a nested exit
2 function testNestedExitStackInner(j, counter) {
3 ++counter;
4 var b = 0;
5 for (var i = 1; i <= 9; i++) {
6 ++b;
7 var a;
8 // Make sure that once everything has been traced we suddenly switch to
9 // a different control flow the first time we run the outermost tree,
10 // triggering a side exit.
11 if (j < 9)
12 a = 1;
13 else
14 a = 0;
15 ++b;
16 b += a;
17 }
18 return counter + b;
19 }
20 function testNestedExitStackOuter() {
21 var counter = 0;
22 for (var j = 1; j <= 9; ++j) {
23 for (var k = 1; k <= 9; ++k) {
24 counter = testNestedExitStackInner(j, counter);
25 }
26 }
27 return counter;
28 }
29 //assertEq(testNestedExitStackOuter(), 81);