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
== of a property array against its array_map copy is false once a second new passes a differently shaped literal to the same constructor #154
Comparing an object's array property with an array_map copy of itself returns false where php returns true. It only happens when the same constructor is called a second time, later in the program, with an array literal of a different shape. Without the second new, the comparison is correct.
Impact
A wrong boolean with no warning or crash. Any code that compares collections held in a typed array property can take the wrong branch depending on unrelated new calls elsewhere in the file. The result depends on whole-program shape, not on the comparison itself, so it is hard to diagnose.
Removing the last line makes the output correct, so the comparison is being compiled against a property type that has been widened by the second call site.
Reproduces on the v0.13.0 bootstrap compiler and on the current tip of dsmap, so it is not caused by the Ds work in progress.
Found while fixing the alpine failure of array_eq_nested_lists_null_rows, which is unrelated: that one was a use-after-free in literal arguments.
Tracking
Known-bug repro: tests/aot/repro/wrong/array_eq_rows_after_second_ctor_literal.php. bash tests/aot/xfail.sh -k array_eq_rows_after_second_ctor_literal 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
Link the array == after second constructor literal repro to its issue
Manticore\Ds Map, Set and Vec: native insertion-ordered hash containe…