1
0
Fork 0

PHP_6: disassembler/decompiler: fix property

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@730 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
3.0
Xuefer 12 years ago
parent 8e3a73cbfc
commit d7a969ea1c

@ -1669,10 +1669,11 @@ class Decompiler
}
// }}}
// {{{ properties
if (!empty($class['default_properties']) || !empty($class['default_static_members'])) {
$member_variables = isset($class['properties_info']) ? $class['properties_info'] : ($class['default_static_members'] + $class['default_properties']);
if ($member_variables) {
echo "\n";
$infos = !empty($class['properties_info']) ? $class['properties_info'] : null;
foreach (!empty($class['properties_info']) ? $class['properties_info'] : ($class['default_static_members'] + $class['default_properties']) as $name => $dummy) {
foreach ($member_variables as $name => $dummy) {
$info = (isset($infos) && isset($infos[$name])) ? $infos[$name] : null;
if (isset($info)) {
if (!empty($info['doc_comment'])) {
@ -1725,9 +1726,14 @@ class Decompiler
echo '$', $name;
$key = isset($info) ? $info['name'] . ($mangled ? "\000" : "") : $name;
if (isset($info['offset'])) {
$value = $class[$static ? 'default_static_members_table' : 'default_properties_table'][$info['offset']];
}
else {
$key = isset($info) ? $info['name'] . ($mangled ? "\000" : "") : $name;
$value = $class[$static ? 'default_static_members' : 'default_properties'][$key];
$value = $class[$static ? 'default_static_members' : 'default_properties'][$key];
}
if (isset($value)) {
echo ' = ';
echo str(value($value));

@ -327,10 +327,10 @@ DEF_STRUCT_P_FUNC(`zend_class_entry', , `dnl {{{
#ifdef ZEND_ENGINE_2_4
DISPATCH(int, default_properties_count)
STRUCT_ARRAY(default_properties_count, zval, default_properties_table)
STRUCT_ARRAY(default_properties_count, zval_ptr, default_properties_table)
DISPATCH(int, default_static_members_count)
STRUCT_ARRAY(default_static_members_count, zval, default_static_members_table)
IFCOPY(`dst->static_members_table = &dst->default_static_members_table;')
STRUCT_ARRAY(default_static_members_count, zval_ptr, default_static_members_table)
IFCOPY(`dst->static_members_table = dst->default_static_members_table;')
DONE(static_members_table)
#else
IFCOPY(`dst->builtin_functions = src->builtin_functions;')

Loading…
Cancel
Save