--- Comment #3 from ---
(In reply to Andrei Alexandrescu from comment #2)
> Thomas, do you have a code sample that illustrates the problem?

Sorry; I linked you to this issue by accident. Issue 14835 is the blocker that
I mentioned. That said...

bool isValidDChar(dchar cp)
    if (cp > dchar.max)
        return false;
        return true;

The compiler automatically assumes that (cp <= dchar.max), always. So, *IF* VRP
propagated to comparisons, this function would be "optimized" to always return
true - which it should not, because it's quite easy to generate dchar values
that are greater than dchar.max, even in valid code.

However, VRP isn't currently used for compile-time evaluation of comparisons,
so there is (to my knowledge) no way to trigger this issue without my VRP
upgrade PR ( ).

It's a non-issue; the latest version of that PR already includes the fix for
this, so no-one but me should ever be bothered by it, I hope.


Reply via email to