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 try inside a generator restores the backtrace depth saved at try entry. The generator is #90
A try inside a generator restores the backtrace depth saved at try entry. The generator is.
Repro
<?php// started at the top level and its catch runs when resumed from a deep call: the depth drops to the// stale value, the callers' pops then take it negative and count(getTrace()) is garbage// (a large negative on main); a later push writes before the ring. php: 0.functiong() {
try {
yield1;
thrownewException('x');
} catch (Exception$e) {
yield2;
}
}
functiondeep(int$n, Generator$gen) {
if ($n > 0) { deep($n - 1, $gen); return; }
$gen->next();
}
$gen = g();
$gen->current();
deep(50, $gen);
echocount((newException('t'))->getTrace()), "\n";
Expected (php)
0
Actual (manticore 3dc6ed40, Darwin arm64)
[exit code 138 — SIGBUS]
Tracking
Known-bug repro: tests/aot/repro/crash/generator_try_restores_stale_backtrace_depth.php — bash tests/aot/xfail.sh -k generator_try_restores_stale_backtrace_depth 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
test: promote fixed repro #90 to cases; add repros for #87 #88 #89 #91 (