mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Some cleanups in GasMeter
This commit is contained in:
parent
d64be90497
commit
d7c3f197c4
@ -101,8 +101,8 @@ GasMeter::GasConsumption GasMeter::estimateMax(AssemblyItem const& _item, bool _
|
|||||||
break;
|
break;
|
||||||
case Instruction::KECCAK256:
|
case Instruction::KECCAK256:
|
||||||
gas = GasCosts::keccak256Gas;
|
gas = GasCosts::keccak256Gas;
|
||||||
gas += wordGas(GasCosts::keccak256WordGas, m_state->relativeStackElement(-1));
|
|
||||||
gas += memoryGas(0, -1);
|
gas += memoryGas(0, -1);
|
||||||
|
gas += wordGas(GasCosts::keccak256WordGas, m_state->relativeStackElement(-1));
|
||||||
break;
|
break;
|
||||||
case Instruction::CALLDATACOPY:
|
case Instruction::CALLDATACOPY:
|
||||||
case Instruction::CODECOPY:
|
case Instruction::CODECOPY:
|
||||||
@ -214,7 +214,7 @@ GasMeter::GasConsumption GasMeter::memoryGas(ExpressionClasses::Id _position)
|
|||||||
if (!value)
|
if (!value)
|
||||||
return GasConsumption::infinite();
|
return GasConsumption::infinite();
|
||||||
if (*value < m_largestMemoryAccess)
|
if (*value < m_largestMemoryAccess)
|
||||||
return GasConsumption(u256(0));
|
return GasConsumption(0);
|
||||||
u256 previous = m_largestMemoryAccess;
|
u256 previous = m_largestMemoryAccess;
|
||||||
m_largestMemoryAccess = *value;
|
m_largestMemoryAccess = *value;
|
||||||
auto memGas = [=](u256 const& pos) -> u256
|
auto memGas = [=](u256 const& pos) -> u256
|
||||||
|
Loading…
Reference in New Issue
Block a user