Skip to content

fix(interpreter): exit builtin terminates execution in compound commands#904

Merged
chaliy merged 2 commits intomainfrom
fix/exit-control-flow
Mar 31, 2026
Merged

fix(interpreter): exit builtin terminates execution in compound commands#904
chaliy merged 2 commits intomainfrom
fix/exit-control-flow

Conversation

@chaliy
Copy link
Copy Markdown
Contributor

@chaliy chaliy commented Mar 31, 2026

Summary

  • The exit builtin returned a plain exit code without ControlFlow signaling, so commands after exit in if/while/for/case blocks kept running
  • Added ControlFlow::Exit(i32) variant and wired it through the interpreter: propagates past function boundaries, consumed at subshell and command substitution boundaries (matching bash semantics)

Test plan

  • 7 new spec tests: exit in if, while, for, case, function, subshell isolation
  • cargo test --all-features passes
  • cargo clippy and cargo fmt clean
  • CI green

chaliy added 2 commits March 31, 2026 02:48
The exit builtin returned a plain exit code without ControlFlow signaling,
so commands after exit in if/while/for/case blocks kept running. Added
ControlFlow::Exit variant, propagated through the interpreter, consumed at
subshell and command substitution boundaries (matching bash semantics).
Bump exemptions for wasm-bindgen ecosystem minor version bumps.
@chaliy chaliy merged commit 9e7f605 into main Mar 31, 2026
27 checks passed
@chaliy chaliy deleted the fix/exit-control-flow branch March 31, 2026 03:33
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.

1 participant