From d295957957c828588a8ca3c7b8619c7a93be6b5c Mon Sep 17 00:00:00 2001 From: akr Date: Tue, 2 Nov 2010 22:37:08 +0000 Subject: [PATCH] * vm_method.c (rb_clear_cache_by_class): just return if the class has no method. reported by Eric Wong. [ruby-core:32689] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ vm_method.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index f958addaa9..4f19050a46 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Nov 3 07:33:57 2010 Tanaka Akira + + * vm_method.c (rb_clear_cache_by_class): just return if the class has + no method. reported by Eric Wong. [ruby-core:32689] + Tue Nov 2 22:50:25 2010 Aaron Patterson * ext/psych/lib/psych/visitors/visitor.rb (initialize): push accessor diff --git a/vm_method.c b/vm_method.c index 41c53a5b47..fa5738b5cb 100644 --- a/vm_method.c +++ b/vm_method.c @@ -85,6 +85,9 @@ rb_clear_cache_by_class(VALUE klass) { struct cache_entry *ent, *end; + if (RCLASS_M_TBL(klass)->num_entries == 0) + return; + rb_vm_change_state(); if (!ruby_running)