develooper Front page | perl.perl5.porters | Postings from April 2014

[perl #121712] [PATCH] Coverity: regcomp.c etc.

Thread Previous
Tony Cook via RT
April 23, 2014 01:43
[perl #121712] [PATCH] Coverity: regcomp.c etc.
Message ID:
On Tue Apr 22 17:33:07 2014, jhi wrote:
> Needed compile-time limits for the PL_reg_intflags_name so that the
> bit loop doesn't waltz off past the array.  Could not use C_ARRAY_LENGTH
> because the size of name array is not visible during compile time
> (only const char*[] is), so modified to generate the size,
> made it visible only for the re extension.  Did extflags analogously
> even though its size currently exactly 32 already.  The sizeof(flags)*8
> is extra paranoia for ILP64.

Wouldn't the paranoia in:

+    for (bit=0;
+         bit<REG_EXTFLAGS_NAME_SIZE && bit<sizeof(flags)*8;
+         bit++) {

be better handled with an assert?  Even a compile-time assert if we had the mechanism for it.


via perlbug:  queue: perl5 status: new

Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About