From 90c2560b5229dba322ef07e04582bd82db9ae741 Mon Sep 17 00:00:00 2001 From: Masaaki Goshima Date: Sun, 31 Jan 2021 02:30:48 +0900 Subject: [PATCH] Fix accepatable address range --- encode.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/encode.go b/encode.go index 5f2470d..a48c4c3 100644 --- a/encode.go +++ b/encode.go @@ -36,8 +36,8 @@ type compiledCode struct { } const ( - bufSize = 1024 - maxTypeAddrRange = 1024 * 1024 * 16 // 16 Mib + bufSize = 1024 + maxAcceptableTypeAddrRange = 1024 * 1024 * 2 // 2 Mib ) const ( @@ -111,7 +111,7 @@ func setupOpcodeSets() error { if addrRange == 0 { return fmt.Errorf("failed to get address range of types") } - if addrRange > maxTypeAddrRange { + if addrRange > maxAcceptableTypeAddrRange { return fmt.Errorf("too big address range %d", addrRange) } cachedOpcodeSets = make([]*opcodeSet, addrRange)