neoneo-go/pkg
Anna Shaleva 0bca027f99 compiler: avoid panic on empty package list
An attempt to compile unexisting file via neo-go-vm CLI leads to the following
panic:
```
NEO-GO-VM > loadgo ./1-print.go
panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
github.com/nspcc-dev/neo-go/pkg/compiler.codeGen(0xc000047300)
	github.com/nspcc-dev/neo-go/pkg/compiler/codegen.go:2188 +0x60c
github.com/nspcc-dev/neo-go/pkg/compiler.CompileWithOptions({0xc000047300, 0xf66c92}, {0x0, 0x0}, 0xc0003a0000)
	github.com/nspcc-dev/neo-go/pkg/compiler/compiler.go:218 +0x65
github.com/nspcc-dev/neo-go/pkg/vm/cli.handleLoadGo(0xc0000f5340)
	github.com/nspcc-dev/neo-go/pkg/vm/cli/cli.go:480 +0x1a5
github.com/urfave/cli.HandleAction({0xde74a0, 0x10d61d0}, 0x6)
	github.com/urfave/cli@v1.22.5/app.go:524 +0xa8
github.com/urfave/cli.Command.Run({{0xf632f0, 0x6}, {0x0, 0x0}, {0x0, 0x0, 0x0}, {0xf9915b, 0x38}, {0xf6a57b, ...}, ...}, ...)
	github.com/urfave/cli@v1.22.5/command.go:173 +0x652
github.com/urfave/cli.(*App).Run(0xc0002c2000, {0xc00036c330, 0x3, 0x3})
	github.com/urfave/cli@v1.22.5/app.go:277 +0x705
github.com/nspcc-dev/neo-go/pkg/vm/cli.(*VMCLI).Run(0xc000290890)
	github.com/nspcc-dev/neo-go/pkg/vm/cli/cli.go:694 +0x317
github.com/nspcc-dev/neo-go/cli/vm.startVMPrompt(0xc0001b9e40)
	github.com/nspcc-dev/neo-go/cli/vm/vm.go:29 +0x92
github.com/urfave/cli.HandleAction({0xde74a0, 0x10d5d10}, 0x2)
	github.com/urfave/cli@v1.22.5/app.go:524 +0xa8
github.com/urfave/cli.Command.Run({{0xf60a2f, 0x2}, {0x0, 0x0}, {0x0, 0x0, 0x0}, {0xf7880b, 0x19}, {0x0, ...}, ...}, ...)
	github.com/urfave/cli@v1.22.5/command.go:173 +0x652
github.com/urfave/cli.(*App).Run(0xc0001c8fc0, {0xc000116020, 0x2, 0x2})
	github.com/urfave/cli@v1.22.5/app.go:277 +0x705
main.main()
	./main.go:21 +0x33
```
2022-08-17 11:29:28 +03:00
..
compiler compiler: avoid panic on empty package list 2022-08-17 11:29:28 +03:00
config cli: also check new ApplicationConfiguration for consistency 2022-07-27 12:30:08 +03:00
consensus wallet: fix wallet version to conform to NEP-6 2022-08-07 22:41:40 +03:00
core state: add more convenient method to get native contract hashes 2022-08-15 10:54:29 +03:00
crypto crypto: adjust Checksum documentation 2022-05-13 13:20:40 +03:00
encoding *: apply go 1.19 formatter heuristics 2022-08-09 15:37:52 +03:00
interop *: apply go 1.19 formatter heuristics 2022-08-09 15:37:52 +03:00
io [#2442] English Check 2022-05-04 19:48:27 +03:00
neorpc rpcsrv: return more configuration data to the client 2022-08-09 15:36:40 +03:00
neotest *: apply go 1.19 formatter heuristics 2022-08-09 15:37:52 +03:00
network *: apply go 1.19 formatter heuristics 2022-08-09 15:37:52 +03:00
rpcclient rpcclient: add policy package for the PolicyContract contract 2022-08-16 12:43:25 +03:00
services rpcclient: add policy package for the PolicyContract contract 2022-08-16 12:43:25 +03:00
smartcontract Merge pull request #2632 from nspcc-dev/rpcclient-actor 2022-08-09 17:21:24 +03:00
util *: apply go 1.19 formatter heuristics 2022-08-09 15:37:52 +03:00
vm *: apply go 1.19 formatter heuristics 2022-08-09 15:37:52 +03:00
wallet Merge pull request #2632 from nspcc-dev/rpcclient-actor 2022-08-09 17:21:24 +03:00