* Add test for #9838 * Remove noisy assert
This commit is contained in:
parent
aafd1e10be
commit
3d3885d151
|
@ -2182,8 +2182,6 @@ bool Token::addValue(const ValueFlow::Value &value)
|
||||||
|
|
||||||
// Add value
|
// Add value
|
||||||
if (it == mImpl->mValues->end()) {
|
if (it == mImpl->mValues->end()) {
|
||||||
// If the errorPath has gotten this large then there must be something wrong
|
|
||||||
assert(value.errorPath.size() < 64);
|
|
||||||
ValueFlow::Value v(value);
|
ValueFlow::Value v(value);
|
||||||
if (v.varId == 0)
|
if (v.varId == 0)
|
||||||
v.varId = mImpl->mVarId;
|
v.varId = mImpl->mVarId;
|
||||||
|
|
|
@ -728,6 +728,15 @@ private:
|
||||||
" }\n"
|
" }\n"
|
||||||
"};\n", /*cpp*/ true);
|
"};\n", /*cpp*/ true);
|
||||||
ASSERT_EQUALS("", errout.str());
|
ASSERT_EQUALS("", errout.str());
|
||||||
|
|
||||||
|
check("int g(int *p) {\n" // #9838
|
||||||
|
" std::unique_ptr<int> temp(p);\n"
|
||||||
|
" return DoSomething(p);\n"
|
||||||
|
"}\n"
|
||||||
|
"int f() {\n"
|
||||||
|
" return g(new int(3));\n"
|
||||||
|
"}\n", /*cpp*/ true);
|
||||||
|
ASSERT_EQUALS("", errout.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void doublefree1() { // #3895
|
void doublefree1() { // #3895
|
||||||
|
|
Loading…
Reference in New Issue