[PATCH] [analyzer][Review request] Better modelling of memcpy by the CStringChecker (PR16731)

Anna Zaks ganna at apple.com
Mon Oct 28 22:38:48 PDT 2013


Hi Anton,

Sorry, I see that I've misread your patch. I'll give it another look tomorrow.

However, can you double check that all the test cases we've discussed in "Re: new/delete checker LLVM false positives" thread are either already in the repository or are added to the patch.

Thanks,
Anna.

On Oct 28, 2013, at 6:59 PM, Антон Ярцев <anton.yartsev at gmail.com> wrote:

> 
>  It is the analyzer core (RegionStoreManager::invalidateRegions()) that perform common invalidation of a region as well as it's subregions/indirect regions, traits are used to handle exceptions from the common invalidation logic. Thus marking a region with TK_PreserveContents we prevent the contents of the particularly this region (not subregions/indirect regions) from being invalidated by the core if invalidation touches this region. All the subregions/indirect regions are invalidated in default way.
> 
>  The similar situation with the pointer escape - normally we either call pointer escape callback for an any region/symbol, touched by the invalidation of a top level region or do not call pointer escape callback for either of the regions touched by that invalidation. For now we deviate from this rule only in the case, when we artificially model an impact of the call to 'memcpy' (and several similar library copy functions) on it's source and destination buffers.
> 
>  Calling ConstPointerEscape with TK_SuppressEscape and !TK_PreserveContents means that the checkConstPointerEscape should not be fired for a given region for two reasons - TK_SuppressEscape tells that the escape of a given region is suppressed (currently by the user) and !TK_PreserveContents tells that a given symbol is the matter of a regular pointer escape.
> 
>  If I understand correctly, invalidation and escape is already split into at least three callbacks: checkRegionChanges for invalidation and checkPointerEscape/checkConstPointerEscape for escape.
> 
>  I think it is currently no need to give the user an ability to invalidate/escape a particular region/symbol passing the common invalidation/escape mechanism.
> 
> http://llvm-reviews.chandlerc.com/D1887
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits





More information about the cfe-commits mailing list