Skip to content

[AUTOMATED] Preserve C++ range-for control flow - #15

Merged
mahaloz merged 23 commits into
Noelo-Lab:mainfrom
sjkim1127:codex/cpp-range-for-cfg
Nov 9, 2026
Merged

mahaloz merged 23 commits into
Noelo-Lab:mainfrom
sjkim1127:codex/cpp-range-for-cfg

Conversation

@sjkim1127

Copy link
Copy Markdown

[AUTOMATED]

A C++ range-for such as for (int x : get()) { if (x) break; } drops get() from the CFG and leaves break without its successor. Keep the range evaluation before the loop, with a zero-iteration exit and an advance path for normal completion and continue. Iterator operations are represented by abstract nodes.

The pattern occurs in The Powder Toy and Piper. Joern 4.0.150 also drops the initializer on the identical reduced input. The divergence is documented.

Clang C++11 and C++17 runtime controls confirmed one range evaluation, zero visits for an empty range, and the continue/break sequence. 206 Rust tests, Clippy and formatting passed. Python ran 154 tests with 16 skips. The 12-input replay preserved eight successful responses and four preexisting strict rejections byte for byte. Median CLI time on one unchanged C++ input was 16.94 vs 16.95 ms over ten alternating runs.

Copilot AI balanced review requested due to automatic review settings November 9, 2026 00:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

mahaloz and others added 10 commits November 9, 2026 16:07
Keep the GNU case-range operator in the generated table, and the C++ pack-size spelling in the lexical bridge, so the operator port does not change either.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0179iMKNTKZkNX6ZRBmB96eA
Every other restorable divergence has a joern_* option that original-reference comparisons request. Add joern_cpp_control_flow for the C++ evaluation-order fixes, starting with noexcept operands.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0179iMKNTKZkNX6ZRBmB96eA
Keep the lowering this change replaced, so original-reference comparisons can still request it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0179iMKNTKZkNX6ZRBmB96eA
@mahaloz
mahaloz merged commit 2392474 into Noelo-Lab:main Nov 9, 2026
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.

3 participants