diff options
author | Taylor Gerring <taylor.gerring@gmail.com> | 2015-03-27 05:42:46 +0800 |
---|---|---|
committer | Taylor Gerring <taylor.gerring@gmail.com> | 2015-03-27 05:42:46 +0800 |
commit | 6bd1f6cc49acd459e61559e5af515da2db2481e5 (patch) | |
tree | 3e4f7a51ca8e3cb03d24fbe1898578d88fd7456c /core | |
parent | bb12dbe233db2e064715b329b7ba987c76ba3bfa (diff) | |
parent | b0b0939879b9fb8453ec1c8fa2ceb522e56df3bc (diff) | |
download | dexon-6bd1f6cc49acd459e61559e5af515da2db2481e5.tar dexon-6bd1f6cc49acd459e61559e5af515da2db2481e5.tar.gz dexon-6bd1f6cc49acd459e61559e5af515da2db2481e5.tar.bz2 dexon-6bd1f6cc49acd459e61559e5af515da2db2481e5.tar.lz dexon-6bd1f6cc49acd459e61559e5af515da2db2481e5.tar.xz dexon-6bd1f6cc49acd459e61559e5af515da2db2481e5.tar.zst dexon-6bd1f6cc49acd459e61559e5af515da2db2481e5.zip |
Merge remote-tracking branch 'origin' into rpcargs
Conflicts:
rpc/args.go
Diffstat (limited to 'core')
-rw-r--r-- | core/filter.go | 2 | ||||
-rw-r--r-- | core/vm/stack.go | 6 |
2 files changed, 7 insertions, 1 deletions
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 { 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 |