[OpenMP] Fix infinite loop in Sema::isOpenMPGlobalCapturedDecl()
authorYang Fan <nullptr.cpp@gmail.com>
Tue, 1 Sep 2020 12:45:23 +0000 (08:45 -0400)
committerAlexey Bataev <a.bataev@hotmail.com>
Tue, 1 Sep 2020 12:45:38 +0000 (08:45 -0400)
commit2114f71aaa8dc2e75fe9cd79aa4d72d164e9b95d
treea6d5f9e23d9218f32d21172e33b84b76a8d776da
parentbd6ee511502f89319f8e50ad883cfe0406202ce1
[OpenMP] Fix infinite loop in Sema::isOpenMPGlobalCapturedDecl()

Function Sema::isOpenMPGlobalCapturedDecl() has a parameter `unsigned Level`,
but use `Level >= 0` as the condition of `while`, thus cause an infinite loop.
Fix by changing the loop condition to `Level > 0`.

Reviewed By: ABataev

Differential Revision: https://reviews.llvm.org/D86858
clang/lib/Sema/SemaOpenMP.cpp