Skip to content

Verilog: handle streaming concatenation with multiple stream expressions - #1947

Merged
tautschnig merged 1 commit into
diffblue:mainfrom
kroening:fix-streaming-concat
Sep 17, 2026
Merged

tautschnig merged 1 commit into
diffblue:mainfrom
kroening:fix-streaming-concat

Conversation

@kroening

Copy link
Copy Markdown
Collaborator

Summary

The convert_unary_expr and convert_binary_expr cases for ID_verilog_streaming_concatenation_* had hard preconditions operands().size() == 1 that assumed the stream body always contains exactly one expression. Streaming concatenations can have multiple expressions (e.g., {<<{a, b, c}}). Iterate over all operands instead of asserting on the count.

Test plan

  • Fixes invariant-violation crash on multi-expression streaming concatenations

🤖 Generated with Claude Code

@kroening
kroening force-pushed the fix-streaming-concat branch from 50a5154 to a324735 Compare June 28, 2026 18:34
@kroening
kroening marked this pull request as draft June 28, 2026 19:34
@kroening kroening changed the title verilog: handle streaming concatenation with multiple stream expressions Verilog: handle streaming concatenation with multiple stream expressions Jun 28, 2026
@kroening
kroening force-pushed the fix-streaming-concat branch from a324735 to c679cf3 Compare August 9, 2026 14:58
@kroening
kroening marked this pull request as ready for review August 9, 2026 14:58
@tautschnig

Copy link
Copy Markdown
Collaborator

Can we please have a test?

@kroening
kroening force-pushed the fix-streaming-concat branch 2 times, most recently from a590118 to f17fa70 Compare September 5, 2026 23:30
@kroening

kroening commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator Author

Now with test.

The preconditions expr.op().operands().size() == 1 and
expr.op1().operands().size() == 1 assumed the stream body always
contains a single expression. Streaming concatenations can have multiple
expressions (e.g., {<<{a, b, c}}). Iterate over all operands instead.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@kroening
kroening force-pushed the fix-streaming-concat branch from f17fa70 to 4edf40f Compare September 5, 2026 23:52
@tautschnig
tautschnig merged commit 93ea926 into diffblue:main Sep 17, 2026
11 checks passed
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