Skip to content

Commit

Permalink
fix package creation ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
deelawn committed Apr 25, 2024
1 parent 4e21d02 commit 4c59eb3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gnovm/pkg/gnolang/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,15 +270,16 @@ func (m *Machine) runMemPackage(memPkg *std.MemPackage, save, overrides bool) (*
m.Store.SetBlockNode(pn)
m.Store.SetCachePackage(pv)
}

m.SetActivePackage(pv)
initFuncs := m.RunFiles(files.Files...)

// Save package values and types so they are finalized before
// the init functions are run.
if save {
m.savePackageValuesAndTypes()
}

initFuncs := m.RunFiles(files.Files...)
initFuncs.Run(m)

// Finish saving the package state.
Expand Down

0 comments on commit 4c59eb3

Please sign in to comment.