[all-commits] [llvm/llvm-project] 6ec446: [Clang] Add sanity check in Sema::getDestructorNam...

Shafik Yaghmour via All-commits all-commits at lists.llvm.org
Wed Jan 25 10:49:21 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6ec446ddcee33777a8420c227374f7b422a7df1b
      https://github.com/llvm/llvm-project/commit/6ec446ddcee33777a8420c227374f7b422a7df1b
  Author: Shafik Yaghmour <shafik.yaghmour at intel.com>
  Date:   2023-01-25 (Wed, 25 Jan 2023)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/Sema/SemaExprCXX.cpp
    A clang/test/SemaCXX/GH59446.cpp

  Log Message:
  -----------
  [Clang] Add sanity check in Sema::getDestructorName to prevent nullptr dereference

Currently in Sema::getDestructorName we call SS.getScopeRep()->getPrefix() but
SS.getScopeRep() can return nullptr because LookupInNestedNameSpec(...) called a
little before can invalidate SS.

This fixes: https://github.com/llvm/llvm-project/issues/59446

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




More information about the All-commits mailing list