[PATCH] D110315: [Sema] Fix a null pointer reference crash.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 23 02:06:09 PDT 2021


hokein added inline comments.


================
Comment at: clang/lib/Sema/SemaDecl.cpp:14496
 
-  if (FSI->UsesFPIntrin && !FD->hasAttr<StrictFPAttr>())
+  if (FSI->UsesFPIntrin && FD && !FD->hasAttr<StrictFPAttr>())
     FD->addAttr(StrictFPAttr::CreateImplicit(Context));
----------------
I have a reproduce test case, and wait for the creduce to minimize it (will add it once creduce finishes)

I think the bug is obvious,  by reading the code on the line 14495, FD could be a nullptr.  


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110315



More information about the cfe-commits mailing list