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

* marshal.c (w_unique): should not dump anonymous class.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2001-10-05 06:30:42 +00:00
parent 809a9c5b6d
commit ef52ffdf61
4 changed files with 23 additions and 19 deletions

View file

@ -1,3 +1,7 @@
Fri Oct 5 15:19:46 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
* marshal.c (w_unique): should not dump anonymous class.
Fri Oct 5 11:59:13 2001 Nobuyoshi Nakada <nobu.nakada@nifty.ne.jp>
* eval.c (proc_s_new): revived.

View file

@ -76,7 +76,7 @@ rb_ary_s_alloc(klass)
VALUE klass;
{
NEWOBJ(ary, struct RArray);
OBJSETUP(ary, rb_cArray, T_ARRAY);
OBJSETUP(ary, klass, T_ARRAY);
ary->len = 0;
ary->capa = 0;

View file

@ -213,6 +213,9 @@ w_unique(s, arg)
char *s;
struct dump_arg *arg;
{
if (s[0] == '#') {
rb_raise(rb_eArgError, "can't dump anonymous class %s", s);
}
w_symbol(rb_intern(s), arg);
}

33
re.c
View file

@ -883,17 +883,28 @@ rb_reg_initialize(obj, s, len, options)
}
}
static VALUE
rb_reg_s_alloc(klass)
VALUE klass;
{
NEWOBJ(re, struct RRegexp);
OBJSETUP(re, klass, T_REGEXP);
re->ptr = 0;
re->len = 0;
re->str = 0;
return (VALUE)re;
}
VALUE
rb_reg_new(s, len, options)
const char *s;
long len;
int options;
{
NEWOBJ(re, struct RRegexp);
OBJSETUP(re, rb_cRegexp, T_REGEXP);
VALUE re = rb_reg_s_alloc(rb_cRegexp);
re->ptr = 0; re->len = 0; re->str = 0;
rb_reg_initialize(re, s, len, options);
return (VALUE)re;
}
@ -1041,20 +1052,6 @@ rb_reg_initialize_m(argc, argv, self)
return self;
}
static VALUE
rb_reg_s_alloc(klass)
VALUE klass;
{
NEWOBJ(re, struct RRegexp);
OBJSETUP(re, klass, T_REGEXP);
re->ptr = 0;
re->len = 0;
re->str = 0;
return (VALUE)re;
}
static VALUE
rb_reg_s_quote(argc, argv)
int argc;