Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
petar-dambovaliev committed May 13, 2024
1 parent 02ce626 commit 8b3833d
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions gnovm/pkg/gnolang/preprocess.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Check warning on line 2749 in gnovm/pkg/gnolang/preprocess.go

View check run for this annotation

Codecov / codecov/patch

gnovm/pkg/gnolang/preprocess.go#L2746-L2749

Added lines #L2746 - L2749 were not covered by tests

if un != "" {
return un

Check warning on line 2752 in gnovm/pkg/gnolang/preprocess.go

View check run for this annotation

Codecov / codecov/patch

gnovm/pkg/gnolang/preprocess.go#L2751-L2752

Added lines #L2751 - L2752 were not covered by tests
}
case *PanicStmt:
un := findUndefined2SkipLocals(store, last, s.Exception, t)

Check warning on line 2755 in gnovm/pkg/gnolang/preprocess.go

View check run for this annotation

Codecov / codecov/patch

gnovm/pkg/gnolang/preprocess.go#L2754-L2755

Added lines #L2754 - L2755 were not covered by tests

if un != "" {
return un

Check warning on line 2758 in gnovm/pkg/gnolang/preprocess.go

View check run for this annotation

Codecov / codecov/patch

gnovm/pkg/gnolang/preprocess.go#L2757-L2758

Added lines #L2757 - L2758 were not covered by tests
}
case *BlockStmt:
for _, rh := range s.Body {
un := findUndefinedStmt(store, last, rh, t)

Check warning on line 2762 in gnovm/pkg/gnolang/preprocess.go

View check run for this annotation

Codecov / codecov/patch

gnovm/pkg/gnolang/preprocess.go#L2760-L2762

Added lines #L2760 - L2762 were not covered by tests

if un != "" {
return un

Check warning on line 2765 in gnovm/pkg/gnolang/preprocess.go

View check run for this annotation

Codecov / codecov/patch

gnovm/pkg/gnolang/preprocess.go#L2764-L2765

Added lines #L2764 - L2765 were not covered by tests
}
}
case *DeferStmt:
un := findUndefined2SkipLocals(store, last, s.Call.Func, t)

Check warning on line 2769 in gnovm/pkg/gnolang/preprocess.go

View check run for this annotation

Codecov / codecov/patch

gnovm/pkg/gnolang/preprocess.go#L2768-L2769

Added lines #L2768 - L2769 were not covered by tests

if un != "" {
return un

Check warning on line 2772 in gnovm/pkg/gnolang/preprocess.go

View check run for this annotation

Codecov / codecov/patch

gnovm/pkg/gnolang/preprocess.go#L2771-L2772

Added lines #L2771 - L2772 were not covered by tests
}

for _, rh := range s.Call.Args {
un = findUndefined2SkipLocals(store, last, rh, t)

Check warning on line 2776 in gnovm/pkg/gnolang/preprocess.go

View check run for this annotation

Codecov / codecov/patch

gnovm/pkg/gnolang/preprocess.go#L2775-L2776

Added lines #L2775 - L2776 were not covered by tests

if un != "" {
return un

Check warning on line 2779 in gnovm/pkg/gnolang/preprocess.go

View check run for this annotation

Codecov / codecov/patch

gnovm/pkg/gnolang/preprocess.go#L2778-L2779

Added lines #L2778 - L2779 were not covered by tests
}
}
case *SwitchStmt:
un := findUndefined2SkipLocals(store, last, s.X, t)
if un != "" {
Expand Down

0 comments on commit 8b3833d

Please sign in to comment.