Fixed #5166 (segmentation fault (invalid code) in lib/checkother.cpp:329 ( void * f { } void b ( ) { * f } ))
This commit is contained in:
parent
361a99f1af
commit
50a184c3e9
|
@ -364,7 +364,7 @@ void CheckOther::clarifyStatement()
|
||||||
const std::size_t functions = symbolDatabase->functionScopes.size();
|
const std::size_t functions = symbolDatabase->functionScopes.size();
|
||||||
for (std::size_t i = 0; i < functions; ++i) {
|
for (std::size_t i = 0; i < functions; ++i) {
|
||||||
const Scope * scope = symbolDatabase->functionScopes[i];
|
const Scope * scope = symbolDatabase->functionScopes[i];
|
||||||
for (const Token* tok = scope->classStart; tok != scope->classEnd; tok = tok->next()) {
|
for (const Token* tok = scope->classStart; tok && tok != scope->classEnd; tok = tok->next()) {
|
||||||
if (Token::Match(tok, "* %var%")) {
|
if (Token::Match(tok, "* %var%")) {
|
||||||
const Token *tok2=tok->previous();
|
const Token *tok2=tok->previous();
|
||||||
|
|
||||||
|
|
|
@ -4250,6 +4250,10 @@ private:
|
||||||
" bar(**c++);\n"
|
" bar(**c++);\n"
|
||||||
"}");
|
"}");
|
||||||
ASSERT_EQUALS("", errout.str());
|
ASSERT_EQUALS("", errout.str());
|
||||||
|
|
||||||
|
// #5166 segmentation fault (invalid code) in lib/checkother.cpp:329 ( void * f { } void b ( ) { * f } )
|
||||||
|
check("void * f { } void b ( ) { * f }");
|
||||||
|
ASSERT_EQUALS("", errout.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
// clarify conditions with = and comparison
|
// clarify conditions with = and comparison
|
||||||
|
|
Loading…
Reference in New Issue