This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
In S_regclass(), create listsv as a mortal, claiming a reference if needed.
authorNicholas Clark <nick@ccl4.org>
Fri, 18 Jan 2013 10:32:44 +0000 (11:32 +0100)
committerNicholas Clark <nick@ccl4.org>
Tue, 19 Mar 2013 10:53:19 +0000 (11:53 +0100)
commit5a4ca00e1ae70ead90d5ddb57d6bf189a749ae9c
tree3a27a582f1532d8e87d7a91f0073deb67328269a
parentb8989050d30609050cd38eb5df7c4142da5f63bf
In S_regclass(), create listsv as a mortal, claiming a reference if needed.

The SV listsv is sometimes stored in an array generated near the end of
S_regclass(). In other cases it is not used, and it needs to be freed if
any of the warnings that S_regclass() can trigger turn out to be fatal.

The simplest solution to this problem is to declare it from the start as a
mortal, and claim a (new) reference to it if it is *not* to be freed. This
permits the removal of all other code related to ensuring that it is freed
at the right time, but not freed prematurely if a call to a warning returns.
embed.fnc
embed.h
proto.h
regcomp.c