summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--op.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/op.c b/op.c
index 10a6db17e6..3eb0e9ba38 100644
--- a/op.c
+++ b/op.c
@@ -8686,7 +8686,7 @@ Perl_newATTRSUB_x(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs,
}
/* don't copy new BEGIN CV to old BEGIN CV - RT #129099 */
- if (name && *name == 'B' && strEQ(name, "BEGIN"))
+ if (name && cv && *name == 'B' && strEQ(name, "BEGIN"))
cv = NULL;
if (cv) { /* must reuse cv if autoloaded */