[Bug 846330] New: Lexical subroutines make some variables unavailable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



https://bugzilla.redhat.com/show_bug.cgi?id=846330

            Bug ID: 846330
        QA Contact: extras-qa@xxxxxxxxxxxxxxxxx
          Severity: unspecified
               URL: https://rt.perl.org/rt3//Public/Bug/Display.html?id=11
                    3930
           Version: 17
          Priority: unspecified
                CC: cweyl@xxxxxxxxxxxxxxx, iarnell@xxxxxxxxx,
                    jplesnik@xxxxxxxxxx, kasal@xxxxxx, lkundrak@xxxxx,
                    mmaslano@xxxxxxxxxx,
                    perl-devel@xxxxxxxxxxxxxxxxxxxxxxx, ppisar@xxxxxxxxxx,
                    psabata@xxxxxxxxxx, rc040203@xxxxxxxxxx,
                    tcallawa@xxxxxxxxxx
          Assignee: mmaslano@xxxxxxxxxx
           Summary: Lexical subroutines make some variables unavailable
        Regression: ---
      Story Points: ---
    Classification: Fedora
                OS: Unspecified
          Reporter: ppisar@xxxxxxxxxx
              Type: Bug
     Documentation: ---
          Hardware: Unspecified
        Mount Type: ---
            Status: ASSIGNED
         Component: perl
           Product: Fedora

This code:

sub foo {
    my $x if @_;
    return if @_;

    $x = 17;
    print $x, "\n";
    print sub { $x }->(), "\n";
    return;

}
foo(1); # make $x stale in all perl versions
foo;

produces errors and wrong output because it stales the $x:

17
Variable "$x" is not available at ./lexical_sub line 11.
Use of uninitialized value in print at ./lexical_sub line 11.


All perls since 5.10.1 are affected.

All Fedoras are affected.

Fixed in upstream by commit:

commit cae5dbbe30ba4a96ff5e570be0d90779f06fee71
Author: Father Chrysostomos <sprout@xxxxxxxx>
Date:   Sat Aug 4 14:42:47 2012 -0700

    Close over stale vars in active subs

-- 
You are receiving this mail because:
You are on the CC list for the bug.
--
Fedora Extras Perl SIG
http://www.fedoraproject.org/wiki/Extras/SIGs/Perl
perl-devel mailing list
perl-devel@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/perl-devel



[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Legacy Announce]     [Fedora PHP Devel]     [Kernel Devel]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Big List of Linux Books]     [Gimp]     [Yosemite Information]
  Powered by Linux