#483651 libperl5.10: Regression in argument verification

Package:
perl
Source:
perl
Description:
Larry Wall's Practical Extraction and Report Language
Submitter:
Sebastian Harl
Date:
2015-05-24 10:09:06 UTC
Severity:
normal
#483651#5
Date:
2008-05-30 09:04:36 UTC
From:
To:
Hi,

I noticed the following changes in av.c between Perl 5.8 and 5.10:

In Perl 5.8, Perl_av_clear(), Perl_av_undef() and possibly other API
functions simply returned without doing anything, if the AV * argument
was NULL:

  if (!av)
      return;

In Perl 5.10, this has been changed to an assertion:

  assert(av);

Now, this imho is a regression for the following reasons:

 - Old code which relies on those functions handling NULL pointers
   safely is now broken. That code will now either trigger the assertion
   or simply segfault (if NDEBUG was defined when building Perl).

 - Imho, library functions should never cause a program to abort because
   of invalid arguments (at least, in cases which are equally frequent
   as this one).

I would really like to see those changes reverted. I did not use
severity "wishlist" because this has a (minor) impact on the usability
of libperl.

TIA,
Sebastian

#483651#10
Date:
2008-06-05 22:03:32 UTC
From:
To:
tag 483651 upstream
thanks

This was not accidental. Please see the upstream discussion starting at

http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-01/msg00702.html

I don't think it makes sense to diverge from upstream here, so please
bring this up on the perl5-porters list if you think you can convince
them otherwise.