diff --git a/ChangeLog b/ChangeLog index 3ff93cb602..bafbfaa9f9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Jun 3 00:26:48 2008 Yusuke Endoh + + * marshal.c (w_object): add a check for modification of array during + its dump. + Mon Jun 2 22:27:57 2008 Yusuke Endoh * enc/iso_8859_5.c: Large omicron should lowercase to small omicron. diff --git a/marshal.c b/marshal.c index fda961fdf2..9f22cdcc88 100644 --- a/marshal.c +++ b/marshal.c @@ -703,13 +703,14 @@ w_object(VALUE obj, struct dump_arg *arg, int limit) w_uclass(obj, rb_cArray, arg); w_byte(TYPE_ARRAY, arg); { - long len = RARRAY_LEN(obj); - VALUE *ptr = RARRAY_PTR(obj); + long i, len = RARRAY_LEN(obj); w_long(len, arg); - while (len--) { - w_object(*ptr, arg, limit); - ptr++; + for (i=0; i