develooper Front page | perl.perl5.porters | Postings from July 2001

[patch] undef &xsub for 1,2

Thread Next
From:
Doug MacEachern
Date:
July 9, 2001 20:15
Subject:
[patch] undef &xsub for 1,2
Message ID:
Pine.LNX.4.21.0107092012570.1913-100000@mako.covalent.net
the following will segv with bleedperl:
% perl -MPOSIX -e 'undef &POSIX::isalnum for 1,2'

since 'undef &xsub' on the first pass will null CvXSUB, the next pass
attempts to free CvFILE.  patch below fixes.

Index: op.c
===================================================================
RCS file: /usr/local/cvs_repository/perl-current-mirror/op.c,v
retrieving revision 1.1.1.45
diff -u -r1.1.1.45 op.c
--- op.c        2001/07/06 16:37:22     1.1.1.45
+++ op.c        2001/07/06 16:39:38
@@ -4161,8 +4161,8 @@
 #ifdef USE_ITHREADS
     if (CvFILE(cv) && !CvXSUB(cv)) {
        Safefree(CvFILE(cv));
-       CvFILE(cv) = 0;
     }
+    CvFILE(cv) = 0;
 #endif
 
     if (!CvXSUB(cv) && CvROOT(cv)) {



Thread Next


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