Changeset 784 for branches/1.3/Decompiler.class.php
- Timestamp:
- 2011-04-22T17:18:42+02:00 (2 years ago)
- Location:
- branches/1.3
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
Decompiler.class.php (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/1.3
- Property svn:mergeinfo changed
/trunk merged: 775-778,780-783
- Property svn:mergeinfo changed
-
branches/1.3/Decompiler.class.php
r766 r784 737 737 $EX['last'] = count($opcodes) - 1; 738 738 $EX['silence'] = 0; 739 $EX['recvs'] = array(); 740 $EX['uses'] = array(); 739 741 740 742 for ($next = 0, $last = $EX['last']; … … 1139 1141 break; 1140 1142 } 1143 if (is_a($rvalue, 'Decompiler_Fetch')) { 1144 $src = str($rvalue->src, $EX); 1145 if ('$' . unquoteName($src) == $lvalue) { 1146 switch ($rvalue->fetchType) { 1147 case ZEND_FETCH_STATIC: 1148 $statics = &$EX['op_array']['static_variables']; 1149 if ((xcache_get_type($statics[$name]) & IS_LEXICAL_VAR)) { 1150 $EX['uses'][] = str($lvalue); 1151 unset($statics); 1152 break 2; 1153 } 1154 unset($statics); 1155 } 1156 } 1157 } 1141 1158 $resvar = "$lvalue = " . str($rvalue, $EX); 1142 1159 break; … … 1155 1172 case ZEND_FETCH_STATIC: 1156 1173 $statics = &$EX['op_array']['static_variables']; 1174 if ((xcache_get_type($statics[$name]) & IS_LEXICAL_REF)) { 1175 $EX['uses'][] = '&' . str($lvalue); 1176 unset($statics); 1177 break 2; 1178 } 1179 1157 1180 $resvar = 'static ' . $lvalue; 1158 1181 $name = unquoteName($src); … … 1203 1226 if ($opc == XC_ISSET_ISEMPTY_VAR) { 1204 1227 $rvalue = $this->getOpVal($op1, $EX); 1228 // for < PHP_5_3 1229 if ($op1['op_type'] == XC_IS_CONST) { 1230 $rvalue = '$' . unquoteVariableName($this->getOpVal($op1, $EX)); 1231 } 1205 1232 if ($op2['EA.type'] == ZEND_FETCH_STATIC_MEMBER) { 1206 1233 $class = $this->getOpVal($op2, $EX); … … 1227 1254 switch ((!ZEND_ENGINE_2 ? $op['op2']['var'] /* constant */ : $ext) & (ZEND_ISSET|ZEND_ISEMPTY)) { 1228 1255 case ZEND_ISSET: 1229 $rvalue = "isset( $rvalue)";1256 $rvalue = "isset(" . str($rvalue) . ")"; 1230 1257 break; 1231 1258 case ZEND_ISEMPTY: 1232 $rvalue = "empty( $rvalue)";1259 $rvalue = "empty(" . str($rvalue) . ")"; 1233 1260 break; 1234 1261 } … … 1838 1865 } 1839 1866 // }}} 1867 function duses(&$EX, $indent) // {{{ 1868 { 1869 if ($EX['uses']) { 1870 echo ' use(', implode(', ', $EX['uses']), ')'; 1871 } 1872 } 1873 // }}} 1840 1874 function dfunction($func, $indent = '', $nobody = false) // {{{ 1841 1875 { … … 1846 1880 $EX['op_array'] = &$func['op_array']; 1847 1881 $EX['recvs'] = array(); 1882 $EX['uses'] = array(); 1848 1883 } 1849 1884 else { … … 1852 1887 $EX = &$this->dop_array($func['op_array'], $newindent); 1853 1888 $body = ob_get_clean(); 1854 if (!isset($EX['recvs'])) {1855 $EX['recvs'] = array();1856 }1857 1889 } 1858 1890 … … 1861 1893 $functionName = ''; 1862 1894 } 1863 echo 'function ', $functionName, '(';1895 echo 'function', $functionName ? ' ' . $functionName : '', '('; 1864 1896 $this->dargs($EX, $indent); 1865 1897 echo ")"; 1898 $this->duses($EX, $indent); 1866 1899 if ($nobody) { 1867 1900 echo ";\n"; … … 2231 2264 define('IS_CONSTANT', 8); 2232 2265 define('IS_CONSTANT_ARRAY', 9); 2266 /* Ugly hack to support constants as static array indices */ 2267 define('IS_CONSTANT_TYPE_MASK', 0x0f); 2268 define('IS_CONSTANT_UNQUALIFIED', 0x10); 2269 define('IS_CONSTANT_INDEX', 0x80); 2270 define('IS_LEXICAL_VAR', 0x20); 2271 define('IS_LEXICAL_REF', 0x40); 2233 2272 2234 2273 @define('XC_IS_CV', 16);
Note: See TracChangeset
for help on using the changeset viewer.

