Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_API.c
| From: | Marcus Boerger | Date: | Sat, 05 Jun 2004 22:43:54 +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-2683@lists.php.net to get a copy of this message | ||
Hello Clemens,
we could add a check for every place that ends up calling object
initialization. But you don't win anything. Also in the original
bug report the problem was that some serialized data was later
unserialized with another API. The current fix prevents from any
other compareable situation.
regards
marcus
p.s.: funny email addy
Saturday, June 5, 2004, 6:08:12 PM, you wrote:
> Hi Marcus,
> thanks for this fix.
> Shouldn't __autoload() be evaluated before throwing this error?
> Clemens
>> -----Original Message-----
>> From: Marcus Boerger [mailto:helly@php.net]
>> Sent: Saturday, June 05, 2004 4:59 PM
>> To: zend-engine-cvs@lists.php.net
>> Subject: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_API.c
>>
>>
>> helly Sat Jun 5 10:59:21 2004 EDT
>>
>> Modified files:
>> /ZendEngine2 zend_API.c
>> Log:
>> Fix #28641: Instance of Interface
>>
>
> http://cvs.php.net/diff.php/ZendEngine2/zend_API.c?r1=1.255&r2=1.256&ty=
> u
> Index: ZendEngine2/zend_API.c
> diff -u ZendEngine2/zend_API.c:1.255 ZendEngine2/zend_API.c:1.256
> --- ZendEngine2/zend_API.c:1.255 Tue May 18 17:19:15 2004
> +++ ZendEngine2/zend_API.c Sat Jun 5 10:59:21 2004
> @@ -18,7 +18,7 @@
> +----------------------------------------------------------------------+
> */
> -/* $Id: zend_API.c,v 1.255 2004/05/18 21:19:15 helly Exp $ */
> +/* $Id: zend_API.c,v 1.256 2004/06/05 14:59:21 helly Exp $ */
> #include "zend.h"
> #include "zend_execute.h"
> @@ -693,6 +693,11 @@
> {
> zval *tmp;
> zend_object *object;
> +
> + if (class_type->ce_flags &
> (ZEND_ACC_INTERFACE|ZEND_ACC_IMPLICIT_ABSTRACT_CLASS|ZEND_ACC_EXPLICIT_A
> BSTRACT_CLASS)) {
> + char *what = class_type->ce_flags & ZEND_ACC_INTERFACE ?
> "interface" : "abstract class";
> + zend_error(E_ERROR, "Cannot instantiate %s %s", what,
> class_type->name);
> + }
> if (!class_type->constants_updated) {
> zend_hash_apply_with_argument(&class_type->default_properties,
> (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC);
> --
> Zend Engine CVS Mailing List (http://cvs.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--
Best regards,
Marcus mailto:helly@php.net