Skip to content

Commit 96b1c21

Browse files
committed
Provide more macros for handling of interned strings
* str_erealloc behaves like erealloc for normal strings, but will use emalloc+memcpy for interned strings. * str_estrndup behaves like estrndup for normal strings, but will not copy interned strings. * str_strndup behaves like zend_strndup for normal strings, but will not copy interned strings. * str_efree_rel behaves like efree_rel for normal strings, but will not free interned strings. * str_hash will return INTERNED_HASH for interned strings and compute it using zend_hash_func for normal strings.
1 parent d2950ac commit 96b1c21

14 files changed

+511
-773
lines changed

Zend/zend.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -670,8 +670,8 @@ END_EXTERN_C()
670670

671671
/* FIXME: Check if we can save if (ptr) too */
672672

673-
#define STR_FREE(ptr) if (ptr && !IS_INTERNED(ptr)) { efree(ptr); }
674-
#define STR_FREE_REL(ptr) if (ptr && !IS_INTERNED(ptr)) { efree_rel(ptr); }
673+
#define STR_FREE(ptr) if (ptr) { str_efree(ptr); }
674+
#define STR_FREE_REL(ptr) if (ptr) { str_efree_rel(ptr); }
675675

676676
#define STR_EMPTY_ALLOC() estrndup("", sizeof("")-1)
677677

Zend/zend_API.c

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2029,14 +2029,15 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
20292029
const zend_function_entry *ptr = functions;
20302030
zend_function function, *reg_function;
20312031
zend_internal_function *internal_function = (zend_internal_function *)&function;
2032-
int count=0, unload=0, result=0;
2032+
int count=0, unload=0;
20332033
HashTable *target_function_table = function_table;
20342034
int error_type;
20352035
zend_function *ctor = NULL, *dtor = NULL, *clone = NULL, *__get = NULL, *__set = NULL, *__unset = NULL, *__isset = NULL, *__call = NULL, *__callstatic = NULL, *__tostring = NULL;
20362036
const char *lowercase_name;
20372037
int fname_len;
20382038
const char *lc_class_name = NULL;
20392039
int class_name_len = 0;
2040+
zend_ulong hash;
20402041

20412042
if (type==MODULE_PERSISTENT) {
20422043
error_type = E_CORE_WARNING;
@@ -2135,12 +2136,8 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
21352136
}
21362137
fname_len = strlen(ptr->fname);
21372138
lowercase_name = zend_new_interned_string(zend_str_tolower_dup(ptr->fname, fname_len), fname_len + 1, 1 TSRMLS_CC);
2138-
if (IS_INTERNED(lowercase_name)) {
2139-
result = zend_hash_quick_add(target_function_table, lowercase_name, fname_len+1, INTERNED_HASH(lowercase_name), &function, sizeof(zend_function), (void**)&reg_function);
2140-
} else {
2141-
result = zend_hash_add(target_function_table, lowercase_name, fname_len+1, &function, sizeof(zend_function), (void**)&reg_function);
2142-
}
2143-
if (result == FAILURE) {
2139+
hash = str_hash(lowercase_name, fname_len);
2140+
if (zend_hash_quick_add(target_function_table, lowercase_name, fname_len+1, hash, &function, sizeof(zend_function), (void**)&reg_function) == FAILURE) {
21442141
unload=1;
21452142
str_efree(lowercase_name);
21462143
break;
@@ -2493,6 +2490,7 @@ static zend_class_entry *do_register_internal_class(zend_class_entry *orig_class
24932490
{
24942491
zend_class_entry *class_entry = malloc(sizeof(zend_class_entry));
24952492
char *lowercase_name = emalloc(orig_class_entry->name_length + 1);
2493+
zend_ulong hash;
24962494
*class_entry = *orig_class_entry;
24972495

24982496
class_entry->type = ZEND_INTERNAL_CLASS;
@@ -2506,11 +2504,8 @@ static zend_class_entry *do_register_internal_class(zend_class_entry *orig_class
25062504

25072505
zend_str_tolower_copy(lowercase_name, orig_class_entry->name, class_entry->name_length);
25082506
lowercase_name = (char*)zend_new_interned_string(lowercase_name, class_entry->name_length + 1, 1 TSRMLS_CC);
2509-
if (IS_INTERNED(lowercase_name)) {
2510-
zend_hash_quick_update(CG(class_table), lowercase_name, class_entry->name_length+1, INTERNED_HASH(lowercase_name), &class_entry, sizeof(zend_class_entry *), NULL);
2511-
} else {
2512-
zend_hash_update(CG(class_table), lowercase_name, class_entry->name_length+1, &class_entry, sizeof(zend_class_entry *), NULL);
2513-
}
2507+
hash = str_hash(lowercase_name, class_entry->name_length);
2508+
zend_hash_quick_update(CG(class_table), lowercase_name, class_entry->name_length+1, hash, &class_entry, sizeof(zend_class_entry *), NULL);
25142509
str_efree(lowercase_name);
25152510
return class_entry;
25162511
}

Zend/zend_builtin_functions.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ ZEND_FUNCTION(define)
706706
zval_ptr_dtor(&val_free);
707707
}
708708
c.flags = case_sensitive; /* non persistent */
709-
c.name = IS_INTERNED(name) ? name : zend_strndup(name, name_len);
709+
c.name = str_strndup(name, name_len);
710710
if(c.name == NULL) {
711711
RETURN_FALSE;
712712
}

Zend/zend_compile.c

Lines changed: 20 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,8 @@
6161
} while (0)
6262

6363
#define CALCULATE_LITERAL_HASH(num) do { \
64-
if (IS_INTERNED(Z_STRVAL(CONSTANT(num)))) { \
65-
Z_HASH_P(&CONSTANT(num)) = INTERNED_HASH(Z_STRVAL(CONSTANT(num))); \
66-
} else { \
67-
Z_HASH_P(&CONSTANT(num)) = zend_hash_func(Z_STRVAL(CONSTANT(num)), Z_STRLEN(CONSTANT(num))+1); \
68-
} \
64+
zval *c = &CONSTANT(num); \
65+
Z_HASH_P(c) = str_hash(Z_STRVAL_P(c), Z_STRLEN_P(c)); \
6966
} while (0)
7067

7168
#define GET_CACHE_SLOT(literal) do { \
@@ -107,9 +104,7 @@ ZEND_API zend_executor_globals executor_globals;
107104

108105
static void zend_duplicate_property_info(zend_property_info *property_info) /* {{{ */
109106
{
110-
if (!IS_INTERNED(property_info->name)) {
111-
property_info->name = estrndup(property_info->name, property_info->name_length);
112-
}
107+
property_info->name = str_estrndup(property_info->name, property_info->name_length);
113108
if (property_info->doc_comment) {
114109
property_info->doc_comment = estrndup(property_info->doc_comment, property_info->doc_comment_len);
115110
}
@@ -118,9 +113,7 @@ static void zend_duplicate_property_info(zend_property_info *property_info) /* {
118113

119114
static void zend_duplicate_property_info_internal(zend_property_info *property_info) /* {{{ */
120115
{
121-
if (!IS_INTERNED(property_info->name)) {
122-
property_info->name = zend_strndup(property_info->name, property_info->name_length);
123-
}
116+
property_info->name = str_strndup(property_info->name, property_info->name_length);
124117
}
125118
/* }}} */
126119

@@ -657,13 +650,13 @@ void fetch_simple_variable_ex(znode *result, znode *varname, int bp, zend_uchar
657650
zend_llist *fetch_list_ptr;
658651

659652
if (varname->op_type == IS_CONST) {
660-
ulong hash = 0;
653+
ulong hash;
661654

662655
if (Z_TYPE(varname->u.constant) != IS_STRING) {
663656
convert_to_string(&varname->u.constant);
664-
} else if (IS_INTERNED(Z_STRVAL(varname->u.constant))) {
665-
hash = INTERNED_HASH(Z_STRVAL(varname->u.constant));
666657
}
658+
659+
hash = str_hash(Z_STRVAL(varname->u.constant), Z_STRLEN(varname->u.constant));
667660
if (!zend_is_auto_global_quick(Z_STRVAL(varname->u.constant), Z_STRLEN(varname->u.constant), hash TSRMLS_CC) &&
668661
!(Z_STRLEN(varname->u.constant) == (sizeof("this")-1) &&
669662
!memcmp(Z_STRVAL(varname->u.constant), "this", sizeof("this"))) &&
@@ -1568,16 +1561,11 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
15681561
op_array.line_start = zend_get_compiled_lineno(TSRMLS_C);
15691562

15701563
if (is_method) {
1571-
int result;
1564+
zend_ulong hash;
15721565

15731566
lcname = zend_new_interned_string(zend_str_tolower_dup(name, name_len), name_len + 1, 1 TSRMLS_CC);
1574-
1575-
if (IS_INTERNED(lcname)) {
1576-
result = zend_hash_quick_add(&CG(active_class_entry)->function_table, lcname, name_len+1, INTERNED_HASH(lcname), &op_array, sizeof(zend_op_array), (void **) &CG(active_op_array));
1577-
} else {
1578-
result = zend_hash_add(&CG(active_class_entry)->function_table, lcname, name_len+1, &op_array, sizeof(zend_op_array), (void **) &CG(active_op_array));
1579-
}
1580-
if (result == FAILURE) {
1567+
hash = str_hash(lcname, name_len);
1568+
if (zend_hash_quick_add(&CG(active_class_entry)->function_table, lcname, name_len+1, hash, &op_array, sizeof(zend_op_array), (void **) &CG(active_op_array)) == FAILURE) {
15811569
zend_error(E_COMPILE_ERROR, "Cannot redeclare %s::%s()", CG(active_class_entry)->name, name);
15821570
}
15831571

@@ -1840,7 +1828,7 @@ void zend_do_receive_arg(zend_uchar op, znode *varname, const znode *offset, con
18401828
zend_arg_info *cur_arg_info;
18411829
znode var;
18421830

1843-
if (zend_is_auto_global_quick(Z_STRVAL(varname->u.constant), Z_STRLEN(varname->u.constant), 0 TSRMLS_CC)) {
1831+
if (zend_is_auto_global(Z_STRVAL(varname->u.constant), Z_STRLEN(varname->u.constant) TSRMLS_CC)) {
18441832
zend_error(E_COMPILE_ERROR, "Cannot re-assign auto-global variable %s", Z_STRVAL(varname->u.constant));
18451833
} else {
18461834
var.op_type = IS_CV;
@@ -1984,9 +1972,7 @@ void zend_do_begin_method_call(znode *left_bracket TSRMLS_DC) /* {{{ */
19841972
if (Z_TYPE(name) != IS_STRING) {
19851973
zend_error(E_COMPILE_ERROR, "Method name must be a string");
19861974
}
1987-
if (!IS_INTERNED(Z_STRVAL(name))) {
1988-
Z_STRVAL(name) = estrndup(Z_STRVAL(name), Z_STRLEN(name));
1989-
}
1975+
Z_STRVAL(name) = str_estrndup(Z_STRVAL(name), Z_STRLEN(name));
19901976
FREE_POLYMORPHIC_CACHE_SLOT(last_op->op2.constant);
19911977
last_op->op2.constant =
19921978
zend_add_func_name_literal(CG(active_op_array), &name TSRMLS_CC);
@@ -2112,7 +2098,7 @@ void zend_resolve_non_class_name(znode *element_name, zend_bool check_namespace
21122098
memcpy(Z_STRVAL(tmp.u.constant), Z_STRVAL_P(CG(current_namespace)), Z_STRLEN_P(CG(current_namespace)));
21132099
memcpy(&(Z_STRVAL(tmp.u.constant)[Z_STRLEN_P(CG(current_namespace))]), "\\", sizeof("\\")-1);
21142100
memcpy(&(Z_STRVAL(tmp.u.constant)[Z_STRLEN_P(CG(current_namespace)) + sizeof("\\")-1]), Z_STRVAL(element_name->u.constant), Z_STRLEN(element_name->u.constant)+1);
2115-
STR_FREE(Z_STRVAL(element_name->u.constant));
2101+
str_efree(Z_STRVAL(element_name->u.constant));
21162102
*element_name = tmp;
21172103
}
21182104
}
@@ -2405,14 +2391,14 @@ void zend_do_build_full_name(znode *result, znode *prefix, znode *name, int is_c
24052391
Z_STRVAL(result->u.constant) = erealloc(Z_STRVAL(result->u.constant), length+1);
24062392
memcpy(&Z_STRVAL(result->u.constant)[Z_STRLEN(result->u.constant)], "::", sizeof("::")-1);
24072393
memcpy(&Z_STRVAL(result->u.constant)[Z_STRLEN(result->u.constant) + sizeof("::")-1], Z_STRVAL(name->u.constant), Z_STRLEN(name->u.constant)+1);
2408-
STR_FREE(Z_STRVAL(name->u.constant));
2394+
str_efree(Z_STRVAL(name->u.constant));
24092395
Z_STRLEN(result->u.constant) = length;
24102396
} else {
24112397
length = sizeof("\\")-1 + Z_STRLEN(result->u.constant) + Z_STRLEN(name->u.constant);
24122398
Z_STRVAL(result->u.constant) = erealloc(Z_STRVAL(result->u.constant), length+1);
24132399
memcpy(&Z_STRVAL(result->u.constant)[Z_STRLEN(result->u.constant)], "\\", sizeof("\\")-1);
24142400
memcpy(&Z_STRVAL(result->u.constant)[Z_STRLEN(result->u.constant) + sizeof("\\")-1], Z_STRVAL(name->u.constant), Z_STRLEN(name->u.constant)+1);
2415-
STR_FREE(Z_STRVAL(name->u.constant));
2401+
str_efree(Z_STRVAL(name->u.constant));
24162402
Z_STRLEN(result->u.constant) = length;
24172403
}
24182404
}
@@ -5305,7 +5291,7 @@ void zend_do_declare_class_constant(znode *var_name, const znode *value TSRMLS_D
53055291
{
53065292
zval *property;
53075293
const char *cname = NULL;
5308-
int result;
5294+
zend_ulong hash;
53095295

53105296
if(Z_TYPE(value->u.constant) == IS_CONSTANT_ARRAY) {
53115297
zend_error(E_COMPILE_ERROR, "Arrays are not allowed in class constants");
@@ -5320,13 +5306,8 @@ void zend_do_declare_class_constant(znode *var_name, const znode *value TSRMLS_D
53205306
*property = value->u.constant;
53215307

53225308
cname = zend_new_interned_string(Z_STRVAL(var_name->u.constant), Z_STRLEN(var_name->u.constant)+1, 0 TSRMLS_CC);
5323-
5324-
if (IS_INTERNED(cname)) {
5325-
result = zend_hash_quick_add(&CG(active_class_entry)->constants_table, cname, Z_STRLEN(var_name->u.constant)+1, INTERNED_HASH(cname), &property, sizeof(zval *), NULL);
5326-
} else {
5327-
result = zend_hash_add(&CG(active_class_entry)->constants_table, cname, Z_STRLEN(var_name->u.constant)+1, &property, sizeof(zval *), NULL);
5328-
}
5329-
if (result == FAILURE) {
5309+
hash = str_hash(cname, Z_STRLEN(var_name->u.constant));
5310+
if (zend_hash_quick_add(&CG(active_class_entry)->constants_table, cname, Z_STRLEN(var_name->u.constant)+1, hash, &property, sizeof(zval *), NULL) == FAILURE) {
53305311
FREE_ZVAL(property);
53315312
zend_error(E_COMPILE_ERROR, "Cannot redefine class constant %s::%s", CG(active_class_entry)->name, Z_STRVAL(var_name->u.constant));
53325313
}
@@ -6692,10 +6673,9 @@ void zend_do_ticks(TSRMLS_D) /* {{{ */
66926673
}
66936674
/* }}} */
66946675

6695-
zend_bool zend_is_auto_global_quick(const char *name, uint name_len, ulong hashval TSRMLS_DC) /* {{{ */
6676+
zend_bool zend_is_auto_global_quick(const char *name, uint name_len, ulong hash TSRMLS_DC) /* {{{ */
66966677
{
66976678
zend_auto_global *auto_global;
6698-
ulong hash = hashval ? hashval : zend_hash_func(name, name_len+1);
66996679

67006680
if (zend_hash_quick_find(CG(auto_globals), name, name_len+1, hash, (void **) &auto_global)==SUCCESS) {
67016681
if (auto_global->armed) {
@@ -6709,7 +6689,7 @@ zend_bool zend_is_auto_global_quick(const char *name, uint name_len, ulong hashv
67096689

67106690
zend_bool zend_is_auto_global(const char *name, uint name_len TSRMLS_DC) /* {{{ */
67116691
{
6712-
return zend_is_auto_global_quick(name, name_len, 0 TSRMLS_CC);
6692+
return zend_is_auto_global_quick(name, name_len, zend_hash_func(name, name_len+1) TSRMLS_CC);
67136693
}
67146694
/* }}} */
67156695

Zend/zend_constants.c

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ void free_zend_constant(zend_constant *c)
3838

3939
void copy_zend_constant(zend_constant *c)
4040
{
41-
if (!IS_INTERNED(c->name)) {
42-
c->name = zend_strndup(c->name, c->name_len - 1);
43-
}
41+
c->name = str_strndup(c->name, c->name_len - 1);
4442
if (!(c->flags & CONST_PERSISTENT)) {
4543
zval_copy_ctor(&c->value);
4644
}
@@ -474,7 +472,7 @@ ZEND_API int zend_register_constant(zend_constant *c TSRMLS_DC)
474472
char *lowercase_name = NULL;
475473
char *name;
476474
int ret = SUCCESS;
477-
ulong chash = 0;
475+
ulong chash;
478476

479477
#if 0
480478
printf("Registering constant for module %d\n", c->module_number);
@@ -486,23 +484,18 @@ ZEND_API int zend_register_constant(zend_constant *c TSRMLS_DC)
486484
zend_str_tolower(lowercase_name, c->name_len-1);
487485
lowercase_name = (char*)zend_new_interned_string(lowercase_name, c->name_len, 1 TSRMLS_CC);
488486
name = lowercase_name;
489-
chash = IS_INTERNED(lowercase_name) ? INTERNED_HASH(lowercase_name) : 0;
490487
} else {
491488
char *slash = strrchr(c->name, '\\');
492-
if(slash) {
489+
if (slash) {
493490
lowercase_name = estrndup(c->name, c->name_len-1);
494491
zend_str_tolower(lowercase_name, slash-c->name);
495492
lowercase_name = (char*)zend_new_interned_string(lowercase_name, c->name_len, 1 TSRMLS_CC);
496493
name = lowercase_name;
497-
498-
chash = IS_INTERNED(lowercase_name) ? INTERNED_HASH(lowercase_name) : 0;
499494
} else {
500495
name = c->name;
501496
}
502497
}
503-
if (chash == 0) {
504-
chash = zend_hash_func(name, c->name_len);
505-
}
498+
chash = str_hash(name, c->name_len-1);
506499

507500
/* Check if the user is trying to define the internal pseudo constant name __COMPILER_HALT_OFFSET__ */
508501
if ((c->name_len == sizeof("__COMPILER_HALT_OFFSET__")
@@ -521,8 +514,8 @@ ZEND_API int zend_register_constant(zend_constant *c TSRMLS_DC)
521514
}
522515
ret = FAILURE;
523516
}
524-
if (lowercase_name && !IS_INTERNED(lowercase_name)) {
525-
efree(lowercase_name);
517+
if (lowercase_name) {
518+
str_efree(lowercase_name);
526519
}
527520
return ret;
528521
}

Zend/zend_execute.c

Lines changed: 17 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -767,32 +767,21 @@ static inline void zend_assign_to_object(zval **retval, zval **object_ptr, zval
767767

768768
static inline int zend_assign_to_string_offset(const temp_variable *T, const zval *value, int value_type TSRMLS_DC)
769769
{
770-
if (Z_TYPE_P(T->str_offset.str) == IS_STRING) {
771-
772-
if (((int)T->str_offset.offset < 0)) {
773-
zend_error(E_WARNING, "Illegal string offset: %d", T->str_offset.offset);
770+
zval *str = T->str_offset.str;
771+
zend_uint offset = T->str_offset.offset;
772+
if (Z_TYPE_P(str) == IS_STRING) {
773+
if ((int)offset < 0) {
774+
zend_error(E_WARNING, "Illegal string offset: %d", offset);
774775
return 0;
775776
}
776777

777-
if (T->str_offset.offset >= Z_STRLEN_P(T->str_offset.str)) {
778-
if (IS_INTERNED(Z_STRVAL_P(T->str_offset.str))) {
779-
char *tmp = (char *) emalloc(T->str_offset.offset+1+1);
780-
781-
memcpy(tmp, Z_STRVAL_P(T->str_offset.str), Z_STRLEN_P(T->str_offset.str)+1);
782-
Z_STRVAL_P(T->str_offset.str) = tmp;
783-
} else {
784-
Z_STRVAL_P(T->str_offset.str) = (char *) erealloc(Z_STRVAL_P(T->str_offset.str), T->str_offset.offset+1+1);
785-
}
786-
memset(Z_STRVAL_P(T->str_offset.str) + Z_STRLEN_P(T->str_offset.str),
787-
' ',
788-
T->str_offset.offset - Z_STRLEN_P(T->str_offset.str));
789-
Z_STRVAL_P(T->str_offset.str)[T->str_offset.offset+1] = 0;
790-
Z_STRLEN_P(T->str_offset.str) = T->str_offset.offset+1;
791-
} else if (IS_INTERNED(Z_STRVAL_P(T->str_offset.str))) {
792-
char *tmp = (char *) emalloc(Z_STRLEN_P(T->str_offset.str) + 1);
793-
794-
memcpy(tmp, Z_STRVAL_P(T->str_offset.str), Z_STRLEN_P(T->str_offset.str) + 1);
795-
Z_STRVAL_P(T->str_offset.str) = tmp;
778+
if (offset >= Z_STRLEN_P(str)) {
779+
Z_STRVAL_P(str) = str_erealloc(Z_STRVAL_P(str), offset+1+1);
780+
memset(Z_STRVAL_P(str) + Z_STRLEN_P(str), ' ', offset - Z_STRLEN_P(str));
781+
Z_STRVAL_P(str)[offset+1] = 0;
782+
Z_STRLEN_P(str) = offset+1;
783+
} else if (IS_INTERNED(Z_STRVAL_P(str))) {
784+
Z_STRVAL_P(str) = estrndup(Z_STRVAL_P(str), Z_STRLEN_P(str));
796785
}
797786

798787
if (Z_TYPE_P(value) != IS_STRING) {
@@ -803,15 +792,15 @@ static inline int zend_assign_to_string_offset(const temp_variable *T, const zva
803792
zval_copy_ctor(&tmp);
804793
}
805794
convert_to_string(&tmp);
806-
Z_STRVAL_P(T->str_offset.str)[T->str_offset.offset] = Z_STRVAL(tmp)[0];
807-
STR_FREE(Z_STRVAL(tmp));
795+
Z_STRVAL_P(str)[offset] = Z_STRVAL(tmp)[0];
796+
str_efree(Z_STRVAL(tmp));
808797
} else {
809-
Z_STRVAL_P(T->str_offset.str)[T->str_offset.offset] = Z_STRVAL_P(value)[0];
798+
Z_STRVAL_P(str)[offset] = Z_STRVAL_P(value)[0];
810799
if (value_type == IS_TMP_VAR) {
811800
/* we can safely free final_value here
812801
* because separation is done only
813802
* in case value_type == IS_VAR */
814-
STR_FREE(Z_STRVAL_P(value));
803+
str_efree(Z_STRVAL_P(value));
815804
}
816805
}
817806
/*
@@ -1024,11 +1013,7 @@ static inline zval **zend_fetch_dimension_address_inner(HashTable *ht, const zva
10241013
hval = Z_HASH_P(dim);
10251014
} else {
10261015
ZEND_HANDLE_NUMERIC_EX(offset_key, offset_key_length+1, hval, goto num_index);
1027-
if (IS_INTERNED(offset_key)) {
1028-
hval = INTERNED_HASH(offset_key);
1029-
} else {
1030-
hval = zend_hash_func(offset_key, offset_key_length+1);
1031-
}
1016+
hval = str_hash(offset_key, offset_key_length);
10321017
}
10331018
fetch_string_dim:
10341019
if (zend_hash_quick_find(ht, offset_key, offset_key_length+1, hval, (void **) &retval) == FAILURE) {

0 commit comments

Comments
 (0)