Mention RETURNDATACOPY in GasMeter and SemanticInformation

This commit is contained in:
Yoichi Hirai 2017-05-17 13:29:42 +02:00
parent 55737213d1
commit 9ff3064d03
No known key found for this signature in database
GPG Key ID: E7B75D080FCF7992
2 changed files with 4 additions and 0 deletions

View File

@ -103,6 +103,7 @@ GasMeter::GasConsumption GasMeter::estimateMax(AssemblyItem const& _item, bool _
break; break;
case Instruction::CALLDATACOPY: case Instruction::CALLDATACOPY:
case Instruction::CODECOPY: case Instruction::CODECOPY:
case Instruction::RETURNDATACOPY:
gas += memoryGas(0, -2); gas += memoryGas(0, -2);
gas += wordGas(GasCosts::copyGas, m_state->relativeStackElement(-2)); gas += wordGas(GasCosts::copyGas, m_state->relativeStackElement(-2));
break; break;

View File

@ -143,6 +143,8 @@ bool SemanticInformation::isDeterministic(AssemblyItem const& _item)
case Instruction::MSIZE: // depends on previous writes and reads, not only on content case Instruction::MSIZE: // depends on previous writes and reads, not only on content
case Instruction::BALANCE: // depends on previous calls case Instruction::BALANCE: // depends on previous calls
case Instruction::EXTCODESIZE: case Instruction::EXTCODESIZE:
case Instruction::RETURNDATACOPY: // depends on previous calls
case Instruction::RETURNDATASIZE:
return false; return false;
default: default:
return true; return true;
@ -156,6 +158,7 @@ bool SemanticInformation::invalidatesMemory(Instruction _instruction)
case Instruction::CALLDATACOPY: case Instruction::CALLDATACOPY:
case Instruction::CODECOPY: case Instruction::CODECOPY:
case Instruction::EXTCODECOPY: case Instruction::EXTCODECOPY:
case Instruction::RETURNDATACOPY:
case Instruction::MSTORE: case Instruction::MSTORE:
case Instruction::MSTORE8: case Instruction::MSTORE8:
case Instruction::CALL: case Instruction::CALL: