fixed stack level

This commit is contained in:
obscuren
2015-04-03 11:27:56 +02:00
parent fd5c5b2969
commit c59c826ab4
3 changed files with 32 additions and 6 deletions

View File

@ -2,8 +2,9 @@ package vm
import (
"fmt"
"github.com/ethereum/go-ethereum/params"
"math/big"
"github.com/ethereum/go-ethereum/params"
)
var (
@ -37,8 +38,8 @@ func baseCheck(op OpCode, stack *stack, gas *big.Int) error {
return err
}
if r.stackPush && len(stack.data)-r.stackPop+1 > int(params.StackLimit.Int64()) {
return fmt.Errorf("stack limit reached (%d)", params.StackLimit.Int64())
if r.stackPush && len(stack.data)-r.stackPop > int(params.StackLimit.Int64()) {
return fmt.Errorf("stack limit reached %d (%d)", len(stack.data), params.StackLimit.Int64())
}
gas.Add(gas, r.gas)