Skip to content

llgo run should raise running errors #294

Description

@cpunion

Case:

package main

func main() {
	var p *int = nil
	*p = 0
}

Expect:

$ go run ./main.go
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x104f9aa34]

goroutine 1 [running]:
main.main()
	/Users/lijie/test/go/crash/main.go:5 +0x4
exit status 2
$ echo $?
1

Got:

$ llgo run ./main.go
$ echo $?
0
$ llgo build -o main main.go
# command-line-arguments
$ ./main
[1]    66960 segmentation fault  ./main
$ crash echo $?
139

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions