Skip to content

Do not skip past decls_end() for an empty tag in GetAllCppNames - #1079

Open
conrade-ctc wants to merge 1 commit into
compiler-research:mainfrom
chicagotrading:conrade/getallcppnames-empty-tag
Open

conrade-ctc wants to merge 1 commit into
compiler-research:mainfrom
chicagotrading:conrade/getallcppnames-empty-tag

Conversation

@conrade-ctc

Copy link
Copy Markdown
Collaborator

The increment that skips a tag's injected class name ran before the loop's end check, so an enum with no enumerators advanced a past-the-end iterator and crashed the process.

decl = DC->decls_begin();
decl++;                       // before the end check below
...
for (/* decl set above */; decl != DC->decls_end(); decl++)

The existing test's tag cases are all CXXRecordDecls, which always contain the injected class name, so they never reach an empty context.

Part of #1078.

@codecov

codecov Bot commented Jul 31, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.86%. Comparing base (3ab124a) to head (bbaf9e9).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1079   +/-   ##
=======================================
  Coverage   88.86%   88.86%           
=======================================
  Files          24       24           
  Lines        7014     7015    +1     
=======================================
+ Hits         6233     6234    +1     
  Misses        781      781           
Files with missing lines Coverage Δ
lib/CppInterOp/CppInterOp.cpp 91.23% <100.00%> (+<0.01%) ⬆️
Files with missing lines Coverage Δ
lib/CppInterOp/CppInterOp.cpp 91.23% <100.00%> (+<0.01%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@vgvassilev vgvassilev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@vgvassilev
vgvassilev force-pushed the conrade/getallcppnames-empty-tag branch from df9b7e7 to 7a7cdd6 Compare August 20, 2026 14:17
@github-actions

Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@conrade-ctc
conrade-ctc force-pushed the conrade/getallcppnames-empty-tag branch 2 times, most recently from 1fcf981 to 477d582 Compare September 15, 2026 16:15
The increment that skips a tag's injected class name ran before the loop's end
check, so an enum with no enumerators advanced a past-the-end iterator.
@conrade-ctc
conrade-ctc force-pushed the conrade/getallcppnames-empty-tag branch from 477d582 to bbaf9e9 Compare November 30, 2026 22:08

This branch has not been deployed

No deployments
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