aboutsummaryrefslogtreecommitdiffstats
path: root/ArrayUtils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ArrayUtils.cpp')
-rw-r--r--ArrayUtils.cpp8
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())