com php-src: Avoid duplicate "non well-formed" warning: Zend/zend_execute.c
| From: | Nikita Popov | Date: | Mon, 26 Aug 2019 11:16:02 +0000 |
| Subject: | com php-src: Avoid duplicate "non well-formed" warning: Zend/zend_execute.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-108057@lists.php.net to get a copy of this message | ||
Commit: 0038db22510cce37b24491c266123ba5b1e93953
Author: Nikita Popov <nikita.ppv@gmail.com> Mon, 26 Aug 2019 13:14:53 +0200
Parents: d5f42d68c89497834649fce36d9dd65fb6598c35
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=0038db22510cce37b24491c266123ba5b1e93953
Log:
Avoid duplicate "non well-formed" warning
The arginfo checking code for internal functions should not generate
this warning, as it will be thrown by zpp.
Changed paths:
M Zend/zend_execute.c
Diff:
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index 52ba9ee..5151dfc 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -865,10 +865,27 @@ static zend_bool zend_verify_weak_scalar_type_hint_no_sideeffect(zend_uchar
type
}
case IS_LONG: {
zend_long dest;
+ if (Z_TYPE_P(arg) == IS_STRING) {
+ /* Handle this case separately to avoid the "non well-formed" warning */
+ double dval;
+ zend_uchar type = is_numeric_string(Z_STRVAL_P(arg), Z_STRLEN_P(arg), NULL, &dval, 1);
+ if (type == IS_LONG) {
+ return 1;
+ }
+ if (type == IS_DOUBLE) {
+ return !zend_isnan(dval) && ZEND_DOUBLE_FITS_LONG(dval);
+
+ }
+ return 0;
+ }
return zend_parse_arg_long_weak(arg, &dest);
}
case IS_DOUBLE: {
double dest;
+ if (Z_TYPE_P(arg) == IS_STRING) {
+ /* Handle this case separately to avoid the "non well-formed" warning */
+ return is_numeric_string(Z_STRVAL_P(arg), Z_STRLEN_P(arg), NULL, NULL, 1) != 0;
+ }
return zend_parse_arg_double_weak(arg, &dest);
}
case IS_STRING: