[Mesa-dev] [PATCH v2 2/3] nvc0: check return value of nvc0_program_validate()
Pierre Moreau
pierre.morrow at free.fr
Tue Dec 15 01:19:51 PST 2015
On 12:01 PM - Dec 14 2015, Ilia Mirkin wrote:
> On Mon, Dec 14, 2015 at 11:59 AM, Pierre Moreau <pierre.morrow at free.fr> wrote:
> > On 11:56 AM - Dec 14 2015, Ilia Mirkin wrote:
> >> No, gp->code_size is set by the validation. You need to put that last.
> >
> > IIRC, you can't assume in which order the compiler will decide to evaluate the
> > different expressions being AND'ed.
>
> Actually you can. It's known as "short-circuiting".
>
> -ilia
I knew about "short-circuiting" but you could have evaluated the right operand
first and then if false, skip the first one. What I didn't know, is that unlike
other operators whose operands' evaluation order is undefined, `&&`, `||`, and
`,` have their left operand evaluated first and then their second one.
Thanks for the tip!
Pierre
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list