mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Assume that the symbol is not garbage in rb_sym2id
rb_sym2id is a public API, so it is always a bug if the user holds on to a dead object and passes it in.
This commit is contained in:
parent
4592d63739
commit
8b2d76136b
1 changed files with 1 additions and 1 deletions
2
symbol.c
2
symbol.c
|
@ -953,7 +953,7 @@ rb_sym2id(VALUE sym)
|
|||
}
|
||||
else if (DYNAMIC_SYM_P(sym)) {
|
||||
GLOBAL_SYMBOLS_LOCKING(symbols) {
|
||||
sym = dsymbol_check(symbols, sym);
|
||||
RUBY_ASSERT(!rb_objspace_garbage_object_p(sym));
|
||||
id = RSYMBOL(sym)->id;
|
||||
|
||||
if (UNLIKELY(!(id & ~ID_SCOPE_MASK))) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue