summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorPaul "LeoNerd" Evans <leonerd@leonerd.org.uk>2023-03-05 12:40:19 +0000
committerPaul Evans <leonerd@leonerd.org.uk>2023-03-06 10:41:20 +0000
commit75ea41ae51200ab26d84c418f08859a784a71b85 (patch)
tree498308616b1680531c1c5020a3492160a368d626 /op.c
parenta287df13cf577b9af034665350e89ba94eb55d77 (diff)
downloadperl-75ea41ae51200ab26d84c418f08859a784a71b85.tar.gz
Have newATTRSUB() call class_wrap_method_body() if CVf_IsMETHOD
Diffstat (limited to 'op.c')
-rw-r--r--op.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/op.c b/op.c
index dec2247f96..1130dd9afa 100644
--- a/op.c
+++ b/op.c
@@ -10638,6 +10638,8 @@ Perl_newATTRSUB_x(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs,
if (block) {
assert(PL_parser);
+ if (CvIsMETHOD(PL_compcv))
+ block = class_wrap_method_body(block);
/* This makes sub {}; work as expected. */
if (block->op_type == OP_STUB) {
const line_t l = PL_parser->copline;