php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #69090
Patch bug69090.diff revision 2016-11-15 15:37 UTC by dmitry@php.net
revision 2016-11-15 15:11 UTC by dmitry@php.net
Patch validate_permission.diff revision 2016-11-15 11:21 UTC by dmitry@php.net
Patch opcache_bug69090_user_id_keys revision 2016-11-04 10:35 UTC by php-dev at coydogsoftware dot net

Patch bug69090.diff for opcache Bug #69090

Patch version 2016-11-15 15:37 UTC

Return to Bug #69090 | Download this patch
This patch renders other patches obsolete

Obsolete patches:

Patch Revisions: 2016-11-15 15:37 UTC | 2016-11-15 15:11 UTC

Developer: dmitry@php.net



   	/* preallocated shared-memory block to save current script */
   	void                   *mem;
   	/* cache to save hash lookup on the same INCLUDE opcode */
  diff --git a/ext/opcache/zend_accelerator_hash.c b/ext/opcache/zend_accelerator_hash.c
 index 992885f..32e9af7 100644
 index 992885f..4b8b712 100644
  --- a/ext/opcache/zend_accelerator_hash.c
  +++ b/ext/opcache/zend_accelerator_hash.c
 @@ -86,6 +86,7 @@ zend_accel_hash_entry* zend_accel_hash_update(zend_accel_hash *accel_hash, char
 @@ -86,6 +86,9 @@ zend_accel_hash_entry* zend_accel_hash_update(zend_accel_hash *accel_hash, char
   	}
   
   	hash_value = zend_inline_hash_func(key, key_length);
 +#ifndef ZEND_WIN32
  +	hash_value ^= ZCG(root_hash);
 +#endif
   	index = hash_value % accel_hash->max_num_entries;
   
   	/* try to see if the element already exists in the hash */
 @@ -147,6 +148,7 @@ void* zend_accel_hash_find(zend_accel_hash *accel_hash, char *key, zend_uint key
 @@ -147,6 +150,9 @@ void* zend_accel_hash_find(zend_accel_hash *accel_hash, char *key, zend_uint key
   	zend_accel_hash_entry *entry;
   
   	hash_value = zend_inline_hash_func(key, key_length);
 +#ifndef ZEND_WIN32
  +	hash_value ^= ZCG(root_hash);
 +#endif
   	index = hash_value % accel_hash->max_num_entries;
   
   	entry = accel_hash->hash_table[index];
 @@ -175,6 +177,7 @@ zend_accel_hash_entry* zend_accel_hash_find_entry(zend_accel_hash *accel_hash, c
 @@ -175,6 +181,9 @@ zend_accel_hash_entry* zend_accel_hash_find_entry(zend_accel_hash *accel_hash, c
   	zend_accel_hash_entry *entry;
   
   	hash_value = zend_inline_hash_func(key, key_length);
 +#ifndef ZEND_WIN32
  +	hash_value ^= ZCG(root_hash);
 +#endif
   	index = hash_value % accel_hash->max_num_entries;
   
   	entry = accel_hash->hash_table[index];
 @@ -200,6 +203,7 @@ int zend_accel_hash_unlink(zend_accel_hash *accel_hash, char *key, zend_uint key
 @@ -200,6 +209,9 @@ int zend_accel_hash_unlink(zend_accel_hash *accel_hash, char *key, zend_uint key
       zend_accel_hash_entry *entry, *last_entry=NULL;
   
   	hash_value = zend_inline_hash_func(key, key_length);
 +#ifndef ZEND_WIN32
  +	hash_value ^= ZCG(root_hash);
 +#endif
   	index = hash_value % accel_hash->max_num_entries;
   
   	entry = accel_hash->hash_table[index];
  diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 09:01:29 2024 UTC