global var init

This commit is contained in:
xushiwei
2024-04-21 00:22:39 +08:00
parent 358e18b9de
commit 8f31e4a6d3
7 changed files with 22 additions and 11 deletions

View File

@@ -53,6 +53,7 @@ func (p *context) compileGlobal(pkg llssa.Package, gbl *ssa.Global) llssa.Global
return g
}
g := pkg.NewVar(gbl.Name(), gbl.Type())
g.Init(p.prog.Null(g.Type))
p.glbs[gbl] = g
return g
}