Diff Detail
Event Timeline
clang/lib/Analysis/CFG.cpp | ||
---|---|---|
4156 | I get that we're counting on the dereference on 4145 to have made this check irrelevant, but are we sure that we KNOW that "S" is non-null here otherwise? That is, is the bug actually 4145 doing 'alwaysAdd' without checking vs the unnecessary check here? | |
clang/lib/CodeGen/CGObjCGNU.cpp | ||
58 | I would suggest instead making these inline initialization rather than here (that is, CGM = nullptr on line 49, etc). |
clang/lib/Analysis/CFG.cpp | ||
---|---|---|
4156 | VisitCXXTypeidExpr is used only in one place - here https://github.com/llvm/llvm-project/blob/a89c9b35be08b665cc1a01d840bc20349ba1308f/clang/lib/Analysis/CFG.cpp#L2288 where S is not null. Null check for S already happens at the beginning of the method where VisitCXXTypeidExpr is called. |
Address comment- Use default member initialization instead of initializing in a constructor.
clang/lib/CodeGen/CGObjCGNU.cpp | ||
---|---|---|
58 | The comment above needs to be updated? |
clang/lib/Analysis/CFG.cpp | ||
---|---|---|
4156 |
Hi @aaron.ballman, could you please comment on this? Thank you! |
clang/lib/Analysis/CFG.cpp | ||
---|---|---|
4156 | I don't think an assert is necessary; I think it's a predicate to pass non-null nodes to the Visit functions in general, and I don't think we get a whole lot out of asserting in each Visit method that its given node is nonnull. | |
clang/lib/CodeGen/CGObjCGNU.cpp | ||
58 | I think the comment is stale or imprecise -- the class certainly is initialized (it was being initialized previously as well, just not fully initialized). I think it may have meant "not initialized to useful values", so we could either repair it that way or remove the comment entirely. |
Remove stale comment about default constructor not initializing members in a useful way.
Can you mark this change as closed?
If you'd put "Differential Revision: https://reviews.llvm.org/D153589" in your commit message this would have happened automatically.
I put the link to the review but worded the commit message differently. Thanks, I will close this.
I get that we're counting on the dereference on 4145 to have made this check irrelevant, but are we sure that we KNOW that "S" is non-null here otherwise? That is, is the bug actually 4145 doing 'alwaysAdd' without checking vs the unnecessary check here?