> With your patch, I get :
>
> $ ./perl -e 'print "-" x undef'
> Segmentation fault
>
> The problem coming from the line :
>
> count = SvIVX(sv);
>
> when sv is &PL_sv_undef.
>
> Moreover you shouldn't be setting count = IV_MAX in all cases, I think.
> So, not applied as is.

I'm just a beginner, so I don't know the correct way. How about this:

count = sv_2iv(sv);
if (SvIsUV(sv) && count < 0)
    count = IV_MAX;

This is at least better than it was. Maybe I should use SvIV or SvIVx instead 
of sv_2iv? But in this case mg_get doesn't get called
if SvIOK. I'm confused. Please explain me this.

I'm also aware that using IV_MAX is not the best way, however it seems less 
harmful than using I32 for items and max.

Attachment: patch-repeat-big
Description: Binary data

Reply via email to