diff options
author | Koichi Sasada <ko1@atdot.net> | 2019-12-23 15:02:14 +0900 |
---|---|---|
committer | Koichi Sasada <ko1@atdot.net> | 2019-12-23 15:04:56 +0900 |
commit | a96f8cecc2488126d7298ea304da8bad3dde1792 (patch) | |
tree | ceed4c3656acf2969c9ff1d39752da23347b02de /gc.c | |
parent | 672a61b97fe0cdb256611c707e7cc69856208467 (diff) |
ObjectSpace._id2ref should check liveness.
objspace->id_to_obj_tbl can contain died objects because of lazy
sweep, so that it should check liveness.
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -3644,7 +3644,8 @@ id2ref(VALUE objid) } } - if (st_lookup(objspace->id_to_obj_tbl, objid, &orig)) { + if (st_lookup(objspace->id_to_obj_tbl, objid, &orig) && + is_live_object(objspace, orig)) { return orig; } |