[all-commits] [llvm/llvm-project] cf236a: [NFC][CLANG] Fix nullptr dereference issue in Dedu...

smanna12 via All-commits all-commits at lists.llvm.org
Tue May 30 19:03:48 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cf236a037fd846d12131809ed07766fceec65fdc
  Author: Manna, Soumi <soumi.manna at intel.com>
  Date:   2023-05-30 (Tue, 30 May 2023)

  Changed paths:
    M clang/lib/Sema/SemaTemplateDeduction.cpp

  Log Message:
  [NFC][CLANG] Fix nullptr dereference issue in DeduceTemplateArgumentsByTypeMatch()

DeduceTemplateArgumentsByTypeMatch() returns null value which is dereferenced without checking since getAsIncompleteArrayType() returns nullptr and we are dereferencing null pointer value for S.Context->getAsIncompleteArrayType(P) when calling getElementType().

This patch adds an assert.

Reviewed By: erichkeane

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

More information about the All-commits mailing list