This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Fix infinite loop in Sema::isOpenMPGlobalCapturedDecl()
ClosedPublic

Authored by nullptr.cpp on Aug 30 2020, 9:33 PM.

Details

Summary

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.

Diff Detail

Unit TestsFailed

Event Timeline

nullptr.cpp created this revision.Aug 30 2020, 9:33 PM
nullptr.cpp requested review of this revision.Aug 30 2020, 9:33 PM

Can you add the test that exposed this?

Fix by changing the loop condition to Level > 0.

nullptr.cpp edited the summary of this revision. (Show Details)Aug 30 2020, 11:49 PM

Can you add the test that exposed this?

Sorry, this was discovered by a static analyzer checker.

This revision is now accepted and ready to land.Aug 31 2020, 9:24 AM

trigger rebuild

@jdoerfert @ABataev
I don't have commit access, can you help commit this?
Yang Fan <nullptr.cpp@gmail.com>
Thanks!