com php-src: check if object store was freed before accessing particular object: Zend/zend_gc.c

From: Date: Thu, 20 Mar 2014 13:26:20 +0000
Subject: com php-src: check if object store was freed before accessing particular object: Zend/zend_gc.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-77576@lists.php.net to get a copy of this message
Commit: a9d21c14576b76bf1451357555a4210ee2150cf7 Author: Dmitry Stogov <dmitry@zend.com> Thu, 20 Mar 2014 17:26:20 +0400 Parents: 36cd92a7d3ae83f8169c6d7cead06ecda0b53df3 Branches: phpng Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a9d21c14576b76bf1451357555a4210ee2150cf7 Log: check if object store was freed before accessing particular object Changed paths: M Zend/zend_gc.c Diff: diff --git a/Zend/zend_gc.c b/Zend/zend_gc.c index bea503e..e79e604 100644 --- a/Zend/zend_gc.c +++ b/Zend/zend_gc.c @@ -641,9 +641,9 @@ ZEND_API int gc_collect_cycles(TSRMLS_D) if (p->u.v.type == IS_OBJECT) { zend_object *obj = (zend_object*)p; - if (obj->handlers->dtor_obj && - EG(objects_store).object_buckets && - IS_VALID(EG(objects_store).object_buckets[obj->handle]) && + if (EG(objects_store).object_buckets && + obj->handlers->dtor_obj && + IS_VALID(EG(objects_store).object_buckets[obj->handle]) && !(obj->gc.u.v.flags & IS_OBJ_DESTRUCTOR_CALLED)) { obj->gc.u.v.flags |= IS_OBJ_DESTRUCTOR_CALLED;

« previous php.cvs (#77576) next »