Don <> changed:

           What    |Removed                     |Added
           Keywords|                            |diagnostic
                 CC|                            |

--- Comment #1 from Don <> 2012-10-24 10:42:30 PDT ---
This behaviour is intentional. The relevant line is:

return a.length &&
       b.ptr >= a.ptr &&
       b.ptr + b.length <= a.ptr + a.length;

This means:
return (a.length &&
       b.ptr >= a.ptr) &&
       b.ptr + b.length <= a.ptr + a.length;

If the b.ptr < a.ptr, then the first subexpression fails, and because of
short-circuit evaluation, b.ptr + b.length <= a.ptr + a.length is never

What you actually want is:

return a.length &&
       (b.ptr >= a.ptr &&
       b.ptr + b.length <= a.ptr + a.length);

Now in this particular case, the compiler could recognize e1 && e2 && e3 but it
won't work in general, I think it makes things unpredictable.

Changing to a diagnostic bug.

I'm so disappointed, I went to a lot of trouble to give a good error message
(even using the variable names you used!), and it seems it's still not clear
enough. Any suggestions?

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to