[clang] 12038be - [Concepts] Fix crash in D41910
Saar Raz via cfe-commits
cfe-commits at lists.llvm.org
Wed Dec 18 11:32:27 PST 2019
Author: Saar Raz
Date: 2019-12-18T21:31:33+02:00
New Revision: 12038be20ee6a903cdbd3fddce65535ef683e31d
URL: https://github.com/llvm/llvm-project/commit/12038be20ee6a903cdbd3fddce65535ef683e31d
DIFF: https://github.com/llvm/llvm-project/commit/12038be20ee6a903cdbd3fddce65535ef683e31d.diff
LOG: [Concepts] Fix crash in D41910
Differential Revision: https://reviews.llvm.org/D41910
Added:
Modified:
clang/lib/Sema/SemaConcept.cpp
Removed:
################################################################################
diff --git a/clang/lib/Sema/SemaConcept.cpp b/clang/lib/Sema/SemaConcept.cpp
index cd41000fa023..f9d54a811469 100755
--- a/clang/lib/Sema/SemaConcept.cpp
+++ b/clang/lib/Sema/SemaConcept.cpp
@@ -558,7 +558,7 @@ static bool substituteParameterMappings(Sema &S, NormalizedConstraint &N,
Atomic.ParameterMapping.emplace();
Atomic.ParameterMapping->reserve(OccurringIndices.size());
for (unsigned I = 0, C = TemplateParams->size(); I != C; ++I)
- if (OccurringIndices[I])
+ if (I < OccurringIndices.size() && OccurringIndices[I])
Atomic.ParameterMapping->push_back(
S.getIdentityTemplateArgumentLoc(TemplateParams->begin()[I],
// Here we assume we do not support things like
More information about the cfe-commits
mailing list