]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-7.1' into PHP-7.2
authorXinchen Hui <laruence@gmail.com>
Wed, 27 Jun 2018 05:07:36 +0000 (13:07 +0800)
committerXinchen Hui <laruence@gmail.com>
Wed, 27 Jun 2018 05:07:36 +0000 (13:07 +0800)
* PHP-7.1:
  Fixed bug #76534 (PHP hangs on 'illegal string offset on string references with an error handler)

Conflicts:
Zend/zend_execute.c
Zend/zend_vm_def.h
Zend/zend_vm_execute.h

1  2 
Zend/zend_execute.c
Zend/zend_vm_def.h
Zend/zend_vm_execute.h

index 8a9ddb2d8da0906e0051d80b96b18fcb818e3d77,f88fac6c88c27895b711489f5354aa999341540a..3edbb9c7d693e03d01622164fc104f0aeaefcdda
@@@ -1650,8 -1699,10 +1650,10 @@@ fetch_from_array
                if (dim == NULL) {
                        zend_throw_error(NULL, "[] operator not supported for strings");
                } else {
 -                      zend_check_string_offset(dim, type);
 +                      zend_check_string_offset(dim, type EXECUTE_DATA_CC);
-                       zend_wrong_string_offset(EXECUTE_DATA_C);
+                       if (EXPECTED(EG(exception) == NULL)) {
 -                              zend_wrong_string_offset();
++                              zend_wrong_string_offset(EXECUTE_DATA_C);
+                       }
                }
                ZVAL_ERROR(result);
        } else if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
index 7eb91efe8b87762ef60fddd04d190d3c8e056404,ea9870d31b2e4bddc4d387f98929b59983dffc5d..4c104b8e61b937f86469ebb630041c4020eda7f9
@@@ -915,10 -890,11 +915,12 @@@ ZEND_VM_C_LABEL(assign_dim_op_convert_t
                                if (OP2_TYPE == IS_UNUSED) {
                                        zend_throw_error(NULL, "[] operator not supported for strings");
                                } else {
 -                                      zend_check_string_offset(dim, BP_VAR_RW);
 +                                      zend_check_string_offset(dim, BP_VAR_RW EXECUTE_DATA_CC);
-                                       zend_wrong_string_offset(EXECUTE_DATA_C);
+                                       if (EXPECTED(EG(exception) == NULL)) {
 -                                              zend_wrong_string_offset();
++                                              zend_wrong_string_offset(EXECUTE_DATA_C);
+                                       }
                                }
 +                              UNDEF_RESULT();
                        } else if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) {
                                ZEND_VM_C_GOTO(assign_dim_op_convert_to_array);
                        } else {
index 82f8c4ef68744dfa62992b636e95fe64a7403f7e,af3c181552ac040ab9d93170cf599cecbd490ba5..854268108bf3a0dc79fa68f85be21b28c146281a
@@@ -17660,10 -17595,11 +17660,12 @@@ assign_dim_op_convert_to_array
                                if (IS_CONST == IS_UNUSED) {
                                        zend_throw_error(NULL, "[] operator not supported for strings");
                                } else {
 -                                      zend_check_string_offset(dim, BP_VAR_RW);
 +                                      zend_check_string_offset(dim, BP_VAR_RW EXECUTE_DATA_CC);
-                                       zend_wrong_string_offset(EXECUTE_DATA_C);
+                                       if (EXPECTED(EG(exception) == NULL)) {
 -                                              zend_wrong_string_offset();
++                                              zend_wrong_string_offset(EXECUTE_DATA_C);
+                                       }
                                }
 +                              UNDEF_RESULT();
                        } else if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) {
                                goto assign_dim_op_convert_to_array;
                        } else {
@@@ -20684,10 -21015,11 +20686,12 @@@ assign_dim_op_convert_to_array
                                if (IS_UNUSED == IS_UNUSED) {
                                        zend_throw_error(NULL, "[] operator not supported for strings");
                                } else {
 -                                      zend_check_string_offset(dim, BP_VAR_RW);
 +                                      zend_check_string_offset(dim, BP_VAR_RW EXECUTE_DATA_CC);
-                                       zend_wrong_string_offset(EXECUTE_DATA_C);
+                                       if (EXPECTED(EG(exception) == NULL)) {
 -                                              zend_wrong_string_offset();
++                                              zend_wrong_string_offset(EXECUTE_DATA_C);
+                                       }
                                }
 +                              UNDEF_RESULT();
                        } else if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) {
                                goto assign_dim_op_convert_to_array;
                        } else {
@@@ -21998,10 -22388,11 +22002,12 @@@ assign_dim_op_convert_to_array
                                if (IS_CV == IS_UNUSED) {
                                        zend_throw_error(NULL, "[] operator not supported for strings");
                                } else {
 -                                      zend_check_string_offset(dim, BP_VAR_RW);
 +                                      zend_check_string_offset(dim, BP_VAR_RW EXECUTE_DATA_CC);
-                                       zend_wrong_string_offset(EXECUTE_DATA_C);
+                                       if (EXPECTED(EG(exception) == NULL)) {
 -                                              zend_wrong_string_offset();
++                                              zend_wrong_string_offset(EXECUTE_DATA_C);
+                                       }
                                }
 +                              UNDEF_RESULT();
                        } else if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) {
                                goto assign_dim_op_convert_to_array;
                        } else {
@@@ -24604,10 -25335,11 +24610,12 @@@ assign_dim_op_convert_to_array
                                if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) {
                                        zend_throw_error(NULL, "[] operator not supported for strings");
                                } else {
 -                                      zend_check_string_offset(dim, BP_VAR_RW);
 +                                      zend_check_string_offset(dim, BP_VAR_RW EXECUTE_DATA_CC);
-                                       zend_wrong_string_offset(EXECUTE_DATA_C);
+                                       if (EXPECTED(EG(exception) == NULL)) {
 -                                              zend_wrong_string_offset();
++                                              zend_wrong_string_offset(EXECUTE_DATA_C);
+                                       }
                                }
 +                              UNDEF_RESULT();
                        } else if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) {
                                goto assign_dim_op_convert_to_array;
                        } else {
@@@ -35399,10 -37062,11 +35407,12 @@@ assign_dim_op_convert_to_array
                                if (IS_CONST == IS_UNUSED) {
                                        zend_throw_error(NULL, "[] operator not supported for strings");
                                } else {
 -                                      zend_check_string_offset(dim, BP_VAR_RW);
 +                                      zend_check_string_offset(dim, BP_VAR_RW EXECUTE_DATA_CC);
-                                       zend_wrong_string_offset(EXECUTE_DATA_C);
+                                       if (EXPECTED(EG(exception) == NULL)) {
 -                                              zend_wrong_string_offset();
++                                              zend_wrong_string_offset(EXECUTE_DATA_C);
+                                       }
                                }
 +                              UNDEF_RESULT();
                        } else if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) {
                                goto assign_dim_op_convert_to_array;
                        } else {
@@@ -39557,10 -41674,11 +39567,12 @@@ assign_dim_op_convert_to_array
                                if (IS_UNUSED == IS_UNUSED) {
                                        zend_throw_error(NULL, "[] operator not supported for strings");
                                } else {
 -                                      zend_check_string_offset(dim, BP_VAR_RW);
 +                                      zend_check_string_offset(dim, BP_VAR_RW EXECUTE_DATA_CC);
-                                       zend_wrong_string_offset(EXECUTE_DATA_C);
+                                       if (EXPECTED(EG(exception) == NULL)) {
 -                                              zend_wrong_string_offset();
++                                              zend_wrong_string_offset(EXECUTE_DATA_C);
+                                       }
                                }
 +                              UNDEF_RESULT();
                        } else if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) {
                                goto assign_dim_op_convert_to_array;
                        } else {
@@@ -41916,10 -44160,11 +41928,12 @@@ assign_dim_op_convert_to_array
                                if (IS_CV == IS_UNUSED) {
                                        zend_throw_error(NULL, "[] operator not supported for strings");
                                } else {
 -                                      zend_check_string_offset(dim, BP_VAR_RW);
 +                                      zend_check_string_offset(dim, BP_VAR_RW EXECUTE_DATA_CC);
-                                       zend_wrong_string_offset(EXECUTE_DATA_C);
+                                       if (EXPECTED(EG(exception) == NULL)) {
 -                                              zend_wrong_string_offset();
++                                              zend_wrong_string_offset(EXECUTE_DATA_C);
+                                       }
                                }
 +                              UNDEF_RESULT();
                        } else if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) {
                                goto assign_dim_op_convert_to_array;
                        } else {
@@@ -45590,10 -48233,11 +45604,12 @@@ assign_dim_op_convert_to_array
                                if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) {
                                        zend_throw_error(NULL, "[] operator not supported for strings");
                                } else {
 -                                      zend_check_string_offset(dim, BP_VAR_RW);
 +                                      zend_check_string_offset(dim, BP_VAR_RW EXECUTE_DATA_CC);
-                                       zend_wrong_string_offset(EXECUTE_DATA_C);
+                                       if (EXPECTED(EG(exception) == NULL)) {
 -                                              zend_wrong_string_offset();
++                                              zend_wrong_string_offset(EXECUTE_DATA_C);
+                                       }
                                }
 +                              UNDEF_RESULT();
                        } else if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) {
                                goto assign_dim_op_convert_to_array;
                        } else {