summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-03-09 00:00:26 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-03-09 00:00:26 +0000
commitd5770197462ee4445c4bd4898339ce50052af7d7 (patch)
treec9b6f83d1674ac9e20ca489cfd2ed9df05b1c214 /gc.c
parentcaa2a5bb0eb919d022bd50a7553197192dd78014 (diff)
Early return in gc_mark_children
for types Float, Bignum and Symbol as they do not have references and singleton classes. [Fix GH-2091] From: Lourens Naudé <lourens@bearmetal.eu> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/gc.c b/gc.c
index 9f6dd75400..1331ef21dc 100644
--- a/gc.c
+++ b/gc.c
@@ -4694,6 +4694,13 @@ gc_mark_children(rb_objspace_t *objspace, VALUE obj)
}
switch (BUILTIN_TYPE(obj)) {
+ case T_FLOAT:
+ case T_BIGNUM:
+ case T_SYMBOL:
+ /* Not immediates, but does not have references and singleton
+ * class */
+ return;
+
case T_NIL:
case T_FIXNUM:
rb_bug("rb_gc_mark() called for broken object");
@@ -4805,11 +4812,6 @@ gc_mark_children(rb_objspace_t *objspace, VALUE obj)
gc_mark(objspace, any->as.regexp.src);
break;
- case T_FLOAT:
- case T_BIGNUM:
- case T_SYMBOL:
- break;
-
case T_MATCH:
gc_mark(objspace, any->as.match.regexp);
if (any->as.match.str) {