diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-05-01 13:52:36 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-05-01 13:52:36 +0000 |
commit | 0e7a25bd4e8fb8bbc2e3fb703c99054510824baf (patch) | |
tree | 0a1bf71b7b9421f1989a4ece96c02068c3785ebd /parse.y | |
parent | da0c358ebe0b847ab1885d00c8a24959d367f489 (diff) | |
download | ruby-0e7a25bd4e8fb8bbc2e3fb703c99054510824baf.tar.gz |
parse.y: abort at inappropriate symbol
* parse.y (must_be_dynamic_symbol): abort if inappropriate symbol
is given, which should never happen.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45777 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -10457,12 +10457,13 @@ static ID intern_str(VALUE str); 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)); } } |