Commit 63e16d63 authored by Nikolai Kosjar's avatar Nikolai Kosjar

C++: Limit number of nested class instantiations

...to avoid out of memory crashes.

Task-number: QTCREATORBUG-18649
Change-Id: I5e121bf4be0fd0c01a97a182ed07ee7552fb68ac
Reviewed-by: default avatarPrzemyslaw Gorszkowski <pgorszkowski@gmail.com>
Reviewed-by: Orgad Shaneh's avatarOrgad Shaneh <orgads@gmail.com>
parent 58aef639
......@@ -1387,6 +1387,8 @@ void ClassOrNamespace::instantiateNestedClasses(ClassOrNamespace *enclosingTempl
void ClassOrNamespace::NestedClassInstantiator::instantiate(ClassOrNamespace *enclosingTemplateClass,
ClassOrNamespace *enclosingTemplateClassInstantiation)
{
if (_alreadyConsideredNestedClassInstantiations.size() >= 3)
return;
if (_alreadyConsideredNestedClassInstantiations.contains(enclosingTemplateClass))
return;
_alreadyConsideredNestedClassInstantiations.insert(enclosingTemplateClass);
......
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