Permalink
Browse files

CC: fix test 48 for 5.18 threaded CopSTASHPV_set NULL

use now CopSTASHPV_set, and add 5.16 special case from B::C
  • Loading branch information...
Reini Urban
Reini Urban committed Feb 17, 2014
1 parent 79fa3ed commit c8aed62dc402962e0bfaf83cc7ca1d70ee36e8bd
Showing with 11 additions and 4 deletions.
  1. +11 −4 lib/B/CC.pm
View
@@ -1512,13 +1512,20 @@ sub pp_nextstate {
} else {
write_label($op);
}
- #testcc 48: protect CopFILE_free and CopSTASH_free in END block (#296)
$curcop->load($op);
loadop($op);
- if ($ppname =~ /^pp_sub_END(_\d+)?$/) {
+ #testcc 48: protect CopFILE_free and CopSTASH_free in END block (#296)
+ if ($ppname =~ /^pp_sub_END(_\d+)?$/ and $ITHREADS) {
runtime("#ifdef USE_ITHREADS",
- "CopFILE((COP*)PL_op) = NULL; CopSTASHPV((COP*)PL_op) = NULL;",
- "#endif");
+ "CopFILE((COP*)PL_op) = NULL;");
+ if ($] >= 5.018) {
+ runtime("CopSTASH_set((COP*)PL_op, NULL);");
+ } elsif ($] >= 5.016 and $] <= 5.017) {
+ runtime("CopSTASHPV_set((COP*)PL_op, NULL, 0);");
+ } else {
+ runtime("CopSTASHPV_set((COP*)PL_op, NULL);");
+ }
+ runtime("#endif");
}
@stack = ();
debug( sprintf( "%s:%d\n", $op->file, $op->line ) ) if $debug{lineno};

0 comments on commit c8aed62

Please sign in to comment.