diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2014-12-13 01:58:46 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2014-12-13 01:58:46 +0000 |
commit | 9ac18f8c2abf0ad2f43a7eb73f6032a0ca518436 (patch) | |
tree | 47a267fe393bee628364575fd5986b2ee920b52e /libgo | |
parent | 967b254be1e60b4cb21c8e55a7f4b0346149b3ec (diff) | |
download | gcc-9ac18f8c2abf0ad2f43a7eb73f6032a0ca518436.zip gcc-9ac18f8c2abf0ad2f43a7eb73f6032a0ca518436.tar.gz gcc-9ac18f8c2abf0ad2f43a7eb73f6032a0ca518436.tar.bz2 |
re PR go/61258 (gccgo: assertion failure go-map-delete.c:37 [GoSmith])
PR go/61258
runtime: Don't crash when deleting zero-sized key.
From-SVN: r218702
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 de8b046..aff25d1 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); |