Skip to content

Test: cover script-scope pre-decrement and mixed ++/-- runs (#23840 follow-on) - #23867

Merged
PurHur merged 1 commit into
masterfrom
test/g09-predec-coverage
Jul 27, 2026
Merged

PurHur merged 1 commit into
masterfrom
test/g09-predec-coverage

Conversation

@PurHur

@PurHur PurHur commented Jul 27, 2026

Copy link
Copy Markdown
Owner

Gap

#23840 made every script-scope ++/-- a no-op. The cases that landed with its fix gate two
shapes:

existing case covers
g08_incdec_post_dec $n--
g08_toplevel_incdec_echo $a++, and ++ inside a script-scope loop

Neither covers pre-decrement (--$n), nor a run that mixes both forms on one variable. Both
were equally broken while #23840 was live, and nothing exercises them today.

Added

--$n;                  // pre-decrement at script scope
$n++; $n++; $n--;      // mixed run on one variable
$z--; $z--; $z--;      // crossing zero — the sign flip
--$p;  $q--;           // both forms storing the same value

Kept top-level on purpose. The regression only ever appeared at script scope, because every
pre-existing ++/-- differential case declares its variables inside a function — that gap is what
let it ship.

Verified on master f98ba3500, both backends

  • VM — run directly against bin/vm.php: matches Zend (4 / 2 / 3 / -2 / 9 9)
  • AOTok g09_toplevel_predec_mixed.php in script/differential-sweep.sh --aot

I checked VM by hand rather than reading it off the sweep. The sweep run that covered AOT had
already globbed its case list before this file existed, so its VM section does not list it — and
inferring "passed" from "absent" is exactly the mistake that let #23840 through in the first place
(correction on #23781). Same trap, caught this time.

Sweep health on that commit, for reference

VM : 58/58 match Zend, exit 0
AOT: 34/55 match, 4 skipped, exit 21 — zero newly failing vs baseline

Test only, no lib/ changes.

…ollow-on)

#23840 made every script-scope ++/-- a no-op. The cases added with its fix gate two shapes:
plain post-decrement (g08_incdec_post_dec) and ++ inside a script-scope loop
(g08_toplevel_incdec_echo). Neither covers:

  --$n            pre-decrement at script scope
  $n++; $n++; $n--;   a run mixing both forms on one variable
  $z--; past zero     the sign flip
  --$p vs $q--        both forms storing the same value

All of those were equally broken while #23840 was live, and nothing exercises them today.

Kept top-level deliberately: the regression only ever appeared at script scope, because every
pre-existing ++/-- differential case declares its variables inside a function. That gap is what let
it ship.

Verified on master f98ba35, both backends explicitly:

  VM  — run directly against bin/vm.php: matches Zend (4 / 2 / 3 / -2 / 9 9)
  AOT — ok in script/differential-sweep.sh --aot

Checked VM by hand rather than reading it off a sweep: the sweep run that covered AOT had already
globbed its case list before this file existed, so its VM section does not include it. Inferring a
pass from absence is exactly the mistake that let #23840 through (see the correction on #23781).

Test only, no lib/ changes.
@PurHur
PurHur force-pushed the test/g09-predec-coverage branch from c3f7749 to e7a0ac9 Compare July 27, 2026 14:36
@PurHur
PurHur merged commit 7c9908d into master Jul 27, 2026
@PurHur
PurHur deleted the test/g09-predec-coverage branch July 27, 2026 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants