Skip to content

Commit

Permalink
Properly update string type flags
Browse files Browse the repository at this point in the history
  • Loading branch information
dstogov committed Sep 12, 2017
1 parent 7674b5e commit 99b1a62
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Zend/zend_variables.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,13 @@ ZEND_API void ZEND_FASTCALL _zval_copy_ctor_func(zval *zvalue ZEND_FILE_LINE_DC)
{
if (EXPECTED(Z_TYPE_P(zvalue) == IS_ARRAY)) {
ZVAL_ARR(zvalue, zend_array_dup(Z_ARRVAL_P(zvalue)));
} else if (EXPECTED(Z_TYPE_P(zvalue) == IS_STRING)) {
CHECK_ZVAL_STRING_REL(Z_STR_P(zvalue));
ZVAL_NEW_STR(zvalue, zend_string_dup(Z_STR_P(zvalue), 0));
} else if (EXPECTED(Z_TYPE_P(zvalue) == IS_CONSTANT)) {
CHECK_ZVAL_STRING_REL(Z_STR_P(zvalue));
Z_STR_P(zvalue) = zend_string_dup(Z_STR_P(zvalue), 0);
Z_TYPE_INFO_P(zvalue) = IS_CONSTANT_EX;
} else if (EXPECTED(Z_TYPE_P(zvalue) == IS_STRING) ||
EXPECTED(Z_TYPE_P(zvalue) == IS_CONSTANT)) {
CHECK_ZVAL_STRING_REL(Z_STR_P(zvalue));
Expand Down

0 comments on commit 99b1a62

Please sign in to comment.