Permalink
Browse files

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

  • Loading branch information...
zsuraski committed Dec 8, 2002
1 parent 93ee146 commit dc5c790a49f6eaa23a473c6e8a103796d0da3a21
Showing with 4 additions and 7 deletions.
  1. +1 −1 Zend/zend_compile.c
  2. +1 −4 Zend/zend_compile.h
  3. +2 −2 Zend/zend_language_parser.y
View
@@ -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
@@ -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);
@@ -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:

0 comments on commit dc5c790

Please sign in to comment.