From fb7f646086311493502a172b09fcfd17f51f6d0f Mon Sep 17 00:00:00 2001 From: ocean Date: Tue, 20 Dec 2005 03:34:39 +0000 Subject: [PATCH] * ext/syck/rubyext.c (syck_node_transform): ruby object holding explicitly freed SyckNode caused SEGV. [ruby-dev:28067] ... I think syck GC problem was solved now! git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9720 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 7 +++++++ ext/syck/rubyext.c | 6 ++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index cf19dffb53..e5f370c87e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Tue Dec 20 12:33:01 2005 Hirokazu Yamamoto + + * ext/syck/rubyext.c (syck_node_transform): ruby object holding + explicitly freed SyckNode caused SEGV. [ruby-dev:28067] + + ... I think syck GC problem was solved now! + Tue Dec 20 01:46:48 2005 Tanaka Akira * io.c (rb_f_backquote): fix a GC problem on diff --git a/ext/syck/rubyext.c b/ext/syck/rubyext.c index 8f8474aaff..52cda8fffd 100644 --- a/ext/syck/rubyext.c +++ b/ext/syck/rubyext.c @@ -1783,7 +1783,7 @@ syck_node_transform( self ) SyckNode *n; SyckNode *orig_n; Data_Get_Struct(self, SyckNode, orig_n); - t = Data_Wrap_Struct( cNode, syck_node_mark, NULL, 0 ); + t = Data_Wrap_Struct( cNode, syck_node_mark, syck_free_node, 0 ); switch (orig_n->kind) { @@ -1824,9 +1824,7 @@ syck_node_transform( self ) n->anchor = syck_strndup( orig_n->anchor, strlen( orig_n->anchor ) ); } n->id = t; - t = rb_funcall( oDefaultResolver, s_node_import, 1, t ); - syck_free_node( n ); - return t; + return rb_funcall( oDefaultResolver, s_node_import, 1, t ); } /*