]> granicus.if.org Git - clang/commit
Check i < FD->getNumParams() before querying
authorDmitri Gribenko <gribozavr@gmail.com>
Wed, 10 Apr 2019 20:25:07 +0000 (20:25 +0000)
committerDmitri Gribenko <gribozavr@gmail.com>
Wed, 10 Apr 2019 20:25:07 +0000 (20:25 +0000)
commitb6c2a59e4dbc3456716d90b5b52712c5552d37d7
treeaf00f3cc9a640a0ed000ce5065758c09ac706a84
parent515b0570852864af5aef68ceb94454e00a507f01
Check i < FD->getNumParams() before querying

Summary:
As was already stated in a previous comment, the parameter isn't
necessarily referring to one of the DeclContext's parameter. We
should check the index is within the range to avoid out-of-boundary
access.

Reviewers: gribozavr, rsmith, lebedev.ri

Reviewed By: gribozavr, rsmith

Subscribers: lebedev.ri, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D60055

Patch by Violet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@358134 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaTemplateInstantiate.cpp
test/SemaCXX/PR41139.cpp [new file with mode: 0644]
test/SemaCXX/cxx1y-generic-lambdas.cpp