Skip to content

Fix 6 language correctness bugs found in comprehensive audit#504

Open
nbeerbower wants to merge 3 commits into
mainfrom
claude/language-correctness-checklist-ra4x2
Open

Fix 6 language correctness bugs found in comprehensive audit#504
nbeerbower wants to merge 3 commits into
mainfrom
claude/language-correctness-checklist-ra4x2

Conversation

@nbeerbower

Copy link
Copy Markdown
Collaborator

CRITICAL fixes:

  • Fix labeled break/continue losing target_label through try-finally blocks
    (statements.c: save/restore target_label alongside is_breaking/is_continuing)
  • Fix OR patterns in match not binding variables in both interpreter and compiler
    (interpreter: transfer temp_env bindings to parent env on match;
    compiler: pre-declare bindings before OR blocks, use assignment in alternatives)
  • Fix compiler defer stack not scoped per function — nested calls executed wrong defers
    (add hml_defer_save_depth/hml_defer_execute_to_depth to runtime,
    emit depth tracking at function entry, use scoped execution at return)

HIGH fixes:

  • Fix exception value not retained when re-thrown from task join
    (concurrency.c: VALUE_RETAIN exception_value after copying exception_state)
  • Fix const parameter modifier parsed but never enforced at runtime
    (add param_is_const to Function struct, pass to env_define_param,
    environment already enforces const on set)

MODERATE fix:

  • Fix leading-dot float literals (.5) not supporting underscore separators
    (lexer.c: allow underscores in fractional/exponent digits, use strip_underscores)

Adds 4 parity tests covering the fixed issues.

https://claude.ai/code/session_01Vm74RMmHxnBri5cPBSshkY

claude added 3 commits April 8, 2026 01:17
CRITICAL fixes:
- Fix labeled break/continue losing target_label through try-finally blocks
  (statements.c: save/restore target_label alongside is_breaking/is_continuing)
- Fix OR patterns in match not binding variables in both interpreter and compiler
  (interpreter: transfer temp_env bindings to parent env on match;
   compiler: pre-declare bindings before OR blocks, use assignment in alternatives)
- Fix compiler defer stack not scoped per function — nested calls executed wrong defers
  (add hml_defer_save_depth/hml_defer_execute_to_depth to runtime,
   emit depth tracking at function entry, use scoped execution at return)

HIGH fixes:
- Fix exception value not retained when re-thrown from task join
  (concurrency.c: VALUE_RETAIN exception_value after copying exception_state)
- Fix const parameter modifier parsed but never enforced at runtime
  (add param_is_const to Function struct, pass to env_define_param,
   environment already enforces const on set)

MODERATE fix:
- Fix leading-dot float literals (.5) not supporting underscore separators
  (lexer.c: allow underscores in fractional/exponent digits, use strip_underscores)

Adds 4 parity tests covering the fixed issues.

https://claude.ai/code/session_01Vm74RMmHxnBri5cPBSshkY
…ctness-checklist-ra4x2

# Conflicts:
#	src/backends/interpreter/runtime/eval_pattern_match.c
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