summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2021-03-02 00:01:01 +0300
committerDmitry Stogov <dmitry@zend.com>2021-03-02 00:01:01 +0300
commitc28751c69c9e2f923dd923fee5e1d4a3c970308a (patch)
treefc3976b786c60ada4fc281107d0fd73a4c7f4cbe /ext
parent9da66e6ad0f57d7ba71417731ec2586703f4d790 (diff)
parent957cb13a4959ed6a802508f14317253bf06f82cd (diff)
downloadphp-git-c28751c69c9e2f923dd923fee5e1d4a3c970308a.tar.gz
Merge branch 'PHP-8.0'
* PHP-8.0: Fixed bug #80802: (zend_jit_fetch_indirect_var assert failure with tracing JIT)
Diffstat (limited to 'ext')
-rw-r--r--ext/opcache/tests/jit/bug80802.phpt49
-rw-r--r--ext/spl/spl_array.c2
2 files changed, 50 insertions, 1 deletions
diff --git a/ext/opcache/tests/jit/bug80802.phpt b/ext/opcache/tests/jit/bug80802.phpt
new file mode 100644
index 0000000000..89a116cc92
--- /dev/null
+++ b/ext/opcache/tests/jit/bug80802.phpt
@@ -0,0 +1,49 @@
+--TEST--
+Bug #80802: zend_jit_fetch_indirect_var assert failure with tracing JIT
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.jit_buffer_size=1M
+opcache.jit=tracing
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+abstract class AsyncTask{
+ private static $threadLocalStorage = null;
+
+ protected function storeLocal(string $key, $complexData) : void{
+ if(self::$threadLocalStorage === null){
+ self::$threadLocalStorage = new \ArrayObject();
+ }
+ self::$threadLocalStorage[spl_object_id($this)][$key] = $complexData;
+ }
+
+ final public function __destruct(){
+ $this->reallyDestruct();
+ if(self::$threadLocalStorage !== null and isset(self::$threadLocalStorage[$h = spl_object_id($this)])){
+ unset(self::$threadLocalStorage[$h]);
+ if(self::$threadLocalStorage->count() === 0){
+ self::$threadLocalStorage = null;
+ }
+ }
+ }
+
+ protected function reallyDestruct() : void{
+
+ }
+}
+
+class Task extends AsyncTask{
+ public function __construct(){
+ $this->storeLocal("thing1", new stdClass);
+ }
+}
+
+for($i = 0; $i < 10000; ++$i){
+ new Task;
+}
+echo "OK\n";
+?>
+--EXPECT--
+OK
diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c
index 519e45a768..83e4f014a1 100644
--- a/ext/spl/spl_array.c
+++ b/ext/spl/spl_array.c
@@ -412,7 +412,7 @@ static zval *spl_array_get_dimension_ptr(int check_inherited, spl_array_object *
zend_error(E_WARNING, "Undefined array key " ZEND_LONG_FMT, key.h);
case BP_VAR_W: {
zval value;
- ZVAL_UNDEF(&value);
+ ZVAL_NULL(&value);
retval = zend_hash_index_update(ht, key.h, &value);
}
}