[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:51:09 PDT 2026
ChenMiaoi wrote:
> > 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
>
> Also, in most of these places, rather than checking for annotation tokens, it would probably make more sense to check `Tok.is(tok::identifier)` instead. On that note, `Token::isAnyIdentifier()` is also wrong, because that returns true for `tok::raw_identifier`, but `getIdentifierInfo()` asserts for those... if you want to look into fixing that too, feel free to do that as part of this patch. I’d be fine w/ this being a more general ‘make sure we don’t call `getIdentifierInfo()` on something that’s not an identifier’ patch if that’s not too much work for you
I'll try to look into this.
https://github.com/llvm/llvm-project/pull/228990
More information about the cfe-commits
mailing list