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

index dd0faeb1318c7ae0f737208ec335ea88b0d0cafa..7c75aad71965fb3e2f63ea6d76b259e3617b6319 100644 (file)
@@ -366,7 +366,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);