summaryrefslogtreecommitdiff
path: root/symbol.c
diff options
context:
space:
mode:
authorPeter Zhu <[email protected]>2024-04-05 16:14:35 -0400
committerPeter Zhu <[email protected]>2024-04-05 16:15:40 -0400
commita80e8ba1c4c0fc802acb21279a72fdb78abe9364 (patch)
tree8176b7383b227c42dd2d3ef4d2e95827639b2ffb /symbol.c
parent37490474c4bd45572c0bb35506dc6e032c8ebfd2 (diff)
Assert correct types in set_id_entry
Diffstat (limited to 'symbol.c')
-rw-r--r--symbol.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/symbol.c b/symbol.c
index 7be0a61a75..c0c06f6a72 100644
--- a/symbol.c
+++ b/symbol.c
@@ -430,6 +430,9 @@ static void
set_id_entry(rb_symbols_t *symbols, rb_id_serial_t num, VALUE str, VALUE sym)
{
ASSERT_vm_locking();
+ RUBY_ASSERT(BUILTIN_TYPE(str) == T_STRING);
+ RUBY_ASSERT(SYMBOL_P(sym));
+
size_t idx = num / ID_ENTRY_UNIT;
VALUE ary, ids = symbols->ids;