diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-03-09 00:00:26 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-03-09 00:00:26 +0000 |
commit | d5770197462ee4445c4bd4898339ce50052af7d7 (patch) | |
tree | c9b6f83d1674ac9e20ca489cfd2ed9df05b1c214 /gc.c | |
parent | caa2a5bb0eb919d022bd50a7553197192dd78014 (diff) | |
download | ruby-d5770197462ee4445c4bd4898339ce50052af7d7.tar.gz |
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.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -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) { |