aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/codegen
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2016-09-01 02:43:24 +0800
committerchriseth <c@ethdev.com>2016-09-06 03:28:28 +0800
commit9c64edf11052f2918f10ccd202bbfda628005562 (patch)
tree55d5cd9610711cc4c035fceb89f5b6ed0881a795 /libsolidity/codegen
parent962531af96a8a3ed6b28462d43c69d78fa48d511 (diff)
downloaddexon-solidity-9c64edf11052f2918f10ccd202bbfda628005562.tar.gz
dexon-solidity-9c64edf11052f2918f10ccd202bbfda628005562.tar.zst
dexon-solidity-9c64edf11052f2918f10ccd202bbfda628005562.zip
Change function type to include and propagate payable and constant modifier.
Diffstat (limited to 'libsolidity/codegen')
-rw-r--r--libsolidity/codegen/ContractCompiler.cpp6
-rw-r--r--libsolidity/codegen/ExpressionCompiler.cpp2
2 files changed, 8 insertions, 0 deletions
diff --git a/libsolidity/codegen/ContractCompiler.cpp b/libsolidity/codegen/ContractCompiler.cpp
index 58e6847c..33571bc0 100644
--- a/libsolidity/codegen/ContractCompiler.cpp
+++ b/libsolidity/codegen/ContractCompiler.cpp
@@ -242,6 +242,12 @@ void ContractCompiler::appendFunctionSelector(ContractDefinition const& _contrac
m_context << notFound;
if (fallback)
{
+ if (!fallback->isPayable())
+ {
+ // Throw if function is not payable but call contained ether.
+ m_context << Instruction::CALLVALUE;
+ m_context.appendConditionalJumpTo(m_context.errorTag());
+ }
eth::AssemblyItem returnTag = m_context.pushNewTag();
fallback->accept(*this);
m_context << returnTag;
diff --git a/libsolidity/codegen/ExpressionCompiler.cpp b/libsolidity/codegen/ExpressionCompiler.cpp
index 4a81e27d..de937b42 100644
--- a/libsolidity/codegen/ExpressionCompiler.cpp
+++ b/libsolidity/codegen/ExpressionCompiler.cpp
@@ -583,6 +583,8 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
Location::Bare,
false,
nullptr,
+ false,
+ false,
true,
true
),