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
4164d317
Commit
4164d317
authored
Jun 16, 2009
by
Roberto Raggi
Browse files
Fixed crash in SimpleDeclarationAST::lastToken()
parent
1077631d
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/shared/cplusplus/AST.cpp
View file @
4164d317
...
...
@@ -1170,15 +1170,23 @@ void DeclaratorListAST::accept0(ASTVisitor *visitor)
unsigned
DeclaratorListAST
::
firstToken
()
const
{
if
(
comma_token
)
return
comma_token
;
return
declarator
->
firstToken
();
}
unsigned
DeclaratorListAST
::
lastToken
()
const
{
for
(
const
DeclaratorListAST
*
it
=
this
;
it
;
it
=
it
->
next
)
{
if
(
!
it
->
next
)
return
it
->
declarator
->
lastToken
();
if
(
!
it
->
next
)
{
if
(
it
->
declarator
)
return
it
->
declarator
->
lastToken
();
else
if
(
it
->
comma_token
)
return
it
->
comma_token
+
1
;
}
}
return
0
;
}
...
...
@@ -2877,10 +2885,8 @@ unsigned SimpleDeclarationAST::lastToken() const
if
(
semicolon_token
)
return
semicolon_token
+
1
;
for
(
DeclaratorListAST
*
it
=
declarators
;
it
;
it
=
it
->
next
)
{
if
(
!
it
->
next
)
return
it
->
lastToken
();
}
if
(
declarators
)
return
declarators
->
lastToken
();
for
(
SpecifierAST
*
it
=
decl_specifier_seq
;
it
;
it
=
it
->
next
)
{
if
(
!
it
->
next
)
...
...
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