Changeset 246071 in webkit
- Timestamp:
- Jun 4, 2019, 10:56:59 AM (7 years ago)
- Location:
- trunk
- 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
-
trunk/JSTests/ChangeLog
r246041 r246071 1 2019-06-04 Tadeu Zagallo <tzagallo@apple.com> 2 3 Argument elimination should check for negative indices in GetByVal 4 https://bugs.webkit.org/show_bug.cgi?id=198302 5 <rdar://problem/51188095> 6 7 Reviewed by Filip Pizlo. 8 9 * stress/eliminate-arguments-negative-rest-access.js: Added. 10 (inlinee): 11 (opt): 12 1 13 2019-06-03 Caio Lima <ticaiolima@gmail.com> 2 14 -
trunk/Source/JavaScriptCore/ChangeLog
r246060 r246071 1 2019-06-04 Tadeu Zagallo <tzagallo@apple.com> 2 3 Argument elimination should check for negative indices in GetByVal 4 https://bugs.webkit.org/show_bug.cgi?id=198302 5 <rdar://problem/51188095> 6 7 Reviewed by Filip Pizlo. 8 9 In DFG::ArgumentEliminationPhase, the index is treated as unsigned, but there's no check 10 for overflow in the addition. In compileGetMyArgumentByVal, there's a check for overflow, 11 but the index is treated as signed, resulting in an index lower than numberOfArgumentsToSkip. 12 13 * dfg/DFGArgumentsEliminationPhase.cpp: 14 * ftl/FTLLowerDFGToB3.cpp: 15 (JSC::FTL::DFG::LowerDFGToB3::compileGetMyArgumentByVal): 16 1 17 2019-06-04 Tadeu Zagallo <tzagallo@apple.com> 2 18 -
trunk/Source/JavaScriptCore/dfg/DFGArgumentsEliminationPhase.cpp
r243232 r246071 763 763 index += numberOfArgumentsToSkip; 764 764 765 bool safeToGetStack ;765 bool safeToGetStack = index >= numberOfArgumentsToSkip; 766 766 if (inlineCallFrame) 767 safeToGetStack = index < inlineCallFrame->argumentCountIncludingThis - 1;767 safeToGetStack &= index < inlineCallFrame->argumentCountIncludingThis - 1; 768 768 else { 769 safeToGetStack =769 safeToGetStack &= 770 770 index < static_cast<unsigned>(codeBlock()->numParameters()) - 1; 771 771 } -
trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
r246041 r246071 4462 4462 LValue numberOfArgs = m_out.sub(numberOfArgsIncludingThis, m_out.int32One); 4463 4463 LValue indexToCheck = originalIndex; 4464 LValue numberOfArgumentsToSkip = m_out.int32Zero; 4464 4465 if (m_node->numberOfArgumentsToSkip()) { 4465 CheckValue* check = m_out.speculateAdd(indexToCheck, m_out.constInt32(m_node->numberOfArgumentsToSkip())); 4466 numberOfArgumentsToSkip = m_out.constInt32(m_node->numberOfArgumentsToSkip()); 4467 CheckValue* check = m_out.speculateAdd(indexToCheck, numberOfArgumentsToSkip); 4466 4468 blessSpeculation(check, Overflow, noValue(), nullptr, m_origin); 4467 4469 indexToCheck = check; 4468 4470 } 4469 4471 4470 LValue isOutOfBounds = m_out. aboveOrEqual(indexToCheck, numberOfArgs);4472 LValue isOutOfBounds = m_out.bitOr(m_out.aboveOrEqual(indexToCheck, numberOfArgs), m_out.below(indexToCheck, numberOfArgumentsToSkip)); 4471 4473 LBasicBlock continuation = nullptr; 4472 4474 LBasicBlock lastNext = nullptr;
Note:
See TracChangeset
for help on using the changeset viewer.