projects
/
gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
967b254
)
re PR go/61258 (gccgo: assertion failure go-map-delete.c:37 [GoSmith])
author
Ian Lance Taylor
<ian@gcc.gnu.org>
Sat, 13 Dec 2014 01:58:46 +0000
(
01:58
+0000)
committer
Ian Lance Taylor
<ian@gcc.gnu.org>
Sat, 13 Dec 2014 01:58:46 +0000
(
01:58
+0000)
PR go/61258
runtime: Don't crash when deleting zero-sized key.
From-SVN: r218702
libgo/runtime/go-map-delete.c
patch
|
blob
|
history
diff --git
a/libgo/runtime/go-map-delete.c
b/libgo/runtime/go-map-delete.c
index de8b0469deaf394e0e1648ce91d73e710d0e9379..aff25d104bf4e9685b7ca13a5f0d9309421dfcda 100644
(file)
--- 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);