develooper Front page | perl.perl5.porters | Postings from October 2011

Re: [perl #94560] [PATCH v5.12.4-1-gea42574] large repeat count causesheap corruption

Thread Previous
From:
Vincent Pit
Date:
October 23, 2011 14:21
Subject:
Re: [perl #94560] [PATCH v5.12.4-1-gea42574] large repeat count causesheap corruption
Message ID:
4EA48537.3050004@profvince.com

>> As for fixing it, I've included a patch that works for me, but it's
>> probably not so simple.  I doubt you can so easily change a public API
>> like Perl_repeatcpy, even if it's so fundamentally limited.
> I’m no C expert, but if IV is bigger than I32, then isn’t it OK to
> change the signature? It won’t be binary-compatible (which 5.16 won’t be
> anyway), but it should be source-compatible, shouldn’t it?

I believe it could cause some conversion warnings when extra flags are 
passed to the compiler (like -Wconversion), but I think it is fair in 
this case. Note that Perl_repeatcpy() is also called in regcomp.c with 
an int as the last argument, so if a smoker sets that flag we'll see the 
warning soon.

> In other words: Can other perl porters tell me whether this patch can be
> applied as-is?

This is easy : no, it can't. The prototype of Perl_repeatcpy should be 
changed in embed.fnc, and then the headers can be regenerated.


Vincent.

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About