NoQ added inline comments.

================
Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:400
+      ProgramStateRef NotNullState, NullState;
+      std::tie(NotNullState, NullState) = 
State->assume(CallExprVal.getValue());
+
----------------
vrnithinkumar wrote:
> NoQ wrote:
> > It's always `UnknownVal` because the call has not been evaluated yet. This 
> > `assume()` does nothing.
> Okay.
> So in that case the `NotNullState` and `NullState` will be same as the 
> original state?
Yup.


================
Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:411
+      if (NotNullState) {
+        auto NonNullVal = C.getSValBuilder().makeTruthVal(true);
+        NotNullState =
----------------
vrnithinkumar wrote:
> Since the inner pointer value can be any non-null value, I am not sure what 
> should be the value to be added to the map for tracking.
> 
Don't add values, constrain existing values.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86027

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

Reply via email to