cvs: ZendEngine2 / zend_compile.c
| From: | Andi Gutmans | Date: | Sat, 01 Mar 2003 14:57:49 +0000 |
| Subject: | cvs: ZendEngine2 / zend_compile.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-980@lists.php.net to get a copy of this message | ||
andi Sat Mar 1 09:57:49 2003 EDT
Modified files:
/ZendEngine2 zend_compile.c
Log:
- Make __construct() have higher priority than class name functions
- for constructors.
- Fix problem with the engine allowing final/abstract for the same method.
- Both patches are by Marcus Börger.
Index: ZendEngine2/zend_compile.c
diff -u ZendEngine2/zend_compile.c:1.375 ZendEngine2/zend_compile.c:1.376
--- ZendEngine2/zend_compile.c:1.375 Tue Feb 25 05:03:26 2003
+++ ZendEngine2/zend_compile.c Sat Mar 1 09:57:49 2003
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_compile.c,v 1.375 2003/02/25 10:03:26 zeev Exp $ */
+/* $Id: zend_compile.c,v 1.376 2003/03/01 14:57:49 andi Exp $ */
#include "zend_language_parser.h"
#include "zend.h"
@@ -916,6 +916,9 @@
&& ((current_access_type->u.constant.value.lval & ZEND_ACC_PPP_MASK) !=
(new_modifier->u.constant.value.lval & ZEND_ACC_PPP_MASK))) {
zend_error(E_COMPILE_ERROR, "Multiple access type modifiers are not allowed");
}
+ if (((current_access_type->u.constant.value.lval | new_modifier->u.constant.value.lval)
& (ZEND_ACC_ABSTRACT | ZEND_ACC_FINAL)) == (ZEND_ACC_ABSTRACT | ZEND_ACC_FINAL)) {
+ zend_error(E_COMPILE_ERROR, "Cannot use the final modifier on an abstract class
member");
+ }
if (((current_access_type->u.constant.value.lval | new_modifier->u.constant.value.lval)
& (ZEND_ACC_PRIVATE | ZEND_ACC_FINAL)) == (ZEND_ACC_PRIVATE | ZEND_ACC_FINAL)) {
zend_error(E_COMPILE_ERROR, "Cannot use the final modifier on a private class member");
}
@@ -974,7 +977,7 @@
fn_flags |= ZEND_ACC_PUBLIC;
}
- if ((short_class_name_length == name_len) && (!memcmp(short_class_name, name, name_len)))
{
+ if ((short_class_name_length == name_len) && (!memcmp(short_class_name, name, name_len))
&& !CG(active_class_entry)->constructor) {
CG(active_class_entry)->constructor = (zend_function *) CG(active_op_array);
} else if ((function_name->u.constant.value.str.len == sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)-1)
&& (!memcmp(function_name->u.constant.value.str.val, ZEND_CONSTRUCTOR_FUNC_NAME,
sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)))) {
CG(active_class_entry)->constructor = (zend_function *) CG(active_op_array);