Skip to content

Nil pointer dereference caused by underscore-ignored parameter #179

@y1yang0

Description

@y1yang0

The current implementation causes a nil pointer panic when a parameter is ignored with an underscore, as it attempts to dereference a nil pointer in the trampoline.

type M struct{}

func TargetFunc(_ M) {
	Trampoline(nil)
}

func Trampoline(arg *M) {
	Hook(*arg) // panic
}

func Hook(arg M) {}

func main() {
	TargetFunc(M{})
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    availableWelcome to claim it and implement itbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions