FAQ
This change ...

Change 22376 by [email protected] on 2004/02/25 17:10:56

stop "const in void context" warning for a const in an
optimised-away boolean expresssion, eg 5 || print;

... introduces the following:

----Program----
1&&undef

----Output of .../pmkg5be/[email protected]/bin/perl----

----EOF ($?='0')----
----Output of .../pyIn9WJ/[email protected]/bin/perl----
Modification of a read-only value attempted at test.pl line 1.

----EOF ($?='65280')----

Marcus

--
BOFH Excuse #452:

Somebody ran the operating system through a spelling checker.

Search Discussions

  • Dave Mitchell at Apr 1, 2004 at 10:36 pm

    On Thu, Apr 01, 2004 at 09:18:16PM +0200, Marcus Holland-Moritz wrote:
    This change ...

    Change 22376 by [email protected] on 2004/02/25 17:10:56

    stop "const in void context" warning for a const in an
    optimised-away boolean expresssion, eg 5 || print;

    ... introduces the following:

    ----Program----
    1&&undef

    ----Output of .../pmkg5be/[email protected]/bin/perl----

    ----EOF ($?='0')----
    ----Output of .../pyIn9WJ/[email protected]/bin/perl----
    Modification of a read-only value attempted at test.pl line 1.

    ----EOF ($?='65280')----
    Mea cupla and all that. Fixed below.

    --
    "There's something wrong with our bloody ships today, Chatfield."
    -- Admiral Beatty at the Battle of Jutland, 31st May 1916.

    Change 22635 by [email protected] on 2004/04/01 20:27:14

    Fix change #22376. Only mark a const as short-circuited
    if it's actually a const!

    Affected files ...

    ... //depot/perl/op.c#622 edit

    Differences ...

    ==== //depot/perl/op.c#622 (text) ====

    @@ -3373,7 +3373,8 @@
    (type == OP_DOR && !SvOK(((SVOP*)first)->op_sv))) {
    op_free(first);
    *firstp = Nullop;
    - other->op_private |= OPpCONST_SHORTCIRCUIT;
    + if (other->op_type == OP_CONST)
    + other->op_private |= OPpCONST_SHORTCIRCUIT;
    return other;
    }
    else {
    @@ -3396,7 +3397,8 @@

    op_free(other);
    *otherp = Nullop;
    - first->op_private |= OPpCONST_SHORTCIRCUIT;
    + if (first->op_type == OP_CONST)
    + first->op_private |= OPpCONST_SHORTCIRCUIT;
    return first;
    }
    }
  • Dave Mitchell at Apr 1, 2004 at 11:16 pm

    On Thu, Apr 01, 2004 at 09:50:44PM +0100, Dave Mitchell wrote:
    Change 22635 by [email protected] on 2004/04/01 20:27:14

    Fix change #22376. Only mark a const as short-circuited
    if it's actually a const!
    Nick, I'd strongly recommend this gets into 5.8.4; without it, any
    construct of the form (trueconstant && something) stomps on the private
    flags of the head op of 'something'!

    --
    The Enterprise successfully ferries an alien VIP from one place to another
    without serious incident.
    -- Things That Never Happen in "Star Trek" #7
  • Nicholas Clark at Apr 2, 2004 at 2:10 pm

    On Fri, Apr 02, 2004 at 12:11:26AM +0100, Dave Mitchell wrote:
    On Thu, Apr 01, 2004 at 09:50:44PM +0100, Dave Mitchell wrote:
    Change 22635 by [email protected] on 2004/04/01 20:27:14

    Fix change #22376. Only mark a const as short-circuited
    if it's actually a const!
    Nick, I'd strongly recommend this gets into 5.8.4; without it, any
    construct of the form (trueconstant && something) stomps on the private
    flags of the head op of 'something'!
    I thought the same when I read the thread. It's in maint, so it'll be in
    RC1. In turn, I think that that will be out at some point this weekend.

    Nicholas Clark

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupperl5-porters @
categoriesperl
postedApr 1, '04 at 10:07p
activeApr 2, '04 at 2:10p
posts4
users3
websiteperl.org

People

Translate

site design / logo © 2023 Grokbase