Skip to content

gccgo: delete on nil map must not panic #4536

@griesemer

Description

@griesemer
cat x.go:

package main

func main() {
    var m map[int]int
    delete(m, 0)
}

$ gccgo x.go && a.out
panic: runtime error: deletion of entry in nil map

With the recent spec change (rev d09a8b21b517), delete on nil maps is a no-op.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions