cvs: ZendEngine2 / zend_API.c zend_compile.c zend_compile.h

From: Date: Fri, 23 Jan 2004 20:52:39 +0000
Subject: cvs: ZendEngine2 / zend_API.c zend_compile.c zend_compile.h
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-2245@lists.php.net to get a copy of this message
helly Fri Jan 23 15:52:39 2004 EDT Modified files: /ZendEngine2 zend_compile.h zend_compile.c zend_API.c Log: Disallow static declaration of clone http://cvs.php.net/diff.php/ZendEngine2/zend_compile.h?r1=1.267&r2=1.268&ty=u Index: ZendEngine2/zend_compile.h diff -u ZendEngine2/zend_compile.h:1.267 ZendEngine2/zend_compile.h:1.268 --- ZendEngine2/zend_compile.h:1.267 Thu Jan 8 12:31:47 2004 +++ ZendEngine2/zend_compile.h Fri Jan 23 15:52:39 2004 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_compile.h,v 1.267 2004/01/08 17:31:47 sniper Exp $ */ +/* $Id: zend_compile.h,v 1.268 2004/01/23 20:52:39 helly Exp $ */ #ifndef ZEND_COMPILE_H #define ZEND_COMPILE_H @@ -111,7 +111,8 @@ #define ZEND_ACC_IMPLICIT_PUBLIC 0x1000 #define ZEND_ACC_CTOR 0x2000 -#define ZEND_ACC_DTOR 0x4000 +#define ZEND_ACC_DTOR 0x4000 +#define ZEND_ACC_CLONE 0x8000 char *zend_visibility_string(zend_uint fn_flags); http://cvs.php.net/diff.php/ZendEngine2/zend_compile.c?r1=1.515&r2=1.516&ty=u Index: ZendEngine2/zend_compile.c diff -u ZendEngine2/zend_compile.c:1.515 ZendEngine2/zend_compile.c:1.516 --- ZendEngine2/zend_compile.c:1.515 Fri Jan 16 19:26:12 2004 +++ ZendEngine2/zend_compile.c Fri Jan 23 15:52:39 2004 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_compile.c,v 1.515 2004/01/17 00:26:12 sniper Exp $ */ +/* $Id: zend_compile.c,v 1.516 2004/01/23 20:52:39 helly Exp $ */ #include "zend_language_parser.h" #include "zend.h" @@ -2400,6 +2400,12 @@ zend_error(E_COMPILE_ERROR, "Destructor %s::%s() cannot be static", ce->name, ce->destructor->common.function_name); } } + if (ce->clone) { + ce->clone->common.fn_flags |= ZEND_ACC_CLONE; + if (ce->clone->common.fn_flags & ZEND_ACC_STATIC) { + zend_error(E_COMPILE_ERROR, "Clone method %s::%s() cannot be static", ce->name, ce->clone->common.function_name); + } + } ce->line_end = zend_get_compiled_lineno(TSRMLS_C); http://cvs.php.net/diff.php/ZendEngine2/zend_API.c?r1=1.235&r2=1.236&ty=u Index: ZendEngine2/zend_API.c diff -u ZendEngine2/zend_API.c:1.235 ZendEngine2/zend_API.c:1.236 --- ZendEngine2/zend_API.c:1.235 Sun Jan 18 19:39:29 2004 +++ ZendEngine2/zend_API.c Fri Jan 23 15:52:39 2004 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_API.c,v 1.235 2004/01/19 00:39:29 helly Exp $ */ +/* $Id: zend_API.c,v 1.236 2004/01/23 20:52:39 helly Exp $ */ #include "zend.h" #include "zend_execute.h" @@ -1304,6 +1304,12 @@ zend_error(error_type, "Destructor %s::%s cannot be static", dtor->common.scope->name, dtor->common.function_name); } } + if (clone) { + clone->common.fn_flags |= ZEND_ACC_CLONE; + if (clone->common.fn_flags & ZEND_ACC_STATIC) { + zend_error(error_type, "Constructor %s::%s cannot be static", clone->common.scope->name, clone->common.function_name); + } + } } return SUCCESS; }

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