diff options
Diffstat (limited to 'Zend/zend_vm_execute.h')
-rw-r--r-- | Zend/zend_vm_execute.h | 327 |
1 files changed, 222 insertions, 105 deletions
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 9c98ffe167..348fd3a6b7 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -9010,16 +9010,25 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_CONST(int prop_dim, } else { result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); } - } else if ((*container)->type == IS_STRING) { /* string offsets */ - zval tmp_offset; - - if (!prop_dim) { - if (Z_TYPE_P(offset) != IS_LONG) { - tmp_offset = *offset; - zval_copy_ctor(&tmp_offset); - convert_to_long(&tmp_offset); - offset = &tmp_offset; + } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */ + zval tmp; + + if (Z_TYPE_P(offset) == IS_STRING) { + char *strval; + long lval; + + strval = Z_STRVAL_P(offset); + if (is_numeric_string(strval, Z_STRLEN_P(offset), &lval, NULL, 0) == IS_LONG) { + ZVAL_LONG(&tmp, lval); + offset = &tmp; } + } else if (offset->type != IS_LONG) { + tmp = *offset; + zval_copy_ctor(&tmp); + convert_to_long(&tmp); + offset = &tmp; + } + if (offset->type == IS_LONG) { switch (opline->extended_value) { case ZEND_ISSET: if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) { @@ -10325,16 +10334,25 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_TMP(int prop_dim, ZE } else { result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); } - } else if ((*container)->type == IS_STRING) { /* string offsets */ - zval tmp_offset; + } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */ + zval tmp; + + if (Z_TYPE_P(offset) == IS_STRING) { + char *strval; + long lval; - if (!prop_dim) { - if (Z_TYPE_P(offset) != IS_LONG) { - tmp_offset = *offset; - zval_copy_ctor(&tmp_offset); - convert_to_long(&tmp_offset); - offset = &tmp_offset; + strval = Z_STRVAL_P(offset); + if (is_numeric_string(strval, Z_STRLEN_P(offset), &lval, NULL, 0) == IS_LONG) { + ZVAL_LONG(&tmp, lval); + offset = &tmp; } + } else if (offset->type != IS_LONG) { + tmp = *offset; + zval_copy_ctor(&tmp); + convert_to_long(&tmp); + offset = &tmp; + } + if (offset->type == IS_LONG) { switch (opline->extended_value) { case ZEND_ISSET: if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) { @@ -11661,16 +11679,25 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_VAR(int prop_dim, ZE } else { result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); } - } else if ((*container)->type == IS_STRING) { /* string offsets */ - zval tmp_offset; + } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */ + zval tmp; - if (!prop_dim) { - if (Z_TYPE_P(offset) != IS_LONG) { - tmp_offset = *offset; - zval_copy_ctor(&tmp_offset); - convert_to_long(&tmp_offset); - offset = &tmp_offset; + if (Z_TYPE_P(offset) == IS_STRING) { + char *strval; + long lval; + + strval = Z_STRVAL_P(offset); + if (is_numeric_string(strval, Z_STRLEN_P(offset), &lval, NULL, 0) == IS_LONG) { + ZVAL_LONG(&tmp, lval); + offset = &tmp; } + } else if (offset->type != IS_LONG) { + tmp = *offset; + zval_copy_ctor(&tmp); + convert_to_long(&tmp); + offset = &tmp; + } + if (offset->type == IS_LONG) { switch (opline->extended_value) { case ZEND_ISSET: if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) { @@ -13127,16 +13154,25 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_CV(int prop_dim, ZEN } else { result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); } - } else if ((*container)->type == IS_STRING) { /* string offsets */ - zval tmp_offset; + } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */ + zval tmp; + + if (Z_TYPE_P(offset) == IS_STRING) { + char *strval; + long lval; - if (!prop_dim) { - if (Z_TYPE_P(offset) != IS_LONG) { - tmp_offset = *offset; - zval_copy_ctor(&tmp_offset); - convert_to_long(&tmp_offset); - offset = &tmp_offset; + strval = Z_STRVAL_P(offset); + if (is_numeric_string(strval, Z_STRLEN_P(offset), &lval, NULL, 0) == IS_LONG) { + ZVAL_LONG(&tmp, lval); + offset = &tmp; } + } else if (offset->type != IS_LONG) { + tmp = *offset; + zval_copy_ctor(&tmp); + convert_to_long(&tmp); + offset = &tmp; + } + if (offset->type == IS_LONG) { switch (opline->extended_value) { case ZEND_ISSET: if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) { @@ -14193,16 +14229,25 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_CONST(int prop_di } else { result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); } - } else if ((*container)->type == IS_STRING) { /* string offsets */ - zval tmp_offset; + } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */ + zval tmp; - if (!prop_dim) { - if (Z_TYPE_P(offset) != IS_LONG) { - tmp_offset = *offset; - zval_copy_ctor(&tmp_offset); - convert_to_long(&tmp_offset); - offset = &tmp_offset; + if (Z_TYPE_P(offset) == IS_STRING) { + char *strval; + long lval; + + strval = Z_STRVAL_P(offset); + if (is_numeric_string(strval, Z_STRLEN_P(offset), &lval, NULL, 0) == IS_LONG) { + ZVAL_LONG(&tmp, lval); + offset = &tmp; } + } else if (offset->type != IS_LONG) { + tmp = *offset; + zval_copy_ctor(&tmp); + convert_to_long(&tmp); + offset = &tmp; + } + if (offset->type == IS_LONG) { switch (opline->extended_value) { case ZEND_ISSET: if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) { @@ -15142,16 +15187,25 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_TMP(int prop_dim, } else { result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); } - } else if ((*container)->type == IS_STRING) { /* string offsets */ - zval tmp_offset; + } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */ + zval tmp; + + if (Z_TYPE_P(offset) == IS_STRING) { + char *strval; + long lval; - if (!prop_dim) { - if (Z_TYPE_P(offset) != IS_LONG) { - tmp_offset = *offset; - zval_copy_ctor(&tmp_offset); - convert_to_long(&tmp_offset); - offset = &tmp_offset; + strval = Z_STRVAL_P(offset); + if (is_numeric_string(strval, Z_STRLEN_P(offset), &lval, NULL, 0) == IS_LONG) { + ZVAL_LONG(&tmp, lval); + offset = &tmp; } + } else if (offset->type != IS_LONG) { + tmp = *offset; + zval_copy_ctor(&tmp); + convert_to_long(&tmp); + offset = &tmp; + } + if (offset->type == IS_LONG) { switch (opline->extended_value) { case ZEND_ISSET: if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) { @@ -16091,16 +16145,25 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_VAR(int prop_dim, } else { result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); } - } else if ((*container)->type == IS_STRING) { /* string offsets */ - zval tmp_offset; + } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */ + zval tmp; - if (!prop_dim) { - if (Z_TYPE_P(offset) != IS_LONG) { - tmp_offset = *offset; - zval_copy_ctor(&tmp_offset); - convert_to_long(&tmp_offset); - offset = &tmp_offset; + if (Z_TYPE_P(offset) == IS_STRING) { + char *strval; + long lval; + + strval = Z_STRVAL_P(offset); + if (is_numeric_string(strval, Z_STRLEN_P(offset), &lval, NULL, 0) == IS_LONG) { + ZVAL_LONG(&tmp, lval); + offset = &tmp; } + } else if (offset->type != IS_LONG) { + tmp = *offset; + zval_copy_ctor(&tmp); + convert_to_long(&tmp); + offset = &tmp; + } + if (offset->type == IS_LONG) { switch (opline->extended_value) { case ZEND_ISSET: if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) { @@ -17159,16 +17222,25 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_CV(int prop_dim, } else { result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); } - } else if ((*container)->type == IS_STRING) { /* string offsets */ - zval tmp_offset; + } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */ + zval tmp; - if (!prop_dim) { - if (Z_TYPE_P(offset) != IS_LONG) { - tmp_offset = *offset; - zval_copy_ctor(&tmp_offset); - convert_to_long(&tmp_offset); - offset = &tmp_offset; + if (Z_TYPE_P(offset) == IS_STRING) { + char *strval; + long lval; + + strval = Z_STRVAL_P(offset); + if (is_numeric_string(strval, Z_STRLEN_P(offset), &lval, NULL, 0) == IS_LONG) { + ZVAL_LONG(&tmp, lval); + offset = &tmp; } + } else if (offset->type != IS_LONG) { + tmp = *offset; + zval_copy_ctor(&tmp); + convert_to_long(&tmp); + offset = &tmp; + } + if (offset->type == IS_LONG) { switch (opline->extended_value) { case ZEND_ISSET: if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) { @@ -19644,16 +19716,25 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_CONST(int prop_dim, Z } else { result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); } - } else if ((*container)->type == IS_STRING) { /* string offsets */ - zval tmp_offset; + } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */ + zval tmp; + + if (Z_TYPE_P(offset) == IS_STRING) { + char *strval; + long lval; - if (!prop_dim) { - if (Z_TYPE_P(offset) != IS_LONG) { - tmp_offset = *offset; - zval_copy_ctor(&tmp_offset); - convert_to_long(&tmp_offset); - offset = &tmp_offset; + strval = Z_STRVAL_P(offset); + if (is_numeric_string(strval, Z_STRLEN_P(offset), &lval, NULL, 0) == IS_LONG) { + ZVAL_LONG(&tmp, lval); + offset = &tmp; } + } else if (offset->type != IS_LONG) { + tmp = *offset; + zval_copy_ctor(&tmp); + convert_to_long(&tmp); + offset = &tmp; + } + if (offset->type == IS_LONG) { switch (opline->extended_value) { case ZEND_ISSET: if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) { @@ -20959,16 +21040,25 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_TMP(int prop_dim, ZEN } else { result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); } - } else if ((*container)->type == IS_STRING) { /* string offsets */ - zval tmp_offset; + } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */ + zval tmp; - if (!prop_dim) { - if (Z_TYPE_P(offset) != IS_LONG) { - tmp_offset = *offset; - zval_copy_ctor(&tmp_offset); - convert_to_long(&tmp_offset); - offset = &tmp_offset; + if (Z_TYPE_P(offset) == IS_STRING) { + char *strval; + long lval; + + strval = Z_STRVAL_P(offset); + if (is_numeric_string(strval, Z_STRLEN_P(offset), &lval, NULL, 0) == IS_LONG) { + ZVAL_LONG(&tmp, lval); + offset = &tmp; } + } else if (offset->type != IS_LONG) { + tmp = *offset; + zval_copy_ctor(&tmp); + convert_to_long(&tmp); + offset = &tmp; + } + if (offset->type == IS_LONG) { switch (opline->extended_value) { case ZEND_ISSET: if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) { @@ -22295,16 +22385,25 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_VAR(int prop_dim, ZEN } else { result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); } - } else if ((*container)->type == IS_STRING) { /* string offsets */ - zval tmp_offset; + } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */ + zval tmp; + + if (Z_TYPE_P(offset) == IS_STRING) { + char *strval; + long lval; - if (!prop_dim) { - if (Z_TYPE_P(offset) != IS_LONG) { - tmp_offset = *offset; - zval_copy_ctor(&tmp_offset); - convert_to_long(&tmp_offset); - offset = &tmp_offset; + strval = Z_STRVAL_P(offset); + if (is_numeric_string(strval, Z_STRLEN_P(offset), &lval, NULL, 0) == IS_LONG) { + ZVAL_LONG(&tmp, lval); + offset = &tmp; } + } else if (offset->type != IS_LONG) { + tmp = *offset; + zval_copy_ctor(&tmp); + convert_to_long(&tmp); + offset = &tmp; + } + if (offset->type == IS_LONG) { switch (opline->extended_value) { case ZEND_ISSET: if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) { @@ -23761,16 +23860,25 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_CV(int prop_dim, ZEND } else { result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); } - } else if ((*container)->type == IS_STRING) { /* string offsets */ - zval tmp_offset; + } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */ + zval tmp; - if (!prop_dim) { - if (Z_TYPE_P(offset) != IS_LONG) { - tmp_offset = *offset; - zval_copy_ctor(&tmp_offset); - convert_to_long(&tmp_offset); - offset = &tmp_offset; + if (Z_TYPE_P(offset) == IS_STRING) { + char *strval; + long lval; + + strval = Z_STRVAL_P(offset); + if (is_numeric_string(strval, Z_STRLEN_P(offset), &lval, NULL, 0) == IS_LONG) { + ZVAL_LONG(&tmp, lval); + offset = &tmp; } + } else if (offset->type != IS_LONG) { + tmp = *offset; + zval_copy_ctor(&tmp); + convert_to_long(&tmp); + offset = &tmp; + } + if (offset->type == IS_LONG) { switch (opline->extended_value) { case ZEND_ISSET: if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) { @@ -30827,16 +30935,25 @@ static int zend_isset_isempty_dim_prop_obj_handler(int prop_dim, ZEND_OPCODE_HAN } else { result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); } - } else if ((*container)->type == IS_STRING) { /* string offsets */ - zval tmp_offset; + } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */ + zval tmp; + + if (Z_TYPE_P(offset) == IS_STRING) { + char *strval; + long lval; - if (!prop_dim) { - if (Z_TYPE_P(offset) != IS_LONG) { - tmp_offset = *offset; - zval_copy_ctor(&tmp_offset); - convert_to_long(&tmp_offset); - offset = &tmp_offset; + strval = Z_STRVAL_P(offset); + if (is_numeric_string(strval, Z_STRLEN_P(offset), &lval, NULL, 0) == IS_LONG) { + ZVAL_LONG(&tmp, lval); + offset = &tmp; } + } else if (offset->type != IS_LONG) { + tmp = *offset; + zval_copy_ctor(&tmp); + convert_to_long(&tmp); + offset = &tmp; + } + if (offset->type == IS_LONG) { switch (opline->extended_value) { case ZEND_ISSET: if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) { |