summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2013-07-05 22:51:50 -0700
committerFather Chrysostomos <sprout@cpan.org>2013-08-09 19:44:13 -0700
commit1dc74fdba201402174cfbd293adc42f5a0bafc22 (patch)
treebf675ece5baae52ad8e311dd1b9de36514736c4c /ext
parent449dd03960bf018889fc68eb9ff03ef613eb893b (diff)
downloadperl-1dc74fdba201402174cfbd293adc42f5a0bafc22.tar.gz
Revert "[perl #117855] Store CopFILEGV in a pad under ithreads"
This reverts commit c82ecf346. It turn out to be faulty, because a location shared betweens threads (the cop) was holding a reference count on a pad entry in a particu- lar thread. So when you free the cop, how do you know where to do SvREFCNT_dec? In reverting c82ecf346, this commit still preserves the bug fix from 1311cfc0a7b, but shifts it around.
Diffstat (limited to 'ext')
-rw-r--r--ext/B/B.pm2
-rw-r--r--ext/B/B.xs11
-rw-r--r--ext/XS-APItest/APItest.xs7
-rw-r--r--ext/XS-APItest/t/copstash.t (renamed from ext/XS-APItest/t/cop.t)3
4 files changed, 2 insertions, 21 deletions
diff --git a/ext/B/B.pm b/ext/B/B.pm
index aa8dfef825..35b81cf7cb 100644
--- a/ext/B/B.pm
+++ b/ext/B/B.pm
@@ -1228,8 +1228,6 @@ Since perl 5.17.1
=item file
-=item filegvoff (threaded only)
-
=item cop_seq
=item arybase
diff --git a/ext/B/B.xs b/ext/B/B.xs
index 502fb46218..23e7620b6a 100644
--- a/ext/B/B.xs
+++ b/ext/B/B.xs
@@ -682,11 +682,7 @@ struct OP_methods {
#ifdef USE_ITHREADS
STR_WITH_LEN("pmoffset"),IVp, offsetof(struct pmop, op_pmoffset),/*20*/
STR_WITH_LEN("filegv"), op_offset_special, 0, /*21*/
-# if PERL_VERSION < 19
STR_WITH_LEN("file"), char_pp, offsetof(struct cop, cop_file), /*22*/
-# else
- STR_WITH_LEN("file"), op_offset_special, 0, /*22*/
-# endif
STR_WITH_LEN("stash"), op_offset_special, 0, /*23*/
# if PERL_VERSION < 17
STR_WITH_LEN("stashpv"), char_pp, offsetof(struct cop, cop_stashpv), /*24*/
@@ -732,11 +728,6 @@ struct OP_methods {
STR_WITH_LEN("folded"), op_offset_special, 0, /*50*/
#endif
#endif
-#if PERL_VERSION < 19 || !defined(USE_ITHREADS)
- STR_WITH_LEN("filegvoff"),op_offset_special, 0, /*51*/
-#else
- STR_WITH_LEN("filegvoff"),PADOFFSETp,offsetof(struct cop, cop_filegvoff),/*51*/
-#endif
};
#include "const-c.inc"
@@ -1040,7 +1031,7 @@ next(o)
ret = make_sv_object(aTHX_ (SV *)CopFILEGV((COP*)o));
break;
#endif
-#if !defined(USE_ITHREADS) || PERL_VERSION >= 19
+#ifndef USE_ITHREADS
case 22: /* file */
ret = sv_2mortal(newSVpv(CopFILE((COP*)o), 0));
break;
diff --git a/ext/XS-APItest/APItest.xs b/ext/XS-APItest/APItest.xs
index c0e18e5aa0..8eaabdb66a 100644
--- a/ext/XS-APItest/APItest.xs
+++ b/ext/XS-APItest/APItest.xs
@@ -3387,13 +3387,6 @@ CODE:
OUTPUT:
RETVAL
-bool
-test_allocfilegv()
-CODE:
- RETVAL = PL_filegvpad[allocfilegv(PL_defgv)] == PL_defgv;
-OUTPUT:
- RETVAL
-
#endif
bool
diff --git a/ext/XS-APItest/t/cop.t b/ext/XS-APItest/t/copstash.t
index b5571e6aec..8ed98a231b 100644
--- a/ext/XS-APItest/t/cop.t
+++ b/ext/XS-APItest/t/copstash.t
@@ -2,9 +2,8 @@ use Config;
use Test::More;
BEGIN { plan skip_all => 'no threads' unless $Config{useithreads} }
-plan tests => 2;
+plan tests => 1;
use XS::APItest;
ok test_alloccopstash;
-ok test_allocfilegv;