[PATCH] D103100: [AIX] Enable stackprotect feature

ChenZheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 27 17:44:15 PDT 2021


shchenz accepted this revision.
shchenz added a comment.
This revision is now accepted and ready to land.

LGTM.  Thanks.



================
Comment at: llvm/lib/Target/PowerPC/PPCISelLowering.cpp:16424
+Value *PPCTargetLowering::getSDagStackGuard(const Module &M) const {
+  if (Subtarget.isAIXABI())
+    return M.getGlobalVariable(AIXSSPCanaryWordName);
----------------
jsji wrote:
> shchenz wrote:
> > Is it better to add an assertion here to indicate that the return value will never be nullptr?
> We can, but I don't think it is necessary.
> We call `M.getOrInsertGlobal` in `insertSSPDeclarations` above, so there should not be nullptr.
> Also none of the other targets like x86/arm adding the assert too.
> 
OK.  I suggest this because some users of this function directly dereference the result without checking null. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103100



More information about the llvm-commits mailing list