com php-src: Avoid run-time checks performed at compile-time.: Zend/zend_vm_def.h Zend/zend_vm_execute.h
| From: | Dmitry Stogov | Date: | Tue, 13 Jun 2017 10:48:58 +0000 |
| Subject: | com php-src: Avoid run-time checks performed at compile-time.: Zend/zend_vm_def.h Zend/zend_vm_execute.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-98071@lists.php.net to get a copy of this message | ||
Commit: 8fe47a47cf30eb3bf50a5cdb4e07f6fa135d21c7
Author: Dmitry Stogov <dmitry@zend.com> Tue, 13 Jun 2017 13:48:58 +0300
Parents: 1385784f54de9b620c82fd881f563b99ccff0956
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8fe47a47cf30eb3bf50a5cdb4e07f6fa135d21c7
Log:
Avoid run-time checks performed at compile-time.
Changed paths:
M Zend/zend_vm_def.h
M Zend/zend_vm_execute.h
Diff:
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index dc00f3c..7b39093 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 b34082a..35bf0d3 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;