ruby-changes:33696
From: nobu <ko1@a...>
Date: Thu, 1 May 2014 22:52:41 +0900 (JST)
Subject: [ruby-changes:33696] nobu:r45777 (trunk): parse.y: abort at inappropriate symbol
nobu 2014-05-01 22:52:36 +0900 (Thu, 01 May 2014) New Revision: 45777 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=45777 Log: parse.y: abort at inappropriate symbol * parse.y (must_be_dynamic_symbol): abort if inappropriate symbol is given, which should never happen. Modified files: trunk/parse.y Index: parse.y =================================================================== --- parse.y (revision 45776) +++ parse.y (revision 45777) @@ -10457,12 +10457,13 @@ static ID intern_str(VALUE str); https://github.com/ruby/ruby/blob/trunk/parse.y#L10457 static void must_be_dynamic_symbol(VALUE x) { - if (STATIC_SYM_P(x)) { - rb_raise(rb_eTypeError, "wrong argument %+"PRIsVALUE" (expected dynamic Symbol)", x); + st_data_t data; + if (STATIC_SYM_P(x) && lookup_id_str(RSHIFT((unsigned long)(x),RUBY_SPECIAL_SHIFT), &data)) { + rb_bug("wrong argument :%s (inappropriate Symbol)", RSTRING_PTR((VALUE)data)); } if (SPECIAL_CONST_P(x) || BUILTIN_TYPE(x) != T_SYMBOL) { - rb_raise(rb_eTypeError, "wrong argument type %s (expected Symbol)", - rb_builtin_class_name(x)); + rb_bug("wrong argument type %s (expected Symbol)", + rb_builtin_class_name(x)); } } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/