Travis: Fixed false positive in lib/checkbufferoverrun. Ticket: #4486
This commit is contained in:
parent
1de54ba88e
commit
a39a2479da
|
@ -65,7 +65,7 @@ void Check64BitPortability::pointerassignment()
|
|||
continue;
|
||||
|
||||
for (const Token* tok = scope->classStart->next(); tok != scope->classEnd; tok = tok->next()) {
|
||||
if (Token::Match(tok, "return %var%|%num% [;+]")) {
|
||||
if (Token::Match(tok, "return %var%|%num% [;+]") && !Token::simpleMatch(tok, "return 0 ;")) {
|
||||
enum { NO, INT, PTR, PTRDIFF } type = NO;
|
||||
for (const Token *tok2 = tok->next(); tok2; tok2 = tok2->next()) {
|
||||
if ((type == NO || type == INT) && isaddr(tok2->variable()))
|
||||
|
|
|
@ -151,6 +151,11 @@ private:
|
|||
"}\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
check("void* foo() {\n"
|
||||
" return 0;\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
check("int foo(int i) {\n"
|
||||
" return i;\n"
|
||||
"}\n");
|
||||
|
|
Loading…
Reference in New Issue