This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Implement use attrs qw(locked package);
[perl5.git] / pp_hot.c
index 0422605..41f2aee 100644 (file)
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -1923,8 +1923,11 @@ PP(pp_entersub)
      */
     MUTEX_LOCK(CvMUTEXP(cv));
     if (CvFLAGS(cv) & CVf_LOCKED) {
-       MAGIC *mg;      
-       if (CvFLAGS(cv) & CVf_METHOD) {
+       MAGIC *mg;        
+       if (CvFLAGS(cv) & CVf_PACKAGE) {
+           sv = (SV *) CvGV(cv);
+       }
+       else if (CvFLAGS(cv) & CVf_METHOD) {
            if (SP > stack_base + TOPMARK)
                sv = *(stack_base + TOPMARK + 1);
            else {