Skip to content

Partial fix for #14576: Missing attribute alignas (aligned_storage case)#8307

Open
ludviggunne wants to merge 2 commits intodanmar:mainfrom
ludviggunne:14576-2
Open

Partial fix for #14576: Missing attribute alignas (aligned_storage case)#8307
ludviggunne wants to merge 2 commits intodanmar:mainfrom
ludviggunne:14576-2

Conversation

@ludviggunne
Copy link
Collaborator

No description provided.

@ludviggunne ludviggunne force-pushed the 14576-2 branch 2 times, most recently from a1da918 to a8b3275 Compare March 11, 2026 09:40

tok = tok->next();
const Token *end = tok->link();
tok = tok->next();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is redundant as far as I see and in theory tok will become null if "<" is the last token and then there will be a crash.

if (std < Standards::CPP11 || std >= Standards::CPP23)
return;

for (Token *tok = list.front(); tok; tok = tok->next()) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if tok becomes null in the loop body then yes there will be null pointer dereference when tok->next() is executed here. I am not sure if tok can become null but we do have some code like tok && .. that suggest that tok can become null..

@ludviggunne ludviggunne changed the title Partial fix for #14756: Missing attribute alignas (aligned_storage case) Partial fix for #14576: Missing attribute alignas (aligned_storage case) Mar 11, 2026
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants