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

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 16 04:47:36 PDT 2023


aaron.ballman 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);
----------------
This is unnecessary, `getCanonicalDecl()` can never return a null pointer (it will return `this`, at the very least)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D153033



More information about the cfe-commits mailing list