[clang] [clang] Fix pragma attribute crashes caused by nested _Pragma (PR #228990)
Chen Miao via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 7 13:47:26 PDT 2026
ChenMiaoi wrote:
> The fix is correct, but while you’re at it, could you look at the other pragmas in here and see if there are any that call `getIdentifierInfo()` w/o checking whether we actually have an identifier? E.g. this also crashes (w/ `-fms-compatibility`):
>
> ```c
> #pragma strict_gs_check (_Pragma("weak foobar"))
> ```
>
> `_Pragma("weak foobar")` seems to be a reliable way of producing an annotation token pretty much irrespective of where it appears, so I’d just look at the code and see what happens if you put that in a place where we call `getIdentifierInfo()` but don’t check the token kind before that
I'll check the other pragmas for similar issues. If I find multiple places that need fixing, would you prefer a single commit or separate commits?
https://github.com/llvm/llvm-project/pull/228990
More information about the cfe-commits
mailing list