summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2020-03-12 14:14:24 +0000
committerDavid Mitchell <davem@iabyn.com>2020-03-12 15:16:58 +0000
commitfb8188b84d8a8f34f90aa9a8d9837892967f6b93 (patch)
tree6cf8f9d905e129be04851a7cb770e881fe51ffff /op.c
parent89561f3b90d656b6fbc944a234921a2507c9a006 (diff)
downloadperl-fb8188b84d8a8f34f90aa9a8d9837892967f6b93.tar.gz
fixup to "avoid identical stack traces"
GH #15109, #17567 My original fix for this issue, v5.31.6-141-gf2f32cd638 made a shallow copy of &PL_compiling. However, for non-default warning bits, this made two COPs share the malloced() cop_warnings, and bad things ensured. In particular this was flagged up in: GH #17567: "BBC: AYOUNG/OpenVZ-0.01.tar.gz" The fix in this commit is to do a deep copy of the COP using newSTATEOP().
Diffstat (limited to 'op.c')
-rw-r--r--op.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/op.c b/op.c
index a3ad215b9f..7cf4e84868 100644
--- a/op.c
+++ b/op.c
@@ -11598,10 +11598,8 @@ S_process_special_blocks(pTHX_ I32 floor, const char *const fullname,
* to PL_compiling, IN_PERL_COMPILETIME/IN_PERL_RUNTIME
* will give the wrong answer.
*/
- Newx(PL_curcop, 1, COP);
- StructCopy(&PL_compiling, PL_curcop, COP);
- PL_curcop->op_slabbed = 0;
- SAVEFREEPV(PL_curcop);
+ PL_curcop = (COP*)newSTATEOP(PL_compiling.op_flags, NULL, NULL);
+ CopLINE_set(PL_curcop, CopLINE(&PL_compiling));
}
PUSHSTACKi(PERLSI_REQUIRE);