HomePhabricator

[analyzer] pr43179: Make CallDescription defensive against C variadic functions.

Description

[analyzer] pr43179: Make CallDescription defensive against C variadic functions.

Most functions that our checkers react upon are not C-style variadic functions,
and therefore they have as many actual arguments as they have formal parameters.

However, it's not impossible to define a variadic function with the same name.
This will crash any checker that relies on CallDescription to check the number
of arguments but silently assumes that the number of parameters is the same.

Change CallDescription to check both the number of arguments and the number of
parameters by default.

If we're intentionally trying to match variadic functions, allow specifying
arguments and parameters separately (possibly omitting any of them).
For now we only have one CallDescription which would make use of those,
namely __builtin_va_start itself.

Differential Revision: https://reviews.llvm.org/D67019

Details

Committed
NoQSep 6 2019, 1:55 PM
Differential Revision
D67019: [analyzer] pr43179: CallDescription: Check number of parameters as well as number of arguments.
Branches
Unknown
Tags
Unknown