Repository navigation
Issue sweep: 31 bugs across front end, coercion, calls and class resolution - #655
Merged
Merged
Conversation
…anges start at a receiver's '('
break(1); / continue((2)); parse as php does; `$x instanceof self::$prop` (and `[...]` subscripts) names the class by a static property's value, sharing new's new_variable parser. In ranges mode a postfix or binary node on a parenthesised operand starts at the '('.
Fixes #618
Fixes #619
Fixes #505
…ed trait php counts an abstract method of a trait the class uses (directly or via trait-uses-trait) as overridden; a concrete trait method still is not. Fixes #617
…un-time Error The parent-scope body is reached only by a direct call, where php throws "Access to undeclared static property C::$p"; the subclass-scope bodies keep their slots. The read of the same name said "Undefined constant C::$p"; both now share one helper with php's wording. Fixes #620
`if (Logger::API >= 3) { trait Compat … } else { trait Compat … }` (sentry's Monolog compat traits) folds like a global constant guard.
Fixes #621
…he runtime source The codegen calls runtime helpers (__mc_dtoa_core, …) directly, so such an app failed in clang with an undefined IR value. The option exists for the compiler, which compiles src/Runtime itself. Fixes #506
…#606 repro to its issue
…, and the parsed or given zone P/O/p read 'Z' as UTC; an escaped format char must match the input. The object keeps the microseconds, takes the zone written in the string (or +00:00 for an epoch) and otherwise reads the fields as wall-clock time in $timezone or the default zone — it used to treat them as UTC and force +00:00. One helper serves DateTime and DateTimeImmutable. Fixes #572
…functions, analyzer prelude
Analyze\Builtins (which seeds the runtime function_exists table and get_defined_functions) missed 61 dispatch names, so a runtime-name function_exists('stripos') / ('gc_enable') answered false. The emitter-inline list gains the 8 names whose literal answer leaned on a stdlib body. The analyzer now indexes the 16 intl prelude files. calibrate.sh no longer reads "runtime\\libc\\strlen" or $name === $target as dispatch names and skips the *_off.php driver stand-ins.
Fixes #646
releaseAllClassMetadata (front-end memory trim) emptied every ClassDecl's consts before the export fold and the .sig writer read them, so an app importing a library class saw "Undefined constant Acme\\Point::NAME". Exported types (Module::typeDecls, library builds only) keep their metadata. libclass_smoke.sh looked for the pre-#631 method symbol spelling. Fixes #632
Weak-mode php turns an int landing in a ?float / float|string slot into a float; such a slot is a cell and kept the int tag. Params convert in a callee-side prologue (direct, dynamic, default, by-ref, ?float variadic), returns through the declared hint (functions, methods, closures, arrow fns, get hooks), instance and static property stores, and a float variadic pack built from int args. Fixes #553 Fixes #554 Fixes #490
…able paths - Spread arrays: the positional run is the int-keyed prefix (__mir_array_pos_prefix); a string key naming no parameter goes to the variadic under its key, or throws "Unknown named parameter" / "Cannot use positional argument after named argument"; mixed-key literals count as keyed. The fixed+variadic split moves from lowering (positional array_slice) to the emitter, and a spread no longer refines the callee's params from the pack's array type. - func_get_args() sees spread arguments: argc and overflow come from the pack at run time. - ArgumentCountError names Class::method, not Class::::method. - $obj() on a variadic __invoke packs its arguments. - A variadic arm of an erased receiver packs the written arguments when lowering could not name the method. - A static method reached through an object ($o->m(...), [$o, 'm'], erased receiver) gets no $this; ResolveMethodFcc forwards every param of a static target. - A function-name string in a `callable` slot stays tagged, so the invoke resolves it by name instead of jumping to it as a closure. Fixes #571 Fixes #573 Fixes #574 Fixes #583 Fixes #593 Fixes #595 Fixes #596 Fixes #650
…s_a, enum interfaces, Generator; type errors for array props and string args get_parent_class answers for runtime names and built-in classes, is_a folds case, UnitEnum/BackedEnum match enum cases, get_class names a Generator in a mixed slot, ReflectionMethod::invoke of __construct runs on the given object, a scalar stored into an array property and an array/object passed to a stdlib string parameter by runtime name throw TypeError. Fixes #332 Fixes #578 Fixes #579 Fixes #584 Fixes #588 Fixes #570
…ased receiver Fixes #594
This was referenced Nov 12, 2026
The #579 check wrapped the value in a __mir_assert_array_prop call that retained it and was listed as owned, so every store into an `array` property leaked one reference (mysqli stmt_procedural LEAK on CI). Classed as a borrow it freed the argument temp before the store retained it. The check now goes through a temp local (is_scalar / is_null -> TypeError, else the local), the shape the int->float coercion uses, and the builtin is gone.
blacktrs
added a commit
that referenced
this pull request
Nov 13, 2026
…st the stdlib:false guard from #655
blacktrs
added a commit
that referenced
this pull request
Nov 13, 2026
…rampolines (#611) * A builtin shadows its in-program PHP twin at $mono$ calls and through name trampolines When the stdlib twins are compiled into the program (the compiler's own build, the semantic test binary), Monomorphize repointed `__mc_sort_native` to a `$mono$` clone, so the emitter never asked the builtin: sort() ran the twin (always false) and its fallback read cell words under a vec<string> claim (SIGSEGV). emitBuiltin now also dispatches under the base name. `__mc_weak_arm`'s trampoline stored a pointer to `__mc_weak_forget` without prelude/weak.php (link error); it is a no-op then. Fixes #609 * Move the builtin-twin repros to a stdlib:false manifest smoke: a program that defines a stdlib symbol only links without the stdlib (GNU ld rejects the duplicate) * Run the builtin-twins smoke in the gate * Builtin-twins smoke: twins as a runtime library built --apps-only, past the stdlib:false guard from #655
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
A sweep of the open bug tracker: 31 issues fixed (plus
get_parent_class()on built-in classes, which had no issue) in four groups, each repro promoted fromtests/aot/reprototests/aot/cases(php is the oracle), plus new cases for the siblings found on the way.Front end and tooling
break(1);/continue((2));parse;$x instanceof self::$propnames the class by a static property's value (sharesnew's new_variable parser).#[\Override]accepts a method implementing an abstract method of a used trait (a concrete trait method still does not count, as in php).static::$p = vin a parent that only its subclasses declare$pfor lowers to php's run-time Error; the read of the same name now says "Access to undeclared static property" instead of "Undefined constant".if (Logger::API >= 3) { trait Compat … } else { … }.(.buildrefuses"stdlib": falseon an app that does not compile the runtime source (it died in clang with an undefined IR value)..sigexports class constants again — a front-end memory trim emptied them before the export read them.function_exists('stripos')/get_defined_functions()see every builtin; the analyzer indexes the intl prelude;calibrate.shSYNC is green.DateTime::createFromFormat:Zoffsets, escaped literals, microseconds, the zone written in the string, otherwise wall-clock time in$timezone/ the default zone.int → float in union slots
An int landing in
?float/float|string(params, returns, instance and static props, hooks, promoted ctor params, variadics) becomes float, as in php's weak mode.Calls, spread, variadics, callables
Spread binds string keys like php (variadic keys kept, "Unknown named parameter", positional-after-named),
func_get_args()sees spread overflow, variadic__invoke, static methods through FCC / array callables / erased receivers,'C::m'strings in callable slots, ctor name in ArgumentCountError.Classes, names, reflection
Case-insensitive
*_exists/is_aon runtime names,UnitEnum/BackedEnumfor enum cases,get_parent_class()for runtime names and built-in classes, Generator name throughmixed, TypeError for a scalar stored into anarrayproperty and for an array/object passed by runtime name to a stdlib string parameter, unset typed property read through an erased receiver throws,constant('X::C')names the missing class,invokeArgson__construct, tentative internal return types.Housekeeping
Drops the #407 repro (closed: not reproducible in AOT), links the #606 repro, adds the #653 repro and two new XFAIL repros found on the way (
float_variadic_spread_int_stays_int,hook_set_union_float_string_garbage).Left open (need design; root causes noted in the issues' follow-up)
#46 #47 (int/float typing), #475 #577 (scope-aware private slots), #597, #615, #589, #613.
Notes for review
opaque2415 → 6461 from the A stdlib function called by runtime name with an object/array argument reads the pointer as string bytes instead of throwing TypeError. #332 run-time-name string-arg check in stdlib thunks; violations 0.Testing (macOS arm64)
bin/buildgenerations, CELLGUARD 0 violations.tests/aot/run.sh -kover 25 related subsets (~2100 cases): all pass. Full suite, difftest and the Linux gate not run locally.tests/aot/xfail.sh: 36 XFAIL, 0 XPASS. Parser golden 112/112, CLI golden ok, all fourtools/lib*_smoke.shok,tools/audit/calibrate.shSYNC ok.Fixes #332
Fixes #490
Fixes #505
Fixes #506
Fixes #553
Fixes #554
Fixes #563
Fixes #570
Fixes #571
Fixes #572
Fixes #573
Fixes #574
Fixes #578
Fixes #579
Fixes #583
Fixes #584
Fixes #588
Fixes #593
Fixes #594
Fixes #595
Fixes #596
Fixes #603
Fixes #604
Fixes #617
Fixes #618
Fixes #619
Fixes #620
Fixes #621
Fixes #632
Fixes #646
Fixes #650