summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2017-06-13 13:48:58 +0300
committerDmitry Stogov <dmitry@zend.com>2017-06-13 13:48:58 +0300
commit8fe47a47cf30eb3bf50a5cdb4e07f6fa135d21c7 (patch)
treefbec7cc54e4473655d3cfe6ada697a2cb3d45599
parent1385784f54de9b620c82fd881f563b99ccff0956 (diff)
downloadphp-git-8fe47a47cf30eb3bf50a5cdb4e07f6fa135d21c7.tar.gz
Avoid run-time checks performed at compile-time.
-rw-r--r--Zend/zend_vm_def.h3
-rw-r--r--Zend/zend_vm_execute.h27
2 files changed, 20 insertions, 10 deletions
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;