diff options
author | Liana Husikyan <liana@ethdev.com> | 2015-05-15 18:23:13 +0800 |
---|---|---|
committer | Liana Husikyan <liana@ethdev.com> | 2015-06-01 19:06:12 +0800 |
commit | 2f50eb0028c7f7525ff35a60db7a18e09eee42e6 (patch) | |
tree | 67722e7b7f2960db1a7e8716a0eb0ab6fe13b88f /ArrayUtils.cpp | |
parent | f7e3568c6202b940394097f147e0c4e6ffe7fe9c (diff) | |
download | dexon-solidity-2f50eb0028c7f7525ff35a60db7a18e09eee42e6.tar.gz dexon-solidity-2f50eb0028c7f7525ff35a60db7a18e09eee42e6.tar.zst dexon-solidity-2f50eb0028c7f7525ff35a60db7a18e09eee42e6.zip |
added error jump instead of STOP instraction in case of exception
Diffstat (limited to 'ArrayUtils.cpp')
-rw-r--r-- | ArrayUtils.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/ArrayUtils.cpp b/ArrayUtils.cpp index 448e4da2..f59385d9 100644 --- a/ArrayUtils.cpp +++ b/ArrayUtils.cpp @@ -455,12 +455,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()) |