mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix clone with regards to value transfer.
This commit is contained in:
parent
6daa27622a
commit
eab9585ea1
@ -712,11 +712,13 @@ eth::Assembly Compiler::getCloneRuntime()
|
||||
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;
|
||||
a << u256(0) << eth::Instruction::DUP1;
|
||||
// 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;
|
||||
// this is the address which has to be substituted by the linker.
|
||||
//@todo implement as special "marker" AssemblyItem.
|
||||
a << u256("0xcafecafecafecafecafecafecafecafecafecafe");
|
||||
a << u256(eth::c_callGas + 10) << eth::Instruction::GAS << eth::Instruction::SUB;
|
||||
a << u256(eth::c_callGas + eth::c_callValueTransferGas + 10) << eth::Instruction::GAS << eth::Instruction::SUB;
|
||||
a << eth::Instruction::CALLCODE;
|
||||
//@todo adjust for larger return values, make this dynamic.
|
||||
a << u256(0x20) << u256(0) << eth::Instruction::RETURN;
|
||||
|
Loading…
Reference in New Issue
Block a user