mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-03 02:27:48 +00:00
wasi: do not crash if argc is 0
Instead, leave args at its default value (which provides a fake argv[0] as it has for a long time). linux and mac do not seem affected. Fixes #1862 (tinygo apps after v0.17.0-113-g7b761fa crash if run without argv[0])
This commit is contained in:
@@ -30,6 +30,9 @@ func init() {
|
||||
// these args (argv).
|
||||
var argc, argv_buf_size uint32
|
||||
args_sizes_get(&argc, &argv_buf_size)
|
||||
if argc == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
// Obtain the command line arguments
|
||||
argsSlice := make([]unsafe.Pointer, argc)
|
||||
|
||||
Reference in New Issue
Block a user