]> granicus.if.org Git - php/commitdiff
- Move is_ref back to being an unsigned char and not a bit field.
authorAndi Gutmans <andi@php.net>
Fri, 1 Oct 1999 23:31:39 +0000 (23:31 +0000)
committerAndi Gutmans <andi@php.net>
Fri, 1 Oct 1999 23:31:39 +0000 (23:31 +0000)
Zend/zend.h
Zend/zend_API.h
Zend/zend_builtin_functions.c
Zend/zend_compile.h
Zend/zend_execute.c
Zend/zend_execute_API.c
Zend/zend_opcode.c
Zend/zend_operators.h

index d83538783cadd6661080d87f2e6b276c9da288bf..4b8491186c64d951070bba090f9f45a6f1109ace 100644 (file)
@@ -125,9 +125,7 @@ struct _zval_struct {
        /* Variable information */
        zvalue_value value;             /* value */
        unsigned char type;     /* active type */
-       struct {
-               unsigned int is_ref:1;
-       } EA;
+       unsigned char is_ref;
        short refcount;
 };
 
@@ -267,7 +265,7 @@ extern zend_utility_values zend_uv;
 
 #define INIT_PZVAL(z)          \
        (z)->refcount = 1;              \
-       (z)->EA.is_ref = 0;     
+       (z)->is_ref = 0;        
 
 #define MAKE_STD_ZVAL(zv)                               \
        zv = (zval *) emalloc(sizeof(zval)); \
@@ -283,7 +281,7 @@ extern zend_utility_values zend_uv;
                        **(ppzv) = *orig_ptr;                                                   \
                        zval_copy_ctor(*(ppzv));                                                \
                        (*(ppzv))->refcount=1;                                                  \
-                       (*(ppzv))->EA.is_ref = 0;                                               \
+                       (*(ppzv))->is_ref = 0;                                          \
                }                                                                                                       \
        }
 
index a32aa4e5e8738b0f16918b72b1175c360eaa3f69..cf3428415f8d6d23bf9b4113350e55b7ec3414ac 100644 (file)
@@ -243,7 +243,7 @@ ZEND_API int add_property_stringl(zval *arg, char *key, char *str, uint length,
                if (zend_hash_find(symtable, (name), (name_length), (void **) &orig_var)==SUCCESS                               \
                        && PZVAL_IS_REF(*orig_var)) {                                                                                                                           \
                        var->refcount = (*orig_var)->refcount;                                                                                                          \
-                       var->EA.is_ref = 1;                                                                                                                                                     \
+                       var->is_ref = 1;                                                                                                                                                        \
                                                                                                                                                                                                                \
                        zval_dtor(*orig_var);                                                                                                                                           \
                        **orig_var = *var;                                                                                                                                                      \
index e05acdfbbd27babcbb7896463eddb1504b066650..fd3ce162df9ff4da2b84bd20f0738cdf17b0c245 100644 (file)
@@ -228,11 +228,11 @@ ZEND_FUNCTION(each)
        entry = *entry_ptr;
 
        /* add value elements */
-       if (entry->EA.is_ref) {
+       if (entry->is_ref) {
                tmp = (zval *)emalloc(sizeof(zval));
                *tmp = *entry;
                zval_copy_ctor(tmp);
-               tmp->EA.is_ref=0;
+               tmp->is_ref=0;
                tmp->refcount=0;
                entry=tmp;
        }
index 2bfedf94387df0c127e0e295a9e3faa300f66ede..1e17e34d3037ece970fae446b503c8285222106e 100644 (file)
@@ -565,7 +565,7 @@ int zendlex(znode *zendlval CLS_DC);
                (ai).ptr = NULL; \
        }
 
-#define PZVAL_IS_REF(z)                ((z)->EA.is_ref)
+#define PZVAL_IS_REF(z)                ((z)->is_ref)
 
 #define PZVAL_LOCK(z)  ((z)->refcount++)
 #define PZVAL_UNLOCK(z)        ((z)->refcount--)
index de077f0c935107b1a9179eb9a58f89d2d6f7e712..808332631942538fbd988db86711037afc1aaae6 100644 (file)
@@ -99,7 +99,7 @@ static inline zval *_get_zval_ptr(znode *node, temp_variable *Ts, int *should_fr
                                        case IS_OVERLOADED_OBJECT:
                                                Ts[node->u.var].tmp_var = get_overloaded_property(ELS_C);
                                                Ts[node->u.var].tmp_var.refcount=1;
-                                               Ts[node->u.var].tmp_var.EA.is_ref=1;
+                                               Ts[node->u.var].tmp_var.is_ref=1;
                                                return &Ts[node->u.var].tmp_var;
                                                break;
                                        case IS_STRING_OFFSET: {
@@ -118,7 +118,7 @@ static inline zval *_get_zval_ptr(znode *node, temp_variable *Ts, int *should_fr
                                                        }
                                                        zval_ptr_dtor(&str);
                                                        T->tmp_var.refcount=1;
-                                                       T->tmp_var.EA.is_ref=1;
+                                                       T->tmp_var.is_ref=1;
                                                        T->tmp_var.type = IS_STRING;
                                                        return &T->tmp_var;
                                                }
@@ -317,7 +317,7 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
                        zendi_zval_dtor(*variable_ptr);
                        *variable_ptr = *value;
                        variable_ptr->refcount = refcount;
-                       variable_ptr->EA.is_ref = 1;
+                       variable_ptr->is_ref = 1;
                        if (type!=IS_TMP_VAR) {
                                zendi_zval_copy_ctor(*variable_ptr);
                                zval_ptr_dtor(&value);
@@ -395,7 +395,7 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
                                        break;
                        }
                }
-               (*variable_ptr_ptr)->EA.is_ref=0;
+               (*variable_ptr_ptr)->is_ref=0;
        }
        if (result) {
                Ts[result->u.var].var.ptr_ptr = variable_ptr_ptr;
@@ -636,7 +636,7 @@ static inline void zend_fetch_dimension_address(znode *result, znode *op1, znode
                                        container->refcount--;
                                        if (container->refcount>0) {
                                                container = *container_ptr = (zval *) emalloc(sizeof(zval));
-                                               container->EA.is_ref=0;
+                                               container->is_ref=0;
                                        }
                                        container->refcount=1;
                                }
@@ -804,7 +804,7 @@ static inline void zend_fetch_property_address(znode *result, znode *op1, znode
                                        container->refcount--;
                                        if (container->refcount>0) {
                                                container = *container_ptr = (zval *) emalloc(sizeof(zval));
-                                               container->EA.is_ref=0;
+                                               container->is_ref=0;
                                        }
                                        container->refcount=1;
                                }
@@ -931,7 +931,7 @@ void execute(zend_op_array *op_array ELS_DC)
                zval *globals = (zval *) emalloc(sizeof(zval));
 
                globals->refcount=1;
-               globals->EA.is_ref=1;
+               globals->is_ref=1;
                globals->type = IS_ARRAY;
                globals->value.ht = &EG(symbol_table);
                if (zend_hash_add(EG(active_symbol_table), "GLOBALS", sizeof("GLOBALS"), &globals, sizeof(zval *), NULL)==FAILURE) {
@@ -1489,7 +1489,7 @@ do_fcall_common:
                                                                        *object.ptr_ptr = tmp;
                                        }
                                        object.ptr->refcount = 1;
-                                       object.ptr->EA.is_ref = 1;
+                                       object.ptr->is_ref = 1;
                                        }
                                                        *this_ptr = object.ptr;
                                                        object.ptr->refcount++;
@@ -1569,13 +1569,13 @@ do_fcall_common:
                                                varptr = (zval *) emalloc(sizeof(zval));
                                                var_uninit(varptr);
                                                varptr->refcount=0;
-                                               varptr->EA.is_ref=0;
+                                               varptr->is_ref=0;
                                        } else if (PZVAL_IS_REF(varptr)) {
                                                zval *original_var = varptr;
 
                                                varptr = (zval *) emalloc(sizeof(zval));
                                                *varptr = *original_var;
-                                               varptr->EA.is_ref = 0;
+                                               varptr->is_ref = 0;
                                                varptr->refcount = 0;
                                                zval_copy_ctor(varptr);
                                        }
@@ -1599,7 +1599,7 @@ send_by_ref:
                                                        varptr->refcount = 1;
                                                        zval_copy_ctor(varptr);
                                                }
-                                               varptr->EA.is_ref = 1;
+                                               varptr->is_ref = 1;
                                                /* at the end of this code refcount is always 1 */
                                        }
                                        varptr->refcount++;
@@ -1643,7 +1643,7 @@ send_by_ref:
                                                                *default_value = tmp;
                                                        }
                                                        default_value->refcount=0;
-                                                       default_value->EA.is_ref=0;
+                                                       default_value->is_ref=0;
                                                        param = &default_value;
                                                        assignment_value = default_value;
                                                } else {
@@ -1759,7 +1759,7 @@ send_by_ref:
                                        }
                                        object_init_ex(&Ts[opline->result.u.var].tmp_var, ce);
                                        Ts[opline->result.u.var].tmp_var.refcount=1;
-                                       Ts[opline->result.u.var].tmp_var.EA.is_ref=1;
+                                       Ts[opline->result.u.var].tmp_var.is_ref=1;
                                        zval_dtor(&class_name);
                                        FREE_OP(&opline->op1, EG(free_op1));
                                }
@@ -1803,7 +1803,7 @@ send_by_ref:
                                                        if (!PZVAL_IS_REF(expr_ptr)) {
                                                                SEPARATE_ZVAL(expr_ptr_ptr);
                                                                expr_ptr = *expr_ptr_ptr;
-                                                               expr_ptr->EA.is_ref = 1;
+                                                               expr_ptr->is_ref = 1;
                                                        }
                                                        expr_ptr->refcount++;
                                                } else if (PZVAL_IS_REF(expr_ptr)) {
index aee059c8fb78b304b57b7616ceff37e924e39210..c9f0abebeecc03a78bb9cc0457b91a4a3099804a 100644 (file)
@@ -84,10 +84,10 @@ void init_executor(CLS_D ELS_DC)
        var_uninit(&EG(uninitialized_zval));
        var_uninit(&EG(error_zval));
        EG(uninitialized_zval).refcount = 1;
-       EG(uninitialized_zval).EA.is_ref=0;
+       EG(uninitialized_zval).is_ref=0;
        EG(uninitialized_zval_ptr)=&EG(uninitialized_zval);
        EG(error_zval).refcount = 1;
-       EG(error_zval).EA.is_ref=0;
+       EG(error_zval).is_ref=0;
        EG(error_zval_ptr)=&EG(error_zval);
        EG(destroying_function_symbol_table) = 0;
        zend_ptr_stack_init(&EG(arg_types_stack));
@@ -337,7 +337,7 @@ int call_user_function_ex(HashTable *function_table, zval *object, zval *functio
                                *params[i] = new_zval;
                        }
                        (*params[i])->refcount++;
-                       (*params[i])->EA.is_ref = 1;
+                       (*params[i])->is_ref = 1;
                        param = *params[i];
                } else if (*params[i] != &EG(uninitialized_zval)) {
                        (*params[i])->refcount++;
@@ -473,7 +473,7 @@ ZEND_API inline void zend_assign_to_variable_reference(znode *result, zval **var
                                zendi_zval_copy_ctor(*value_ptr);
                        }
                        value_ptr->refcount = 1;
-                       value_ptr->EA.is_ref = 1;
+                       value_ptr->is_ref = 1;
                }
 
                *variable_ptr_ptr = value_ptr;
index 4ab5abc055fe8ae323835923341cb9a832fc6377..8c2444659f36218b155313d6fb49ec3c7c1261d1 100644 (file)
@@ -311,10 +311,10 @@ void pass_include_eval(zend_op_array *op_array)
 
        while (opline<end) {
                if (opline->op1.op_type==IS_CONST) {
-                       opline->op1.u.constant.EA.is_ref = 1;
+                       opline->op1.u.constant.is_ref = 1;
                }
                if (opline->op2.op_type==IS_CONST) {
-                       opline->op2.u.constant.EA.is_ref = 1;
+                       opline->op2.u.constant.is_ref = 1;
                }
                opline++;
        }
index ad3b69cf9360594478e1f210e30ecd0e385d04b6..d0d71e97ab52127381645329134d8264a293de6d 100644 (file)
@@ -72,7 +72,7 @@ ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2);
 
 #define convert_to_long_ex(ppzv)                                                       \
        if ((*ppzv)->type!=IS_LONG) {                                                   \
-               if (!(*ppzv)->EA.is_ref) {                                                      \
+               if (!(*ppzv)->is_ref) {                                                 \
                        SEPARATE_ZVAL(ppzv);                                                    \
                }                                                                                                       \
                convert_to_long(*ppzv);                                                         \
@@ -80,7 +80,7 @@ ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2);
 
 #define convert_to_double_ex(ppzv)                                                     \
        if ((*ppzv)->type!=IS_DOUBLE) {                                                 \
-               if (!(*ppzv)->EA.is_ref) {                                                      \
+               if (!(*ppzv)->is_ref) {                                                 \
                        SEPARATE_ZVAL(ppzv);                                                    \
                }                                                                                                       \
                convert_to_double(*ppzv);                                                       \
@@ -88,7 +88,7 @@ ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2);
 
 #define convert_to_string_ex(ppzv)                                                     \
        if ((*ppzv)->type!=IS_STRING) {                                                 \
-               if (!(*ppzv)->EA.is_ref) {                                                      \
+               if (!(*ppzv)->is_ref) {                                                 \
                        SEPARATE_ZVAL(ppzv);                                                    \
                }                                                                                                       \
                convert_to_string(*ppzv);                                                       \
@@ -96,7 +96,7 @@ ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2);
 
 #define convert_to_array_ex(ppzv)                                                      \
        if ((*ppzv)->type!=IS_ARRAY) {                                                  \
-               if (!(*ppzv)->EA.is_ref) {                                                      \
+               if (!(*ppzv)->is_ref) {                                                 \
                        SEPARATE_ZVAL(ppzv);                                                    \
                }                                                                                                       \
                convert_to_array(*ppzv);                                                        \
@@ -104,7 +104,7 @@ ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2);
 
 #define convert_to_object_ex(ppzv)                                                     \
        if ((*ppzv)->type!=IS_OBJECT) {                                                 \
-               if (!(*ppzv)->EA.is_ref) {                                                      \
+               if (!(*ppzv)->is_ref) {                                                 \
                        SEPARATE_ZVAL(ppzv);                                                    \
                }                                                                                                       \
                convert_to_object(*ppzv);                                                       \
@@ -112,7 +112,7 @@ ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2);
 
 #define convert_to_boolean_ex(ppzv)                                                    \
        if ((*ppzv)->type!=IS_BOOL) {                                                   \
-               if (!(*ppzv)->EA.is_ref) {                                                      \
+               if (!(*ppzv)->is_ref) {                                                 \
                        SEPARATE_ZVAL(ppzv);                                                    \
                }                                                                                                       \
                convert_to_boolean(*ppzv);                                                      \