[PATCH] Proposal on how to fix temporary dtors.

Manuel Klimek klimek at google.com
Wed May 28 07:12:18 PDT 2014


Ok, found out that lambdas are currently very unsupported in the analyzer
anyway:
    case Stmt::LambdaExprClass:
    case Stmt::SEHFinallyStmtClass: {
      const ExplodedNode *node = Bldr.generateSink(S, Pred,
Pred->getState());
      Engine.addAbortedBlock(node, currBldrCtx->getBlock());
      break;
    }

More work!



On Wed, May 28, 2014 at 3:54 PM, Manuel Klimek <klimek at google.com> wrote:

> By now I think I'm completely out of my league here.
> Lambdas seem to be modeled very differently from other things in the AST:
> 1. The lambda decl has its own CXXBindTemporary (as the lambda itself is
> like a construction of a class)
> 2. the capture statement has its own CXXBindTemporary
>
> I don't think we want to insert the temp dtors into the CFG after the
> lambda declaration, as the result of the capture initializer seems to
> always be bound to the lifetime of the lambda (I have no idea whether
> that's correct, though) :)
>
>
>
> On Wed, May 28, 2014 at 3:38 PM, Manuel Klimek <klimek at google.com> wrote:
>
>> And one more update: apparently we have to at least visit the captures
>> for by-value captures (just like VisitLambda does, I should have looked
>> there in the first place ;)
>>
>>
>> On Wed, May 28, 2014 at 3:04 PM, Manuel Klimek <klimek at google.com> wrote:
>>
>>> FYI, note that this test would fail miserably at trunk, too..
>>>
>>>
>>> On Wed, May 28, 2014 at 3:03 PM, Manuel Klimek <klimek at google.com>wrote:
>>>
>>>> Do not recursively visit lambdas for temporaries. This fixes the CFG,
>>>> but does
>>>> not yet fix what we can reach.
>>>>
>>>> http://reviews.llvm.org/D3627
>>>>
>>>> Files:
>>>>   include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h
>>>>   include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h
>>>>   include/clang/StaticAnalyzer/Core/PathSensitive/SubEngine.h
>>>>   lib/Analysis/CFG.cpp
>>>>   lib/StaticAnalyzer/Core/CoreEngine.cpp
>>>>   lib/StaticAnalyzer/Core/ExprEngine.cpp
>>>>   lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
>>>>   test/Analysis/temp-obj-dtors-cfg-output.cpp
>>>>   test/Analysis/temporaries.cpp
>>>>
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140528/dc90ad34/attachment.html>


More information about the cfe-commits mailing list