Skip Menu |
Report information
Id: 128872
Status: new
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: alex.jakimenko [at] gmail.com
Cc:
AdminCc:

Severity: (no value)
Tag: (no value)
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Subject: LEAVE inside a block is leaking internals on sub exit (regression)
First let's take a look at example that works:

Code:
sub foo {
    say ‘start’;
    {
        LEAVE { say ‘block left’ }
        return 42;
    }
    say ‘end’;
}
say foo;

Result:
start
block left
42


↑ Fine, no problem here. Now let's remove the first “say”:

Code:
sub foo {
    {
        LEAVE { say ‘block left’ }
        return 42;
    }
    say ‘end’;
}
say foo;

Current Result:
block left
0

Oops. What is 0? Why 0?
If we print it's .^name, then it is BOOTInt.

bisectable is giving a list of commits that could have introduced the problem:
e609822f01b82608b1b1c869032c95e9641172ce
615d30c39eba318f7449b94bbbd0295e2fd75387
8beb87b415014254412409d56378afb3ed5f14d9
05170e0c14969663c816ee1c5aaa019d70938247
899e0fd4c1ce51bc492666ffc69627c502f657f7
e5443765d4bce0697c6191dd2b17db3044e027ab
fcd0093b43614ce91caeb8c23e2bbcff68d54f72
04929feeb06fa851d77ef5efa6be35248301f88c
7ee6578ce99aae069349c283012ae7e45dfd75ec
519e76487ddd1546b319bfbd47661beac2417d61

Seems like it is associated with the merge of return-without-lexotic branch.

Just in case, IRC log: http://irclog.perlgeek.de/perl6/2016-08-08#i_12984076
Subject: [REGRESSION] a combination of LEAVE phaser and “return” causes return not to work ({ LEAVE { say ‘hi’ }; return 42})
Download (untitled) / with headers
text/plain 715b
Code: sub foo { LEAVE { say ‘block left’ }; return 42 }; say foo Result (2015.12,2016.05): block left 42 Result (2016.06,HEAD): block left 0 Not sure where would this 0 come from. Bisectable gives this list of possible causes (similarly to https://rt.perl.org/Ticket/Display.html?id=130442 ): e609822f01b82608b1b1c869032c95e9641172ce 615d30c39eba318f7449b94bbbd0295e2fd75387 8beb87b415014254412409d56378afb3ed5f14d9 05170e0c14969663c816ee1c5aaa019d70938247 899e0fd4c1ce51bc492666ffc69627c502f657f7 e5443765d4bce0697c6191dd2b17db3044e027ab fcd0093b43614ce91caeb8c23e2bbcff68d54f72 04929feeb06fa851d77ef5efa6be35248301f88c 7ee6578ce99aae069349c283012ae7e45dfd75ec 519e76487ddd1546b319bfbd47661beac2417d61


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org