mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
parent
45c6b58768
commit
a1db5ecd93
Notes:
git
2023-04-15 00:11:07 +00:00
6 changed files with 163 additions and 1 deletions
|
@ -727,8 +727,9 @@ wkmap_aset(VALUE self, VALUE key, VALUE value)
|
|||
struct weakkeymap *w;
|
||||
TypedData_Get_Struct(self, struct weakkeymap, &weakkeymap_type, w);
|
||||
|
||||
if (!(FL_ABLE(key) && !SYMBOL_P(key) && !RB_BIGNUM_TYPE_P(key))) {
|
||||
if (!FL_ABLE(key) || SYMBOL_P(key) || RB_BIGNUM_TYPE_P(key) || RB_TYPE_P(key, T_FLOAT)) {
|
||||
rb_raise(rb_eArgError, "WeakKeyMap must be garbage collectable");
|
||||
UNREACHABLE_RETURN(Qnil);
|
||||
}
|
||||
|
||||
st_index_t hash = wkmap_lookup_hash(w, key);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue