From f6034e2ebe2ccd7c99faba28b61b8e997738cffc Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 31 Jul 2008 02:30:46 +0000 Subject: * ext/syck/rubyext.c (rb_syck_compile): expression in ASSERT() has no effect unless debug mode. git-svn-id: http://svn.ruby-lang.org/repos/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 9120400c5..168cc31cc 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 c229f0d4d..d5c637207 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 ); -- cgit