]> granicus.if.org Git - clang/commit
[OpenMP] fix seg-faults printing diagnostics with invalid ordered(n) values
authorRachel Craik <rcraik@ca.ibm.com>
Tue, 19 Sep 2017 21:04:23 +0000 (21:04 +0000)
committerRachel Craik <rcraik@ca.ibm.com>
Tue, 19 Sep 2017 21:04:23 +0000 (21:04 +0000)
commite4848b1ad307e451a6a503d87d511429f5f688e3
treeadec3729d48fc3542e4276fbb4ea1f200abb3110
parentcac5bac11b51c77c46ed014d8ceab2473aa6a820
[OpenMP] fix seg-faults printing diagnostics with invalid ordered(n) values

When the value specified for n in ordered(n) is larger than the number of loops a segmentation fault can occur in one of two ways when attempting to print out a diagnostic for an associated depend(sink : vec):
1) The iteration vector vec contains less than n items
2) The iteration vector vec contains a variable that is not a loop control variable
This patch addresses both of these issues.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313675 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/SemaOpenMP.cpp
test/OpenMP/ordered_messages.cpp