]> granicus.if.org Git - php/commitdiff
fix #41608 (segfault on a weird code with objects and switch())
authorAntony Dovgal <tony2001@php.net>
Wed, 6 Jun 2007 08:33:54 +0000 (08:33 +0000)
committerAntony Dovgal <tony2001@php.net>
Wed, 6 Jun 2007 08:33:54 +0000 (08:33 +0000)
Zend/zend_execute.c

index ef88fca2b2e11f6c36f6ab85ff56ce80fea62073..0792be6e77673aeb820496a46b98d959162ed2bc 100644 (file)
@@ -389,7 +389,7 @@ static inline void zend_switch_free(zend_op *opline, temp_variable *Ts TSRMLS_DC
                                 * quick & silent get_zval_ptr, and FREE_OP
                                 */
                                PZVAL_UNLOCK_FREE(T->str_offset.str);
-                       } else {
+                       } else if (T(opline->op1.u.var).var.ptr) {
                                zval_ptr_dtor(&T(opline->op1.u.var).var.ptr);
                                if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { /* foreach() free */
                                        zval_ptr_dtor(&T(opline->op1.u.var).var.ptr);