summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-07 12:03:16 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-07 12:03:16 +0000
commitd60738f6f1fb182f09a4706852f535f62772c09b (patch)
tree4ca90cd4a04f27a1942dff105c44eac2506261ae /hash.c
parent1e9eb839280b8398d693c86c1b7ce4db93bff380 (diff)
Adjust reserved hash values
The reserved hash values in hash.c must be consistend with st.c. [ruby-core:90356] [Bug #15389] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66274 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/hash.c b/hash.c
index c41b8e7387..63333b6b5f 100644
--- a/hash.c
+++ b/hash.c
@@ -311,14 +311,16 @@ static const struct st_hash_type identhash = {
#define PTR_EQUAL(ptr, hash_val, key_) \
((ptr)->hash == (hash_val) && EQUAL((key_), (ptr)->key))
-#define RESERVED_HASH_VAL ((st_hash_t) 0)
-#define RESERVED_HASH_SUBSTITUTION_VAL (~(st_hash_t) 0)
+#define RESERVED_HASH_VAL (~(st_hash_t) 0)
+#define RESERVED_HASH_SUBSTITUTION_VAL ((st_hash_t) 0)
#define SET_KEY(entry, _key) (entry)->key = (_key)
#define SET_HASH(entry, _hash) (entry)->hash = (_hash)
#define SET_RECORD(entry, _value) (entry)->record = (_value)
typedef st_data_t st_hash_t;
+extern const st_hash_t st_reserved_hash_val;
+extern const st_hash_t st_reserved_hash_substitution_val;
static inline st_hash_t
do_hash(st_data_t key)
@@ -5792,6 +5794,9 @@ Init_Hash(void)
#undef rb_intern
#define rb_intern(str) rb_intern_const(str)
+ RUBY_ASSERT(RESERVED_HASH_VAL == st_reserved_hash_val);
+ RUBY_ASSERT(RESERVED_HASH_SUBSTITUTION_VAL == st_reserved_hash_substitution_val);
+
id_hash = rb_intern("hash");
id_yield = rb_intern("yield");
id_default = rb_intern("default");