mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Add ZEND_TRY_ASSIGN_BOOL API
Cherry-picked from master, this is of course also necessary in 7.4...
This commit is contained in:
parent
7a6fa7f624
commit
a9d4caeece
1 changed files with 14 additions and 0 deletions
|
@ -716,6 +716,20 @@ ZEND_API int zend_try_assign_typed_ref_zval_ex(zend_reference *ref, zval *zv, ze
|
|||
ZVAL_TRUE(_zv); \
|
||||
} while (0)
|
||||
|
||||
#define ZEND_TRY_ASSIGN_BOOL(zv, bval) do { \
|
||||
zval *_zv = zv; \
|
||||
if (EXPECTED(Z_ISREF_P(_zv))) { \
|
||||
zend_reference *ref = Z_REF_P(_zv); \
|
||||
if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { \
|
||||
zend_try_assign_typed_ref_bool(ref, 1); \
|
||||
break; \
|
||||
} \
|
||||
_zv = &ref->val; \
|
||||
} \
|
||||
zval_ptr_dtor(_zv); \
|
||||
ZVAL_BOOL(_zv, bval); \
|
||||
} while (0)
|
||||
|
||||
#define ZEND_TRY_ASSIGN_LONG(zv, lval) do { \
|
||||
zval *_zv = zv; \
|
||||
if (EXPECTED(Z_ISREF_P(_zv))) { \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue