Skip to content

Fix GH-25746: array_column() crashes with JIT when the result for an empty array is modified - #25748

Closed
thunderer wants to merge 1 commit into
php:PHP-8.6from
thunderer:fix/array-column-refcount
Closed

thunderer wants to merge 1 commit into
php:PHP-8.6from
thunderer:fix/array-column-refcount

Conversation

@thunderer

Copy link
Copy Markdown
Contributor

Fixes GH-25746.

Since 5d24c8b, array_column() returns the shared immutable empty array for an empty input. The stub still declared @refcount 1, so function JIT and tracing JIT modified that array in place and crashed.

This drops the annotation and regenerates the arginfo and optimizer info, as 359a21f, 8575931 and 195a8fd did for other functions. The test fails without the change.

…an empty array is modified

Since 5d24c8b, array_column() returns the shared immutable empty array for
an empty input. The stub still declared @refcount 1, which lets function JIT
and tracing JIT modify the result in place and crash. Drop the annotation.

@ndossche ndossche left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@ndossche ndossche closed this in e43d3d1 Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants