aboutsummaryrefslogtreecommitdiff
path: root/libgo/runtime/go-map-delete.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/runtime/go-map-delete.c')
-rw-r--r--libgo/runtime/go-map-delete.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libgo/runtime/go-map-delete.c b/libgo/runtime/go-map-delete.c
index 7a3a7b8..9b19ff1 100644
--- a/libgo/runtime/go-map-delete.c
+++ b/libgo/runtime/go-map-delete.c
@@ -9,6 +9,7 @@
#include "go-alloc.h"
#include "go-assert.h"
+#include "go-panic.h"
#include "map.h"
/* Delete the entry matching KEY from MAP. */
@@ -25,6 +26,9 @@ __go_map_delete (struct __go_map *map, const void *key)
size_t bucket_index;
void **pentry;
+ if (map == NULL)
+ __go_panic_msg ("assignment to entry in nil map");
+
descriptor = map->__descriptor;
key_descriptor = descriptor->__map_descriptor->__key_type;