Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

should not indirect nil #3052

Closed
ltzmaxwell opened this issue Oct 30, 2024 · 0 comments · Fixed by #3053
Closed

should not indirect nil #3052

ltzmaxwell opened this issue Oct 30, 2024 · 0 comments · Fixed by #3053
Assignees

Comments

@ltzmaxwell
Copy link
Contributor

ltzmaxwell commented Oct 30, 2024

Example:

package main

func main() {
	println(*nil)
}

Output:

panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference:
	--- preprocess stack ---
	stack 2: func main() { (const (println func(xs ...interface{})()))(*((const (undefined)))) }
	stack 1: file{ package main; func main() { (const (println func(xs ...interface{})()))(*((const (undefined)))) } }
	stack 0: package(main)

Expected Output:
invalid operation: cannot indirect nil.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging a pull request may close this issue.

2 participants