From c59c826ab45e2e999dc9a173e5bce9727754f544 Mon Sep 17 00:00:00 2001 From: obscuren Date: Fri, 3 Apr 2015 11:27:56 +0200 Subject: fixed stack level --- core/vm/gas.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'core') diff --git a/core/vm/gas.go b/core/vm/gas.go index f7abe63f8..33fc3a002 100644 --- a/core/vm/gas.go +++ b/core/vm/gas.go @@ -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) -- cgit