From a3a45fafa3d7df3ea1a406847abef1b4aaa07bf1 Mon Sep 17 00:00:00 2001 From: ko1 Date: Thu, 15 Jan 2009 15:31:43 +0000 Subject: * vm.c (rb_vm_inc_const_missing_count, ruby_vm_const_missing_count): added. * vm_insnhelper.h: ditto. * variable.c (rb_const_get_0), insns.def: Constants should not be cached if const_missing is called. [ruby-core:21059] [Bug #967] * bootstraptest/test_class.rb: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21536 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- variable.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'variable.c') diff --git a/variable.c b/variable.c index 283db99266..0cc87d7fd3 100644 --- a/variable.c +++ b/variable.c @@ -17,6 +17,8 @@ #include "node.h" void rb_vm_change_state(void); +void rb_vm_inc_const_missing_count(void); + st_table *rb_global_tbl; st_table *rb_class_tbl; static ID autoload, classpath, tmp_classpath; @@ -1488,7 +1490,9 @@ rb_const_get_0(VALUE klass, ID id, int exclude, int recurse) goto retry; } - return const_missing(klass, id); + value = const_missing(klass, id); + rb_vm_inc_const_missing_count(); + return value; } VALUE -- cgit v1.2.3