ymandel accepted this revision.
ymandel added inline comments.
This revision is now accepted and ready to land.


================
Comment at: 
clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp:542
+        State.Env.getStorageLocationStrict(*E));
+    if (!Loc) {
+      Loc =
----------------
`loc == nullptr`


================
Comment at: 
clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp:545
+          &cast<AggregateStorageLocation>(State.Env.createStorageLocation(*E));
+      State.Env.setStorageLocationStrict(*E, *Loc);
+    }
----------------
Should this line instead be outside of this `if`? So that the flow is
```
Loc = get
if (!Loc) Loc = create
set(Loc)
```


================
Comment at: clang/lib/Analysis/FlowSensitive/Transfer.cpp:473-474
       if (S->isElidable()) {
-        Env.setStorageLocation(*S, *ArgLoc);
-      } else if (auto *ArgVal = cast_or_null<StructValue>(Env.getValue(*Arg))) 
{
+        if (Value *Val = Env.getValue(*ArgLoc))
+          Env.setValueStrict(*S, *Val);
+      } else {
----------------
What happens otherwise? I gather that `S` just isn't associated with anything?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D156672

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

Reply via email to