Fixed #3441 (segmentation fault of cppcheck (%: return ; ()))
This commit is contained in:
parent
df8504f0ea
commit
409364747c
|
@ -1627,6 +1627,9 @@ void CheckOther::checkUnreachableCode()
|
||||||
tok = Token::findmatch(secondBreak, "[}:]");
|
tok = Token::findmatch(secondBreak, "[}:]");
|
||||||
} else
|
} else
|
||||||
tok = secondBreak;
|
tok = secondBreak;
|
||||||
|
|
||||||
|
if (!tok)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1914,6 +1914,8 @@ private:
|
||||||
" virtual void foo1 (P & Val) throw ();\n"
|
" virtual void foo1 (P & Val) throw ();\n"
|
||||||
"}");
|
"}");
|
||||||
ASSERT_EQUALS("", errout.str());
|
ASSERT_EQUALS("", errout.str());
|
||||||
|
|
||||||
|
check("%: return ; ()"); // Don't crash. #3441.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue