From c6d5de8864468f448d67b43a1a78ef04e643231e Mon Sep 17 00:00:00 2001 From: Wei-Ning Huang Date: Mon, 26 Nov 2018 16:59:08 +0800 Subject: core: vm: fix power2 table calculation (#50) --- core/vm/instructions.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'core') diff --git a/core/vm/instructions.go b/core/vm/instructions.go index 499e066f7..3a82190da 100644 --- a/core/vm/instructions.go +++ b/core/vm/instructions.go @@ -43,10 +43,10 @@ var ( ) func init() { - cur := int64(1) + cur := big.NewInt(1) for i := 0; i < 256; i++ { - power2[i] = big.NewInt(cur) - cur <<= 1 + power2[i] = new(big.Int).Set(cur) + cur = new(big.Int).Mul(cur, big2) } } -- cgit v1.2.3