Skip to content

Conversation

@zharinov
Copy link
Member

@zharinov zharinov commented Jan 7, 2026

Summary

  • Fix panic when unlabeled alternations have 5+ branches with unique captures
  • Add emit_match_with_cascade() to split overflow pre-effects into epsilon chain
  • Add assertions for bytecode field limits (pre/post/neg counts, Up level)

Why

Unlabeled alternations inject Null + Set effects for missing captures per branch. With 5+ branches, this exceeded the 3-bit limit (max 7) for pre_count, causing u16 overflow that corrupted successor addresses and panicked with "range start index 90816 out of range".

The fix cascades overflow effects into leading epsilon transitions, matching the existing pattern for successor overflow.

@zharinov zharinov merged commit 5d581db into master Jan 7, 2026
4 checks passed
@zharinov zharinov deleted the fix/effects-overflow-cascade branch January 7, 2026 20:42
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