aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-10 13:46:38 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-10 13:46:38 +0000
commitf6e203441a956d652341f356cae5f61f5d66ff8f (patch)
tree733efd871ba09cf20786c035d0ed9393a40672ab
parent9aef3a6f0998bbd013062b87dd47f455ffc7a3a2 (diff)
downloadruby-f6e203441a956d652341f356cae5f61f5d66ff8f.tar.gz
Make `rb_ast_dispose` use `RB_OBJ_WRITE`
This fixes the mistake of r60722. I used `rb_gc_writebarrier_remember` to notify to GC that the references is changed. But the function just adds the object to the remember set blindly. Ko1 told me that `RB_OBJ_WRITE` is suitable in this case. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60737 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--node.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/node.c b/node.c
index c424abf638..0a56bb08cc 100644
--- a/node.c
+++ b/node.c
@@ -1147,17 +1147,17 @@ rb_ast_mark(rb_ast_t *ast)
void
rb_ast_free(rb_ast_t *ast)
{
- if (ast->node_buffer) rb_node_buffer_free(ast->node_buffer);
- ast->node_buffer = 0;
- ast->root = 0;
- ast->mark_ary = 0;
+ if (ast->node_buffer) {
+ rb_node_buffer_free(ast->node_buffer);
+ ast->node_buffer = 0;
+ }
}
void
rb_ast_dispose(rb_ast_t *ast)
{
rb_ast_free(ast);
- rb_gc_writebarrier_remember((VALUE)ast);
+ RB_OBJ_WRITE(ast, &ast->mark_ary, Qnil);
}
void