Changeset 246379 in webkit
- Timestamp:
- Jun 12, 2019, 3:20:54 PM (7 years ago)
- Location:
- branches/safari-607-branch
- Files:
-
- 1 added
- 4 edited
-
JSTests/ChangeLog (modified) (1 diff)
-
JSTests/stress/eliminate-arguments-negative-rest-access.js (added)
-
Source/JavaScriptCore/ChangeLog (modified) (1 diff)
-
Source/JavaScriptCore/dfg/DFGArgumentsEliminationPhase.cpp (modified) (1 diff)
-
Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-607-branch/JSTests/ChangeLog
r245928 r246379 1 2019-06-12 Null <null@apple.com> 2 3 Cherry-pick r246071. rdar://problem/51656838 4 5 Argument elimination should check for negative indices in GetByVal 6 https://bugs.webkit.org/show_bug.cgi?id=198302 7 <rdar://problem/51188095> 8 9 Reviewed by Filip Pizlo. 10 11 JSTests: 12 13 * stress/eliminate-arguments-negative-rest-access.js: Added. 14 (inlinee): 15 (opt): 16 17 Source/JavaScriptCore: 18 19 In DFG::ArgumentEliminationPhase, the index is treated as unsigned, but there's no check 20 for overflow in the addition. In compileGetMyArgumentByVal, there's a check for overflow, 21 but the index is treated as signed, resulting in an index lower than numberOfArgumentsToSkip. 22 23 * dfg/DFGArgumentsEliminationPhase.cpp: 24 * ftl/FTLLowerDFGToB3.cpp: 25 (JSC::FTL::DFG::LowerDFGToB3::compileGetMyArgumentByVal): 26 27 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@246071 268f45cc-cd09-0410-ab3c-d52691b4dbfc 28 29 2019-06-04 Tadeu Zagallo <tzagallo@apple.com> 30 31 Argument elimination should check for negative indices in GetByVal 32 https://bugs.webkit.org/show_bug.cgi?id=198302 33 <rdar://problem/51188095> 34 35 Reviewed by Filip Pizlo. 36 37 * stress/eliminate-arguments-negative-rest-access.js: Added. 38 (inlinee): 39 (opt): 40 1 41 2019-05-30 Kocsen Chung <kocsen_chung@apple.com> 2 42 -
branches/safari-607-branch/Source/JavaScriptCore/ChangeLog
r246378 r246379 1 2019-06-12 Null <null@apple.com> 2 3 Cherry-pick r246071. rdar://problem/51656838 4 5 Argument elimination should check for negative indices in GetByVal 6 https://bugs.webkit.org/show_bug.cgi?id=198302 7 <rdar://problem/51188095> 8 9 Reviewed by Filip Pizlo. 10 11 JSTests: 12 13 * stress/eliminate-arguments-negative-rest-access.js: Added. 14 (inlinee): 15 (opt): 16 17 Source/JavaScriptCore: 18 19 In DFG::ArgumentEliminationPhase, the index is treated as unsigned, but there's no check 20 for overflow in the addition. In compileGetMyArgumentByVal, there's a check for overflow, 21 but the index is treated as signed, resulting in an index lower than numberOfArgumentsToSkip. 22 23 * dfg/DFGArgumentsEliminationPhase.cpp: 24 * ftl/FTLLowerDFGToB3.cpp: 25 (JSC::FTL::DFG::LowerDFGToB3::compileGetMyArgumentByVal): 26 27 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@246071 268f45cc-cd09-0410-ab3c-d52691b4dbfc 28 29 2019-06-04 Tadeu Zagallo <tzagallo@apple.com> 30 31 Argument elimination should check for negative indices in GetByVal 32 https://bugs.webkit.org/show_bug.cgi?id=198302 33 <rdar://problem/51188095> 34 35 Reviewed by Filip Pizlo. 36 37 In DFG::ArgumentEliminationPhase, the index is treated as unsigned, but there's no check 38 for overflow in the addition. In compileGetMyArgumentByVal, there's a check for overflow, 39 but the index is treated as signed, resulting in an index lower than numberOfArgumentsToSkip. 40 41 * dfg/DFGArgumentsEliminationPhase.cpp: 42 * ftl/FTLLowerDFGToB3.cpp: 43 (JSC::FTL::DFG::LowerDFGToB3::compileGetMyArgumentByVal): 44 1 45 2019-06-12 Null <null@apple.com> 2 46 -
branches/safari-607-branch/Source/JavaScriptCore/dfg/DFGArgumentsEliminationPhase.cpp
r241458 r246379 757 757 index += numberOfArgumentsToSkip; 758 758 759 bool safeToGetStack ;759 bool safeToGetStack = index >= numberOfArgumentsToSkip; 760 760 if (inlineCallFrame) 761 safeToGetStack = index < inlineCallFrame->argumentCountIncludingThis - 1;761 safeToGetStack &= index < inlineCallFrame->argumentCountIncludingThis - 1; 762 762 else { 763 safeToGetStack =763 safeToGetStack &= 764 764 index < static_cast<unsigned>(codeBlock()->numParameters()) - 1; 765 765 } -
branches/safari-607-branch/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
r243577 r246379 4233 4233 LValue numberOfArgs = m_out.sub(numberOfArgsIncludingThis, m_out.int32One); 4234 4234 LValue indexToCheck = originalIndex; 4235 LValue numberOfArgumentsToSkip = m_out.int32Zero; 4235 4236 if (m_node->numberOfArgumentsToSkip()) { 4236 CheckValue* check = m_out.speculateAdd(indexToCheck, m_out.constInt32(m_node->numberOfArgumentsToSkip())); 4237 numberOfArgumentsToSkip = m_out.constInt32(m_node->numberOfArgumentsToSkip()); 4238 CheckValue* check = m_out.speculateAdd(indexToCheck, numberOfArgumentsToSkip); 4237 4239 blessSpeculation(check, Overflow, noValue(), nullptr, m_origin); 4238 4240 indexToCheck = check; 4239 4241 } 4240 4242 4241 LValue isOutOfBounds = m_out. aboveOrEqual(indexToCheck, numberOfArgs);4243 LValue isOutOfBounds = m_out.bitOr(m_out.aboveOrEqual(indexToCheck, numberOfArgs), m_out.below(indexToCheck, numberOfArgumentsToSkip)); 4242 4244 LBasicBlock continuation = nullptr; 4243 4245 LBasicBlock lastNext = nullptr;
Note:
See TracChangeset
for help on using the changeset viewer.