mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* marshal.c (w_extended): erroneous check condition when dump
method is defined. [ruby-core:10646] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
42a81120e5
commit
ed224698b5
2 changed files with 9 additions and 4 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Tue Mar 20 22:54:50 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* marshal.c (w_extended): erroneous check condition when dump
|
||||||
|
method is defined. [ruby-core:10646]
|
||||||
|
|
||||||
Tue Mar 20 21:36:47 2007 Keiju Ishitsuka <keiju@ruby-lang.org>
|
Tue Mar 20 21:36:47 2007 Keiju Ishitsuka <keiju@ruby-lang.org>
|
||||||
|
|
||||||
* lib/shell.rb, lib/shell: support for ruby 1.9(YARV) thread model.
|
* lib/shell.rb, lib/shell: support for ruby 1.9(YARV) thread model.
|
||||||
|
|
|
@ -343,8 +343,8 @@ w_extended(VALUE klass, struct dump_arg *arg, int check)
|
||||||
{
|
{
|
||||||
char *path;
|
char *path;
|
||||||
|
|
||||||
if (FL_TEST(klass, FL_SINGLETON)) {
|
if (check && FL_TEST(klass, FL_SINGLETON)) {
|
||||||
if (check && RCLASS(klass)->m_tbl->num_entries ||
|
if (RCLASS(klass)->m_tbl->num_entries ||
|
||||||
(RCLASS(klass)->iv_tbl && RCLASS(klass)->iv_tbl->num_entries > 1)) {
|
(RCLASS(klass)->iv_tbl && RCLASS(klass)->iv_tbl->num_entries > 1)) {
|
||||||
rb_raise(rb_eTypeError, "singleton can't be dumped");
|
rb_raise(rb_eTypeError, "singleton can't be dumped");
|
||||||
}
|
}
|
||||||
|
@ -610,13 +610,13 @@ w_object(VALUE obj, struct dump_arg *arg, int limit)
|
||||||
{
|
{
|
||||||
VALUE v;
|
VALUE v;
|
||||||
|
|
||||||
w_class(TYPE_DATA, obj, arg, Qtrue);
|
|
||||||
if (!rb_respond_to(obj, s_dump_data)) {
|
if (!rb_respond_to(obj, s_dump_data)) {
|
||||||
rb_raise(rb_eTypeError,
|
rb_raise(rb_eTypeError,
|
||||||
"no marshal_dump is defined for class %s",
|
"no marshal_dump is defined for class %s",
|
||||||
rb_obj_classname(obj));
|
rb_obj_classname(obj));
|
||||||
}
|
}
|
||||||
v = rb_funcall(obj, s_dump_data, 0);
|
v = rb_funcall(obj, s_dump_data, 0);
|
||||||
|
w_class(TYPE_DATA, obj, arg, Qtrue);
|
||||||
w_object(v, arg, limit);
|
w_object(v, arg, limit);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -1198,7 +1198,7 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod)
|
||||||
VALUE data;
|
VALUE data;
|
||||||
|
|
||||||
v = rb_obj_alloc(klass);
|
v = rb_obj_alloc(klass);
|
||||||
if (! NIL_P(extmod)) {
|
if (!NIL_P(extmod)) {
|
||||||
while (RARRAY_LEN(extmod) > 0) {
|
while (RARRAY_LEN(extmod) > 0) {
|
||||||
VALUE m = rb_ary_pop(extmod);
|
VALUE m = rb_ary_pop(extmod);
|
||||||
rb_extend_object(v, m);
|
rb_extend_object(v, m);
|
||||||
|
|
Loading…
Reference in a new issue