mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Extend memory beyond 32 byte addresses in interpreter.
This commit is contained in:
parent
1fd744c777
commit
5b4b4011c7
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
mstore(0, 7)
|
||||||
|
sstore(0, mload(0))
|
||||||
|
mstore(sub(0, 1), sub(0, 1))
|
||||||
|
sstore(1, mload(sub(0, 1)))
|
||||||
|
}
|
||||||
|
// ----
|
||||||
|
// Trace:
|
||||||
|
// Memory dump:
|
||||||
|
// 0: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff07
|
||||||
|
// FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0: 00000000000000000000000000000000000000000000000000000000000000ff
|
||||||
|
// Storage dump:
|
||||||
|
// 0000000000000000000000000000000000000000000000000000000000000000: 0000000000000000000000000000000000000000000000000000000000000007
|
||||||
|
// 0000000000000000000000000000000000000000000000000000000000000001: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
@ -248,15 +248,14 @@ u256 EVMInstructionInterpreter::eval(
|
|||||||
return m_state.gaslimit;
|
return m_state.gaslimit;
|
||||||
// --------------- memory / storage / logs ---------------
|
// --------------- memory / storage / logs ---------------
|
||||||
case Instruction::MLOAD:
|
case Instruction::MLOAD:
|
||||||
if (accessMemory(arg[0], 0x20))
|
accessMemory(arg[0], 0x20);
|
||||||
return readMemoryWord(arg[0]);
|
return readMemoryWord(arg[0]);
|
||||||
return 0;
|
|
||||||
case Instruction::MSTORE:
|
case Instruction::MSTORE:
|
||||||
if (accessMemory(arg[0], 0x20))
|
accessMemory(arg[0], 0x20);
|
||||||
writeMemoryWord(arg[0], arg[1]);
|
writeMemoryWord(arg[0], arg[1]);
|
||||||
return 0;
|
return 0;
|
||||||
case Instruction::MSTORE8:
|
case Instruction::MSTORE8:
|
||||||
if (accessMemory(arg[0], 1))
|
accessMemory(arg[0], 1);
|
||||||
m_state.memory[arg[0]] = uint8_t(arg[1] & 0xff);
|
m_state.memory[arg[0]] = uint8_t(arg[1] & 0xff);
|
||||||
return 0;
|
return 0;
|
||||||
case Instruction::SLOAD:
|
case Instruction::SLOAD:
|
||||||
|
Loading…
Reference in New Issue
Block a user