File tree Expand file tree Collapse file tree 2 files changed +42
-1
lines changed Expand file tree Collapse file tree 2 files changed +42
-1
lines changed Original file line number Diff line number Diff line change @@ -668,7 +668,7 @@ static inline HashTable *spl_filesystem_object_get_debug_info(zend_object *objec
668
668
if (intern -> type == SPL_FS_DIR ) {
669
669
#ifdef HAVE_GLOB
670
670
pnstr = spl_gen_private_prop_name (spl_ce_DirectoryIterator , "glob" , sizeof ("glob" )- 1 );
671
- if (php_stream_is (intern -> u .dir .dirp ,& php_glob_stream_ops )) {
671
+ if (intern -> u . dir . dirp && php_stream_is (intern -> u .dir .dirp ,& php_glob_stream_ops )) {
672
672
ZVAL_STR_COPY (& tmp , intern -> path );
673
673
} else {
674
674
ZVAL_FALSE (& tmp );
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ GH-14687 segfault on debugging SplObjectStorage instance after __destruct.
3
+ --CREDITS--
4
+ YuanchengJiang
5
+ --EXTENSIONS--
6
+ phar
7
+ --INI--
8
+ phar.require_hash=0
9
+ phar.readonly=0
10
+ --FILE--
11
+ <?php
12
+ $ fname = __DIR__ . '/ ' . basename (__FILE__ , '.php ' ) . '.phar.zip ' ;
13
+ $ phar = new Phar ($ fname );
14
+ class HasDestructor {
15
+ public function __destruct () {
16
+ var_dump ($ GLOBALS ['s ' ]);
17
+ }
18
+ }
19
+ $ s = new SplObjectStorage ();
20
+ $ s [$ phar ] = new HasDestructor ();
21
+ --EXPECT --
22
+ object (SplObjectStorage)#2 (1) {
23
+ ["storage " :"SplObjectStorage":private]=>
24
+ array (1 ) {
25
+ [0 ]=>
26
+ array (2 ) {
27
+ ["obj " ]=>
28
+ object(Phar)#1 (3) {
29
+ ["pathName " :"SplFileInfo":private]=>
30
+ string(0 ) ""
31
+ ["glob " :"DirectoryIterator":private]=>
32
+ bool(false)
33
+ ["subPathName " :"RecursiveDirectoryIterator":private]=>
34
+ string(0 ) ""
35
+ }
36
+ ["inf " ]=>
37
+ object(HasDestructor)#3 (0) {
38
+ }
39
+ }
40
+ }
41
+ }
You can’t perform that action at this time.
0 commit comments