[PATCH] D151964: [NFC][CLANG] Fix Static Code Analyzer Concerns with dereference null return value in applyObjCTypeArgs()

Soumi Manna via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 2 06:51:49 PDT 2023


Manna added inline comments.


================
Comment at: clang/lib/Sema/SemaType.cpp:956
       // Determine whether the type argument is substitutable for the bound.
       if (typeArgObjC->isObjCIdType()) {
         // When the type argument is 'id', the only acceptable type
----------------
erichkeane wrote:
> Note for future reviewers: This 'if' on both branches dereferences the `boundObjC` pointer. The true path is just below here, on 959.  Second is in the condition inside of the `else if` on 961, `canAssignObjCInterfaces` immediately dereferences the parameters.
>>This 'if' on both branches dereferences the boundObjC pointer. The true path is just below here, on 959. Second is in the condition inside of the else if on 961, canAssignObjCInterfaces immediately dereferences the parameters.

Yes.

Thank you @erichkeane for reviews!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D151964



More information about the cfe-commits mailing list