summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-01 13:52:36 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-01 13:52:36 +0000
commit0e7a25bd4e8fb8bbc2e3fb703c99054510824baf (patch)
tree0a1bf71b7b9421f1989a4ece96c02068c3785ebd
parentda0c358ebe0b847ab1885d00c8a24959d367f489 (diff)
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
-rw-r--r--parse.y9
1 files changed, 5 insertions, 4 deletions
diff --git a/parse.y b/parse.y
index 2bf554372b..8fda1d9459 100644
--- a/parse.y
+++ b/parse.y
@@ -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));
}
}