[Clang] Add check to Sema::AddAlignedAttr to verify active bits is not out of range
authorShafik Yaghmour <shafik.yaghmour@intel.com>
Thu, 8 Jun 2023 20:50:42 +0000 (13:50 -0700)
committerShafik Yaghmour <shafik.yaghmour@intel.com>
Thu, 8 Jun 2023 20:53:33 +0000 (13:53 -0700)
commit086183c6c65fc8106b8cae99af95c4974b975f51
tree3fecb7eb5f1b400a64b59e65811f4d78d920df1c
parentc01f284fbbf4c93c65b1f92fb8b3d263afb796c0
[Clang] Add check to Sema::AddAlignedAttr to verify active bits is not out of range

If we provide too large a value for the alignment attribute
APInt::getZExtValue() will assert. This PR adjusts existing check to catch
this case and provide a diagnostic.

This fixes: https://github.com/llvm/llvm-project/issues/50534

Differential Revision: https://reviews.llvm.org/D152335
clang/docs/ReleaseNotes.rst
clang/lib/Sema/SemaDeclAttr.cpp
clang/test/Sema/attr-aligned.c