diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-12-13 01:58:46 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-12-13 01:58:46 +0000 |
commit | c14cc1a76adaf4490fd535ef2066994e73c5e3af (patch) | |
tree | 47a267fe393bee628364575fd5986b2ee920b52e /libgo | |
parent | 91497ed893608cc8bfadf1bed35b8db286584147 (diff) | |
download | gcc-c14cc1a76adaf4490fd535ef2066994e73c5e3af.tar.gz |
PR go/61258
runtime: Don't crash when deleting zero-sized key.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218702 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo')
-rw-r--r-- | libgo/runtime/go-map-delete.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libgo/runtime/go-map-delete.c b/libgo/runtime/go-map-delete.c index de8b0469dea..aff25d104bf 100644 --- a/libgo/runtime/go-map-delete.c +++ b/libgo/runtime/go-map-delete.c @@ -35,7 +35,10 @@ __go_map_delete (struct __go_map *map, const void *key) key_descriptor = descriptor->__map_descriptor->__key_type; key_offset = descriptor->__key_offset; key_size = key_descriptor->__size; - __go_assert (key_size != 0 && key_size != -1UL); + if (key_size == 0) + return; + + __go_assert (key_size != -1UL); equalfn = key_descriptor->__equalfn; key_hash = key_descriptor->__hashfn (key, key_size); |