From: Dmitry Stogov Date: Tue, 13 Jun 2017 10:48:58 +0000 (+0300) Subject: Avoid run-time checks performed at compile-time. X-Git-Tag: php-7.2.0alpha2~34^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8fe47a47cf30eb3bf50a5cdb4e07f6fa135d21c7;p=php Avoid run-time checks performed at compile-time. --- diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index dc00f3ce12..7b390939bc 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -6520,7 +6520,8 @@ ZEND_VM_C_LABEL(isset_str_offset): ZVAL_DEREF(offset); } if (Z_TYPE_P(offset) < IS_STRING /* simple scalar types */ - || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */ + || (OP2_TYPE != IS_CONST + && Z_TYPE_P(offset) == IS_STRING /* or numeric string */ && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) { lval = zval_get_long(offset); ZEND_VM_C_GOTO(isset_str_offset); diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index b34082a2f7..35bf0d3eae 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -6180,7 +6180,8 @@ isset_str_offset: ZVAL_DEREF(offset); } if (Z_TYPE_P(offset) < IS_STRING /* simple scalar types */ - || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */ + || (IS_CONST != IS_CONST + && Z_TYPE_P(offset) == IS_STRING /* or numeric string */ && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) { lval = zval_get_long(offset); goto isset_str_offset; @@ -10055,7 +10056,8 @@ isset_str_offset: ZVAL_DEREF(offset); } if (Z_TYPE_P(offset) < IS_STRING /* simple scalar types */ - || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */ + || (IS_CV != IS_CONST + && Z_TYPE_P(offset) == IS_STRING /* or numeric string */ && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) { lval = zval_get_long(offset); goto isset_str_offset; @@ -11989,7 +11991,8 @@ isset_str_offset: ZVAL_DEREF(offset); } if (Z_TYPE_P(offset) < IS_STRING /* simple scalar types */ - || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */ + || ((IS_TMP_VAR|IS_VAR) != IS_CONST + && Z_TYPE_P(offset) == IS_STRING /* or numeric string */ && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) { lval = zval_get_long(offset); goto isset_str_offset; @@ -38401,7 +38404,8 @@ isset_str_offset: ZVAL_DEREF(offset); } if (Z_TYPE_P(offset) < IS_STRING /* simple scalar types */ - || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */ + || (IS_CONST != IS_CONST + && Z_TYPE_P(offset) == IS_STRING /* or numeric string */ && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) { lval = zval_get_long(offset); goto isset_str_offset; @@ -44735,7 +44739,8 @@ isset_str_offset: ZVAL_DEREF(offset); } if (Z_TYPE_P(offset) < IS_STRING /* simple scalar types */ - || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */ + || (IS_CV != IS_CONST + && Z_TYPE_P(offset) == IS_STRING /* or numeric string */ && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) { lval = zval_get_long(offset); goto isset_str_offset; @@ -48285,7 +48290,8 @@ isset_str_offset: ZVAL_DEREF(offset); } if (Z_TYPE_P(offset) < IS_STRING /* simple scalar types */ - || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */ + || ((IS_TMP_VAR|IS_VAR) != IS_CONST + && Z_TYPE_P(offset) == IS_STRING /* or numeric string */ && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) { lval = zval_get_long(offset); goto isset_str_offset; @@ -50327,7 +50333,8 @@ isset_str_offset: ZVAL_DEREF(offset); } if (Z_TYPE_P(offset) < IS_STRING /* simple scalar types */ - || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */ + || (IS_CONST != IS_CONST + && Z_TYPE_P(offset) == IS_STRING /* or numeric string */ && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) { lval = zval_get_long(offset); goto isset_str_offset; @@ -52522,7 +52529,8 @@ isset_str_offset: ZVAL_DEREF(offset); } if (Z_TYPE_P(offset) < IS_STRING /* simple scalar types */ - || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */ + || (IS_CV != IS_CONST + && Z_TYPE_P(offset) == IS_STRING /* or numeric string */ && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) { lval = zval_get_long(offset); goto isset_str_offset; @@ -53817,7 +53825,8 @@ isset_str_offset: ZVAL_DEREF(offset); } if (Z_TYPE_P(offset) < IS_STRING /* simple scalar types */ - || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */ + || ((IS_TMP_VAR|IS_VAR) != IS_CONST + && Z_TYPE_P(offset) == IS_STRING /* or numeric string */ && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) { lval = zval_get_long(offset); goto isset_str_offset;