mirror of
https://github.com/status-im/ethereumj-personal.git
synced 2025-02-27 03:00:28 +00:00
Compare CALL gas value against gas remaining
This commit is contained in:
parent
7454d99b60
commit
1f3935a3ae
@ -140,8 +140,9 @@ public class VM {
|
||||
break;
|
||||
case CALL:
|
||||
program.spendGas(GasCost.CALL, op.name());
|
||||
if(stack.get(stack.size()-1).value().compareTo(MAX_GAS) == 1) {
|
||||
throw program.new OutOfGasException(); // protect against overflow (needs refactoring)
|
||||
BigInteger callGas = stack.get(stack.size()-1).value();
|
||||
if(callGas.compareTo(program.getGas().value()) == 1) {
|
||||
throw program.new OutOfGasException();
|
||||
}
|
||||
BigInteger x = stack.get(stack.size()-6).value().add(stack.get(stack.size()-7).value());
|
||||
BigInteger y = stack.get(stack.size()-4).value().add(stack.get(stack.size()-5).value());
|
||||
|
Loading…
x
Reference in New Issue
Block a user