aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/codegen
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-02-24 08:27:36 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-02-24 08:27:36 +0800
commit4d290e551c2d563671f9d56744883d3f3dff98ec (patch)
tree9f4a581d0fb76d744a242678bc6dba1c2d5882a9 /libsolidity/codegen
parent59514d8268585f02aa1abb1fdb1b56bcf6e56ef4 (diff)
downloaddexon-solidity-4d290e551c2d563671f9d56744883d3f3dff98ec.tar.gz
dexon-solidity-4d290e551c2d563671f9d56744883d3f3dff98ec.tar.zst
dexon-solidity-4d290e551c2d563671f9d56744883d3f3dff98ec.zip
Disallow setting .gas() on .transfer()
Diffstat (limited to 'libsolidity/codegen')
-rw-r--r--libsolidity/codegen/ExpressionCompiler.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/libsolidity/codegen/ExpressionCompiler.cpp b/libsolidity/codegen/ExpressionCompiler.cpp
index 4956871d..fd4d87a5 100644
--- a/libsolidity/codegen/ExpressionCompiler.cpp
+++ b/libsolidity/codegen/ExpressionCompiler.cpp
@@ -620,19 +620,15 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
_functionCall.expression().accept(*this);
// Provide the gas stipend manually at first because we may send zero ether.
// Will be zeroed if we send more than zero ether.
- if (!function.gasSet())
- m_context << u256(eth::GasCosts::callStipend);
+ m_context << u256(eth::GasCosts::callStipend);
arguments.front()->accept(*this);
utils().convertType(
*arguments.front()->annotation().type,
*function.parameterTypes().front(), true
);
- if (!function.gasSet())
- {
- // gas <- gas * !value
- m_context << Instruction::SWAP1 << Instruction::DUP2;
- m_context << Instruction::ISZERO << Instruction::MUL << Instruction::SWAP1;
- }
+ // gas <- gas * !value
+ m_context << Instruction::SWAP1 << Instruction::DUP2;
+ m_context << Instruction::ISZERO << Instruction::MUL << Instruction::SWAP1;
appendExternalFunctionCall(
FunctionType(
TypePointers{},