Skip to content

fix(builtins): emit stderr warning when sed branch loop limit is reached#1012

Merged
chaliy merged 1 commit intomainfrom
fix/issue-1005-sed-loop-warning
Apr 2, 2026
Merged

fix(builtins): emit stderr warning when sed branch loop limit is reached#1012
chaliy merged 1 commit intomainfrom
fix/issue-1005-sed-loop-warning

Conversation

@chaliy
Copy link
Copy Markdown
Contributor

@chaliy chaliy commented Apr 2, 2026

Summary

  • Emit warning on stderr when sed branch/label loop limit (1000 iterations) is hit
  • Warning includes line number for debugging

What & Why

The sed branch execution loop silently stopped at 1000 iterations, producing silently truncated output. This is a data integrity issue — scripts depending on sed loops would get incorrect results without any indication. Now emits sed: warning: branch/label loop limit (1000) reached on line N; output may be truncated.

Tests Added

  • test_sed_branch_loop_limit_emits_warning — verifies warning on stderr when limit hit
  • test_sed_normal_branch_no_warning — verifies no warning for normal sed usage

Closes #1005

Closes #1005 — the sed branch/label execution loop silently stopped at
1000 iterations, producing incorrect output without warning. Now emits
a diagnostic message on stderr when the limit is hit.
@chaliy chaliy merged commit 07b499f into main Apr 2, 2026
27 checks passed
@chaliy chaliy deleted the fix/issue-1005-sed-loop-warning branch April 2, 2026 11:07
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.

Sed branch loop limit silently truncates output without warning

1 participant