Skip to content

Commit

Permalink
resolve last errors / inconsistencies in ZTS mode
Browse files Browse the repository at this point in the history
  • Loading branch information
krakjoe committed Sep 25, 2013
1 parent ad66245 commit d9a1752
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
10 changes: 6 additions & 4 deletions Zend/zend_compile.c
Expand Up @@ -2235,14 +2235,16 @@ void zend_do_create_anon_class(znode *result TSRMLS_DC) { /* {{{ */

Z_TYPE(result->u.constant) = IS_STRING;
class_name_len = snprintf(
NULL, 0, "Class$$%lu", CG(anon_class_id))+1;
class_name = (char*) safe_emalloc(class_name_len+1, 1, 1);
NULL, 0, "Class$$%lu", CG(anon_class_id));
class_name = (char*) emalloc(class_name_len+1);
snprintf(
class_name, class_name_len,
class_name, class_name_len+1,
"Class$$%lu", CG(anon_class_id)
);
Z_STRLEN(result->u.constant) = class_name_len;
class_name[class_name_len] = '\0';

Z_STRLEN(result->u.constant) = class_name_len;

#ifndef ZTS
Z_STRVAL(result->u.constant) = (char*) zend_new_interned_string(
class_name, class_name_len+1, 0 TSRMLS_CC);
Expand Down
8 changes: 7 additions & 1 deletion Zend/zend_opcode.c
Expand Up @@ -296,7 +296,13 @@ ZEND_API void destroy_zend_class(zend_class_entry **pce)
efree(ce->default_static_members_table);
}
zend_hash_destroy(&ce->properties_info);
str_efree(ce->name);
#ifdef ZTS
if (!(ce->ce_flags & ZEND_ACC_ANON_CLASS)) {
str_efree(ce->name);
}
#else
str_efree(ce->name);
#endif
zend_hash_destroy(&ce->function_table);
zend_hash_destroy(&ce->constants_table);
if (ce->num_interfaces > 0 && ce->interfaces) {
Expand Down

0 comments on commit d9a1752

Please sign in to comment.