From 18caf715c94bf0d95cb0fa3425653179f74f8497 Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 31 Jul 2008 02:30:46 +0000 Subject: [PATCH] * ext/syck/rubyext.c (rb_syck_compile): expression in ASSERT() has no effect unless debug mode. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18284 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ ext/syck/rubyext.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 9120400c5a..168cc31cc5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu Jul 31 11:30:42 2008 Nobuyoshi Nakada + + * ext/syck/rubyext.c (rb_syck_compile): expression in ASSERT() has no + effect unless debug mode. + Thu Jul 31 10:51:39 2008 Nobuyoshi Nakada * iseq.c (ruby_iseq_disasm_insn): suppress warnings on platforms which diff --git a/ext/syck/rubyext.c b/ext/syck/rubyext.c index c229f0d4dd..d5c6372076 100644 --- a/ext/syck/rubyext.c +++ b/ext/syck/rubyext.c @@ -113,7 +113,9 @@ rb_syck_compile(VALUE self, VALUE port) syck_parser_implicit_typing( parser, 0 ); syck_parser_taguri_expansion( parser, 0 ); oid = syck_parse( parser ); - ASSERT(syck_lookup_sym( parser, oid, &data )); + if (!syck_lookup_sym( parser, oid, &data )) { + rb_raise(rb_eSyntaxError, "root node <%lx> not found", oid); + } sav = data; ret = S_ALLOCA_N( char, strlen( sav->buffer ) + 3 );