mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Assume that symbol in rb_check_symbol is not garbage
rb_check_symbol 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
350df4fbd9
commit
116d11062f
1 changed files with 1 additions and 7 deletions
8
symbol.c
8
symbol.c
|
@ -1208,13 +1208,7 @@ rb_check_symbol(volatile VALUE *namep)
|
|||
return name;
|
||||
}
|
||||
else if (DYNAMIC_SYM_P(name)) {
|
||||
if (!SYMBOL_PINNED_P(name)) {
|
||||
GLOBAL_SYMBOLS_LOCKING(symbols) {
|
||||
name = dsymbol_check(symbols, name);
|
||||
}
|
||||
|
||||
*namep = name;
|
||||
}
|
||||
RUBY_ASSERT(!rb_objspace_garbage_object_p(name));
|
||||
return name;
|
||||
}
|
||||
else if (!RB_TYPE_P(name, T_STRING)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue