Repository navigation
Hard bugs: reference representation, object handles, reified fit, comptime require - #555
Merged
Merged
Conversation
…o the caller's variable keeps one representation (Fixes #488)
… reference box (Fixes #495)
…ger mutates the source (Fixes #515)
…the caller's slot, not a written-back scratch (Fixes #187)
…l, typed or not, and keep its declared scalar coercion on stores (Refs #353)
…cell design; add repro for rc-1 reference elements shared on array copy (#548)
…in the ref-cell design
…,2,3 and reuse freed ids (ABI v25)
…ser's generated autoload files as built in under composer: true
…l, so a throw cannot skip the scratch write-back
…, handle reused (was leaked and destructed at shutdown)
…rs, as php frees the temporary, not at statement end
…anded until exit)
…ls, not before as php
…g rekinding, not argument-temporary release order (tracked by repro temp_arg_destroyed_after_callee_locals)
…ed to null leaked its env
…'s buffer per call; pin with require_value_ownership
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.
Summary
Hard bugs grouped by root cause, on top of #546 and #556.
$array = &$array[$key]crashes #488 foreach over an iterator object crashes when a reference to a function-local is held elsewhere in the program #495 array_shift on a foreach value taken from a decoded nested array crashes. #515 An array element that was once referenced keeps sharing its reference box after the reference is gone, so a copy of the array aliases the original. #548 A by-ref parameter reached through a spread of an array passed by reference does not write back #511, A typed or dynamically-called property passed by reference to a storing callee is stored as a stale copy. #353 typed part): caller slot and by-ref param share one representation. A generator's by-ref params, a property passed to a reference-storing param, and a by-ref param a closure captures become cells; an element referenced once is unwrapped when the array is copied (no ABI change);$o->$m(...$args)writes back.spl_object_idandvar_dump#Ncount 1, 2, 3 and reuse freed ids. ABI v25 (header 16 to 24 bytes),docs/design/object-handles.md. Exact numbers now depend on release timing, which exposed three more fixes: a constructor that throws frees its half-built object (it used to stay in the destructor registry and run__destructat exit); a scalar consumer releases its spilled fresh operand right away, like php;var_dumpreleases an owned cell temp.new Box(...)coerces a constructor argument that does not fit the binding's template type. #136 A bound Map<string,int> reinterprets a stored value that does not fit V when it is read back by a matching key. #137): a misfit argument keeps its type or throwsTypeError, never converts. Superset rule: the new expected outputs are not Zend's.requireregression from Backlog sweep: 26 bugs across arrays, refs, leaks, language semantics and stdout #546: a constant path (dirname(__DIR__).'/x') is folded at parse time (Parser\IncludePath) and Composer's generated autoload files are built in undercomposer: true;examples/symfony-appstarts again.requireof a value-returning unit released its array once per call but retained it once (crash on Linux when a unit is required twice), and leaked arealpathbuffer per call (require of a unit that returns a value: the array is released once per call but retained once, and realpath's buffer leaks #559).Fixes #559, #187, #488, #495, #515, #548, #511, #457, #135, #136, #137, #297. Refs #353, #72.
Not fixed
#41 (design in
docs/design/reference-cells.md), #353 dynamic-property part, #72, #475, #45. New: #549, #551, #557 (a temporary argument dies after the callee's locals; php before them).loop_rekind_foreach_bindingnow passes a named array to stay independent of #557.Costs
+8 bytes per object (30M
new+free: 0.556 to 0.592 s);$o->$m(...$args)allocates a box per element.symfony-appbuild: instructions retired +0.7%, binary 424.0 to 421.7 MB.Testing
Targeted
tests/aot/run.sh -kper area,tests/parser,tests/cli, analyze; all cases whose expected output has an object id. Not run locally: full suite, difftest, fixpoint, Linux gate,strict_invariance.sh(the parser now folds constant require operands). CI covers the suite and Linux.