develooper Front page | perl.perl5.porters | Postings from November 2012

Re: [perl #115746] [PATCH] clean up inline string comparisons ingv_fetchpvn_flags

Thread Previous | Thread Next
From:
Karl Williamson
Date:
November 15, 2012 16:33
Subject:
Re: [perl #115746] [PATCH] clean up inline string comparisons ingv_fetchpvn_flags
Message ID:
50A589D8.1010103@khwilliamson.com
On 11/15/2012 05:06 PM, Tony Cook wrote:
> On Thu, Nov 15, 2012 at 11:48:03AM -0800, bulk 88 via RT wrote:
>> Forgot to attach.
>>
>> ---
>> via perlbug:  queue: perl5 status: new
>> https://rt.perl.org:443/rt3/Ticket/Display.html?id=115746
>
>                      stash = GvHV(gv) = newHV();
>                      if (!HvNAME_get(stash)) {
> +#if I32SIZE == 4
> +                       const char COREs [4] = "CORE";
> +#endif
>                          if (GvSTASH(gv) == PL_defstash && len == 6
> +#if I32SIZE == 4
> +                        && *(I32 *)name == *(I32 *)COREs)
> +#else
>                           && strnEQ(name, "CORE", 4))
> +#endif
>                              hv_name_set(stash, "CORE", 4, 0);
> +#if I32SIZE == 4
> +                   /* assume we have a term null even though len is 3 */
> +                   const char INCs [4] = "INC\0";
> +                   const char ENVs [4] = "ENV\0";
> +                   const char SIGs [4] = "SIG\0";
> +                   if (*(I32 *)name == *(I32 *)INCs
> +                       || *(I32 *)name == *(I32 *)ENVs
> +                       || *(I32 *)name == *(I32 *)SIGs)
> +#else
> +
>
> This code makes non-portable assumptions about alignment, or at least
> about accessing unaligned memory as an I32.
>
> Tony
>

This thread may have some bearing:
http://markmail.org/message/aspjihku5iaszw5q

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About