[all-commits] [llvm/llvm-project] 102974: [Sema] Fix null pointer dereference handleAlwaysIn...

Craig Topper via All-commits all-commits at lists.llvm.org
Thu Mar 16 17:52:35 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 10297470e953f4f3968c54c851c8af82b07af00b
      https://github.com/llvm/llvm-project/commit/10297470e953f4f3968c54c851c8af82b07af00b
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2023-03-16 (Thu, 16 Mar 2023)

  Changed paths:
    M clang/lib/Sema/SemaStmtAttr.cpp
    M clang/test/Sema/attr-alwaysinline.cpp
    M clang/test/Sema/attr-noinline.cpp

  Log Message:
  -----------
  [Sema] Fix null pointer dereference handleAlwaysInlineAttr.

It's possible for `getCalleeDecl()` to return a null pointer.

This was encountered by a user of our downstream compiler.

The case involved a DependentScopeDeclRefExpr.

Since this seems to only be for a warning diagnostic, I skipped
the diagnostic check if it returned null. But mabye there's a
different way to fix this.

Reviewed By: erichkeane

Differential Revision: https://reviews.llvm.org/D146089




More information about the All-commits mailing list