In create memory calculation is the same for create2 because the additional parameter was popped before. (#9522)

This commit is contained in:
cheme 2018-09-11 17:47:26 +02:00 committed by Wei Tang
parent 98220442b4
commit 65bf1086a2

View File

@ -233,11 +233,7 @@ impl<Gas: evm::CostType> Gasometer<Gas> {
},
instructions::CREATE | instructions::CREATE2 => {
let gas = Gas::from(schedule.create_gas);
let mem = match instruction {
instructions::CREATE => mem_needed(stack.peek(1), stack.peek(2))?,
instructions::CREATE2 => mem_needed(stack.peek(2), stack.peek(3))?,
_ => unreachable!("instruction can only be CREATE/CREATE2 checked above; qed"),
};
let mem = mem_needed(stack.peek(1), stack.peek(2))?;
Request::GasMemProvide(gas, mem, None)
},