mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* marshal.c (r_object): wrong type check for modules.
* marshal.c (w_object): should not dump anonymous classes/modules. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@1499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a23516c25c
commit
264c2f4fed
4 changed files with 22 additions and 20 deletions
|
|
@ -1,3 +1,9 @@
|
|||
Tue Jun 5 12:44:59 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* marshal.c (r_object): wrong type check for modules.
|
||||
|
||||
* marshal.c (w_object): should not dump anonymous classes/modules.
|
||||
|
||||
Mon Jun 4 17:57:56 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* stable version 1.6.4 released.
|
||||
|
|
|
|||
|
|
@ -71,13 +71,7 @@ end
|
|||
LINK = "@CC@ -o conftest -I#$topdir -I#$top_srcdir #{CFLAGS} -I#$includedir @LDFLAGS@ %s %s %s conftest.c %s %s @LIBS@"
|
||||
CPP = "@CPP@ @CPPFLAGS@ -I#$topdir -I#$top_srcdir #{CFLAGS} -I#$includedir %s %s %s conftest.c"
|
||||
|
||||
if FileTest.readable? 'nul'
|
||||
$null = open('nul', 'w')
|
||||
elsif FileTest.readable? '/dev/null'
|
||||
$null = open('/dev/null', 'w')
|
||||
else
|
||||
$null = open('test.log', 'w')
|
||||
end
|
||||
$log = open('extmk.log', 'w')
|
||||
|
||||
$orgerr = $stderr.dup
|
||||
$orgout = $stdout.dup
|
||||
|
|
@ -86,8 +80,8 @@ def xsystem command
|
|||
puts command
|
||||
return system(command)
|
||||
end
|
||||
$stderr.reopen($null)
|
||||
$stdout.reopen($null)
|
||||
$stderr.reopen($log)
|
||||
$stdout.reopen($log)
|
||||
r = system(command)
|
||||
$stderr.reopen($orgerr)
|
||||
$stdout.reopen($orgout)
|
||||
|
|
|
|||
12
lib/mkmf.rb
12
lib/mkmf.rb
|
|
@ -37,13 +37,7 @@ elsif RUBY_PLATFORM =~ /-nextstep|-rhapsody|-darwin/
|
|||
CFLAGS.gsub!( /-arch\s\w*/, '' )
|
||||
end
|
||||
|
||||
if FileTest.readable? 'nul'
|
||||
$null = open('nul', 'w')
|
||||
elsif FileTest.readable? '/dev/null'
|
||||
$null = open('/dev/null', 'w')
|
||||
else
|
||||
$null = open('test.log', 'w')
|
||||
end
|
||||
$log = open('mkmf.log', 'w')
|
||||
|
||||
LINK = "#{CONFIG['CC']} -o conftest -I#{$hdrdir} #{CFLAGS} -I#{CONFIG['includedir']} %s %s #{CONFIG['LDFLAGS']} %s conftest.c %s %s #{CONFIG['LIBS']}"
|
||||
CPP = "#{CONFIG['CPP']} -E %s -I#{$hdrdir} #{CFLAGS} -I#{CONFIG['includedir']} %s %s conftest.c"
|
||||
|
|
@ -67,8 +61,8 @@ def xsystem command
|
|||
print command, "\n"
|
||||
return system(command)
|
||||
end
|
||||
$stderr.reopen($null)
|
||||
$stdout.reopen($null)
|
||||
$stderr.reopen($log)
|
||||
$stdout.reopen($log)
|
||||
r = system(command)
|
||||
$stderr.reopen($orgerr)
|
||||
$stdout.reopen($orgout)
|
||||
|
|
|
|||
12
marshal.c
12
marshal.c
|
|
@ -52,7 +52,7 @@ shortlen(len, ds)
|
|||
#endif
|
||||
|
||||
#define MARSHAL_MAJOR 4
|
||||
#define MARSHAL_MINOR 5
|
||||
#define MARSHAL_MINOR 6
|
||||
|
||||
#define TYPE_NIL '0'
|
||||
#define TYPE_TRUE 'T'
|
||||
|
|
@ -352,6 +352,14 @@ w_object(obj, arg, limit)
|
|||
w_byte(TYPE_MODULE, arg);
|
||||
{
|
||||
VALUE path = rb_class_path(obj);
|
||||
if (RSTRING(path)->ptr[0] == '#') {
|
||||
rb_raise(rb_eArgError, "can't dump anonymous class %s",
|
||||
RSTRING(path)->ptr);
|
||||
}
|
||||
if (RSTRING(path)->ptr[0] == '#') {
|
||||
rb_raise(rb_eArgError, "can't dump anonymous module %s",
|
||||
RSTRING(path)->ptr);
|
||||
}
|
||||
w_bytes(RSTRING(path)->ptr, RSTRING(path)->len, arg);
|
||||
}
|
||||
break;
|
||||
|
|
@ -986,7 +994,7 @@ r_object(arg)
|
|||
char *buf;
|
||||
r_bytes(buf, arg);
|
||||
m = rb_path2class(buf);
|
||||
if (TYPE(m) != T_CLASS) {
|
||||
if (TYPE(m) != T_MODULE) {
|
||||
rb_raise(rb_eTypeError, "%s is not a module", buf);
|
||||
}
|
||||
return r_regist(m, arg);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue