Changeset 180453 in webkit
- Timestamp:
- Feb 20, 2015 2:21:47 PM (9 years ago)
- Location:
- trunk/LayoutTests
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r180448 r180453 1 2015-02-20 Michael Saboff <msaboff@apple.com> 2 3 Layout Test js/regress-141098.html is failing on 32-bit Machines 4 https://bugs.webkit.org/show_bug.cgi?id=141848 5 6 Reviewed by Geoffrey Garen. 7 8 It appears that different control flow paths in probeAndRecurse() allowed the second time 9 through the test to recurse deeper before getting to the point of overflowing the stack. 10 Restructured the test so that the exact same control flow in probeAndRecurse() is used 11 both times we call it, including probing the depth of the stack. Now we pass a flag that 12 indicates whether or not we should try ever expanding eval strings or reuse the most 13 recent eval string. 14 15 * js/script-tests/regress-141098.js: 16 (testEval): 17 (probeAndRecurse): 18 1 19 2015-02-20 Brent Fulgham <bfulgham@apple.com> 2 20 -
trunk/LayoutTests/js/script-tests/regress-141098.js
r180448 r180453 1 //@ skip2 3 1 description("Regression test for https://webkit.org/b/141098. Make sure eval() properly handles running out of stack space. This test should run without crashing."); 4 2 … … 13 11 var count = 1; 14 12 15 if (!maxIterations) {13 if (!maxIterations) 16 14 var result = eval(lastEvalString); 17 }else {15 else { 18 16 for (var iter = 0; iter < maxIterations; count *= 4, iter++) { 19 17 var evalString = "\"dummy\".valueOf("; … … 27 25 evalString += ");"; 28 26 29 lastEvalString = evalString; 27 if (maxIterations > 1) 28 lastEvalString = evalString; 30 29 result = eval(evalString); 31 30 } … … 35 34 } 36 35 37 function probeAndRecurse(depth )36 function probeAndRecurse(depth, reuseEvalString) 38 37 { 39 38 var result; 40 39 41 40 // Probe stack depth 42 if (depth > 0) { 43 try { 44 result = probeAndRecurse(depth+1); 41 try { 42 result = probeAndRecurse(depth+1, reuseEvalString); 45 43 46 if (!result) { 47 try { 48 testEval(1); 49 } catch (e) { 50 return -49; 51 } 52 } else 53 return result + 1 54 } catch (e) { 55 // We exceeded stack space, now return up the stack until we can execute a simple eval. 56 // Then run an eval test to exceed stack. 57 return -49; 58 } 59 } else if (depth != 0) 60 return probeAndRecurse(depth+1); 44 if (!result) { 45 try { 46 testEval(1); 47 } catch (e) { 48 return -49; 49 } 50 } else 51 return result + 1 52 } catch (e) { 53 // We exceeded stack space, now return up the stack until we can execute a simple eval. 54 // Then run an eval test to exceed stack. 55 return -49; 56 } 61 57 62 58 try { 63 testEval( (depth > 0) ? 20 :0);59 testEval(reuseEvalString ? 0 : 20); 64 60 } catch (e) { 65 61 testPassed("Exception: " + e); … … 69 65 } 70 66 71 var depth = probeAndRecurse( 1);67 var depth = probeAndRecurse(0, false); 72 68 73 69 // Tier up the eval'ed code. … … 77 73 testEval(0); 78 74 79 probeAndRecurse( -depth);75 probeAndRecurse(0, true);
Note: See TracChangeset
for help on using the changeset viewer.