com php-src: Add the Z_PARAM_PATH_OR_NULL() and Z_PARAM_ZVAL_OR_NULL() macros: Zend/zend _API.h ext/pdo/pdo_stmt.c

From: Date: Fri, 24 Jul 2020 08:37:35 +0000
Subject: com php-src: Add the Z_PARAM_PATH_OR_NULL() and Z_PARAM_ZVAL_OR_NULL() macros: Zend/zend _API.h ext/pdo/pdo_stmt.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-112355@lists.php.net to get a copy of this message
Commit: 70a3a909cd47c3ba6168b4e6f7f0f9b84422fa3e Author: Máté Kocsis <kocsismate@woohoolabs.com> Fri, 24 Jul 2020 10:06:45 +0200 Parents: 0a5b7c81b705869618755ed2d559702be6f9d6e4 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=70a3a909cd47c3ba6168b4e6f7f0f9b84422fa3e Log: Add the Z_PARAM_PATH_OR_NULL() and Z_PARAM_ZVAL_OR_NULL() macros Changed paths: M Zend/zend_API.h M ext/pdo/pdo_stmt.c Diff: diff --git a/Zend/zend_API.h b/Zend/zend_API.h index b9eecd3e26..6cfd903dc8 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -1601,6 +1601,9 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_argument_value_error(uint32_t arg_num #define Z_PARAM_PATH(dest, dest_len) \ Z_PARAM_PATH_EX(dest, dest_len, 0, 0) +#define Z_PARAM_PATH_OR_NULL(dest, dest_len) \ + Z_PARAM_PATH_EX(dest, dest_len, 1, 0) + /* old "P" */ #define Z_PARAM_PATH_STR_EX2(dest, check_null, deref, separate) \ Z_PARAM_PROLOGUE(deref, separate); \ @@ -1681,6 +1684,9 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_argument_value_error(uint32_t arg_num #define Z_PARAM_ZVAL(dest) \ Z_PARAM_ZVAL_EX(dest, 0, 0) +#define Z_PARAM_ZVAL_OR_NULL(dest) \ + Z_PARAM_ZVAL_EX(dest, 1, 0) + /* old "+" and "*" */ #define Z_PARAM_VARIADIC_EX(spec, dest, dest_num, post_varargs) do { \ uint32_t _num_varargs = _num_args - _i - (post_varargs); \ diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index 74256671b2..6bb7ca7322 100644 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -1595,7 +1595,7 @@ PHP_METHOD(PDOStatement, setAttribute) ZEND_PARSE_PARAMETERS_START(2, 2) Z_PARAM_LONG(attr) - Z_PARAM_ZVAL_EX(value, 1, 0) + Z_PARAM_ZVAL_OR_NULL(value) ZEND_PARSE_PARAMETERS_END(); PHP_STMT_GET_OBJ;

« previous php.cvs (#112355) next »