summaryrefslogtreecommitdiff
path: root/symbol.c
diff options
context:
space:
mode:
Diffstat (limited to 'symbol.c')
-rw-r--r--symbol.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/symbol.c b/symbol.c
index 1b2a77c7c4..79ec4de502 100644
--- a/symbol.c
+++ b/symbol.c
@@ -486,7 +486,8 @@ rb_id_serial_to_id(rb_id_serial_t num)
{
if (is_notop_id((ID)num)) {
VALUE sym = get_id_serial_entry(num, 0, ID_ENTRY_SYM);
- return SYM2ID(sym);
+ if (sym) return SYM2ID(sym);
+ return ((ID)num << ID_SCOPE_SHIFT) | ID_INTERNAL | ID_STATIC_SYM;
}
else {
return (ID)num;