[all-commits] [llvm/llvm-project] 98339f: Avoid nullptr dereferencing of 'Constraint'; NFC

schittir via All-commits all-commits at lists.llvm.org
Tue Aug 24 04:09:35 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 98339f14a0420cdfbe4215d8d1bc0a01165e0495
      https://github.com/llvm/llvm-project/commit/98339f14a0420cdfbe4215d8d1bc0a01165e0495
  Author: Sindhu Chittireddy <sindhu.chittireddy at intel.com>
  Date:   2021-08-24 (Tue, 24 Aug 2021)

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

  Log Message:
  -----------
  Avoid nullptr dereferencing of 'Constraint'; NFC

Klocwork static code analysis exposed this bug:
Pointer 'Constraint' returned from call to function
'cast_or_null<clang::ConceptSpecializationExpr,clang::Expr>' may
be NULL and will be dereferenced in the statement following it

Replace 'cast_or_null' with 'cast' so that the latter can assert
when it encounters a NULL.

This also removes an 'assert' that is covered by the previous
call to 'cast<>'.




More information about the All-commits mailing list