issue in copying the hash table
| From: | Kamesh Jayachandran | Date: | Wed, 23 Jun 2004 10:41:14 +0000 |
| Subject: | issue in copying the hash table | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-10721@lists.php.net to get a copy of this message | ||
Hi All,
I could not understand one piece of code in PHP 5.0 RC3.
File Zend/zend.c
function compiler_globals_ctor()
Here we copy global_class_table to thread specific compiler_globals's
class_table.
For this we use zend_hash_copy which is a generic function used by many
types.
As of my knowledge our class table HashTable structure is structured as,
key = char*
value = zend_class_entry **
If it is the case how this zend_hash_copy will work?
As I could see zend_hash_copy calls zend_hash_add_or_update with data as
the bucket's pData which is void* and semantically zend_class_entry **
and memcpy of INIT_DATA macro tries to copy from whatever pData points
to (zend_class_entry**) till sizeof(zend_class_entry)=292 bytes which is
wrong shoudl cause seg fault ideally.
Please clarify.
With regards
Kamesh Jayachandran