aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/codegen/Compiler.cpp
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2016-03-07 23:55:53 +0800
committerchriseth <c@ethdev.com>2016-03-12 00:49:32 +0800
commite5514becb89c945f59fd440696d0bb3122edbe99 (patch)
tree6358ae151c50802b3cb0c158f7b8b06c53669fd4 /libsolidity/codegen/Compiler.cpp
parent60a21c6487743578af6fd4e1540a36a2b80fcac7 (diff)
downloaddexon-solidity-e5514becb89c945f59fd440696d0bb3122edbe99.tar
dexon-solidity-e5514becb89c945f59fd440696d0bb3122edbe99.tar.gz
dexon-solidity-e5514becb89c945f59fd440696d0bb3122edbe99.tar.bz2
dexon-solidity-e5514becb89c945f59fd440696d0bb3122edbe99.tar.lz
dexon-solidity-e5514becb89c945f59fd440696d0bb3122edbe99.tar.xz
dexon-solidity-e5514becb89c945f59fd440696d0bb3122edbe99.tar.zst
dexon-solidity-e5514becb89c945f59fd440696d0bb3122edbe99.zip
BREAKING: Implement delegatecall and make default for library calls.
Diffstat (limited to 'libsolidity/codegen/Compiler.cpp')
-rw-r--r--libsolidity/codegen/Compiler.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/libsolidity/codegen/Compiler.cpp b/libsolidity/codegen/Compiler.cpp
index 18803b71..c7eb71a8 100644
--- a/libsolidity/codegen/Compiler.cpp
+++ b/libsolidity/codegen/Compiler.cpp
@@ -773,15 +773,13 @@ eth::Assembly Compiler::cloneRuntime()
a << u256(0) << eth::Instruction::DUP1 << eth::Instruction::CALLDATACOPY;
//@todo adjust for larger return values, make this dynamic.
a << u256(0x20) << u256(0) << eth::Instruction::CALLDATASIZE;
- // unfortunately, we have to send the value again, so that CALLVALUE returns the correct value
- // in the callcoded contract.
- a << u256(0) << eth::Instruction::CALLVALUE;
+ a << u256(0);
// this is the address which has to be substituted by the linker.
//@todo implement as special "marker" AssemblyItem.
a << u256("0xcafecafecafecafecafecafecafecafecafecafe");
- a << u256(schedule.callGas + schedule.callValueTransferGas + 10) << eth::Instruction::GAS << eth::Instruction::SUB;
- a << eth::Instruction::CALLCODE;
- //Propagate error condition (if CALLCODE pushes 0 on stack).
+ a << u256(schedule.callGas + 10) << eth::Instruction::GAS << eth::Instruction::SUB;
+ a << eth::Instruction::DELEGATECALL;
+ //Propagate error condition (if DELEGATECALL pushes 0 on stack).
a << eth::Instruction::ISZERO;
a.appendJumpI(a.errorTag());
//@todo adjust for larger return values, make this dynamic.