Revision: 2795 http://trac.macosforge.org/projects/ruby/changeset/2795 Author: lsansonetti@apple.com Date: 2009-10-14 13:12:47 -0700 (Wed, 14 Oct 2009) Log Message: ----------- added autoload check to the VM const get primitive Modified Paths: -------------- MacRuby/trunk/vm.cpp Modified: MacRuby/trunk/vm.cpp =================================================================== --- MacRuby/trunk/vm.cpp 2009-10-14 05:20:16 UTC (rev 2794) +++ MacRuby/trunk/vm.cpp 2009-10-14 20:12:47 UTC (rev 2795) @@ -959,9 +959,13 @@ // Search the given class. CFDictionaryRef iv_dict = rb_class_ivar_dict(klass); if (iv_dict != NULL) { +retry: VALUE value; if (CFDictionaryGetValueIfPresent(iv_dict, (const void *)id, (const void **)&value)) { + if (value == Qundef && RTEST(rb_autoload_load(klass, id))) { + goto retry; + } return value; } } @@ -970,7 +974,8 @@ if (mods != Qnil) { int i, count = RARRAY_LEN(mods); for (i = 0; i < count; i++) { - VALUE val = rb_const_get_direct(RARRAY_AT(mods, i), id); + VALUE mod = RARRAY_AT(mods, i); + VALUE val = rb_const_get_direct(mod, id); if (val != Qundef) { return val; }
participants (1)
-
source_changes@macosforge.org