Skip to content

Commit

Permalink
fix(gnovm): return error on parsing error
Browse files Browse the repository at this point in the history
  • Loading branch information
MikaelVallenet committed Oct 31, 2024
1 parent ad1c8df commit cf90c37
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gnovm/memfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func (mempkg *MemPackage) Validate() error {
fset := token.NewFileSet()
astFile, err := parser.ParseFile(fset, file.Name, file.Body, parser.ImportsOnly)
if err != nil {
continue // can be other files like LICENSE, README or empty gno files
return fmt.Errorf("failed to parse imports in file %q of package %q: %w", file.Name, mempkg.Path, err)
}
for _, imp := range astFile.Imports {
// ensure the pkg is a realm by checking if the path contains /r/ and no other / character before it (i.e protect from gno.land/p/demo/r/)
Expand Down

0 comments on commit cf90c37

Please sign in to comment.