Skip to content

fix: string offset warnings, float key deprecation, generator throw finally#440

Draft
Guikingone wants to merge 1 commit into
illegalstudio:mainfrom
Guikingone:fix/batch-7
Draft

fix: string offset warnings, float key deprecation, generator throw finally#440
Guikingone wants to merge 1 commit into
illegalstudio:mainfrom
Guikingone:fix/batch-7

Conversation

@Guikingone

Copy link
Copy Markdown
Collaborator

#351: String offset out-of-bounds access and float array key coercion now emit PHP-matching diagnostics. New runtime helpers __rt_warn_string_offset (formats offset via __rt_itoa) and __rt_warn_float_to_int_key (formats float via __rt_ftoa) write to stderr respecting @ suppression. Float-key deprecation only fires when precision is lost (fractional floats); whole-number floats like 2.0 do not trigger it.

#338: Already fixed on main; added a regression test verifying Generator::send() before first resume injects the value into the first yield and returns the correct result.

#355: Generator::throw() skipped finally blocks during unwinding because try/finally without catch never pushed a TryPushHandler (setjmp frame). In generator bodies, lower_try_finally_without_catches now delegates to lower_try_finally_generator which pushes a TryPushHandler, keeps the static finally-frame duplication for normal exits, and adds a longjmp landing pad that runs the finally body once then re-raises. The finally frame is marked run_on_throw=false to prevent double-entry. Added is_generator_body flag to LoweringContext.

…inally

illegalstudio#351: String offset out-of-bounds access and float array key coercion
now emit PHP-matching diagnostics. New runtime helpers
__rt_warn_string_offset (formats offset via __rt_itoa) and
__rt_warn_float_to_int_key (formats float via __rt_ftoa) write to
stderr respecting @ suppression. Float-key deprecation only fires when
precision is lost (fractional floats); whole-number floats like 2.0
do not trigger it.

illegalstudio#338: Already fixed on main; added a regression test verifying
Generator::send() before first resume injects the value into the first
yield and returns the correct result.

illegalstudio#355: Generator::throw() skipped finally blocks during unwinding because
try/finally without catch never pushed a TryPushHandler (setjmp frame).
In generator bodies, lower_try_finally_without_catches now delegates to
lower_try_finally_generator which pushes a TryPushHandler, keeps the
static finally-frame duplication for normal exits, and adds a longjmp
landing pad that runs the finally body once then re-raises. The finally
frame is marked run_on_throw=false to prevent double-entry. Added
is_generator_body flag to LoweringContext.
@github-actions github-actions Bot added area:codegen Touches target-aware assembly or backend lowering. area:eir Touches EIR definitions, lowering, validation, or passes. area:runtime Touches runtime helpers, GC, ownership, or bridge runtimes. size:m Medium-sized pull request. type:fix Corrects broken or incompatible behavior. labels Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:codegen Touches target-aware assembly or backend lowering. area:eir Touches EIR definitions, lowering, validation, or passes. area:runtime Touches runtime helpers, GC, ownership, or bridge runtimes. size:m Medium-sized pull request. type:fix Corrects broken or incompatible behavior.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant