op.c:newCONSTSUB: Stop using CopFILESV for CvFILE
authorFather Chrysostomos <sprout@cpan.org>
Mon, 5 Aug 2013 09:14:39 +0000 (02:14 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Mon, 5 Aug 2013 09:23:38 +0000 (02:23 -0700)
CopFILESV points to *{"_<filename"}, which can be modified
from perl space.  CopFILE points to the third character of
*{"_<filename"}{NAME}.

Ithreads were already using CopFILE.  Make non-threaded builds do the
same.  This makes things a little more robust.

CvFILE is not actually used anywhere as far as I can tell, so I cannot
easily test this.

op.c

diff --git a/op.c b/op.c
index 183e10d..d87396b 100644 (file)
--- a/op.c
+++ b/op.c
@@ -7812,12 +7812,7 @@ Perl_newCONSTSUB_flags(pTHX_ HV *stash, const char *name, STRLEN len,
 {
     dVAR;
     CV* cv;
-#ifdef USE_ITHREADS
     const char *const file = CopFILE(PL_curcop);
-#else
-    SV *const temp_sv = CopFILESV(PL_curcop);
-    const char *const file = temp_sv ? SvPV_nolen_const(temp_sv) : NULL;
-#endif
 
     ENTER;