CPP: Fix for functions with no definition.

This commit is contained in:
Geoffrey White
2019-04-24 11:33:55 +01:00
parent 6f2274aa5e
commit 2ef3cc30c0
3 changed files with 3 additions and 2 deletions

View File

@@ -30,6 +30,8 @@ where f.getAParameter() = p
exists(FunctionCall fc | fc.getQualifier().getAChild*() = a and not fc.getTarget().hasSpecifier("const"))
)
)
// if there's no block, we can't tell how the parameter is used
and exists(f.getBlock())
select
p, "This parameter of type $@ is " + size.toString() + " bytes - consider passing a const pointer/reference instead.",
t, t.toString()