[clang] [Clang][OpenMP] fixed crash due to invalid binary expression in checking atomic semantics (PR #71480)

via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 6 22:52:42 PST 2023


sun-jacobi wrote:

> This doesn't look like the right place to fix this issue to me. @alexey-bataev might have better suggestion.

The crash occurs at https://github.com/llvm/llvm-project/blob/d34a10a47d25103725174c62ed5e84e8ca380249/clang/lib/Sema/SemaOpenMP.cpp#L13011 

The reason why I fixed the issue like this is that, I think here `IsUpdateExprFound `
https://github.com/llvm/llvm-project/blob/d34a10a47d25103725174c62ed5e84e8ca380249/clang/lib/Sema/SemaOpenMP.cpp#L13000C15-L13000C32 
should not be `true`, since the second statement (or expression) is invalid expression. 

The ` IsUpdateExprFound ` comes from 
https://github.com/llvm/llvm-project/blob/d34a10a47d25103725174c62ed5e84e8ca380249/clang/lib/Sema/SemaOpenMP.cpp#L12994 

This function returns `false`, then the `IsUpdateExprFound ` will be `true`. This is the reason why I fixed this function

https://github.com/llvm/llvm-project/pull/71480


More information about the cfe-commits mailing list