Skip to content

Commit aff9df8

Browse files
author
felipe
committed
- Avoid re-hash here too
git-svn-id: http://svn.php.net/repository/php/php-src/trunk@312320 c90b9560-bf6c-de11-be94-00142212c4b1
1 parent 72c3d03 commit aff9df8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Zend/zend_compile.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -633,16 +633,20 @@ void fetch_simple_variable_ex(znode *result, znode *varname, int bp, zend_uchar
633633
zend_llist *fetch_list_ptr;
634634

635635
if (varname->op_type == IS_CONST) {
636+
ulong hash = 0;
637+
636638
if (Z_TYPE(varname->u.constant) != IS_STRING) {
637639
convert_to_string(&varname->u.constant);
640+
} else if (IS_INTERNED(Z_STRVAL(varname->u.constant))) {
641+
hash = INTERNED_HASH(Z_STRVAL(varname->u.constant));
638642
}
639643
if (!zend_is_auto_global(varname->u.constant.value.str.val, varname->u.constant.value.str.len TSRMLS_CC) &&
640644
!(varname->u.constant.value.str.len == (sizeof("this")-1) &&
641645
!memcmp(varname->u.constant.value.str.val, "this", sizeof("this"))) &&
642646
(CG(active_op_array)->last == 0 ||
643647
CG(active_op_array)->opcodes[CG(active_op_array)->last-1].opcode != ZEND_BEGIN_SILENCE)) {
644648
result->op_type = IS_CV;
645-
result->u.op.var = lookup_cv(CG(active_op_array), varname->u.constant.value.str.val, varname->u.constant.value.str.len, 0 TSRMLS_CC);
649+
result->u.op.var = lookup_cv(CG(active_op_array), varname->u.constant.value.str.val, varname->u.constant.value.str.len, hash TSRMLS_CC);
646650
varname->u.constant.value.str.val = CG(active_op_array)->vars[result->u.op.var].name;
647651
result->EA = 0;
648652
return;

0 commit comments

Comments
 (0)