Fix 10599: regression- segmentation fault on template code (#3565)
This commit is contained in:
parent
4f9a563570
commit
8bff45281d
|
@ -999,6 +999,8 @@ void CheckBufferOverrun::objectIndex()
|
|||
if (v.lifetimeKind != ValueFlow::Value::LifetimeKind::Address)
|
||||
continue;
|
||||
const Variable *var = v.tokvalue->variable();
|
||||
if (!var)
|
||||
continue;
|
||||
if (var->isReference())
|
||||
continue;
|
||||
if (var->isRValueReference())
|
||||
|
|
|
@ -4750,6 +4750,15 @@ private:
|
|||
" free(*str);\n"
|
||||
"}\n", "test.c");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
check("template <typename T, unsigned N>\n"
|
||||
"using vector = Eigen::Matrix<T, N, 1>;\n"
|
||||
"template <typename V>\n"
|
||||
"void scharr(image2d<vector<V, 2>>& out) {\n"
|
||||
" vector<V, 2>* out_row = &out(r, 0);\n"
|
||||
" out_row[c] = vector<V, 2>(1,2);\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue