[cfe-commits] [PATCH] strnlen checker

Lenny Maiorani lenny at Colorado.EDU
Wed Mar 30 16:04:03 PDT 2011


On 03/30/2011 03:23 PM, Ted Kremenek wrote:
>> I am finally getting around to implementing this and the checkNonNull subchecker working for memcpy(), but the unit tests fail. This is because I am putting out the string 'Null pointer argument in call to X' where X is the name of the function. memcpy() has a variant defined as __memcpy_chk() so I cannot properly have an expected output in the unit test file because it changes. Is there a way to do this?
> The user doesn't explicitly write __memcpy_chk().  Isn't that generated by codegen, or does that appear in the actual AST?
>
In the test, when VARIANT is defined memcpy is #defined as 
__memcpy_chk() and then it shows up in the AST as __memcpy_chk(). As 
specified in the header of test/Analysis/bstring.c, you will see where 
the VARIANT stuff changes the functions defined so that the variant gets 
used if one exists, such as bcmp() instead of memcmp().

-Lenny






More information about the cfe-commits mailing list