aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-08-01 23:19:32 +0800
committerGitHub <noreply@github.com>2017-08-01 23:19:32 +0800
commit3aacfc7e3569b27ca97dce41d886bbc3043546e0 (patch)
treee3f40322bdb61180fc25e49788bb81c14e8a7ce9
parentf1ae38402e63c35d64cddcd8063836b57ac0adea (diff)
parent39dba0efe83c5f6309ac2582d92a7150a9d6b0d8 (diff)
downloaddexon-solidity-3aacfc7e3569b27ca97dce41d886bbc3043546e0.tar.gz
dexon-solidity-3aacfc7e3569b27ca97dce41d886bbc3043546e0.tar.zst
dexon-solidity-3aacfc7e3569b27ca97dce41d886bbc3043546e0.zip
Merge pull request #2682 from ethereum/delegatecall-newaccount
Provide new account gas for low-level callcode/delegatecall
-rw-r--r--Changelog.md1
-rw-r--r--libsolidity/codegen/ExpressionCompiler.cpp2
2 files changed, 2 insertions, 1 deletions
diff --git a/Changelog.md b/Changelog.md
index d36b02b5..7e4606bd 100644
--- a/Changelog.md
+++ b/Changelog.md
@@ -3,6 +3,7 @@
Features:
Bugfixes:
+ * Code Generator: Provide "new account gas" for low-level ``callcode`` and ``delegatecall``.
### 0.4.14 (2017-07-31)
diff --git a/libsolidity/codegen/ExpressionCompiler.cpp b/libsolidity/codegen/ExpressionCompiler.cpp
index d661e1b1..2c8cfd76 100644
--- a/libsolidity/codegen/ExpressionCompiler.cpp
+++ b/libsolidity/codegen/ExpressionCompiler.cpp
@@ -1712,7 +1712,7 @@ void ExpressionCompiler::appendExternalFunctionCall(
u256 gasNeededByCaller = eth::GasCosts::callGas + 10;
if (_functionType.valueSet())
gasNeededByCaller += eth::GasCosts::callValueTransferGas;
- if (!isCallCode && !isDelegateCall && !existenceChecked)
+ if (!existenceChecked)
gasNeededByCaller += eth::GasCosts::callNewAccountGas; // we never know
m_context << gasNeededByCaller << Instruction::GAS << Instruction::SUB;
}