From 4913c76f3be7d2d57418beefeb360f36055d29c4 Mon Sep 17 00:00:00 2001 From: Petar Dambovaliev Date: Thu, 16 Jan 2025 17:52:03 +0100 Subject: [PATCH] save --- gnovm/pkg/gnolang/preprocess.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gnovm/pkg/gnolang/preprocess.go b/gnovm/pkg/gnolang/preprocess.go index 8d9015de037..d337706c7ed 100644 --- a/gnovm/pkg/gnolang/preprocess.go +++ b/gnovm/pkg/gnolang/preprocess.go @@ -129,6 +129,7 @@ func PredefineFileSet(store Store, pn *PackageNode, fset *FileSet) { continue } + d.SetAttribute(ATTR_GLOBAL, true) // recursively predefine dependencies. d2, _ := predefineNow(store, fn, d) @@ -4442,6 +4443,7 @@ func findUndefined2(store Store, last BlockNode, x Expr, t Type, skipPredefined return } case *CallExpr: + cx.Func.SetAttribute(ATTR_GLOBAL, cx.GetAttribute(ATTR_GLOBAL)) un = findUndefined2(store, last, cx.Func, nil, skipPredefined) if un != "" { return @@ -4732,6 +4734,7 @@ func tryPredefine(store Store, last BlockNode, d Decl) (un Name) { return } for _, vx := range d.Values { + vx.SetAttribute(ATTR_GLOBAL, d.GetAttribute(ATTR_GLOBAL)) un = findUndefined(store, last, vx) if un != "" { return