@@ -624,44 +624,46 @@ ZEND_API bool ZEND_FASTCALL zend_flf_parse_arg_long_slow(const zval *arg, zend_l
624624 return zend_parse_arg_long_weak (arg , dest , arg_num );
625625}
626626
627- ZEND_API bool ZEND_FASTCALL zend_parse_arg_double_weak (const zval * arg , double * dest , uint32_t arg_num ) /* {{{ */
627+ ZEND_API double ZEND_FASTCALL zend_parse_arg_double_weak (const zval * arg , uint32_t arg_num ) /* {{{ */
628628{
629629 if (EXPECTED (Z_TYPE_P (arg ) == IS_LONG )) {
630- * dest = ( double ) Z_LVAL_P (arg );
630+ return Z_LVAL_P (arg );
631631 } else if (EXPECTED (Z_TYPE_P (arg ) == IS_STRING )) {
632632 zend_long l ;
633+ double dval ;
633634 uint8_t type ;
634635
635- if (UNEXPECTED ((type = is_numeric_str_function (Z_STR_P (arg ), & l , dest )) != IS_DOUBLE )) {
636+ if (UNEXPECTED ((type = is_numeric_str_function (Z_STR_P (arg ), & l , & dval )) != IS_DOUBLE )) {
636637 if (EXPECTED (type != 0 )) {
637- * dest = (double )(l );
638+ return (double )(l );
638639 } else {
639- return 0 ;
640+ return NAN ;
640641 }
642+ } else {
643+ return dval ;
641644 }
642645 } else if (EXPECTED (Z_TYPE_P (arg ) < IS_TRUE )) {
643646 if (UNEXPECTED (Z_TYPE_P (arg ) == IS_NULL ) && !zend_null_arg_deprecated ("float" , arg_num )) {
644- return 0 ;
647+ return NAN ;
645648 }
646- * dest = 0.0 ;
649+ return 0.0 ;
647650 } else if (EXPECTED (Z_TYPE_P (arg ) == IS_TRUE )) {
648- * dest = 1.0 ;
651+ return 1.0 ;
649652 } else {
650- return 0 ;
653+ return NAN ;
651654 }
652- return 1 ;
653655}
654656/* }}} */
655657
656- ZEND_API bool ZEND_FASTCALL zend_parse_arg_double_slow (const zval * arg , double * dest , uint32_t arg_num ) /* {{{ */
658+ ZEND_API double ZEND_FASTCALL zend_parse_arg_double_slow (const zval * arg , uint32_t arg_num ) /* {{{ */
657659{
658660 if (EXPECTED (Z_TYPE_P (arg ) == IS_LONG )) {
659661 /* SSTH Exception: IS_LONG may be accepted instead as IS_DOUBLE */
660- * dest = (double )Z_LVAL_P (arg );
662+ return (double )Z_LVAL_P (arg );
661663 } else if (UNEXPECTED (ZEND_ARG_USES_STRICT_TYPES ())) {
662- return 0 ;
664+ return NAN ;
663665 }
664- return zend_parse_arg_double_weak (arg , dest , arg_num );
666+ return zend_parse_arg_double_weak (arg , arg_num );
665667}
666668/* }}} */
667669
0 commit comments