You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
$a[$k] ??= $c ? $n->prop : f($n) SIGSEGVs once a later inference run erases $n to a cell. #502
$a[$k] ??= $c ? $n->prop : f($n) SIGSEGVs once a later inference run erases $n to a cell.
Repro
<?php// The `??=` value block kept the type it adopted on the first InferTypes run (obj) while its// last node became a cell, so the arm boxed the cell word as an object pointer.finalclass Span { publicfunction__construct(publicint$a) {} }
finalclass Lit { publicfunction__construct(publicSpan$span) {} }
finalclass Call {
/** @param Lit[] $args */publicfunction__construct(publicarray$args) {}
}
finalclass Idx {
/** @var array<string, Span> */privatearray$m = [];
privatestaticfunctionfresh(Lit$n): Span { returnnewSpan($n->span->a + 100); }
publicfunctionadd(string$k, Call$c, bool$low): void {
$lit = $c->args[0];
$this->m[$k] ??= $low ? $lit->span : self::fresh($lit);
$x = ($this->m[$k . '!'] ??= match ($low) { true => $lit->span, false => self::fresh($lit) });
echo$k, '', $x->a, "\n";
}
publicfunctiondump(): void { foreach ($this->mas$k => $s) { echo$k, '', $s->a, "\n"; } }
}
$ix = newIdx();
for ($i = 0; $i < 6; $i++) {
// The second element is not a Lit: the property's element type is erased only once the// call sites are re-inferred.$ix->add('k' . ($i % 4), newCall([newLit(newSpan($i)), $i > 100 ? "x" : $i]), $i % 2 === 0);
}
$ix->dump();
Known-bug repro: tests/aot/repro/crash/coalesce_assign_value_block_stale_type.php — bash tests/aot/xfail.sh -k coalesce_assign_value_block_stale_type reports XFAIL while this is open and XPASS once it is fixed; then move the repro into tests/aot/cases/ and close this issue.
Activity
Add crash repro for a ??= value block whose type froze before its val…
Promote the #502 and #503 repros: both fixed on main
Add crash repro for a ??= value block whose type froze before its val…
Promote the #502 and #503 repros: both fixed on main
Add crash repro for a ??= value block whose type froze before its val…
Promote the #502 and #503 repros: both fixed on main
Semantic core 2/7: tolerant parse ranges, declaration names, ranged d…
LSP: semantic core positions/typer/flow + LSP server (stdio JSON-RPC,…
Semantic P4: compile type hints through SourceType; function-level @t…