mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-03 23:02:27 +00:00
compiler: count locals number properly
This commit is contained in:
parent
57a0377c81
commit
339187a56d
3 changed files with 57 additions and 21 deletions
|
@ -55,14 +55,14 @@ func (c *codegen) traverseGlobals() (int, int, int) {
|
|||
switch n := node.(type) {
|
||||
case *ast.FuncDecl:
|
||||
if isInitFunc(n) {
|
||||
c, _ := countLocals(n)
|
||||
if c > initLocals {
|
||||
initLocals = c
|
||||
num, _ := c.countLocals(n)
|
||||
if num > initLocals {
|
||||
initLocals = num
|
||||
}
|
||||
} else if isDeployFunc(n) {
|
||||
c, _ := countLocals(n)
|
||||
if c > deployLocals {
|
||||
deployLocals = c
|
||||
num, _ := c.countLocals(n)
|
||||
if num > deployLocals {
|
||||
deployLocals = num
|
||||
}
|
||||
}
|
||||
return !hasDefer
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue