Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 27 Jul 2015 23:46:30 +0200
From: Mateusz Tabaka <tabsysdebug@...il.com>
To: john-dev@...ts.openwall.com
Subject: Re: Ambiguous pointer increments

The '||' operator guarantees left-to-right evaluation (6.5.14.4). In 
this case I think we have an undefined behaviour - "Between two sequence 
points, an object is modified more than once".

On 27.07.2015 23:23, magnum wrote:
> The beignet OpenCL driver complained about oldoffice kernel, "multiple
> unsequenced modifications to 'p'" for things like the below:
>
> -               for (i = 0; i < 32; i += 2)
> -                       W[i >> 1] = (uint)*p++ | (*p++ << 16U);
>
> I already changed it but I'm curious - no other driver complained.
>
> +               for (i = 0; i < 32; i += 2) {
> +                       W[i >> 1] = (uint)*p++;
> +                       W[i >> 1] |= (*p++ << 16U);
> +               }
>
> Originally I thought they (the use/increments of p) were guaranteed to
> be left-to-right but after this I'm not sure at all. Anyone know for
> sure? Alexander Cherepanov perhaps? In case it matters, OpenCL is C99.
>
> magnum
>

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.