summaryrefslogtreecommitdiff
path: root/symbol.c
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-08-30 10:30:00 (GMT)
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-08-30 10:30:00 (GMT)
commit765e4e2ea68f4b219df33719009ea83677b5d85d (patch)
treed397137646a826518d6d05917b255653a67c9408 /symbol.c
parent42e5ff998bc70698131a06120f07d1e12cdabfc3 (diff)
symbol.c (rb_sym2id): do not return garbage object
The dynamic sym passed to rb_sym2id may be a garbage object (as accounted for by dsymbol_check). This fixes an occasional segfault in "make test-all" for me. No need to backport, this is from the new symbol GC feature. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'symbol.c')
-rw-r--r--symbol.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/symbol.c b/symbol.c
index b3fa55f..c3ce50f 100644
--- a/symbol.c
+++ b/symbol.c
@@ -759,7 +759,7 @@ rb_sym2id(VALUE sym)
}
else {
if (!SYMBOL_PINNED_P(sym)) {
- dsymbol_pindown(sym);
+ return dsymbol_pindown(sym);
}
return (ID)sym;
}