ruby-changes:6766
From: mame <ko1@a...>
Date: Thu, 31 Jul 2008 02:22:32 +0900 (JST)
Subject: [ruby-changes:6766] Ruby:r18282 (trunk): * ext/syck/rubyext.c (rb_syck_compile): remove meaningless branch
mame 2008-07-31 02:22:16 +0900 (Thu, 31 Jul 2008) New Revision: 18282 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=18282 Log: * ext/syck/rubyext.c (rb_syck_compile): remove meaningless branch that misleads into thinking that the variable sav may be uninitialized. Modified files: trunk/ChangeLog trunk/ext/syck/rubyext.c Index: ChangeLog =================================================================== --- ChangeLog (revision 18281) +++ ChangeLog (revision 18282) @@ -1,3 +1,9 @@ +Thu Jul 31 02:21:39 2008 Yusuke Endoh <mame@t...> + + * ext/syck/rubyext.c (rb_syck_compile): remove meaningless branch + that misleads into thinking that the variable sav may be + uninitialized. + Thu Jul 31 01:25:43 2008 Nobuyoshi Nakada <nobu@r...> * thread.c (rb_mutex_unlock_all): mutex is no longer a ruby object. Index: ext/syck/rubyext.c =================================================================== --- ext/syck/rubyext.c (revision 18281) +++ ext/syck/rubyext.c (revision 18282) @@ -104,7 +104,7 @@ char *ret; VALUE bc; bytestring_t *sav = NULL; - void *data; + void *data = NULL; SyckParser *parser = syck_new_parser(); taint = syck_parser_assign_io(parser, &port); @@ -113,7 +113,8 @@ syck_parser_implicit_typing( parser, 0 ); syck_parser_taguri_expansion( parser, 0 ); oid = syck_parse( parser ); - if (syck_lookup_sym( parser, oid, &data )) sav = data; + ASSERT(syck_lookup_sym( parser, oid, &data )); + sav = data; ret = S_ALLOCA_N( char, strlen( sav->buffer ) + 3 ); ret[0] = '\0'; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/