Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix infinite loop on string offset during by-ref list assign
This commit is contained in:
Nikita Popov 2020-09-02 10:16:35 +02:00
commit 605ee9c8eb
2 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1,16 @@
--TEST--
String offset error during list() by-ref assignment
--FILE--
<?php
$a = [0];
$v = 'b';
$i = 0;
list(&$a[$i++]) = $v;
?>
--EXPECTF--
Fatal error: Uncaught Error: Cannot create references to/from string offsets in %s:%d
Stack trace:
#0 {main}
thrown in %s on line %d

View File

@ -1512,6 +1512,7 @@ static zend_never_inline ZEND_COLD void zend_wrong_string_offset(EXECUTE_DATA_D)
msg = "Cannot create references to/from string offsets";
break;
}
opline++;
}
break;
EMPTY_SWITCH_DEFAULT_CASE();