]> granicus.if.org Git - php/commitdiff
Removed some compilation warnings.
authorDmitry Stogov <dmitry@php.net>
Mon, 18 Jul 2005 06:34:42 +0000 (06:34 +0000)
committerDmitry Stogov <dmitry@php.net>
Mon, 18 Jul 2005 06:34:42 +0000 (06:34 +0000)
Zend/zend_vm_def.h
Zend/zend_vm_execute.h
Zend/zend_vm_gen.php

index f5e2e00d9b045014517b39437a8eaccd7a924643..d4fb7b1a3f3c6fee430fba9c41489e1662d244fb 100644 (file)
@@ -406,7 +406,7 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_helper, VAR|UNUSED|CV, CONST|TMP|VAR|UNU
                case ZEND_ASSIGN_DIM: {
                                zval **object_ptr = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_W);
 
-                               if (OP1_TYPE != IS_CV && free_op1.var == NULL) {
+                               if (OP1_TYPE != IS_CV && !OP1_FREE) {
                                        (*object_ptr)->refcount++;  /* undo the effect of get_obj_zval_ptr_ptr() */
                                }
 
@@ -1993,7 +1993,7 @@ ZEND_VM_HANDLER(62, ZEND_RETURN, CONST|TMP|VAR|CV, ANY)
                if (OP1_TYPE == IS_VAR && !(*retval_ptr_ptr)->is_ref) {
                        if (EX_T(opline->op1.u.var).var.ptr_ptr == &EX_T(opline->op1.u.var).var.ptr
                                || (opline->extended_value == ZEND_RETURNS_FUNCTION && !EX_T(opline->op1.u.var).var.fcall_returned_reference)) {
-                               if (OP1_TYPE == IS_VAR && free_op1.var == NULL) {
+                               if (OP1_TYPE == IS_VAR && !OP1_FREE) {
                                        PZVAL_LOCK(*retval_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */
                                }
                                zend_error(E_NOTICE, "Only variable references should be returned by reference");
index 99c344f3c153e1d3f4f424605da0836ee56a0630..ee898636942d6825320002095f51397b43262432 100644 (file)
@@ -1584,7 +1584,7 @@ static int ZEND_RETURN_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
        zend_op *opline = EX(opline);
        zval *retval_ptr;
        zval **retval_ptr_ptr;
-       zend_free_op free_op1;
+       
 
        if (EG(active_op_array)->return_reference == ZEND_RETURN_REF) {
 
@@ -1603,7 +1603,7 @@ static int ZEND_RETURN_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
                if (IS_CONST == IS_VAR && !(*retval_ptr_ptr)->is_ref) {
                        if (EX_T(opline->op1.u.var).var.ptr_ptr == &EX_T(opline->op1.u.var).var.ptr
                                || (opline->extended_value == ZEND_RETURNS_FUNCTION && !EX_T(opline->op1.u.var).var.fcall_returned_reference)) {
-                               if (IS_CONST == IS_VAR && free_op1.var == NULL) {
+                               if (IS_CONST == IS_VAR && !0) {
                                        PZVAL_LOCK(*retval_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */
                                }
                                zend_error(E_NOTICE, "Only variable references should be returned by reference");
@@ -4012,7 +4012,7 @@ static int ZEND_RETURN_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
                if (IS_TMP_VAR == IS_VAR && !(*retval_ptr_ptr)->is_ref) {
                        if (EX_T(opline->op1.u.var).var.ptr_ptr == &EX_T(opline->op1.u.var).var.ptr
                                || (opline->extended_value == ZEND_RETURNS_FUNCTION && !EX_T(opline->op1.u.var).var.fcall_returned_reference)) {
-                               if (IS_TMP_VAR == IS_VAR && free_op1.var == NULL) {
+                               if (IS_TMP_VAR == IS_VAR && !1) {
                                        PZVAL_LOCK(*retval_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */
                                }
                                zend_error(E_NOTICE, "Only variable references should be returned by reference");
@@ -6942,7 +6942,7 @@ static int ZEND_RETURN_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
                if (IS_VAR == IS_VAR && !(*retval_ptr_ptr)->is_ref) {
                        if (EX_T(opline->op1.u.var).var.ptr_ptr == &EX_T(opline->op1.u.var).var.ptr
                                || (opline->extended_value == ZEND_RETURNS_FUNCTION && !EX_T(opline->op1.u.var).var.fcall_returned_reference)) {
-                               if (IS_VAR == IS_VAR && free_op1.var == NULL) {
+                               if (IS_VAR == IS_VAR && !(free_op1.var != NULL)) {
                                        PZVAL_LOCK(*retval_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */
                                }
                                zend_error(E_NOTICE, "Only variable references should be returned by reference");
@@ -8155,7 +8155,7 @@ static int zend_binary_assign_op_helper_SPEC_VAR_CONST(int (*binary_op)(zval *re
                case ZEND_ASSIGN_DIM: {
                                zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
 
-                               if (IS_VAR != IS_CV && free_op1.var == NULL) {
+                               if (IS_VAR != IS_CV && !(free_op1.var != NULL)) {
                                        (*object_ptr)->refcount++;  /* undo the effect of get_obj_zval_ptr_ptr() */
                                }
 
@@ -9570,7 +9570,7 @@ static int zend_binary_assign_op_helper_SPEC_VAR_TMP(int (*binary_op)(zval *resu
                case ZEND_ASSIGN_DIM: {
                                zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
 
-                               if (IS_VAR != IS_CV && free_op1.var == NULL) {
+                               if (IS_VAR != IS_CV && !(free_op1.var != NULL)) {
                                        (*object_ptr)->refcount++;  /* undo the effect of get_obj_zval_ptr_ptr() */
                                }
 
@@ -10989,7 +10989,7 @@ static int zend_binary_assign_op_helper_SPEC_VAR_VAR(int (*binary_op)(zval *resu
                case ZEND_ASSIGN_DIM: {
                                zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
 
-                               if (IS_VAR != IS_CV && free_op1.var == NULL) {
+                               if (IS_VAR != IS_CV && !(free_op1.var != NULL)) {
                                        (*object_ptr)->refcount++;  /* undo the effect of get_obj_zval_ptr_ptr() */
                                }
 
@@ -12212,7 +12212,7 @@ static int zend_binary_assign_op_helper_SPEC_VAR_UNUSED(int (*binary_op)(zval *r
                case ZEND_ASSIGN_DIM: {
                                zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
 
-                               if (IS_VAR != IS_CV && free_op1.var == NULL) {
+                               if (IS_VAR != IS_CV && !(free_op1.var != NULL)) {
                                        (*object_ptr)->refcount++;  /* undo the effect of get_obj_zval_ptr_ptr() */
                                }
 
@@ -12825,7 +12825,7 @@ static int zend_binary_assign_op_helper_SPEC_VAR_CV(int (*binary_op)(zval *resul
                case ZEND_ASSIGN_DIM: {
                                zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
 
-                               if (IS_VAR != IS_CV && free_op1.var == NULL) {
+                               if (IS_VAR != IS_CV && !(free_op1.var != NULL)) {
                                        (*object_ptr)->refcount++;  /* undo the effect of get_obj_zval_ptr_ptr() */
                                }
 
@@ -14103,7 +14103,7 @@ static int zend_binary_assign_op_obj_helper_SPEC_UNUSED_CONST(int (*binary_op)(z
 static int zend_binary_assign_op_helper_SPEC_UNUSED_CONST(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
 {
        zend_op *opline = EX(opline);
-       zend_free_op free_op1, free_op_data2, free_op_data1;
+       zend_free_op free_op_data2, free_op_data1;
        zval **var_ptr;
        zval *value;
        zend_bool increment_opline = 0;
@@ -14115,7 +14115,7 @@ static int zend_binary_assign_op_helper_SPEC_UNUSED_CONST(int (*binary_op)(zval
                case ZEND_ASSIGN_DIM: {
                                zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
 
-                               if (IS_UNUSED != IS_CV && free_op1.var == NULL) {
+                               if (IS_UNUSED != IS_CV && !0) {
                                        (*object_ptr)->refcount++;  /* undo the effect of get_obj_zval_ptr_ptr() */
                                }
 
@@ -15181,7 +15181,7 @@ static int zend_binary_assign_op_obj_helper_SPEC_UNUSED_TMP(int (*binary_op)(zva
 static int zend_binary_assign_op_helper_SPEC_UNUSED_TMP(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
 {
        zend_op *opline = EX(opline);
-       zend_free_op free_op1, free_op2, free_op_data2, free_op_data1;
+       zend_free_op free_op2, free_op_data2, free_op_data1;
        zval **var_ptr;
        zval *value;
        zend_bool increment_opline = 0;
@@ -15193,7 +15193,7 @@ static int zend_binary_assign_op_helper_SPEC_UNUSED_TMP(int (*binary_op)(zval *r
                case ZEND_ASSIGN_DIM: {
                                zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
 
-                               if (IS_UNUSED != IS_CV && free_op1.var == NULL) {
+                               if (IS_UNUSED != IS_CV && !0) {
                                        (*object_ptr)->refcount++;  /* undo the effect of get_obj_zval_ptr_ptr() */
                                }
 
@@ -16221,7 +16221,7 @@ static int zend_binary_assign_op_obj_helper_SPEC_UNUSED_VAR(int (*binary_op)(zva
 static int zend_binary_assign_op_helper_SPEC_UNUSED_VAR(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
 {
        zend_op *opline = EX(opline);
-       zend_free_op free_op1, free_op2, free_op_data2, free_op_data1;
+       zend_free_op free_op2, free_op_data2, free_op_data1;
        zval **var_ptr;
        zval *value;
        zend_bool increment_opline = 0;
@@ -16233,7 +16233,7 @@ static int zend_binary_assign_op_helper_SPEC_UNUSED_VAR(int (*binary_op)(zval *r
                case ZEND_ASSIGN_DIM: {
                                zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
 
-                               if (IS_UNUSED != IS_CV && free_op1.var == NULL) {
+                               if (IS_UNUSED != IS_CV && !0) {
                                        (*object_ptr)->refcount++;  /* undo the effect of get_obj_zval_ptr_ptr() */
                                }
 
@@ -17261,7 +17261,7 @@ static int zend_binary_assign_op_obj_helper_SPEC_UNUSED_UNUSED(int (*binary_op)(
 static int zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
 {
        zend_op *opline = EX(opline);
-       zend_free_op free_op1, free_op_data2, free_op_data1;
+       zend_free_op free_op_data2, free_op_data1;
        zval **var_ptr;
        zval *value;
        zend_bool increment_opline = 0;
@@ -17273,7 +17273,7 @@ static int zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(int (*binary_op)(zval
                case ZEND_ASSIGN_DIM: {
                                zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
 
-                               if (IS_UNUSED != IS_CV && free_op1.var == NULL) {
+                               if (IS_UNUSED != IS_CV && !0) {
                                        (*object_ptr)->refcount++;  /* undo the effect of get_obj_zval_ptr_ptr() */
                                }
 
@@ -17627,7 +17627,7 @@ static int zend_binary_assign_op_obj_helper_SPEC_UNUSED_CV(int (*binary_op)(zval
 static int zend_binary_assign_op_helper_SPEC_UNUSED_CV(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
 {
        zend_op *opline = EX(opline);
-       zend_free_op free_op1, free_op_data2, free_op_data1;
+       zend_free_op free_op_data2, free_op_data1;
        zval **var_ptr;
        zval *value;
        zend_bool increment_opline = 0;
@@ -17639,7 +17639,7 @@ static int zend_binary_assign_op_helper_SPEC_UNUSED_CV(int (*binary_op)(zval *re
                case ZEND_ASSIGN_DIM: {
                                zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
 
-                               if (IS_UNUSED != IS_CV && free_op1.var == NULL) {
+                               if (IS_UNUSED != IS_CV && !0) {
                                        (*object_ptr)->refcount++;  /* undo the effect of get_obj_zval_ptr_ptr() */
                                }
 
@@ -18970,7 +18970,7 @@ static int ZEND_RETURN_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
        zend_op *opline = EX(opline);
        zval *retval_ptr;
        zval **retval_ptr_ptr;
-       zend_free_op free_op1;
+       
 
        if (EG(active_op_array)->return_reference == ZEND_RETURN_REF) {
 
@@ -18989,7 +18989,7 @@ static int ZEND_RETURN_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
                if (IS_CV == IS_VAR && !(*retval_ptr_ptr)->is_ref) {
                        if (EX_T(opline->op1.u.var).var.ptr_ptr == &EX_T(opline->op1.u.var).var.ptr
                                || (opline->extended_value == ZEND_RETURNS_FUNCTION && !EX_T(opline->op1.u.var).var.fcall_returned_reference)) {
-                               if (IS_CV == IS_VAR && free_op1.var == NULL) {
+                               if (IS_CV == IS_VAR && !0) {
                                        PZVAL_LOCK(*retval_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */
                                }
                                zend_error(E_NOTICE, "Only variable references should be returned by reference");
@@ -20037,7 +20037,7 @@ static int zend_binary_assign_op_obj_helper_SPEC_CV_CONST(int (*binary_op)(zval
 static int zend_binary_assign_op_helper_SPEC_CV_CONST(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
 {
        zend_op *opline = EX(opline);
-       zend_free_op free_op1, free_op_data2, free_op_data1;
+       zend_free_op free_op_data2, free_op_data1;
        zval **var_ptr;
        zval *value;
        zend_bool increment_opline = 0;
@@ -20049,7 +20049,7 @@ static int zend_binary_assign_op_helper_SPEC_CV_CONST(int (*binary_op)(zval *res
                case ZEND_ASSIGN_DIM: {
                                zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC);
 
-                               if (IS_CV != IS_CV && free_op1.var == NULL) {
+                               if (IS_CV != IS_CV && !0) {
                                        (*object_ptr)->refcount++;  /* undo the effect of get_obj_zval_ptr_ptr() */
                                }
 
@@ -21444,7 +21444,7 @@ static int zend_binary_assign_op_obj_helper_SPEC_CV_TMP(int (*binary_op)(zval *r
 static int zend_binary_assign_op_helper_SPEC_CV_TMP(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
 {
        zend_op *opline = EX(opline);
-       zend_free_op free_op1, free_op2, free_op_data2, free_op_data1;
+       zend_free_op free_op2, free_op_data2, free_op_data1;
        zval **var_ptr;
        zval *value;
        zend_bool increment_opline = 0;
@@ -21456,7 +21456,7 @@ static int zend_binary_assign_op_helper_SPEC_CV_TMP(int (*binary_op)(zval *resul
                case ZEND_ASSIGN_DIM: {
                                zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC);
 
-                               if (IS_CV != IS_CV && free_op1.var == NULL) {
+                               if (IS_CV != IS_CV && !0) {
                                        (*object_ptr)->refcount++;  /* undo the effect of get_obj_zval_ptr_ptr() */
                                }
 
@@ -22855,7 +22855,7 @@ static int zend_binary_assign_op_obj_helper_SPEC_CV_VAR(int (*binary_op)(zval *r
 static int zend_binary_assign_op_helper_SPEC_CV_VAR(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
 {
        zend_op *opline = EX(opline);
-       zend_free_op free_op1, free_op2, free_op_data2, free_op_data1;
+       zend_free_op free_op2, free_op_data2, free_op_data1;
        zval **var_ptr;
        zval *value;
        zend_bool increment_opline = 0;
@@ -22867,7 +22867,7 @@ static int zend_binary_assign_op_helper_SPEC_CV_VAR(int (*binary_op)(zval *resul
                case ZEND_ASSIGN_DIM: {
                                zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC);
 
-                               if (IS_CV != IS_CV && free_op1.var == NULL) {
+                               if (IS_CV != IS_CV && !0) {
                                        (*object_ptr)->refcount++;  /* undo the effect of get_obj_zval_ptr_ptr() */
                                }
 
@@ -24069,7 +24069,7 @@ static int zend_binary_assign_op_obj_helper_SPEC_CV_UNUSED(int (*binary_op)(zval
 static int zend_binary_assign_op_helper_SPEC_CV_UNUSED(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
 {
        zend_op *opline = EX(opline);
-       zend_free_op free_op1, free_op_data2, free_op_data1;
+       zend_free_op free_op_data2, free_op_data1;
        zval **var_ptr;
        zval *value;
        zend_bool increment_opline = 0;
@@ -24081,7 +24081,7 @@ static int zend_binary_assign_op_helper_SPEC_CV_UNUSED(int (*binary_op)(zval *re
                case ZEND_ASSIGN_DIM: {
                                zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC);
 
-                               if (IS_CV != IS_CV && free_op1.var == NULL) {
+                               if (IS_CV != IS_CV && !0) {
                                        (*object_ptr)->refcount++;  /* undo the effect of get_obj_zval_ptr_ptr() */
                                }
 
@@ -24681,7 +24681,7 @@ static int zend_binary_assign_op_obj_helper_SPEC_CV_CV(int (*binary_op)(zval *re
 static int zend_binary_assign_op_helper_SPEC_CV_CV(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
 {
        zend_op *opline = EX(opline);
-       zend_free_op free_op1, free_op_data2, free_op_data1;
+       zend_free_op free_op_data2, free_op_data1;
        zval **var_ptr;
        zval *value;
        zend_bool increment_opline = 0;
@@ -24693,7 +24693,7 @@ static int zend_binary_assign_op_helper_SPEC_CV_CV(int (*binary_op)(zval *result
                case ZEND_ASSIGN_DIM: {
                                zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC);
 
-                               if (IS_CV != IS_CV && free_op1.var == NULL) {
+                               if (IS_CV != IS_CV && !0) {
                                        (*object_ptr)->refcount++;  /* undo the effect of get_obj_zval_ptr_ptr() */
                                }
 
index 94e2a65e64a268f6bf034ce6fd67d0b4a7b203b2..235735d9834bba9d40fdf5743046b7be7fb8bd11 100644 (file)
@@ -80,6 +80,24 @@ $op2_type = array(
        "CV"     => "IS_CV",
 );
 
+$op1_free = array(
+       "ANY"    => "(free_op1.var != NULL)",
+       "TMP"    => "1",
+       "VAR"    => "(free_op1.var != NULL)",
+       "CONST"  => "0",
+       "UNUSED" => "0",
+       "CV"     => "0",
+);
+
+$op2_free = array(
+       "ANY"    => "(free_op2.var != NULL)",
+       "TMP"    => "1",
+       "VAR"    => "(free_op2.var != NULL)",
+       "CONST"  => "0",
+       "UNUSED" => "0",
+       "CV"     => "0",
+);
+
 $op1_get_zval_ptr = array(
        "ANY"    => "get_zval_ptr(&opline->op1, EX(Ts), &free_op1, \\1)",
        "TMP"    => "_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)",
@@ -272,7 +290,7 @@ function gen_code($f, $spec, $kind, $code, $op1, $op2) {
                $op1_get_zval_ptr_ptr, $op2_get_zval_ptr_ptr,
                $op1_get_obj_zval_ptr, $op2_get_obj_zval_ptr,
                $op1_get_obj_zval_ptr_ptr, $op2_get_obj_zval_ptr_ptr,
-               $op1_is_tmp_free, $op2_is_tmp_free,
+               $op1_is_tmp_free, $op2_is_tmp_free, $op1_free, $op2_free,
                $op1_free_op, $op2_free_op, $op1_free_op_if_var, $op2_free_op_if_var,
                $op1_free_op_var_ptr, $op2_free_op_var_ptr, $prefix;
 
@@ -281,6 +299,8 @@ function gen_code($f, $spec, $kind, $code, $op1, $op2) {
                array(
                        "/OP1_TYPE/",
                        "/OP2_TYPE/",
+                       "/OP1_FREE/",
+                       "/OP2_FREE/",
                        "/GET_OP1_ZVAL_PTR\(([^)]*)\)/",
                        "/GET_OP2_ZVAL_PTR\(([^)]*)\)/",
                        "/GET_OP1_ZVAL_PTR_PTR\(([^)]*)\)/",
@@ -305,6 +325,8 @@ function gen_code($f, $spec, $kind, $code, $op1, $op2) {
                array(
                        $op1_type[$op1],
                        $op2_type[$op2],
+                       $op1_free[$op1],
+                       $op2_free[$op2],
                        $op1_get_zval_ptr[$op1],
                        $op2_get_zval_ptr[$op2],
                        $op1_get_zval_ptr_ptr[$op1],