mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* eval.c (eval): no need to push ruby_class. [ruby-dev:28176]
* eval.c (rb_f_autoload): check if ruby_cbase is nil (during instance_eval for objects cannot have singleton classes, e.g. fixnums and symbols). [ruby-dev:28178] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
d9e9972d31
commit
02de06ef1a
4 changed files with 34 additions and 18 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
|||
Sat Feb 11 02:04:11 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* eval.c (eval): no need to push ruby_class. [ruby-dev:28176]
|
||||
|
||||
Sat Feb 11 01:57:44 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* eval.c (rb_f_autoload): check if ruby_cbase is nil (during
|
||||
instance_eval for objects cannot have singleton classes,
|
||||
e.g. fixnums and symbols). [ruby-dev:28178]
|
||||
|
||||
Tue Feb 7 23:03:24 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
|
||||
|
||||
* ext/zlib/zlib.c: should not access ruby objects in finalizer.
|
||||
|
|
14
eval.c
14
eval.c
|
@ -1856,14 +1856,13 @@ ev_const_defined(cref, id, self)
|
|||
while (cbase && cbase->nd_next) {
|
||||
struct RClass *klass = RCLASS(cbase->nd_clss);
|
||||
|
||||
if (!NIL_P(klass)) {
|
||||
if (NIL_P(klass)) return rb_const_defined(CLASS_OF(self), id);
|
||||
if (klass->iv_tbl && st_lookup(klass->iv_tbl, id, &result)) {
|
||||
if (result == Qundef && NIL_P(rb_autoload_p((VALUE)klass, id))) {
|
||||
return Qfalse;
|
||||
}
|
||||
return Qtrue;
|
||||
}
|
||||
}
|
||||
cbase = cbase->nd_next;
|
||||
}
|
||||
return rb_const_defined(cref->nd_clss, id);
|
||||
|
@ -1881,7 +1880,7 @@ ev_const_get(cref, id, self)
|
|||
while (cbase && cbase->nd_next) {
|
||||
VALUE klass = cbase->nd_clss;
|
||||
|
||||
if (!NIL_P(klass)) {
|
||||
if (NIL_P(klass)) return rb_const_get(CLASS_OF(self), id);
|
||||
while (RCLASS(klass)->iv_tbl &&
|
||||
st_lookup(RCLASS(klass)->iv_tbl, id, &result)) {
|
||||
if (result == Qundef) {
|
||||
|
@ -1890,7 +1889,6 @@ ev_const_get(cref, id, self)
|
|||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
cbase = cbase->nd_next;
|
||||
}
|
||||
return rb_const_get(cref->nd_clss, id);
|
||||
|
@ -6343,7 +6341,6 @@ eval(self, src, scope, file, line)
|
|||
file = ruby_sourcefile;
|
||||
line = ruby_sourceline;
|
||||
}
|
||||
PUSH_CLASS(ruby_cbase);
|
||||
ruby_in_eval++;
|
||||
if (TYPE(ruby_class) == T_ICLASS) {
|
||||
ruby_class = RBASIC(ruby_class)->klass;
|
||||
|
@ -6364,7 +6361,6 @@ eval(self, src, scope, file, line)
|
|||
result = eval_node(self, node);
|
||||
}
|
||||
POP_TAG();
|
||||
POP_CLASS();
|
||||
ruby_in_eval--;
|
||||
if (!NIL_P(scope)) {
|
||||
int dont_recycle = ruby_scope->flags & SCOPE_DONT_RECYCLE;
|
||||
|
@ -7958,6 +7954,9 @@ rb_f_autoload(obj, sym, file)
|
|||
VALUE sym;
|
||||
VALUE file;
|
||||
{
|
||||
if (NIL_P(ruby_cbase)) {
|
||||
rb_raise(rb_eTypeError, "no class/module for autoload target");
|
||||
}
|
||||
return rb_mod_autoload(ruby_cbase, sym, file);
|
||||
}
|
||||
|
||||
|
@ -7978,6 +7977,9 @@ rb_f_autoload_p(obj, sym)
|
|||
VALUE sym;
|
||||
{
|
||||
/* use ruby_cbase as same as rb_f_autoload. */
|
||||
if (NIL_P(ruby_cbase)) {
|
||||
return Qfalse;
|
||||
}
|
||||
return rb_mod_autoload_p(ruby_cbase, sym);
|
||||
}
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ class DRbService
|
|||
@@ruby += " -d" if $DEBUG
|
||||
def self.add_service_command(nm)
|
||||
dir = File.dirname(File.expand_path(__FILE__))
|
||||
DRb::ExtServManager.command[nm] = "#{@@ruby} #{dir}/#{nm}"
|
||||
DRb::ExtServManager.command[nm] = "#{@@ruby} -d #{dir}/#{nm}"
|
||||
end
|
||||
|
||||
%w(ut_drb.rb ut_array.rb ut_port.rb ut_large.rb ut_safe1.rb ut_eval.rb).each do |nm|
|
||||
|
|
|
@ -4,8 +4,12 @@ module EnvUtil
|
|||
return ruby
|
||||
end
|
||||
ruby = "ruby"
|
||||
rubyexe = ruby+".exe"
|
||||
3.times do
|
||||
if File.exist? ruby or File.exist? ruby+".exe"
|
||||
if File.exist? ruby and File.executable? ruby and !File.directory? ruby
|
||||
return File.expand_path(ruby)
|
||||
end
|
||||
if File.exist? rubyexe and File.executable? rubyexe
|
||||
return File.expand_path(ruby)
|
||||
end
|
||||
ruby = File.join("..", ruby)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue