aboutsummaryrefslogtreecommitdiffstats
path: root/ExpressionCompiler.cpp
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-06-01 23:45:55 +0800
committerchriseth <c@ethdev.com>2015-06-01 23:45:55 +0800
commit408fd7ab5936168a0861cbcf7ba8e029210be179 (patch)
treee45a4ab9fbbd9730ec73793ef1886e92478ce338 /ExpressionCompiler.cpp
parentcf688ea738220cff7226ec8f515948613e885a46 (diff)
parentaf4650beb2360ebdf75e0fb2126b88acf441080a (diff)
downloaddexon-solidity-408fd7ab5936168a0861cbcf7ba8e029210be179.tar.gz
dexon-solidity-408fd7ab5936168a0861cbcf7ba8e029210be179.tar.zst
dexon-solidity-408fd7ab5936168a0861cbcf7ba8e029210be179.zip
Merge pull request #1975 from LianaHus/sol_EVMExceptions
"error jump" instead of STOP instraction in case of exception
Diffstat (limited to 'ExpressionCompiler.cpp')
-rw-r--r--ExpressionCompiler.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/ExpressionCompiler.cpp b/ExpressionCompiler.cpp
index 5a978285..bb326077 100644
--- a/ExpressionCompiler.cpp
+++ b/ExpressionCompiler.cpp
@@ -1106,8 +1106,11 @@ void ExpressionCompiler::appendExternalFunctionCall(
m_context << eth::Instruction::CALLCODE;
else
m_context << eth::Instruction::CALL;
- auto tag = m_context.appendConditionalJump();
- m_context << eth::Instruction::STOP << tag; // STOP if CALL leaves 0.
+
+ //Propagate error condition (if CALL pushes 0 on stack).
+ m_context << eth::Instruction::ISZERO;
+ m_context.appendConditionalJumpTo(m_context.errorTag());
+
if (_functionType.valueSet())
m_context << eth::Instruction::POP;
if (_functionType.gasSet())