On Wed, May 07, 2014 at 12:05:16PM -0600, Karl Williamson wrote:
> With rjbs' permission, I have reverted the Encode 2.60 upgrade so
> that blead will compile again, and we can properly smoke other
> patches that are coming along.

I've now reverted that revert with 89c2544cd3191, and added the following
fix.

Contrary to what I speculated earlier, iv has been upgraded to a PVMG due
to the earlier bless, and will have been given an initial SvLEN() of 0 at
the same time.  So the code will work, assuming that that nothing
elsewhere tries to mess with the string value of the SV.


89c2544cd319141dbdce6c8408aa52896c2549f1
Author:     David Mitchell <[email protected]>
AuthorDate: Thu May 8 13:30:16 2014 +0100
Commit:     David Mitchell <[email protected]>
CommitDate: Thu May 8 13:30:16 2014 +0100

    Fix Encode 2.60 with g++
    
    The recently added Encode 2.60 won't compile with g++, due to assigning
    a const char * const pointer to a char* struct field.
    
    The intent of the code itself is a bit unclear, but it appears to be
    to set SvPVX as a read-only alias of a const string, using the SvLEN()=0
    trick to avoid it being freed.
    
    Fix the g++ builds by casting away the constness, and add some asserts and
    comments to make it less unclear what's going on.


-- 
Overhead, without any fuss, the stars were going out.
    -- Arthur C Clarke

Reply via email to