devwaker / angleproject

Automatically exported from code.google.com/p/angleproject
Other
0 stars 0 forks source link

Add an compile option to work around short-circuit condition bug #482

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Tested on MacOSX 10.8.5 where the bug exists.

int x = 1;
if (true || (x=0)==1) { }

After that, x should be 1 instead of 0.

The workaround I tried out on MacOSX is:

overwrite
A || B   to   A ? true : B
A && B   to   !A ? false : B

Original issue reported on code.google.com by z...@google.com on 2 Oct 2013 at 9:26

GoogleCodeExporter commented 9 years ago
To be clear, the bug has been there for a while (since at least 10.8.4), and is 
covered by the WebGL conformance test 
conformance/glsl/misc/shader-with-short-circuiting-operators.html .

Original comment by kbr@chromium.org on 2 Oct 2013 at 9:43

GoogleCodeExporter commented 9 years ago
Fixed by https://codereview.appspot.com/14529048.

Original comment by c...@chromium.org on 21 May 2014 at 3:52