Treat the absence of an access type just as if 'public' was supplied

This commit is contained in:
Zeev Suraski 2002-12-08 14:09:43 +00:00
parent 93ee146d0e
commit dc5c790a49
3 changed files with 4 additions and 7 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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: