[PATCH] D60055: Check i < FD->getNumParams() before querying

Roman Lebedev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 8 08:41:57 PDT 2019


lebedev.ri added inline comments.


================
Comment at: clang/lib/Sema/SemaTemplateInstantiate.cpp:2895
       // function and isn't necessarily referring to one of FD's parameters.
-      if (FD->getParamDecl(i) == PV)
+      if (i < FD->getNumParams() && FD->getParamDecl(i) == PV)
         return FD->getCanonicalDecl()->getParamDecl(i);
----------------
Have you analyzed how we get here?
Maybe the caller code is faulty?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D60055





More information about the cfe-commits mailing list