From eb433731aa535a47c4a828ea15eafabd37a8278b Mon Sep 17 00:00:00 2001 From: obscuren Date: Thu, 26 Mar 2015 12:06:14 +0100 Subject: Fixed filter and refactored code --- core/filter.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core') diff --git a/core/filter.go b/core/filter.go index 901931d99..ba5d5e14e 100644 --- a/core/filter.go +++ b/core/filter.go @@ -4,8 +4,8 @@ import ( "math" "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/types" ) type AccountChange struct { -- cgit v1.2.3 From c32bca45ad753da69a5530a1ee96ff069e937fc2 Mon Sep 17 00:00:00 2001 From: obscuren Date: Thu, 26 Mar 2015 17:45:09 +0100 Subject: Stack limit --- core/vm/stack.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'core') diff --git a/core/vm/stack.go b/core/vm/stack.go index c5c2774db..1e093476b 100644 --- a/core/vm/stack.go +++ b/core/vm/stack.go @@ -5,6 +5,8 @@ import ( "math/big" ) +const maxStack = 1024 + func newStack() *stack { return &stack{} } @@ -15,6 +17,10 @@ type stack struct { } func (st *stack) push(d *big.Int) { + if len(st.data) == maxStack { + panic(fmt.Sprintf("stack limit reached (%d)", maxStack)) + } + stackItem := new(big.Int).Set(d) if len(st.data) > st.ptr { st.data[st.ptr] = stackItem -- cgit v1.2.3