Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_API.c

From: Date: Thu, 16 Oct 2003 18:00:33 +0000
Subject: Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_API.c
References: 1 2  Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-1908@lists.php.net to get a copy of this message
Hello Andrei, actually this are two fixes Thursday, October 16, 2003, 7:26:50 PM, you wrote: > Hey, what was this for? Doesn't 'o' do what you want? > On Thu, 21 Aug 2003, Marcus Boerger wrote: >> @@ -395,7 +395,7 @@ >> zend_class_entry *ce = va_arg(*va, zend_class_entry *); >> >> if (Z_TYPE_PP(arg) == IS_OBJECT && >> - instanceof_function(Z_OBJCE_PP(arg), ce TSRMLS_CC)) { >> + (!ce || instanceof_function(Z_OBJCE_PP(arg), ce TSRMLS_CC))) { >> *p = *arg; >> } else { >> if (Z_TYPE_PP(arg) == IS_NULL && return_null) { There was code using ce=NULL, if this is wrong here we need to spit out an error. So whatever is really correct here the code was wrong before. >> @@ -584,6 +584,10 @@ >> object = va_arg(va, zval **); >> ce = va_arg(va, zend_class_entry *); >> *object = this_ptr; >> + if (ce && !instanceof_function(Z_OBJCE_P(this_ptr), ce TSRMLS_CC)) { >> + zend_error(E_CORE_ERROR, "%s::%s() must be derived from %s::%s", >> + ce->name, get_active_function_name(TSRMLS_C), >> Z_OBJCE_P(this_ptr)->name, get_active_function_name(TSRMLS_C)); >> + } >> >> retval = zend_parse_va_args(num_args, p, &va, 0 TSRMLS_CC); >> va_end(va); This is for handling object methods where the $this needs to be of a certain class. The check was simply missing here. -- Best regards, Marcus mailto:helly@php.net

« previous php.zend-engine.cvs (#1908) next »