length can be obtained via CopFILESV().
p4raw-id: //depot/perl@32129
Perl_newGP(pTHX_ GV *const gv)
{
GP *gp;
+ U32 hash;
+#ifdef USE_ITHREADS
const char *const file
= (PL_curcop && CopFILE(PL_curcop)) ? CopFILE(PL_curcop) : "";
- STRLEN len = strlen(file);
- U32 hash;
+ const STRLEN len = strlen(file);
+#else
+ SV *const temp_sv = CopFILESV(PL_curcop);
+ const char *file;
+ STRLEN len;
+
+ if (temp_sv) {
+ file = SvPVX(temp_sv);
+ len = SvCUR(temp_sv);
+ } else {
+ file = "";
+ len = 0;
+ }
+#endif
PERL_HASH(hash, file, len);
if (t - s > 0) {
const STRLEN len = t - s;
#ifndef USE_ITHREADS
- const char * const cf = CopFILE(PL_curcop);
- STRLEN tmplen = cf ? strlen(cf) : 0;
+ SV *const temp_sv = CopFILESV(PL_curcop);
+ const char *cf;
+ STRLEN tmplen;
+
+ if (temp_sv) {
+ cf = SvPVX(temp_sv);
+ tmplen = SvCUR(temp_sv);
+ } else {
+ cf = NULL;
+ tmplen = 0;
+ }
+
if (tmplen > 7 && strnEQ(cf, "(eval ", 6)) {
/* must copy *{"::_<(eval N)[oldfilename:L]"}
* to *{"::_<newfilename"} */