[PATCH] D139148: Fix nullptr dereference found by Coverity static analysis tool

Sindhu Chittireddy via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 6 16:21:32 PST 2022


schittir added a comment.





================
Comment at: clang/lib/Sema/SemaInit.cpp:5947
 
     if (TryOCLZeroOpaqueTypeInitialization(S, *this, DestType, Initializer))
       return;
----------------
#1/5 Coverity reported explicit null dereference of 'Initializer'


================
Comment at: clang/lib/Sema/SemaInit.cpp:5967
          (Context.hasSameUnqualifiedType(SourceType, DestType) ||
           S.IsDerivedFrom(Initializer->getBeginLoc(), SourceType, DestType))))
       TryConstructorInitialization(S, Entity, Kind, Args,
----------------
#2/5 Coverity reported explicit null dereference of 'Initializer'


================
Comment at: clang/lib/Sema/SemaInit.cpp:5977
     else
       TryUserDefinedConversion(S, DestType, Kind, Initializer, *this,
                                TopLevelOfInitList);
----------------
#3/5 Coverity reported explicit null dereference of 'Initializer'


================
Comment at: clang/lib/Sema/SemaInit.cpp:6032
       if (Context.hasSameUnqualifiedType(SourceType, Atomic->getValueType()) ||
           S.IsDerivedFrom(Initializer->getBeginLoc(), SourceType,
                           Atomic->getValueType())) {
----------------
#4/5 Coverity reported explicit null dereference of 'Initializer'


================
Comment at: clang/lib/Sema/SemaInit.cpp:6039
 
     TryUserDefinedConversion(S, DestType, Kind, Initializer, *this,
                              TopLevelOfInitList);
----------------
#5/5 Coverity reported explicit null dereference of 'Initializer'


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

https://reviews.llvm.org/D139148



More information about the cfe-commits mailing list