From: matz@... (Yukihiro Matsumoto) Date: 2002-08-29T01:22:18+09:00 Subject: Re: [Update] Port match to new dup, clone framework Hi, In message "Re: [Update] Port match to new dup, clone framework" on 02/08/29, Michal Rokos writes: |> > - re_copy_registers(clone->regs, RMATCH(match)->regs); |> + if (obj == orig) return obj; |> > + RMATCH(obj)->str = RMATCH(orig)->str; |> + re_free_registers(RMATCH(obj)->regs); |> > + RMATCH(obj)->regs->allocated = 0; |> > + re_copy_registers(RMATCH(obj)->regs, RMATCH(orig)->regs); | | Is it OK to commit patch with these changes? OK if you add class check to become method (orig may not be MatchData), like this: if (!rb_obj_is_instance_of(orig, rb_obj_class(obj))) { rb_raise(rb_eTypeError, "wrong argument class"); } matz.