1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* eval.c (is_defined): core dumped during instance_eval for

special constants.

* eval.c (rb_eval): ditto


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@1383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2001-05-08 08:29:58 +00:00
parent 998b538f77
commit d57ab81877
7 changed files with 44 additions and 16 deletions

View file

@ -1,3 +1,10 @@
Tue May 8 17:12:43 2001 K.Kosako <kosako@sofnec.co.jp>
* eval.c (is_defined): core dumped during instance_eval for
special constants.
* eval.c (rb_eval): ditto.
Mon May 7 15:58:45 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
* parse.y (arg): "||=" should not warn for uninitialized instance

View file

@ -124,7 +124,7 @@ realclean: distclean
test: miniruby$(EXEEXT)
@./miniruby$(EXEEXT) $(srcdir)/rubytest.rb
rbconfig.rb: miniruby$(EXEEXT)
rbconfig.rb: miniruby$(EXEEXT) $(srcdir)/mkconfig.rb config.status
@@MINIRUBY@ $(srcdir)/mkconfig.rb rbconfig.rb
fake.rb: miniruby$(EXEEXT)

10
eval.c
View file

@ -1805,6 +1805,12 @@ is_defined(self, node, buf)
break;
case NODE_CVAR:
if (NIL_P(ruby_cbase)) {
if (rb_cvar_defined(CLASS_OF(self), node->nd_vid)) {
return "class variable";
}
break;
}
if (!FL_TEST(ruby_cbase, FL_SINGLETON)) {
if (rb_cvar_defined(ruby_cbase, node->nd_vid)) {
return "class variable";
@ -2722,6 +2728,10 @@ rb_eval(self, n)
break;
case NODE_CVAR: /* normal method */
if (NIL_P(ruby_cbase)) {
result = rb_cvar_get(CLASS_OF(self), node->nd_vid);
break;
}
if (!FL_TEST(ruby_cbase, FL_SINGLETON)) {
result = rb_cvar_get(ruby_cbase, node->nd_vid);
break;

2
file.c
View file

@ -2137,7 +2137,7 @@ rb_find_file(file)
if (is_macos_native_path(file)) {
FILE *f;
if (safe_level >= 2 && !rb_path_check(file)) {
if (rb_safe_level() >= 2 && !rb_path_check(file)) {
rb_raise(rb_eSecurityError, "loading from unsafe file %s", file);
}
f= fopen(file, "r");

View file

@ -12,12 +12,14 @@ SRC_EXT = ["c", "cc", "m", "cxx", "cpp", "C"]
$config_cache = CONFIG["compile_dir"]+"/ext/config.cache"
$srcdir = CONFIG["srcdir"]
$libdir = CONFIG["libdir"]+"/ruby/"+CONFIG["MAJOR"]+"."+CONFIG["MINOR"]
$archdir = $libdir+"/"+CONFIG["arch"]
$sitelibdir = CONFIG["sitedir"]+"/"+CONFIG["MAJOR"]+"."+CONFIG["MINOR"]
$sitearchdir = $sitelibdir+"/"+CONFIG["arch"]
$libdir = CONFIG["libdir"]
$rubylibdir = CONFIG["rubylibdir"]
$archdir = CONFIG["archdir"]
$sitedir = CONFIG["sitedir"]
$sitelibdir = CONFIG["sitelibdir"]
$sitearchdir = CONFIG["sitearchdir"]
if File.exist? $archdir + "/ruby.h"
if File.exist? Config::CONFIG["archdir"] + "/ruby.h"
$hdrdir = $archdir
elsif File.exist? $srcdir + "/ruby.h"
$hdrdir = $srcdir
@ -438,6 +440,8 @@ LIBPATH = #{libpath}
RUBY_INSTALL_NAME = #{CONFIG["RUBY_INSTALL_NAME"]}
RUBY_SO_NAME = #{CONFIG["RUBY_SO_NAME"]}
arch = #{CONFIG["arch"]}
ruby_version = #{Config::CONFIG["ruby_version"]}
#{
if destdir = CONFIG["prefix"].scan(drive)[0] and !destdir.empty?
"\nDESTDIR = " + destdir
@ -446,11 +450,13 @@ else
end
}
prefix = $(DESTDIR)#{CONFIG["prefix"].sub(drive, '')}
exec_prefix = $(DESTDIR)#{CONFIG["exec_prefix"].sub(drive, '')}
libdir = $(DESTDIR)#{$libdir.sub(drive, '')}#{target_prefix}
archdir = $(DESTDIR)#{$archdir.sub(drive, '')}#{target_prefix}
sitelibdir = $(DESTDIR)#{$sitelibdir.sub(drive, '')}#{target_prefix}
sitearchdir = $(DESTDIR)#{$sitearchdir.sub(drive, '')}#{target_prefix}
exec_prefix = #{CONFIG["exec_prefix"].sub(drive, '')}
libdir = #{$libdir.sub(drive, '')}#{target_prefix}
rubylibdir = #{$rubylibdir.sub(drive, '')}#{target_prefix}
archdir = #{$archdir.sub(drive, '')}#{target_prefix}
sitedir = #{$sitedir.sub(drive, '')}#{target_prefix}
sitelibdir = #{$sitelibdir.sub(drive, '')}#{target_prefix}
sitearchdir = #{$sitearchdir.sub(drive, '')}#{target_prefix}
#### End of system configuration section. ####

View file

@ -40,7 +40,7 @@ File.foreach "config.status" do |$_|
next if $so_name and name =~ /^RUBY_SO_NAME$/
v = " CONFIG[\"" + name + "\"] = " +
val.sub(/^\s*(.*)\s*$/, '"\1"').gsub(/\$\{?(\w+)\}?/) {
"\#{CONFIG[\\\"#{$1}\\\"]}"
"$(#{$1})"
} + "\n"
if fast[name]
v_fast << v
@ -89,6 +89,11 @@ end
print v_fast, v_others
print <<EOS
CONFIG["ruby_version"] = "$(MAJOR).$(MINOR)"
CONFIG["rubylibdir"] = "$(libdir)/ruby/$(ruby_version)"
CONFIG["archdir"] = "$(rubylibdir)/$(arch)"
CONFIG["sitelibdir"] = "$(sitedir)/$(ruby_version)"
CONFIG["sitearchdir"] = "$(sitelibdir)/$(arch)"
CONFIG["compile_dir"] = "#{Dir.pwd}"
MAKEFILE_CONFIG = {}
CONFIG.each{|k,v| MAKEFILE_CONFIG[k] = v.dup}
@ -96,7 +101,7 @@ print <<EOS
val.gsub!(/\\$\\(([^()]+)\\)/) do |var|
key = $1
if CONFIG.key? key
"\#{Config::expand(CONFIG[\\\"\#{key}\\\"])}"
Config::expand(CONFIG[key])
else
var
end

View file

@ -1,4 +1,4 @@
#define RUBY_VERSION "1.6.4"
#define RUBY_RELEASE_DATE "2001-05-07"
#define RUBY_RELEASE_DATE "2001-05-08"
#define RUBY_VERSION_CODE 164
#define RUBY_RELEASE_CODE 20010507
#define RUBY_RELEASE_CODE 20010508