-
Notifications
You must be signed in to change notification settings - Fork 560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Normal mechanisms to create a constant do not work on undef #14077
Comments
From @demerphqBoth of these subs should be identified as constants by the perl internals, Bug affects at least perl 5.14, and is still present in bleadperl. For some reason constant.pm is able to create constants which are undef. Yves $ perl -MDevel::Peek -le'sub K1 () { undef } sub K2() { 0 } Dump(\&K1); -- |
From @cpansproutOn Sun Sep 07 23:33:08 2014, demerphq wrote:
Optimising pp_undef to pp_const when it has no arguments is on my to-do list.
This looks constant to me, or did you mean &PL_sv_undef? $ perl -MDevel::Peek -e 'use constant K1=>undef; Dump \&K1' -- Father Chrysostomos |
The RT System itself - Status changed from 'new' to 'open' |
From @demerphqOn 8 September 2014 15:32, Father Chrysostomos via RT <
SV = IV(0x7f91f40070c8) at 0x7f91f40070d0
No, I was observing the same point you are here, for some reason constant.pm Yves |
From @cpansproutOn Mon Sep 08 09:59:48 2014, demerphq wrote:
Sorry, I misread you. Maybe I should start wearing my glasses at the computer. :-) Fixing this is trivial, but I would appreciate any response to the issue I raised in ticket #35129, since it is related. -- Father Chrysostomos |
From @demerphqOn 8 September 2014 21:38, Father Chrysostomos via RT <
Its cool. I could have worded it better anyway.
I responded to the ticket. In short, yes, im opinion you should go ahead Yves -- |
From @cpansproutOn Mon Sep 08 06:32:04 2014, sprout wrote:
(I meant OP_UNDEF and OP_CONST.) Except that is not the best approach. A const op needs a slot in the pad under threads, so that would increase memory usage. pp_undef already has an early return for no arguments, so using pp_const instead would probably not speed things up. So I used a different approach. I taught op_const_sv about OP_UNDEF with !op_private in commit 1542cb4. More general constant folding for undef has yet to be done, but this ticket is resolved. (Actually, would folding undef make much difference? Most people have warnings on, so uninit warnings would prevent folding anyway.) -- Father Chrysostomos |
@cpansprout - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#122728 (status was 'resolved')
Searchable as RT122728$
The text was updated successfully, but these errors were encountered: