diff options
author | chriseth <chris@ethereum.org> | 2018-03-08 03:20:57 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-08 03:20:57 +0800 |
commit | dfe3193c7382c80f1814247a162663a97c3f5e67 (patch) | |
tree | d0540c2dfc43a76f0add46840f60ff2e28604a19 /libsolidity/codegen/ContractCompiler.cpp | |
parent | 3155dd8058672ce8f04bc2c0f2536cb549067d0a (diff) | |
parent | 15920dc75dd5a46a036d5ff16fb8eee0534be6e1 (diff) | |
download | dexon-solidity-dfe3193c7382c80f1814247a162663a97c3f5e67.tar dexon-solidity-dfe3193c7382c80f1814247a162663a97c3f5e67.tar.gz dexon-solidity-dfe3193c7382c80f1814247a162663a97c3f5e67.tar.bz2 dexon-solidity-dfe3193c7382c80f1814247a162663a97c3f5e67.tar.lz dexon-solidity-dfe3193c7382c80f1814247a162663a97c3f5e67.tar.xz dexon-solidity-dfe3193c7382c80f1814247a162663a97c3f5e67.tar.zst dexon-solidity-dfe3193c7382c80f1814247a162663a97c3f5e67.zip |
Merge pull request #3678 from ethereum/develop
Merge develop into release.
Diffstat (limited to 'libsolidity/codegen/ContractCompiler.cpp')
-rw-r--r-- | libsolidity/codegen/ContractCompiler.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/libsolidity/codegen/ContractCompiler.cpp b/libsolidity/codegen/ContractCompiler.cpp index f463db94..5a9498f0 100644 --- a/libsolidity/codegen/ContractCompiler.cpp +++ b/libsolidity/codegen/ContractCompiler.cpp @@ -903,6 +903,15 @@ bool ContractCompiler::visit(Throw const& _throw) return false; } +bool ContractCompiler::visit(EmitStatement const& _emit) +{ + CompilerContext::LocationSetter locationSetter(m_context, _emit); + StackHeightChecker checker(m_context); + compileExpression(_emit.eventCall()); + checker.check(); + return false; +} + bool ContractCompiler::visit(VariableDeclarationStatement const& _variableDeclarationStatement) { StackHeightChecker checker(m_context); @@ -1050,7 +1059,7 @@ void ContractCompiler::compileExpression(Expression const& _expression, TypePoin CompilerUtils(m_context).convertType(*_expression.annotation().type, *_targetType); } -eth::AssemblyPointer ContractCompiler::cloneRuntime() +eth::AssemblyPointer ContractCompiler::cloneRuntime() const { eth::Assembly a; a << Instruction::CALLDATASIZE; @@ -1061,7 +1070,7 @@ eth::AssemblyPointer ContractCompiler::cloneRuntime() // this is the address which has to be substituted by the linker. //@todo implement as special "marker" AssemblyItem. a << u256("0xcafecafecafecafecafecafecafecafecafecafe"); - a << u256(eth::GasCosts::callGas + 10) << Instruction::GAS << Instruction::SUB; + a << u256(eth::GasCosts::callGas(m_context.evmVersion()) + 10) << Instruction::GAS << Instruction::SUB; a << Instruction::DELEGATECALL; //Propagate error condition (if DELEGATECALL pushes 0 on stack). a << Instruction::ISZERO; |