From 8b3833d6e1fdfdab61023f0f8df410c169f8ca02 Mon Sep 17 00:00:00 2001 From: Petar Dambovaliev Date: Mon, 13 May 2024 17:01:04 +0200 Subject: [PATCH] save --- gnovm/pkg/gnolang/preprocess.go | 34 +++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/gnovm/pkg/gnolang/preprocess.go b/gnovm/pkg/gnolang/preprocess.go index 1ef8d581259..e2f7e74b5ad 100644 --- a/gnovm/pkg/gnolang/preprocess.go +++ b/gnovm/pkg/gnolang/preprocess.go @@ -2745,6 +2745,40 @@ func findUndefined2SkipLocals(store Store, last BlockNode, x Expr, t Type) Name func findUndefinedStmt(store Store, last BlockNode, stmt Stmt, t Type) Name { switch s := stmt.(type) { + case *IncDecStmt: + un := findUndefined2SkipLocals(store, last, s.X, t) + + if un != "" { + return un + } + case *PanicStmt: + un := findUndefined2SkipLocals(store, last, s.Exception, t) + + if un != "" { + return un + } + case *BlockStmt: + for _, rh := range s.Body { + un := findUndefinedStmt(store, last, rh, t) + + if un != "" { + return un + } + } + case *DeferStmt: + un := findUndefined2SkipLocals(store, last, s.Call.Func, t) + + if un != "" { + return un + } + + for _, rh := range s.Call.Args { + un = findUndefined2SkipLocals(store, last, rh, t) + + if un != "" { + return un + } + } case *SwitchStmt: un := findUndefined2SkipLocals(store, last, s.X, t) if un != "" {