fix: string offset warnings, float key deprecation, generator throw finally#440
Draft
Guikingone wants to merge 1 commit into
Draft
fix: string offset warnings, float key deprecation, generator throw finally#440Guikingone wants to merge 1 commit into
Guikingone wants to merge 1 commit into
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#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.