Skip to content

Typofix in test-description - #129

Closed
Jille wants to merge 1 commit into
php:masterfrom
Jille:typofixes
Closed

Jille wants to merge 1 commit into
php:masterfrom
Jille:typofixes

Conversation

@Jille

@Jille Jille commented Jul 12, 2012

Copy link
Copy Markdown
Contributor

No description provided.

@php-pulls

Copy link
Copy Markdown

Comment on behalf of stas at php.net:

merged

@php-pulls php-pulls closed this Jul 15, 2012
EdmondDantes added a commit to true-async/php-src that referenced this pull request May 22, 2026
…uest completes

Every coroutine doing I/O on one descriptor parks on the shared per-handle
async-IO event (data->async_io->event), so any single operation's completion
notifies them all. php_stdiop_write()/php_stdiop_read() did not re-check
req->completed after waking, so a spuriously woken coroutine disposed its own
request while that request's libuv write was still in flight — libuv then
wrote into freed memory (heap corruption / SEGV in uv__async_io).

Both await paths now loop, re-suspending until their own request completed.

Found via the ext/async I/O chaos suite; regression test lives in
ext/async (tests/io/083-concurrent_async_write.phpt). The structural fix —
per-request completion events instead of the broadcast — is true-async/php-async#130.
EdmondDantes added a commit to true-async/php-src that referenced this pull request May 22, 2026
heyJordanParker added a commit to heyJordanParker/php-sharp that referenced this pull request Oct 11, 2026
Problem
- master took #101, which pins Mago at #118 (90e8d64) and rewrites
  Sets.sharp:75 and Sets.inc:75 so a Set's changing method has a place.
- This branch pinned php#129's head (bce91aa). Both sides changed the pin line.
  php#129 merged as 82593a4, which did not compile, and mago-sharp php#153 fixed it
  as 625c278.

Solution
- Take master's Sets.sharp and Sets.inc as they are.
- SHARP_MAGO_COMMIT pins 625c278, the merge of
  php#153, which carries both #118 and php#129. The bridge sources the header is
  generated from are unchanged since bce91aa, so the pin is the only line the
  generated header changes.

Zend/tests/sharp/
  Sets.sharp, Sets.inc   from master: the copied Set is held in a local before add
ext/sharp/
  sharp_unit.h           conflict: SHARP_MAGO_COMMIT is 625c278, the merge of mago-sharp php#153
heyJordanParker added a commit to heyJordanParker/php-sharp that referenced this pull request Oct 11, 2026
… to Mago fe442e9

Problem:
Master gained #101, which pins Mago 90e8d64 and rewrites `Sets.sharp:75` so a `Set` that
`copy()` returns is added to through a local. This branch had made the same fix on one line,
so `Sets.sharp`, `Sets.inc` and the pin in `ext/sharp/sharp_unit.h` conflicted.

The generics Mago branch now also holds Mago php#129, which refuses an `int` raised to a
negative power the checker knows. Its flow typing knows `let b = -1;`, so it refuses
`Overflow.constantNegativePower` and `Overflow.zeroNegativePower`, the two fixtures that test
the engine's `ArithmeticError` when opcache propagates a negative exponent. Every pin that
holds php#129 refuses them, on master too.

Solution:
- `Sets.sharp` and `Sets.inc` take master's two-line fix, which owns it.
- `ext/sharp/sharp_unit.h` is the header Mago fe442e9 generates.
- `Overflow.sharp` declares each exponent `int b = -1;` and `int n = -1;`. The checker then
  knows only `int`, and opcache still propagates the constant: the optimized
  `Overflow::constantNegativePower` is `T0 = POW int(2) int(-1)`, which throws. Each line
  keeps its line number. `sharp/bin/test --passes Zend/tests/sharp/overflow_pow.phpt` passes
  under every optimizer pass alone and both JITs.

Zend/tests/sharp/
├── Sets.sharp, Sets.inc   <- conflict: master's fix
└── Overflow.sharp         <- the two negative exponents are typed int locals
ext/sharp/sharp_unit.h     <- conflict: pinned to Mago fe442e9
heyJordanParker added a commit to heyJordanParker/php-sharp that referenced this pull request Oct 11, 2026
… to Mago 9cb1a28

Problem:
Master gained #100, which pins Mago php#129 and keeps `Overflow.constantNegativePower` and
`Overflow.zeroNegativePower` compiling under php#129's negative-power refusal by writing each
exponent as `~0`. This branch had fixed the same two lines with `int b = -1;` and
`int n = -1;`, so `Overflow.sharp` and the pin in `ext/sharp/sharp_unit.h` conflicted.

Solution:
- `Overflow.sharp` takes master's `~0`, which owns the fix. This branch's typed locals
  are gone.
- `ext/sharp/sharp_unit.h` is the header Mago 9cb1a28 generates. `php -n --ri sharp` prints
  "Mago commit => 9cb1a28…".
- `sharp/bin/test` passes 202 of 202 tests, and `sharp/bin/test --passes
  Zend/tests/sharp/overflow_pow.phpt` passes in all 19 modes.

Zend/tests/sharp/Overflow.sharp   <- conflict: master's `~0`
ext/sharp/sharp_unit.h            <- conflict: pinned to Mago 9cb1a28
heyJordanParker added a commit to heyJordanParker/php-sharp that referenced this pull request Oct 13, 2026
Problem:
Master gained php#129, which refuses an `int` where a `float` is expected in PHP# code. Both
sides had renamed upstream's `strict_nonnull` switch to `sharp_rules`, and sixteen files
conflicted where each side built a comparison result its own way. This branch has
`ComparisonResult::for_dialect` and `ComparisonResult::nested`, and php#129 has
`ComparisonResult::with_sharp_rules(bool)` at each call. Composed, three faults appeared:
- A PHP# type parameter whose bound is `string|int` passed into a `float` was named as an
  int-for-float refusal. This branch's opaque type-parameter path in
  `atomic_comparator::is_contained_by` folded the bound's parts with `all()` into one shared
  result, so the first refused part, the `int`, left `int_for_float` set. php#129 fixed that
  fold for templates with `are_parts_contained_by`, and its codex test caught the gap.
- Master itself does not compile. php#129 added `assigned_value` to
  `static_property_assignment::analyze`, and #118's `check_changed_collection` in
  `method_call.rs` still calls it with six arguments. Master CI at 82593a4 failed.
- Local assignments lost this branch's `explain_blocked_substitution` in php#129's rewrite of
  the ordinary message.

Solution:
- One constructor path. `for_dialect` and `nested` stay, `with_sharp_rules` goes, and
  `int_for_float` joins the struct. The `sharp_rules` doc names both PHP# rules: the
  `float` that refuses an `int`, and the opaque type parameter.
- `are_parts_contained_by` is `pub(super)`, and the PHP# type-parameter input folds its
  bound through it, so a bound names its `int` only when the `int` is the one reason.
- `check_changed_collection` passes `None` as `assigned_value`, as the
  `property_assignment::analyze` call beside it does. A changed collection has no
  assigned expression.
- Every php#129 report stays, and the ordinary message in each place keeps
  `explain_blocked_substitution`.

crates/
├── codex/src/ttype/comparator/
│   ├── mod.rs                   <- conflict: for_dialect, nested, int_for_float
│   ├── atomic_comparator.rs     <- conflict; a type parameter's bound folds through are_parts_contained_by
│   ├── union_comparator.rs      <- conflict; are_parts_contained_by is pub(super)
│   └── array_, callable_, generic_, iterable_comparator.rs   <- conflict: nested()
└── analyzer/src/
    ├── expression/assignment/{mod,array_assignment,property_assignment,static_property_assignment}.rs
    │                            <- conflict: php#129's reports with for_dialect and explain_blocked_substitution
    ├── expression/call/method_call.rs  <- master's arity break fixed
    ├── invocation/arguments.rs  <- conflict: both imports, for_dialect
    └── statement/{return,function_like/mod,class_like/property,class_like/constant}.rs
                                 <- conflict: for_dialect
heyJordanParker added a commit to heyJordanParker/php-sharp that referenced this pull request Oct 13, 2026
Problem: PR php#152 must be up to date with master. Master gained php#164, which
leaves `unreachable!` lines out of patch-coverage. It also gained php#163, which
adds List insert, remove and clear, and php#165, which fixes a project with a law
that compiles twice. php#163's `takes_operands` calls
`ComparisonResult::with_sharp_rules(true)`, which this branch replaced in its
php#129 merge, so the merged tree did not compile.

Solution: merge master. Git merged every file on its own. `takes_operands` builds
its result with `ComparisonResult::for_dialect(Dialect::Sharp)`, the branch's one
constructor path. Master's `with_sharp_rules(true)` made the same result. The
analyzer, semantics, bridge and names suites and the root compile tests pass on
the merged tree, and clippy reports nothing.

crates/
├── analyzer/src/expression/binary/utils.rs   for_dialect(Dialect::Sharp) in takes_operands
├── analyzer/src/expression/call/method_call.rs  master's search runs after the call's type is known
├── names/src/lib.rs                          master's insert, remove and clear
└── sharp-bridge/                             master's List changes beside this branch's checks
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