diff options
-rw-r--r-- | Zend/zend_compile.c | 2 | ||||
-rw-r--r-- | Zend/zend_compile.h | 5 | ||||
-rw-r--r-- | Zend/zend_language_parser.y | 4 |
3 files changed, 4 insertions, 7 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index f4b01fb351..d1a90517d3 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -912,7 +912,7 @@ void zend_do_free(znode *op1 TSRMLS_DC) int zend_do_verify_access_types(znode *current_access_type, znode *new_modifier) { - if (current_access_type->u.constant.value.lval & ZEND_FN_PPP_MASK) { + if (current_access_type->u.constant.value.lval & ZEND_ACC_PPP_MASK) { zend_error(E_COMPILE_ERROR, "Multiple access type modifiers are not allowed"); } return (current_access_type->u.constant.value.lval | new_modifier->u.constant.value.lval); diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h index 7291a3a9b5..b006e3052e 100644 --- a/Zend/zend_compile.h +++ b/Zend/zend_compile.h @@ -97,10 +97,7 @@ typedef struct _zend_brk_cont_element { #define ZEND_ACC_PUBLIC 0x10 #define ZEND_ACC_PROTECTED 0x20 #define ZEND_ACC_PRIVATE 0x40 - -/* AND mask for accessing only public/protected/private of fn_flags - */ -#define ZEND_FN_PPP_MASK 0xF0 +#define ZEND_ACC_PPP_MASK (ZEND_ACC_PUBLIC | ZEND_ACC_PROTECTED | ZEND_ACC_PRIVATE) char *zend_visibility_string(zend_uint fn_flags); diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y index 2f50468971..0a736cb03f 100644 --- a/Zend/zend_language_parser.y +++ b/Zend/zend_language_parser.y @@ -456,8 +456,8 @@ variable_modifier: ; method_modifiers: - /* empty */ { $$.u.constant.value.lval = 0; } - | non_empty_method_modifiers { $$ = $1; } + /* empty */ { $$.u.constant.value.lval = ZEND_ACC_PUBLIC; } + | non_empty_method_modifiers { $$ = $1; if (!($$.u.constant.value.lval & ZEND_ACC_PPP_MASK)) { $$.u.constant.value.lval |= ZEND_ACC_PUBLIC; } } ; non_empty_method_modifiers: |