Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
85c501c9
Commit
85c501c9
authored
Jul 09, 2009
by
Roberto Raggi
Browse files
Fixed possible crash when completing function-like arguments.
parent
61e468a8
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/libs/cplusplus/ResolveExpression.cpp
View file @
85c501c9
...
...
@@ -670,7 +670,7 @@ ResolveExpression::resolveMemberExpression(const QList<Result> &baseResults,
if
(
NamedType
*
namedTy
=
ty
->
asNamedType
())
results
+=
resolveMember
(
p
,
memberName
,
namedTy
);
else
if
(
Function
*
fun
=
ty
->
asFunctionType
())
{
if
(
fun
->
scope
()
->
isBlockScope
()
||
fun
->
scope
()
->
isNamespaceScope
())
{
if
(
fun
->
scope
()
&&
(
fun
->
scope
()
->
isBlockScope
()
||
fun
->
scope
()
->
isNamespaceScope
())
)
{
ty
=
fun
->
returnType
();
if
(
ReferenceType
*
refTy
=
ty
->
asReferenceType
())
...
...
@@ -897,7 +897,7 @@ QList<Symbol *> ResolveClass::resolveClass(NamedType *namedTy,
if
(
Function
*
funTy
=
decl
->
type
()
->
asFunctionType
())
{
// QString foo("ciao");
// foo.
if
(
funTy
->
scope
()
->
isBlockScope
()
||
funTy
->
scope
()
->
isNamespaceScope
())
{
if
(
funTy
->
scope
()
&&
(
funTy
->
scope
()
->
isBlockScope
()
||
funTy
->
scope
()
->
isNamespaceScope
())
)
{
const
ResolveExpression
::
Result
r
(
funTy
->
returnType
(),
decl
);
resolvedSymbols
+=
resolveClass
(
r
,
context
);
}
...
...
src/plugins/cpptools/cppcodecompletion.cpp
View file @
85c501c9
...
...
@@ -1013,7 +1013,7 @@ bool CppCodeCompletion::completeMember(const QList<TypeOfExpression::Result> &re
namedTy
=
ty
->
asNamedType
();
if
(
!
namedTy
)
{
Function
*
fun
=
ty
->
asFunctionType
();
if
(
fun
&&
(
fun
->
scope
()
->
isBlockScope
()
||
fun
->
scope
()
->
isNamespaceScope
()))
if
(
fun
&&
fun
->
scope
()
&&
(
fun
->
scope
()
->
isBlockScope
()
||
fun
->
scope
()
->
isNamespaceScope
()))
namedTy
=
fun
->
returnType
()
->
asNamedType
();
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment