Skip to content

Commit

Permalink
Fixed bug #79743 (Fatal error when assigning to array property with J…
Browse files Browse the repository at this point in the history
…IT enabled)

simple typo
  • Loading branch information
laruence committed Jun 29, 2020
1 parent 053ef28 commit d005a8e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ PHP NEWS
. Removed deprecated INTL_IDNA_VARIANT_2003. (cmb)

- JIT:
. Fixed bug #79743 (Fatal error when assigning to array property
with JIT enabled). (Laruence)
. Fixed bug #79582 (Crash seen when opcache.jit=1235 and
opcache.jit_debug=2). (Laruence)
. Fixed bug #77857 (Wrong result if executed with JIT). (Laruence)
Expand Down
8 changes: 4 additions & 4 deletions ext/opcache/jit/zend_jit_helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -1536,10 +1536,10 @@ static void ZEND_FASTCALL zend_jit_check_array_promotion(zval *val, zend_propert
const zend_op *opline = execute_data->opline;
zval *result = EX_VAR(opline->result.var);

if (((Z_TYPE_P(val) <= IS_FALSE
|| (Z_ISREF_P(val) && Z_TYPE_P(Z_REFVAL_P(val)) <= IS_FALSE))
&& ZEND_TYPE_IS_SET(prop->type)
&& ZEND_TYPE_FULL_MASK(prop->type) & (MAY_BE_ITERABLE|MAY_BE_ARRAY)) == 0) {
if ((Z_TYPE_P(val) <= IS_FALSE
|| (Z_ISREF_P(val) && Z_TYPE_P(Z_REFVAL_P(val)) <= IS_FALSE))
&& ZEND_TYPE_IS_SET(prop->type)
&& (ZEND_TYPE_FULL_MASK(prop->type) & (MAY_BE_ITERABLE|MAY_BE_ARRAY)) == 0) {
zend_string *type_str = zend_type_to_string(prop->type);
zend_type_error(
"Cannot auto-initialize an array inside property %s::$%s of type %s",
Expand Down

2 comments on commit d005a8e

@laruence
Copy link
Member Author

Choose a reason for hiding this comment

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

@sgolemon maybe there should be a new section of changes to 8.0 alpha2?

@carusogabriel
Copy link
Contributor

@carusogabriel carusogabriel commented on d005a8e Jun 29, 2020

Choose a reason for hiding this comment

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

@laruence Yes, looks like we need it. Also, should we update this constant to PHP-8.0.0alpha2?

Edit: never mind the constant change, it was done during the tagging.

Edit 2: looks like the NEWS was only updated for tagging, not in the branches.

Please sign in to comment.