https://issues.dlang.org/show_bug.cgi?id=15585

--- Comment #3 from thomas.bock...@gmail.com ---
(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;
    else
        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 ( https://github.com/dlang/dmd/pull/5229 ).

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