Skip to content

Fix an ICE with include files at the ends of blocks#1564

Merged
WardBrian merged 2 commits intomasterfrom
fix/nested-includes-functions-ICE
Oct 17, 2025
Merged

Fix an ICE with include files at the ends of blocks#1564
WardBrian merged 2 commits intomasterfrom
fix/nested-includes-functions-ICE

Conversation

@WardBrian
Copy link
Member

Ran into this today, the issue seems to be that the functions { } was being omitted entirely. This fix seems simple, and doesn't change any other output, so, maybe it's that easy?

Submission Checklist

  • Run unit tests
  • Documentation
    • If a user-facing facing change was made, the documentation PR is here:
    • OR, no user-facing changes were made

Release notes

Fixed a crash with nested includes

Copyright and Licensing

By submitting this pull request, the copyright holder is agreeing to
license the submitted work under the BSD 3-clause license (https://opensource.org/licenses/BSD-3-Clause)

@WardBrian WardBrian requested a review from nhuurre October 17, 2025 20:54
Copy link
Collaborator

@nhuurre nhuurre left a comment

Choose a reason for hiding this comment

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

I agree the simple fix is correct. I think checking should_skip xloc.begin_loc is probably enough, no idea why it ever used end_loc. Also I'm confused as to why this is only a problem for nested includes.

@WardBrian
Copy link
Member Author

I’m also suspicious about why the nested include matters. I wouldn’t be surprised if there is a flaw in the preprocessor’s location code that is only exposed when you pop two buffers in a row (though, I tried finding such an issue and could not)

@WardBrian WardBrian merged commit bc48709 into master Oct 17, 2025
1 check passed
@WardBrian WardBrian deleted the fix/nested-includes-functions-ICE branch October 17, 2025 22:45
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