From 2f50eb0028c7f7525ff35a60db7a18e09eee42e6 Mon Sep 17 00:00:00 2001 From: Liana Husikyan Date: Fri, 15 May 2015 12:23:13 +0200 Subject: added error jump instead of STOP instraction in case of exception --- ArrayUtils.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'ArrayUtils.cpp') 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: // 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: m_context << eth::Instruction::SWAP1; if (_arrayType.isDynamicallySized()) -- cgit v1.2.3