-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
Description
There have been a number of reports about stack overflow errors in DParserCOMServer, Visual D's D_Parser process, e.g. https://issues.dlang.org/show_bug.cgi?id=15458
I could reproduce the issue in the bug report (not in the debug version, I guess the analyzer timeout kicks in before the stack overflow occurs), but debugging the release build shows that D_Parser is trying to evaluate the return type of object.opEquals.
Here is a snippet of the current definition:
auto opEquals(Object lhs, Object rhs)
{
// special cases here...
// General case => symmetric calls to method opEquals
return lhs.opEquals(rhs) && rhs.opEquals(lhs);
}
auto opEquals(const Object lhs, const Object rhs)
{
return opEquals(cast()lhs, cast()rhs);
}
I suspect that return opEquals(cast()lhs, cast()rhs); matches both calls, with the first not considered "better" after casting away const. So the evaluation recurses endlessly.
[Even if the function matching is fixed, I guess there should be a recursion check somewhere.]