Skip to content

Commit

Permalink
Step 2:
Browse files Browse the repository at this point in the history
Rename is_ref to EA
  • Loading branch information
zsuraski committed Jul 9, 1999
1 parent 3a9cb02 commit 5f62c34
Show file tree
Hide file tree
Showing 21 changed files with 137 additions and 136 deletions.
16 changes: 8 additions & 8 deletions Zend/zend-parser.y
Expand Up @@ -272,11 +272,11 @@ parameter_list:


non_empty_parameter_list:
T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$1, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; $$.u.constant.refcount=1; $$.u.constant.is_ref=0; do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE CLS_CC); }
| '&' T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$2, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; $$.u.constant.refcount=1; $$.u.constant.is_ref=0; do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_FORCE CLS_CC); }
| T_CONST T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$2, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; $$.u.constant.refcount=1; $$.u.constant.is_ref=0; do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE CLS_CC); }
| T_VARIABLE '=' static_scalar { znode tmp; fetch_simple_variable(&tmp, &$1, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; $$.u.constant.refcount=1; $$.u.constant.is_ref=0; do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, &$3, BYREF_NONE CLS_CC); }
| T_VARIABLE '=' T_UNSET { znode tmp; fetch_simple_variable(&tmp, &$1, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; $$.u.constant.refcount=1; $$.u.constant.is_ref=0; do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, NULL, BYREF_NONE CLS_CC); }
T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$1, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; $$.u.constant.refcount=1; $$.u.constant.EA=0; do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE CLS_CC); }
| '&' T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$2, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; $$.u.constant.refcount=1; $$.u.constant.EA=0; do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_FORCE CLS_CC); }
| T_CONST T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$2, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; $$.u.constant.refcount=1; $$.u.constant.EA=0; do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE CLS_CC); }
| T_VARIABLE '=' static_scalar { znode tmp; fetch_simple_variable(&tmp, &$1, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; $$.u.constant.refcount=1; $$.u.constant.EA=0; do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, &$3, BYREF_NONE CLS_CC); }
| T_VARIABLE '=' T_UNSET { znode tmp; fetch_simple_variable(&tmp, &$1, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; $$.u.constant.refcount=1; $$.u.constant.EA=0; do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, NULL, BYREF_NONE CLS_CC); }
| non_empty_parameter_list ',' T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$3, 0 CLS_CC); $$=$1; $$.u.constant.value.lval++; do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE CLS_CC); }
| non_empty_parameter_list ',' '&' T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$4, 0 CLS_CC); $$=$1; $$.u.constant.value.lval++; do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_FORCE CLS_CC); }
| non_empty_parameter_list ',' T_CONST T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$4, 0 CLS_CC); $$=$1; $$.u.constant.value.lval++; do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE CLS_CC); }
Expand Down Expand Up @@ -484,16 +484,16 @@ scalar:


static_array_pair_list:
/* empty */ { $$.op_type = IS_CONST; $$.u.constant.refcount=1; $$.u.constant.is_ref=0; array_init(&$$.u.constant); }
/* empty */ { $$.op_type = IS_CONST; $$.u.constant.refcount=1; $$.u.constant.EA=0; array_init(&$$.u.constant); }
| non_empty_static_array_pair_list { $$ = $1; }
;


non_empty_static_array_pair_list:
non_empty_static_array_pair_list ',' static_scalar T_DOUBLE_ARROW static_scalar { do_add_static_array_element(&$$, &$3, &$5); }
| non_empty_static_array_pair_list ',' static_scalar { do_add_static_array_element(&$$, NULL, &$3); }
| static_scalar T_DOUBLE_ARROW static_scalar { $$.op_type = IS_CONST; $$.u.constant.refcount=1; $$.u.constant.is_ref=0; array_init(&$$.u.constant); do_add_static_array_element(&$$, &$1, &$3); }
| static_scalar { $$.op_type = IS_CONST; $$.u.constant.refcount=1; $$.u.constant.is_ref=0; array_init(&$$.u.constant); do_add_static_array_element(&$$, NULL, &$1); }
| static_scalar T_DOUBLE_ARROW static_scalar { $$.op_type = IS_CONST; $$.u.constant.refcount=1; $$.u.constant.EA=0; array_init(&$$.u.constant); do_add_static_array_element(&$$, &$1, &$3); }
| static_scalar { $$.op_type = IS_CONST; $$.u.constant.refcount=1; $$.u.constant.EA=0; array_init(&$$.u.constant); do_add_static_array_element(&$$, NULL, &$1); }
;

expr:
Expand Down
4 changes: 2 additions & 2 deletions Zend/zend.h
Expand Up @@ -91,7 +91,7 @@ struct _zval_struct {
/* Variable information */
zvalue_value value; /* value */
unsigned char type; /* active type */
unsigned char is_ref;
unsigned char EA;
short refcount;
};

Expand Down Expand Up @@ -175,7 +175,7 @@ typedef struct _zend_utility_values {
#define MAKE_STD_ZVAL(zv) \
zv = (zval *) emalloc(sizeof(zval)); \
zv->refcount = 1; \
zv->is_ref = 0;
zv->EA = 0;


int zend_startup(zend_utility_functions *utility_functions, char **extensions);
Expand Down
54 changes: 27 additions & 27 deletions Zend/zend_API.c
Expand Up @@ -52,14 +52,14 @@ ZEND_API int getParameters(int ht, int param_count,...)
while (param_count>0) {
param = va_arg(ptr, zval **);
param_ptr = *(p-param_count);
if (!param_ptr->is_ref && param_ptr->refcount>1) {
if (!param_ptr->EA && param_ptr->refcount>1) {
zval *new_tmp;

new_tmp = (zval *) emalloc(sizeof(zval));
*new_tmp = *param_ptr;
zval_copy_ctor(new_tmp);
new_tmp->refcount = 1;
new_tmp->is_ref = 0;
new_tmp->EA = 0;
param_ptr = new_tmp;
((zval *) *(p-param_count))->refcount--;
*(p-param_count) = param_ptr;
Expand Down Expand Up @@ -90,14 +90,14 @@ ZEND_API int getParametersArray(int ht, int param_count, zval **argument_array)

while (param_count>0) {
param_ptr = *(p-param_count);
if (!param_ptr->is_ref && param_ptr->refcount>1) {
if (!param_ptr->EA && param_ptr->refcount>1) {
zval *new_tmp;

new_tmp = (zval *) emalloc(sizeof(zval));
*new_tmp = *param_ptr;
zval_copy_ctor(new_tmp);
new_tmp->refcount = 1;
new_tmp->is_ref = 0;
new_tmp->EA = 0;
param_ptr = new_tmp;
((zval *) *(p-param_count))->refcount--;
*(p-param_count) = param_ptr;
Expand Down Expand Up @@ -175,7 +175,7 @@ ZEND_API int ParameterPassedByReference(int ht, uint n)
return FAILURE;
}
arg = (zval *) *(p-arg_count+n-1);
return arg->is_ref;
return arg->EA;
}


Expand Down Expand Up @@ -231,7 +231,7 @@ ZEND_API inline int add_assoc_long(zval *arg, char *key, long n)
tmp->type = IS_LONG;
tmp->value.lval = n;
tmp->refcount=1;
tmp->is_ref=0;
tmp->EA=0;
return zend_hash_update(arg->value.ht, key, strlen(key)+1, (void *) &tmp, sizeof(zval *), NULL);
}

Expand All @@ -243,7 +243,7 @@ ZEND_API inline int add_assoc_double(zval *arg, char *key, double d)
tmp->type = IS_DOUBLE;
tmp->value.dval = d;
tmp->refcount=1;
tmp->is_ref=0;
tmp->EA=0;
return zend_hash_update(arg->value.ht, key, strlen(key)+1, (void *) &tmp, sizeof(zval *), NULL);
}

Expand All @@ -260,7 +260,7 @@ ZEND_API inline int add_assoc_string(zval *arg, char *key, char *str, int duplic
tmp->value.str.val = str;
}
tmp->refcount=1;
tmp->is_ref=0;
tmp->EA=0;
return zend_hash_update(arg->value.ht, key, strlen(key)+1, (void *) &tmp, sizeof(zval *), NULL);
}

Expand All @@ -277,7 +277,7 @@ ZEND_API inline int add_assoc_stringl(zval *arg, char *key, char *str, uint leng
tmp->value.str.val = str;
}
tmp->refcount=1;
tmp->is_ref=0;
tmp->EA=0;
return zend_hash_update(arg->value.ht, key, strlen(key)+1, (void *) &tmp, sizeof(zval *), NULL);
}

Expand All @@ -296,7 +296,7 @@ ZEND_API inline int add_index_long(zval *arg, uint index, long n)
tmp->type = IS_LONG;
tmp->value.lval = n;
tmp->refcount=1;
tmp->is_ref=0;
tmp->EA=0;
return zend_hash_index_update(arg->value.ht, index, (void *) &tmp, sizeof(zval *),NULL);
}

Expand All @@ -308,7 +308,7 @@ ZEND_API inline int add_index_double(zval *arg, uint index, double d)
tmp->type = IS_DOUBLE;
tmp->value.dval = d;
tmp->refcount=1;
tmp->is_ref=0;
tmp->EA=0;
return zend_hash_index_update(arg->value.ht, index, (void *) &tmp, sizeof(zval *),NULL);
}

Expand All @@ -325,7 +325,7 @@ ZEND_API inline int add_index_string(zval *arg, uint index, char *str, int dupli
tmp->value.str.val = str;
}
tmp->refcount=1;
tmp->is_ref=0;
tmp->EA=0;
return zend_hash_index_update(arg->value.ht, index, (void *) &tmp, sizeof(zval *), NULL);
}

Expand All @@ -342,7 +342,7 @@ ZEND_API inline int add_index_stringl(zval *arg, uint index, char *str, uint len
tmp->value.str.val = str;
}
tmp->refcount=1;
tmp->is_ref=0;
tmp->EA=0;
return zend_hash_index_update(arg->value.ht, index, (void *) &tmp, sizeof(zval *),NULL);
}

Expand All @@ -354,7 +354,7 @@ ZEND_API inline int add_next_index_long(zval *arg, long n)
tmp->type = IS_LONG;
tmp->value.lval = n;
tmp->refcount=1;
tmp->is_ref=0;
tmp->EA=0;
return zend_hash_next_index_insert(arg->value.ht, &tmp, sizeof(zval *), NULL);
}

Expand All @@ -366,7 +366,7 @@ ZEND_API inline int add_next_index_double(zval *arg, double d)
tmp->type = IS_DOUBLE;
tmp->value.dval = d;
tmp->refcount=1;
tmp->is_ref=0;
tmp->EA=0;
return zend_hash_next_index_insert(arg->value.ht, &tmp, sizeof(zval *), NULL);
}

Expand All @@ -383,7 +383,7 @@ ZEND_API inline int add_next_index_string(zval *arg, char *str, int duplicate)
tmp->value.str.val = str;
}
tmp->refcount=1;
tmp->is_ref=0;
tmp->EA=0;
return zend_hash_next_index_insert(arg->value.ht, &tmp, sizeof(zval *),NULL);
}

Expand All @@ -400,7 +400,7 @@ ZEND_API inline int add_next_index_stringl(zval *arg, char *str, uint length, in
tmp->value.str.val = str;
}
tmp->refcount=1;
tmp->is_ref=0;
tmp->EA=0;
return zend_hash_next_index_insert(arg->value.ht, &tmp, sizeof(zval *),NULL);
}

Expand All @@ -417,7 +417,7 @@ ZEND_API inline int add_get_assoc_string(zval *arg, char *key, char *str, void *
tmp->value.str.val = str;
}
tmp->refcount=1;
tmp->is_ref=0;
tmp->EA=0;
return zend_hash_update(arg->value.ht, key, strlen(key)+1, (void *) &tmp, sizeof(zval *), dest);
}

Expand All @@ -434,7 +434,7 @@ ZEND_API inline int add_get_assoc_stringl(zval *arg, char *key, char *str, uint
tmp->value.str.val = str;
}
tmp->refcount=1;
tmp->is_ref=0;
tmp->EA=0;
return zend_hash_update(arg->value.ht, key, strlen(key)+1, (void *) &tmp, sizeof(zval *), dest);
}

Expand All @@ -446,7 +446,7 @@ ZEND_API inline int add_get_index_long(zval *arg, uint index, long l, void **des
tmp->type = IS_LONG;
tmp->value.lval= l;
tmp->refcount=1;
tmp->is_ref=0;
tmp->EA=0;
return zend_hash_index_update(arg->value.ht, index, (void *) &tmp, sizeof(zval *),dest);
}

Expand All @@ -458,7 +458,7 @@ ZEND_API inline int add_get_index_double(zval *arg, uint index, double d, void *
tmp->type = IS_DOUBLE;
tmp->value.dval= d;
tmp->refcount=1;
tmp->is_ref=0;
tmp->EA=0;
return zend_hash_index_update(arg->value.ht, index, (void *) &tmp, sizeof(zval *),dest);
}

Expand All @@ -475,7 +475,7 @@ ZEND_API inline int add_get_index_string(zval *arg, uint index, char *str, void
tmp->value.str.val = str;
}
tmp->refcount=1;
tmp->is_ref=0;
tmp->EA=0;
return zend_hash_index_update(arg->value.ht, index, (void *) &tmp, sizeof(zval *),dest);
}

Expand All @@ -492,7 +492,7 @@ ZEND_API inline int add_get_index_stringl(zval *arg, uint index, char *str, uint
tmp->value.str.val = str;
}
tmp->refcount=1;
tmp->is_ref=0;
tmp->EA=0;
return zend_hash_index_update(arg->value.ht, index, (void *) &tmp, sizeof(zval *),dest);
}

Expand All @@ -504,7 +504,7 @@ ZEND_API inline int add_property_long(zval *arg, char *key, long n)
tmp->type = IS_LONG;
tmp->value.lval = n;
tmp->refcount=1;
tmp->is_ref=0;
tmp->EA=0;
return zend_hash_update(arg->value.obj.properties, key, strlen(key)+1, (void *) &tmp, sizeof(zval *), NULL);
}

Expand All @@ -516,7 +516,7 @@ ZEND_API inline int add_property_double(zval *arg, char *key, double d)
tmp->type = IS_DOUBLE;
tmp->value.dval = d;
tmp->refcount=1;
tmp->is_ref=0;
tmp->EA=0;
return zend_hash_update(arg->value.obj.properties, key, strlen(key)+1, (void *) &tmp, sizeof(zval *), NULL);
}

Expand All @@ -533,7 +533,7 @@ ZEND_API inline int add_property_string(zval *arg, char *key, char *str, int dup
tmp->value.str.val = str;
}
tmp->refcount=1;
tmp->is_ref=0;
tmp->EA=0;
return zend_hash_update(arg->value.obj.properties, key, strlen(key)+1, (void *) &tmp, sizeof(zval *), NULL);
}

Expand All @@ -550,7 +550,7 @@ ZEND_API inline int add_property_stringl(zval *arg, char *key, char *str, uint l
tmp->value.str.val = str;
}
tmp->refcount=1;
tmp->is_ref=0;
tmp->EA=0;
return zend_hash_update(arg->value.obj.properties, key, strlen(key)+1, (void *) &tmp, sizeof(zval *), NULL);
}

Expand Down
8 changes: 4 additions & 4 deletions Zend/zend_API.h
Expand Up @@ -186,7 +186,7 @@ ZEND_API int add_property_stringl(zval *arg, char *key, char *str, uint length,
var->value.str.val = (str); \
var->value.str.len = strlen((str)); \
var->type = IS_STRING; \
var->is_ref=0; \
var->EA=0; \
var->refcount=1; \
zend_hash_update(&EG(symbol_table), (n), strlen((n))+1, &var, sizeof(zval *), NULL); \
} \
Expand All @@ -199,7 +199,7 @@ ZEND_API int add_property_stringl(zval *arg, char *key, char *str, uint length,
var->value.str.val = (v); \
var->value.str.len = (l); \
var->type = IS_STRING; \
var->is_ref=0; \
var->EA=0; \
var->refcount=1; \
zend_hash_update(&EG(symbol_table), name, strlen(name)+1, &var, sizeof(zval *), NULL); \
} \
Expand All @@ -210,7 +210,7 @@ ZEND_API int add_property_stringl(zval *arg, char *key, char *str, uint length,
\
var->value.lval = (v); \
var->type = IS_LONG; \
var->is_ref=0; \
var->EA=0; \
var->refcount=1; \
zend_hash_update(&EG(symbol_table), (n), strlen((n))+1, &var, sizeof(zval *), NULL); \
} \
Expand All @@ -221,7 +221,7 @@ ZEND_API int add_property_stringl(zval *arg, char *key, char *str, uint length,
\
var->value.dval = (v); \
var->type = IS_DOUBLE; \
var->is_ref=0; \
var->EA=0; \
var->refcount=1; \
zend_hash_update(&EG(symbol_table)), (n), strlen((n))+1, &var, sizeof(zval *), NULL); \
} \
Expand Down
12 changes: 6 additions & 6 deletions Zend/zend_compile.c
Expand Up @@ -840,7 +840,7 @@ void do_return(znode *expr CLS_DC)
var_uninit(&opline->op1.u.constant);
opline->op1.op_type = IS_CONST;
opline->op1.u.constant.refcount=1;
opline->op1.u.constant.is_ref=0;
opline->op1.u.constant.EA=0;
}
SET_UNUSED(opline->op2);
}
Expand Down Expand Up @@ -1039,7 +1039,7 @@ void do_brk_cont(int op, znode *expr CLS_DC)
opline->op2.u.constant.type = IS_LONG;
opline->op2.u.constant.value.lval = 1;
opline->op2.u.constant.refcount=1;
opline->op2.u.constant.is_ref=0;
opline->op2.u.constant.EA=0;
opline->op2.op_type = IS_CONST;
}
}
Expand Down Expand Up @@ -1190,7 +1190,7 @@ void do_default_before_statement(znode *case_list, znode *default_token CLS_DC)
opline->op1.u.constant.type = IS_LONG;
opline->op1.u.constant.value.lval = 1;
opline->op1.u.constant.refcount=1;
opline->op1.u.constant.is_ref=0;
opline->op1.u.constant.EA=0;
SET_UNUSED(opline->op2);
switch_entry_ptr->default_case = next_op_number;

Expand Down Expand Up @@ -1423,7 +1423,7 @@ void do_shell_exec(znode *result, znode *cmd CLS_DC)
opline->op1.u.constant.value.str.val = estrndup("shell_exec",sizeof("shell_exec")-1);
opline->op1.u.constant.value.str.len = sizeof("shell_exec")-1;
opline->op1.u.constant.refcount = 1;
opline->op1.u.constant.is_ref = 0;
opline->op1.u.constant.EA = 0;
opline->op1.u.constant.type = IS_STRING;
opline->op1.op_type = IS_CONST;
opline->extended_value = 1;
Expand Down Expand Up @@ -1562,7 +1562,7 @@ void do_list_end(znode *result, znode *expr CLS_DC)
opline->op2.u.constant.type = IS_LONG;
opline->op2.u.constant.value.lval = *((int *) dimension->data);
opline->op2.u.constant.refcount = 1;
opline->op2.u.constant.is_ref = 0;
opline->op2.u.constant.EA = 0;
if (le == CG(list_llist).tail) {
opline->extended_value = ZEND_FETCH_STANDARD;
} else {
Expand Down Expand Up @@ -1973,7 +1973,7 @@ int zendlex(znode *zendlval CLS_DC)
}

zendlval->u.constant.refcount = 1;
zendlval->u.constant.is_ref = 0;
zendlval->u.constant.EA = 0;
zendlval->op_type = IS_CONST;
return retval;
}

0 comments on commit 5f62c34

Please sign in to comment.