tinygo/loader
Ayke van Laethem c7c874a487 loader: fix panic in CGo files with syntax errors
If all of the Go files presented to the compiler have syntax errors,
cgo.Process gets an empty files slice and will panic:

    panic: runtime error: index out of range [0] with length 0

    goroutine 1 [running]:
    github.com/tinygo-org/tinygo/cgo.Process({0x0, 0x4e8e36, 0x0}, {0xc000024104, 0x18}, 0xc000090fc0, {0xc000899780, 0x7, 0xc00018ce68})
    	/home/ayke/src/github.com/tinygo-org/tinygo/cgo/cgo.go:186 +0x22ee
    github.com/tinygo-org/tinygo/loader.(*Package).parseFiles(0xc0001ccf00)
    	/home/ayke/src/github.com/tinygo-org/tinygo/loader/loader.go:400 +0x51e

This is simple to work around: just don't try to run CGo when there are
no files to process. It just means there are bugs to fix before CGo can
properly run.

(This is perhaps not the nicest solution but certainly the simplest).
2021-09-15 19:04:26 +02:00
..
errors.go main: match go test output 2021-05-06 20:04:16 +02:00
goroot.go baremetal,wasm: support command line params and environment variables 2021-08-12 21:19:24 +02:00
list.go loader: rewrite/refactor much of the code to use go list directly 2020-09-03 22:10:14 +02:00
loader.go loader: fix panic in CGo files with syntax errors 2021-09-15 19:04:26 +02:00
ssa.go compiler: refactor and add tests 2021-01-15 14:43:43 +01:00