ruby-changes:50489
From: nobu <ko1@a...>
Date: Thu, 1 Mar 2018 17:26:08 +0900 (JST)
Subject: [ruby-changes:50489] nobu:r62622 (trunk): compile.c: raise on invalid input
nobu 2018-03-01 17:26:02 +0900 (Thu, 01 Mar 2018) New Revision: 62622 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62622 Log: compile.c: raise on invalid input * compile.c (ibf_load_object_unsupported, ibf_load_object_class): should raise an exception. rejection of invalid input is not a bug. Modified files: trunk/compile.c Index: compile.c =================================================================== --- compile.c (revision 62621) +++ compile.c (revision 62622) @@ -8880,7 +8880,7 @@ ibf_dump_object_unsupported(struct ibf_d https://github.com/ruby/ruby/blob/trunk/compile.c#L8880 static VALUE ibf_load_object_unsupported(const struct ibf_load *load, const struct ibf_object_header *header, ibf_offset_t offset) { - rb_bug("unsupported"); + rb_raise(rb_eArgError, "unsupported"); return Qnil; } @@ -8920,7 +8920,7 @@ ibf_load_object_class(const struct ibf_l https://github.com/ruby/ruby/blob/trunk/compile.c#L8920 return rb_eStandardError; } - rb_bug("ibf_load_object_class: unknown class (%d)", (int)cindex); + rb_raise(rb_eArgError, "ibf_load_object_class: unknown class (%d)", (int)cindex); } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/