Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r224302 - Integer overflow in code generated by LoadVarargs pro…
…cessing in DFG and FTL. https://bugs.webkit.org/show_bug.cgi?id=179140 Reviewed by Saam Barati. JSTests: New regression test. * stress/regress-179140.js: Added. (testWithoutFTL): (testWithFTL): Source/JavaScriptCore: Added overflow checks to computation of arg count plus this. * dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::compile): * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::compileLoadVarargs):
- Loading branch information
1 parent
3639ed2
commit 843521e
Showing
6 changed files
with
86 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Regression test for bug 179140. | ||
|
||
function testWithoutFTL() | ||
{ | ||
g=() => 0 | ||
f=(a) => g.apply(0,a) | ||
|
||
noFTL(f); | ||
|
||
for(i=1e6;i--;) | ||
f([]) | ||
|
||
try { | ||
f({length:1e10}) | ||
} catch(e) { | ||
if (!(e instanceof RangeError)) | ||
throw "Expected RangeError due to stack overflow"; | ||
} | ||
} | ||
|
||
function testWithFTL() | ||
{ | ||
g=() => 0 | ||
f=(a) => g.apply(0,a) | ||
|
||
for(i=1e6;i--;) | ||
f([]) | ||
|
||
try { | ||
f({length:1e10}) | ||
} catch(e) { | ||
if (!(e instanceof RangeError)) | ||
throw "Expected RangeError due to stack overflow"; | ||
} | ||
} | ||
|
||
testWithoutFTL(); | ||
testWithFTL(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters