diff --git a/gcc/testsuite/go.test/test/nil.go b/gcc/testsuite/go.test/test/nil.go index 9f7bcbb59fdb..aa558fa3f49c 100644 --- a/gcc/testsuite/go.test/test/nil.go +++ b/gcc/testsuite/go.test/test/nil.go @@ -151,9 +151,8 @@ func maptest() { shouldPanic(func() { m[2] = 3 }) - shouldPanic(func() { - delete(m, 2) - }) + // can delete (non-existent) entries + delete(m, 2) } // nil slice diff --git a/libgo/runtime/go-map-delete.c b/libgo/runtime/go-map-delete.c index b25760fc8204..f8f8907c345b 100644 --- a/libgo/runtime/go-map-delete.c +++ b/libgo/runtime/go-map-delete.c @@ -27,7 +27,7 @@ __go_map_delete (struct __go_map *map, const void *key) void **pentry; if (map == NULL) - runtime_panicstring ("deletion of entry in nil map"); + return; descriptor = map->__descriptor;