compiler: count auxiliary locals introduced by inlining
During initialization of globals no function scope is present thus locals number is not saved anywere. Save it in `codegen` directly.
This commit is contained in:
parent
87a69b13f1
commit
60a3e0d778
4 changed files with 13 additions and 3 deletions
|
@ -98,6 +98,10 @@ func (c *codegen) traverseGlobals() bool {
|
|||
c.scope = nil
|
||||
})
|
||||
|
||||
if c.globalInlineCount > maxCnt {
|
||||
maxCnt = c.globalInlineCount
|
||||
}
|
||||
|
||||
// Here we remove `INITSLOT` if no code was emitted for `init` function.
|
||||
// Note that the `INITSSLOT` must stay in place.
|
||||
hasNoInit := initOffset+3 == c.prog.Len()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue