C++: Fix crash in code completion.

Caused by a dangling pointer of a template instantiation which had been
cloned into the wrong control. The fix is to remove that control and
refer to the control of the bindings (which is the correct one).

Change-Id: I951a60f2e613aae1e4ac901ce99c820212018709
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
Erik Verbruggen
2013-03-20 13:48:20 +01:00
committed by Erik Verbruggen
parent 6999e3c339
commit 8e18adc70f
7 changed files with 33 additions and 49 deletions

View File

@@ -1778,7 +1778,7 @@ bool CppCompletionAssistProcessor::completeConstructorOrFunction(const QList<CPl
}
if (functions.isEmpty()) {
const Name *functionCallOp = context.control()->operatorNameId(OperatorNameId::FunctionCallOp);
const Name *functionCallOp = context.bindings()->control()->operatorNameId(OperatorNameId::FunctionCallOp);
foreach (const LookupItem &result, results) {
FullySpecifiedType ty = result.type().simplified();
@@ -1873,7 +1873,7 @@ bool CppCompletionAssistProcessor::completeConstructorOrFunction(const QList<CPl
targetCoN = context.globalNamespace();
UseMinimalNames q(targetCoN);
env.enter(&q);
Control *control = context.control().data();
Control *control = context.bindings()->control().data();
// set up signature autocompletion
foreach (Function *f, functions) {