compiler: calculate local variables properly
In case when right-hand side of an assignment is a function, left-hand side should be used.
This commit is contained in:
parent
84c36326f5
commit
b18a7f200c
2 changed files with 13 additions and 1 deletions
|
@ -124,7 +124,7 @@ func (c *funcScope) countLocals() int {
|
|||
}
|
||||
case *ast.AssignStmt:
|
||||
if n.Tok == token.DEFINE {
|
||||
size += len(n.Rhs)
|
||||
size += len(n.Lhs)
|
||||
}
|
||||
case *ast.ReturnStmt, *ast.IfStmt:
|
||||
size++
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue