[PATCH] D153033: [CLANG]Fix potential null pointer dereference bugs

Soumi Manna via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 16 07:09:48 PDT 2023


Manna marked an inline comment as done.
Manna added inline comments.


================
Comment at: clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp:3368
 
-  VD = VD->getCanonicalDecl();
+  VD = cast<VarDecl>(VD->getCanonicalDecl());
   auto I = FunctionGlobalizedDecls.find(CGF.CurFn);
----------------
aaron.ballman wrote:
> This is unnecessary, `getCanonicalDecl()` can never return a null pointer (it will return `this`, at the very least)
Thank you @aaron.ballman for reviews! I agree with you. My previous analysis was wrong. I have removed this change.


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

https://reviews.llvm.org/D153033



More information about the cfe-commits mailing list