Skip to content

Commit 957cb13

Browse files
committed
Fixed bug #80802: (zend_jit_fetch_indirect_var assert failure with tracing JIT)
1 parent 37c9728 commit 957cb13

File tree

2 files changed

+50
-1
lines changed

2 files changed

+50
-1
lines changed

ext/opcache/tests/jit/bug80802.phpt

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
--TEST--
2+
Bug #80802: zend_jit_fetch_indirect_var assert failure with tracing JIT
3+
--INI--
4+
opcache.enable=1
5+
opcache.enable_cli=1
6+
opcache.jit_buffer_size=1M
7+
opcache.jit=tracing
8+
--SKIPIF--
9+
<?php require_once('skipif.inc'); ?>
10+
--FILE--
11+
<?php
12+
abstract class AsyncTask{
13+
private static $threadLocalStorage = null;
14+
15+
protected function storeLocal(string $key, $complexData) : void{
16+
if(self::$threadLocalStorage === null){
17+
self::$threadLocalStorage = new \ArrayObject();
18+
}
19+
self::$threadLocalStorage[spl_object_id($this)][$key] = $complexData;
20+
}
21+
22+
final public function __destruct(){
23+
$this->reallyDestruct();
24+
if(self::$threadLocalStorage !== null and isset(self::$threadLocalStorage[$h = spl_object_id($this)])){
25+
unset(self::$threadLocalStorage[$h]);
26+
if(self::$threadLocalStorage->count() === 0){
27+
self::$threadLocalStorage = null;
28+
}
29+
}
30+
}
31+
32+
protected function reallyDestruct() : void{
33+
34+
}
35+
}
36+
37+
class Task extends AsyncTask{
38+
public function __construct(){
39+
$this->storeLocal("thing1", new stdClass);
40+
}
41+
}
42+
43+
for($i = 0; $i < 10000; ++$i){
44+
new Task;
45+
}
46+
echo "OK\n";
47+
?>
48+
--EXPECT--
49+
OK

ext/spl/spl_array.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ static zval *spl_array_get_dimension_ptr(int check_inherited, spl_array_object *
365365
zend_error(E_WARNING, "Undefined array key " ZEND_LONG_FMT, index);
366366
case BP_VAR_W: {
367367
zval value;
368-
ZVAL_UNDEF(&value);
368+
ZVAL_NULL(&value);
369369
retval = zend_hash_index_update(ht, index, &value);
370370
}
371371
}

0 commit comments

Comments
 (0)