Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 61e585a6 authored by Andreas Pakulat's avatar Andreas Pakulat

Merge branch '318492/prevent_endless_recursion_setSpecializedFrom' into 4.5

BUG: 318492
REVIEW: 111796
parents 886ad1d9 b45c87bc
......@@ -160,6 +160,7 @@ struct ThreadLocalData {
uint delayedDepth;
// recursion counter for alias type resolution
uint aliasDepth;
uint specializedFromDepth;
};
#if (QT_VERSION >= 0x040801)
......@@ -374,7 +375,30 @@ TemplateDeclaration* TemplateDeclaration::instantiatedFrom() const {
}
void TemplateDeclaration::setSpecializedFrom(TemplateDeclaration* other) {
ThreadLocalData& data = threadDataLocal();
PushValue<uint> safety(data.specializedFromDepth, data.specializedFromDepth+1);
if(data.specializedFromDepth > 30) {
QString withVal = "other";
if( other ) {
if( other->instantiatedFrom() ) {
withVal += ".instantiatedFrom() == " + other->instantiatedFrom()->id(true).qualifiedIdentifier().toString();
} else if( other->specializedFrom().data() ) {
withVal += ".specialiedFrom().data() == " + other->specializedFrom().data()->identifier().toString();
} else {
withVal += ".specializedFrom().data() == null && other.instantiatedFrom() == null";
}
} else {
withVal = " == null";
}
kWarning()
<< "depth-limit reached while setting specializedFrom"
<< (specializedFrom().data()
? specializedFrom().data()->identifier().toString()
: "this specializedFrom is null")
<< "with" << withVal;
return;
}
if(other && other->instantiatedFrom()) {
setSpecializedFrom(other->instantiatedFrom());
return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment