Skip to content

Commit

Permalink
Assert correct types in set_id_entry
Browse files Browse the repository at this point in the history
  • Loading branch information
peterzhu2118 committed Apr 5, 2024
1 parent 3749047 commit a80e8ba
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions symbol.c
Expand Up @@ -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;
Expand Down

0 comments on commit a80e8ba

Please sign in to comment.