summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-01 08:25:34 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-01 08:25:34 +0000
commit21ea356a42724847f3066d68ad246639fb374927 (patch)
treee76d4df54133f693ca70769f0d0cb8696b098d14 /gc.c
parentd7b729dcd06fdaaacad6d2ca36811fcd73ad503e (diff)
gc.c: zombie is not alive
* gc.c (is_live_object): finalizer may not run because of lazy-sweep. [ruby-dev:47786] [Bug #9069] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43502 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gc.c b/gc.c
index 93b15882d1..2f261b3037 100644
--- a/gc.c
+++ b/gc.c
@@ -2050,7 +2050,10 @@ is_dead_object(rb_objspace_t *objspace, VALUE ptr)
static inline int
is_live_object(rb_objspace_t *objspace, VALUE ptr)
{
- if (BUILTIN_TYPE(ptr) == 0) return FALSE;
+ switch (BUILTIN_TYPE(ptr)) {
+ case 0: case T_ZOMBIE:
+ return FALSE;
+ }
if (RBASIC(ptr)->klass == 0) return FALSE;
if (is_dead_object(objspace, ptr)) return FALSE;
return TRUE;