mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #1975 from LianaHus/sol_EVMExceptions
"error jump" instead of STOP instraction in case of exception
This commit is contained in:
+3
-5
@@ -465,12 +465,10 @@ void ArrayUtils::accessIndex(ArrayType const& _arrayType) const
|
||||
m_context << eth::Instruction::DUP2 << load;
|
||||
// stack: <base_ref> <index> <length>
|
||||
// check out-of-bounds access
|
||||
m_context << eth::Instruction::DUP2 << eth::Instruction::LT;
|
||||
eth::AssemblyItem legalAccess = m_context.appendConditionalJump();
|
||||
// out-of-bounds access throws exception (just STOP for now)
|
||||
m_context << eth::Instruction::STOP;
|
||||
m_context << eth::Instruction::DUP2 << eth::Instruction::LT << eth::Instruction::ISZERO;
|
||||
// out-of-bounds access throws exception
|
||||
m_context.appendConditionalJumpTo(m_context.errorTag());
|
||||
|
||||
m_context << legalAccess;
|
||||
// stack: <base_ref> <index>
|
||||
m_context << eth::Instruction::SWAP1;
|
||||
if (_arrayType.isDynamicallySized())
|
||||
|
||||
Reference in New Issue
Block a user