Skip to content

Commit

Permalink
fix max names in block check
Browse files Browse the repository at this point in the history
  • Loading branch information
deelawn committed Jul 31, 2024
1 parent fadf622 commit 86d658f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gnovm/pkg/gnolang/nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"go/parser"
"go/token"
"math"
"os"
"path/filepath"
"reflect"
Expand Down Expand Up @@ -1790,7 +1791,7 @@ func (sb *StaticBlock) Define2(isConst bool, n Name, st Type, tv TypedValue) {
if int(sb.NumNames) != len(sb.Names) {
panic("StaticBlock.NumNames and len(.Names) mismatch")
}
if (1<<16 - 1) < sb.NumNames {
if sb.NumNames == math.MaxUint16 {
panic("too many variables in block")
}
if tv.T == nil && tv.V != nil {
Expand Down

0 comments on commit 86d658f

Please sign in to comment.