Skip to content

Commit 1c3d93a

Browse files
Actually fix constant attribute copying
Wasn't triggered before so I didn't realize, zend_array_dup() is wrong
1 parent d27dac1 commit 1c3d93a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Zend/zend_constants.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ void free_zend_constant(zval *zv)
5252
}
5353
if (c->attributes) {
5454
zend_hash_release(c->attributes);
55-
c->attributes = NULL;
5655
}
5756
efree(c);
5857
} else {
@@ -65,7 +64,6 @@ void free_zend_constant(zval *zv)
6564
}
6665
if (c->attributes) {
6766
zend_hash_release(c->attributes);
68-
c->attributes = NULL;
6967
}
7068
free(c);
7169
}
@@ -87,7 +85,8 @@ static void copy_zend_constant(zval *zv)
8785
c->filename = zend_string_copy(c->filename);
8886
}
8987
if (c->attributes != NULL) {
90-
c->attributes = zend_array_dup(c->attributes);
88+
// Use the same attributes table
89+
GC_ADDREF(c->attributes);
9190
}
9291
if (Z_TYPE(c->value) == IS_STRING) {
9392
Z_STR(c->value) = zend_string_dup(Z_STR(c->value), 1);

0 commit comments

Comments
 (0)