summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gcc/testsuite/go.test/test/nil.go5
-rw-r--r--libgo/runtime/go-map-delete.c2
2 files changed, 3 insertions, 4 deletions
diff --git a/gcc/testsuite/go.test/test/nil.go b/gcc/testsuite/go.test/test/nil.go
index 9f7bcbb59fd..aa558fa3f49 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 b25760fc820..f8f8907c345 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;
OpenPOWER on IntegriCloud