[PATCH] D158293: [NFC][CLANG] Fix potential dereferencing of null return values

Owen Pan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 18 13:22:01 PDT 2023


owenpan added inline comments.


================
Comment at: clang/lib/Format/TokenAnnotator.cpp:2009-2010
                (Line.MightBeFunctionDecl || Line.InPPDirective) &&
-               Current.NestingLevel == 0 &&
+               Current.NestingLevel == 0 && Current.Previous &&
                !Current.Previous->isOneOf(tok::kw_operator, tok::identifier)) {
       // not auto operator->() -> xxx;
----------------
`Current.Previous` can't be null here because `AutoFound` is `true`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D158293



More information about the cfe-commits mailing list