summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-23 03:12:28 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-23 03:12:28 +0000
commitd9242d596658382cfc69c0a617ad167630d20687 (patch)
treea326b6624a9cb8612b8b871539c1387e89b21426
parenta3f5a5952f78827b4982f3d6e6f19a424926b26e (diff)
* parse.y (rb_check_id): conversion condition was inverse.
[Bug #5084] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--parse.y2
-rw-r--r--test/ruby/test_module.rb2
3 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 73d984e801..7ebf45992a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sat Jul 23 12:12:25 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (rb_check_id): conversion condition was inverse.
+ [Bug #5084]
+
Fri Jul 22 21:46:54 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
* vm_insnhelper.c (vm_call_cfunc): added volatile for a workaround
diff --git a/parse.y b/parse.y
index d38e0d04c6..9646350e2d 100644
--- a/parse.y
+++ b/parse.y
@@ -10111,7 +10111,7 @@ rb_check_id(VALUE name)
if (SYMBOL_P(name)) {
return SYM2ID(name);
}
- else if (RB_TYPE_P(name, T_STRING)) {
+ else if (!RB_TYPE_P(name, T_STRING)) {
tmp = rb_check_string_type(name);
if (NIL_P(tmp)) {
tmp = rb_inspect(name);
diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb
index 1aa7f8c691..b6e827a944 100644
--- a/test/ruby/test_module.rb
+++ b/test/ruby/test_module.rb
@@ -498,6 +498,8 @@ class TestModule < Test::Unit::TestCase
name = "gadzooks"
assert !Symbol.all_symbols.any? {|sym| sym.to_s == name}
assert_raise(NameError) { c1.const_defined?(name) }
+ bug5084 = '[ruby-dev:44200]'
+ assert_raise(TypeError, bug5084) { c1.const_defined?(1) }
end
def test_const_get_no_inherited