summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2014-11-05 05:26:22 -0800
committerFather Chrysostomos <sprout@cpan.org>2014-11-05 08:37:14 -0800
commitff48fc9f274e69e433a1c3957a5a38a84acebf2c (patch)
tree6aa33bcac1482ffa80d72a494552be934dddb867 /toke.c
parent3e3c2fa4690dc7f4b30ef890b67e5d326a2650b2 (diff)
downloadperl-ff48fc9f274e69e433a1c3957a5a38a84acebf2c.tar.gz
toke.c: Allocate __SUB__ as a baseop if possible
__SUB__ is a baseop, but it gets converted to a const op (a svop) later if the sub is not clonable. Since a svop is bigger, we allo- cate it as a larger size initially. But if we already know that the sub is clonable by the time we see __SUB__, we can go with the smaller op size.
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/toke.c b/toke.c
index f8af55b7cb..d644d9393e 100644
--- a/toke.c
+++ b/toke.c
@@ -6946,7 +6946,9 @@ Perl_yylex(pTHX)
}
case KEY___SUB__:
- FUN0OP(newPVOP(OP_RUNCV,0,NULL));
+ FUN0OP(CvCLONE(PL_compcv)
+ ? newOP(OP_RUNCV, 0)
+ : newPVOP(OP_RUNCV,0,NULL));
case KEY_AUTOLOAD:
case KEY_DESTROY: