baloghadamsoftware marked an inline comment as done.
baloghadamsoftware added a comment.

F11870916: correct.txt <https://reviews.llvm.org/F11870916>

F11870922: incorrect.txt <https://reviews.llvm.org/F11870922>

See the difference between the correct (master branch) and the incorrect (my 
attempt) outputs.



================
Comment at: clang/lib/StaticAnalyzer/Core/Store.cpp:472
+      break;
+    }
+
----------------
Probably this loop could be written better, without `break` at the end, but for 
now it des what it should do. For captured parameters of functions and blocks 
we must look for the original `CallExpr` and `LocationContext`. If it does not 
exist (we analyze the block of the lambda top-level) we revert to `VarRegion` 
since the captured parameters are simple variales for the block or lambda. 
However, we cannot do this if the block or lambda is not analyzed top-level, 
thus the approach I use above seems to be the correct one. However, this 
completely breaks the test `objc-radar17039661.m`. Even order of the 
`postCall()` hooks is changed and the test fails because it cannot find the 
bug. I try to attach the two different outputs annotated by debug printouts. 
@NoQ, do you have an idea what could be wrong here? First I thought on 
`BlockDataRegion`s where it seems I have to duplicate lots of code and also 
change the capture interface to also enable `ParamRegions` for the captures. 
However, in this case it does not seem to play a role.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D77229/new/

https://reviews.llvm.org/D77229



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to