Repository navigation
Fix 40 bugs: callables, stdlib, spread, array repr, dispatch, leaks - #410
Merged
Merged
Conversation
…into one release class (Fixes #373)
…ead of expanding it across the declared slots (Fixes #375)
…t cell and merges a hint-boxed copy: $r = [...$r, [$p, 2]] from $r = [] stored raw words in an unstamped buffer read back as floats. Fixes #379
…wn closure at run time, throwing ArgumentCountError when required slots are missing (Fixes #385)
…ed int property Fixes #291
box_unknown tagged a raw generator frame as an int, and cell retain/drop treated an object-tagged frame as a closure env, so a generator a closure returned through an erased slot was never released. Fixes #268
The capture box owns its value; the enclosing frame already gave the old one back on its own stores, the closure side never did. Fixes #348
…thout requiring a __call class Closure __invoke/call work on a mixed receiver in any program; non-closure objects and scalars get Zend's undefined-method / member-function-on-type errors. Typed Closure->__invoke() lowers to a direct closure call.
The return already retains the value; the box release retained it again. Fixes #394
…: a shape keeps its own per-field repr
…dary must not retype it to the sig's concrete element
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.
What
A sweep of 40 open bugs, grouped by root cause. Each fix has its repro promoted to
tests/aot/cases/; full AOT suite on this branch: 2346 pass, 0 fail, 2 skip (macOS arm64).Fixes
namespace\f()in expressions (A namespace-relative name in an expression (namespace\f(), namespace\C) fails to parse. #378); hex/bin/octal/underscored string offsets (__McTok (prelude tokenizer) lexes a hex / binary / octal / underscored index of a simple string offset ("$a[0x1F]") as T_NUM_STRING "0" + T_STRING "x1F"; Zend makes one T_NUM_STRING. #382); nullsafe in simple interpolation (__McTok (prelude tokenizer) does not lex the nullsafe operator in simple interpolation ("$a?->b"): the?->bstays string text; Zend lexes T_NULLSAFE_OBJECT_OPERATOR + T_STRING. #383).is_callableon builtins, string intocallableparams (A builtin function named by a runtime string is called as if undefined: $f("b"), $f(...) and call_user_func($f) all answer 0 or empty. #230 A function-name string read from an array element and passed to acallableparameter SIGBUSes. #252 is_callable('strlen') answers false for a codegen builtin name. #323 array_map with a callable string built at run time (a builtin or stdlib name) crashes with no output. #324).%dover numeric strings,substrnull length,powmixed,intvalbase,rangestrings,is_objectenum,get_object_varsscope,get_class_vars(is_object() answers false for an enum case (php: true). #319 sprintf('%d', '42') with a numeric string argument prints a pointer instead of 42. #320 substr($s, $o, null) with a null length returns "" instead of the rest of the string. #321 pow() of mixed ints answers float(1024) instead of int(1024). #322 intval($s, $base) with a non-literal base ignores the base and answers 0. #325 range("1", "4") returns ints; php 8.5 keeps numeric-string endpoints as strings. #284 get_object_vars() called outside the class returns private and protected properties. #337 get_class_vars() is undefined: it traps with "Call to undefined function" instead of returning the scope-visible default properties. #265).#[CellArg]params included.class_implementsorder and interface parents (class_implements() and ReflectionClass::getInterfaceNames() of an interface omit the interfaces it extends. #242 class_implements() of a subclass lists inherited interfaces in a different order than php. #243).__call;Closure::bindco-owns$this; typed-property TypeError message (Assigning a mixed value of the wrong type to a typed property throws a TypeError with a generic message instead of php's #291 Closure::bind does not co-own the new $this: it is freed with the last outside owner. #262 A method call on a value of unknown type (closure, null) is dispatched to an unrelated class's __call instead of the closure method / an Error #292 With a __call class in the program, bindTo(null) on a static closure read back from a static array yields a closure that returns 0 #293).__invoke/callwithout a__callclass,?Closureproperty read, nullsafe and first-class dynamic method calls,Closure::callnewThis, explicit__invoke(Closure::call() with an object-typed (erased) newThis argument segfaults. #389 Calling an erased object value that defines __invoke (id($o)(3)) crashes. #390 A nullsafe call with a variable method name on null ($n?->$h(1)) does not yield null. #391 A ?Closure property read through an erased receiver (id($o)->f) decodes as an int. #392 A first-class callable with a variable method name ($o->$h(...)) crashes. #393 ->__invoke() on an erased Closure runs an unrelated class's __invoke when the program defines one. #396).(object)cast, generator in a cell, by-ref capture store, ref-element write-through, out-of-range string offset, return of a ref-boxed local (A dynamic method call on a fresh temporary receiver ((new F)->$m()) never releases the object. #257 (object) cast of an int-valued array literal leaks its property bag. #261 foreach over an IteratorAggregate whose getIterator() is a generator leaks the generator per loop. #268 A store into a by-reference closure capture leaks a string per store. #348 A string written through a reference element of an array property leaks. #354 Reading a string offset past the end of a string leaks a fresh empty string per read. #388 Returning a local that a reference box owns leaks the returned string once per call. #394).Fixes #230, Fixes #242, Fixes #243, Fixes #252, Fixes #257, Fixes #261, Fixes #262, Fixes #265, Fixes #268, Fixes #284, Fixes #291, Fixes #292, Fixes #293, Fixes #319, Fixes #320, Fixes #321, Fixes #322, Fixes #323, Fixes #324, Fixes #325, Fixes #337, Fixes #348, Fixes #354, Fixes #373, Fixes #375, Fixes #376, Fixes #378, Fixes #379, Fixes #382, Fixes #383, Fixes #384, Fixes #385, Fixes #388, Fixes #389, Fixes #390, Fixes #391, Fixes #392, Fixes #393, Fixes #394, Fixes #396
Not in this PR (still open)
#260 (temporaries on the unwind path), #264 (
get_defined_vars, deprioritised), #244, #295, #395 ($z = &$yleak).Review notes
EmitLlvmCalls,EmitLlvm,InferScans, generator-frame accounting in cells (foreach over an IteratorAggregate whose getIterator() is a generator leaks the generator per loop. #268), ref-box return (Returning a local that a reference box owns leaks the returned string once per call. #394). Highest UAF risk: foreach over an IteratorAggregate whose getIterator() is a generator leaks the generator per loop. #268, A store into a by-reference closure capture leaks a string per store. #348, A string written through a reference element of an array property leaks. #354.hasShape()guard in the element-repr de-cellify branch may be broader than needed.