Changeset 726 for branches/1.3
- Timestamp:
- 2011-04-09T14:59:31+02:00 (2 years ago)
- Location:
- branches/1.3
- Files:
-
- 19 edited
-
. (modified) (1 prop)
-
ChangeLog (modified) (1 diff)
-
Decompiler.class.php (modified) (48 diffs)
-
Makefile.frag (modified) (1 diff)
-
NEWS (modified) (1 diff)
-
const_string_opcodes_php6.x.h (modified) (3 diffs)
-
coverager.c (modified) (2 diffs)
-
disassembler.c (modified) (8 diffs)
-
mkstructinfo.awk (modified) (1 diff)
-
opcode_spec.c (modified) (1 diff)
-
opcode_spec_def.h (modified) (6 diffs)
-
processor/hashtable.m4 (modified) (1 diff)
-
processor/head.m4 (modified) (1 diff)
-
processor/main.m4 (modified) (2 diffs)
-
processor/processor.m4 (modified) (22 diffs)
-
processor/struct.m4 (modified) (5 diffs)
-
utils.c (modified) (19 diffs)
-
xcache.c (modified) (3 diffs)
-
xcache.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/1.3
- Property svn:mergeinfo changed
/trunk merged: 709-720,722-723,725
- Property svn:mergeinfo changed
-
branches/1.3/ChangeLog
r708 r726 1 1 1.3.2 2011-??-?? 2 2 ======== 3 * disassembler: DECLARE_INHERITED_CLASS/DELAYED class not found 4 * disassembler: don't dump builtin functions 3 5 * fix win32 build against win32 native gnu tools 4 6 * compatibility fix: fix segv on shutdown when ionCube Loader is loaded -
branches/1.3/Decompiler.class.php
r623 r726 28 28 29 29 if (is_array($src)) { 30 die_error('array str');31 $src = new Decompiler_Array($src, false,$indent);30 exit('array str'); 31 $src = new Decompiler_Array($src, $indent); 32 32 return $src->__toString(); 33 33 } … … 36 36 if (!method_exists($src, '__toString')) { 37 37 var_dump($src); 38 die_error('no __toString');39 } 40 return $src->__toString( $indent);38 exit('no __toString'); 39 } 40 return $src->__toString(); 41 41 } 42 42 … … 55 55 } 56 56 57 if (is_array($value)) { 58 $value = new Decompiler_Array($value, true); 57 if ($value instanceof Decompiler_Object) { 58 // use as is 59 } 60 else if (is_array($value)) { 61 $value = new Decompiler_Array($value); 59 62 } 60 63 else { 61 $value = new Decompiler_Value($value , true);64 $value = new Decompiler_Value($value); 62 65 } 63 66 return $value; … … 257 260 class Decompiler_Array extends Decompiler_Value // {{{ 258 261 { 259 var $needExport = false;260 262 var $indent = ''; 261 263 262 function Decompiler_Array($value = array(), $ needexport = false, $indent = '')264 function Decompiler_Array($value = array(), $indent = '') 263 265 { 264 266 $this->value = $value; 265 $this->needExport = $needexport;266 267 $this->indent = $indent; 267 268 } … … 286 287 ++ $i; 287 288 } 288 if ($assoclen && $this->needExport) {289 if ($assoclen) { 289 290 $assoclen += 2; 290 291 } … … 306 307 } 307 308 308 if ($this->needExport) { 309 $k = var_export($k, true); 310 } 309 $k = var_export($k, true); 311 310 if ($multiline) { 312 311 $exp .= sprintf("%{$assoclen}s => ", $k); … … 316 315 } 317 316 318 if (is_array($v)) { 319 $v = new Decompiler_Array($v, $this->needExport); 320 } 321 $exp .= str($v, $subindent); 317 $exp .= str(value($v), $subindent); 322 318 323 319 $i ++; … … 433 429 switch ($op['op_type']) { 434 430 case XC_IS_CONST: 435 return str(value($op[' u.constant']));431 return str(value($op['constant'])); 436 432 437 433 case XC_IS_VAR: 438 434 case XC_IS_TMP_VAR: 439 435 $T = &$EX['Ts']; 440 $ret = $T[$op[' u.var']];436 $ret = $T[$op['var']]; 441 437 if ($tostr) { 442 438 $ret = str($ret, $EX); 443 439 } 444 440 if ($free) { 445 unset($T[$op[' u.var']]);441 unset($T[$op['var']]); 446 442 } 447 443 return $ret; 448 444 449 445 case XC_IS_CV: 450 $var = $op[' u.var'];446 $var = $op['var']; 451 447 $var = $EX['op_array']['vars'][$var]; 452 448 return '$' . $var['name']; … … 455 451 return null; 456 452 } 453 } 454 // }}} 455 function removeKeyPrefix($array, $prefix) // {{{ 456 { 457 $prefixLen = strlen($prefix); 458 $ret = array(); 459 foreach ($array as $key => $value) { 460 if (substr($key, 0, $prefixLen) == $prefix) { 461 $key = substr($key, $prefixLen); 462 } 463 $ret[$key] = $value; 464 } 465 return $ret; 457 466 } 458 467 // }}} … … 465 474 } 466 475 $EX['indent'] = ''; 467 //for ($i = 0, $cnt = count($opcodes); $i < $cnt; $i ++) { 468 // $opcodes[$i]['opcode'] = xcache_get_fixed_opcode($opcodes[$i]['opcode'], $i); 469 //} 476 for ($i = 0, $cnt = count($opcodes); $i < $cnt; $i ++) { 477 if (function_exists('xcache_get_fixed_opcode')) { 478 $opcodes[$i]['opcode'] = xcache_get_fixed_opcode($opcodes[$i]['opcode'], $i); 479 } 480 if (isset($opcodes[$i]['op1'])) { 481 $opcodes[$i]['op1'] = $this->removeKeyPrefix($opcodes[$i]['op1'], 'u.'); 482 $opcodes[$i]['op2'] = $this->removeKeyPrefix($opcodes[$i]['op2'], 'u.'); 483 $opcodes[$i]['result'] = $this->removeKeyPrefix($opcodes[$i]['result'], 'u.'); 484 } 485 else { 486 $op = array( 487 'op1' => array(), 488 'op2' => array(), 489 'op3' => array(), 490 ); 491 foreach ($opcodes[$i] as $name => $value) { 492 if (preg_match('!^(op1|op2|result)\\.(.*)!', $name, $m)) { 493 list(, $which, $field) = $m; 494 $op[$which][$field] = $value; 495 } 496 else if (preg_match('!^(op1|op2|result)_type$!', $name, $m)) { 497 list(, $which) = $m; 498 $op[$which]['op_type'] = $value; 499 } 500 else { 501 $op[$name] = $value; 502 } 503 } 504 $opcodes[$i] = $op; 505 } 506 } 470 507 // {{{ build jmp array 471 508 for ($i = 0, $cnt = count($opcodes); $i < $cnt; $i ++) { … … 481 518 switch ($op['opcode']) { 482 519 case XC_JMP: 483 $target = $op['op1'][' u.var'];520 $target = $op['op1']['var']; 484 521 $op['jmpouts'] = array($target); 485 522 $opcodes[$target]['jmpins'][] = $i; … … 487 524 488 525 case XC_JMPZNZ: 489 $jmpz = $op['op2'][' u.opline_num'];526 $jmpz = $op['op2']['opline_num']; 490 527 $jmpnz = $op['extended_value']; 491 528 $op['jmpouts'] = array($jmpz, $jmpnz); … … 501 538 case XC_FE_FETCH: 502 539 // case XC_JMP_NO_CTOR: 503 $target = $op['op2'][' u.opline_num'];540 $target = $op['op2']['opline_num']; 504 541 //if (!isset($target)) { 505 542 // $this->dumpop($op, $EX); … … 539 576 // func call 540 577 $EX['object'] = null; 578 $EX['called_scope'] = null; 541 579 $EX['fbc'] = null; 542 580 $EX['argstack'] = array(); … … 588 626 if ($op['opcode'] == XC_FE_FETCH) { 589 627 $opline = $next; 590 $next = $op['op2'][' u.opline_num'];628 $next = $op['op2']['opline_num']; 591 629 $end = $next - 1; 592 630 … … 607 645 /* 608 646 if ($op['opcode'] == XC_JMPZ) { 609 $target = $op2[' u.opline_num'];647 $target = $op2['opline_num']; 610 648 if ($line + 1) { 611 649 $nextblock = $EX['nextbbs'][$next]; 612 650 $jmpop = end($nextblock); 613 651 if ($jmpop['opcode'] == XC_JMP) { 614 $ifendline = $op2[' u.opline_num'];652 $ifendline = $op2['opline_num']; 615 653 if ($ifendline >= $line) { 616 654 $cond = $op['cond']; … … 657 695 } 658 696 659 $var = $fromop['result'][' u.var'];697 $var = $fromop['result']['var']; 660 698 var_dump($EX['Ts'][$var]); 661 699 $EX['Ts'][$var] = '(' . $fromop['and_or'] . " $opstr " . $EX['Ts'][$var] . ')'; … … 719 757 720 758 $resvar = null; 721 if ( ($res['u.EA.type'] & EXT_TYPE_UNUSED) || $res['op_type'] == XC_IS_UNUSED) {759 if (isset($res['EA.type']) && ($res['EA.type'] & EXT_TYPE_UNUSED) || $res['op_type'] == XC_IS_UNUSED) { 722 760 $istmpres = false; 723 761 } … … 749 787 switch ($opc) { 750 788 case XC_NEW: // {{{ 751 array_push($EX['arg_types_stack'], array($EX['object'], $EX['fbc'])); 752 $EX['object'] = (int) $res['u.var']; 789 array_push($EX['arg_types_stack'], array($EX['fbc'], $EX['object'], $EX['called_scope'])); 790 $EX['object'] = (int) $res['var']; 791 $EX['called_scope'] = null; 753 792 $EX['fbc'] = 'new ' . $this->unquoteName($this->getOpVal($op1, $EX)); 754 793 if (PHP_VERSION < 5) { … … 765 804 case ZEND_FETCH_CLASS_PARENT: 766 805 $class = 'parent'; 767 } 806 break; 807 case ZEND_FETCH_CLASS_STATIC: 808 $class = 'static'; 809 break; 810 } 811 $istmpres = true; 768 812 } 769 813 else { 770 $class = $op2[' u.constant'];814 $class = $op2['constant']; 771 815 if (is_object($class)) { 772 816 $class = get_class($class); … … 778 822 case XC_FETCH_CONSTANT: // {{{ 779 823 if ($op1['op_type'] == XC_IS_CONST) { 780 $resvar = $op1[' u.constant'];824 $resvar = $op1['constant']; 781 825 } 782 826 else if ($op1['op_type'] == XC_IS_UNUSED) { 783 $resvar = $op2[' u.constant'];827 $resvar = $op2['constant']; 784 828 } 785 829 else { 786 $class = $T[$op1[' u.var']];830 $class = $T[$op1['var']]; 787 831 assert($class[0] == 'class'); 788 $resvar = $class[1] . '::' . $op2[' u.constant'];832 $resvar = $class[1] . '::' . $op2['constant']; 789 833 } 790 834 break; … … 799 843 case XC_UNSET_VAR: 800 844 $rvalue = $this->getOpVal($op1, $EX); 801 $fetchtype = $op2[PHP_VERSION < 5 ? ' u.fetch_type' : 'u.EA.type'];845 $fetchtype = $op2[PHP_VERSION < 5 ? 'fetch_type' : 'EA.type']; 802 846 switch ($fetchtype) { 803 847 case ZEND_FETCH_STATIC_MEMBER: … … 845 889 846 890 $src = new Decompiler_ListBox($list); 847 if (!isset($op1[' u.var'])) {891 if (!isset($op1['var'])) { 848 892 $this->dumpop($op, $EX); 849 893 var_dump($op); 850 die('missing u.var');894 die('missing var'); 851 895 } 852 $T[$op1[' u.var']] = $src;896 $T[$op1['var']] = $src; 853 897 unset($list); 854 898 } … … 890 934 $type = $rvalue->iskey ? 'fe_key' : 'fe_as'; 891 935 $rvalue->obj[$type] = $lvalue; 892 unset($T[$op2[' u.var']]);936 unset($T[$op2['var']]); 893 937 break; 894 938 } … … 976 1020 $rvalue = "${" . $rvalue . "}"; 977 1021 } 978 if ($op2[' u.EA.type'] == ZEND_FETCH_STATIC_MEMBER) {1022 if ($op2['EA.type'] == ZEND_FETCH_STATIC_MEMBER) { 979 1023 $class = $this->getOpVal($op2, $EX); 980 1024 $rvalue = $class . '::' . $rvalue; … … 987 1031 $container = $this->getOpVal($op1, $EX); 988 1032 $dim = $this->getOpVal($op2, $EX); 989 $rvalue = $container . "[$dim]"; 990 } 991 992 switch (PHP_VERSION < 5 ? $op['op2']['u.var'] /* u.constant */ : $ext) { 1033 if ($opc == XC_ISSET_ISEMPTY_PROP_OBJ) { 1034 if (preg_match($this->rQuotedName, $dim)) { 1035 $rvalue = $container . "->" . substr($dim, 1, -1); 1036 } 1037 else { 1038 $rvalue = $container . "->{" . $dim . "}"; 1039 } 1040 } 1041 else { 1042 $rvalue = $container . "[$dim]"; 1043 } 1044 } 1045 1046 switch ((PHP_VERSION < 5 ? $op['op2']['var'] /* constant */ : $ext) & (ZEND_ISSET|ZEND_ISEMPTY)) { 993 1047 case ZEND_ISSET: 994 1048 $rvalue = "isset($rvalue)"; … … 997 1051 $rvalue = "empty($rvalue)"; 998 1052 break; 999 default:1000 $this->dumpop($op, $EX);1001 die_error('1');1002 1053 } 1003 1054 $resvar = $rvalue; … … 1012 1063 break; 1013 1064 // }}} 1065 case XC_INIT_STATIC_METHOD_CALL: 1014 1066 case XC_INIT_METHOD_CALL: 1015 1067 case XC_INIT_FCALL_BY_FUNC: … … 1018 1070 break; 1019 1071 } 1020 array_push($EX['arg_types_stack'], array($EX[' object'], $EX['fbc']));1021 if ($opc == XC_INIT_ METHOD_CALL || $op1['op_type'] != XC_IS_UNUSED) {1072 array_push($EX['arg_types_stack'], array($EX['fbc'], $EX['object'], $EX['called_scope'])); 1073 if ($opc == XC_INIT_STATIC_METHOD_CALL || $opc == XC_INIT_METHOD_CALL || $op1['op_type'] != XC_IS_UNUSED) { 1022 1074 $obj = $this->getOpVal($op1, $EX); 1023 1075 if (!isset($obj)) { 1024 1076 $obj = '$this'; 1025 1077 } 1026 $EX['object'] = $obj; 1078 if ($opc == XC_INIT_STATIC_METHOD_CALL || /* PHP4 */ isset($op1['constant'])) { 1079 $EX['object'] = null; 1080 $EX['called_scope'] = $this->unquoteName($obj); 1081 } 1082 else { 1083 $EX['object'] = $obj; 1084 $EX['called_scope'] = null; 1085 } 1027 1086 if ($res['op_type'] != XC_IS_UNUSED) { 1028 1087 $resvar = '$obj call$'; … … 1031 1090 else { 1032 1091 $EX['object'] = null; 1092 $EX['called_scope'] = null; 1033 1093 } 1034 1094 1035 1095 if ($opc == XC_INIT_FCALL_BY_FUNC) { 1036 $which = $op1[' u.var'];1096 $which = $op1['var']; 1037 1097 $EX['fbc'] = $EX['op_array']['funcs'][$which]['name']; 1038 1098 } … … 1043 1103 // }}} 1044 1104 case XC_DO_FCALL_BY_FUNC: 1045 $which = $op1[' u.var'];1105 $which = $op1['var']; 1046 1106 $fname = $EX['op_array']['funcs'][$which]['name']; 1047 1107 $args = $this->popargs($EX, $ext); … … 1065 1125 $resvar = 1066 1126 (isset($object) ? $object . '->' : '' ) 1127 . (isset($EX['called_scope']) ? $EX['called_scope'] . '::' : '' ) 1067 1128 . $fname . "($args)"; 1068 1129 unset($args); … … 1072 1133 $resvar = null; 1073 1134 } 1074 list($EX[' object'], $EX['fbc']) = array_pop($EX['arg_types_stack']);1135 list($EX['fbc'], $EX['object'], $EX['called_scope']) = array_pop($EX['arg_types_stack']); 1075 1136 break; 1076 1137 // }}} 1077 1138 case XC_VERIFY_ABSTRACT_CLASS: // {{{ 1078 //unset($T[$op1[' u.var']]);1139 //unset($T[$op1['var']]); 1079 1140 break; 1080 1141 // }}} 1081 1142 case XC_DECLARE_CLASS: 1082 case XC_DECLARE_INHERITED_CLASS: // {{{ 1083 $key = $op1['u.constant']; 1143 case XC_DECLARE_INHERITED_CLASS: 1144 case XC_DECLARE_INHERITED_CLASS_DELAYED: // {{{ 1145 $key = $op1['constant']; 1146 if (!isset($this->dc['class_table'][$key])) { 1147 echo 'class not found: ', $key, 'existing classes are:', "\n"; 1148 var_dump(array_keys($this->dc['class_table'])); 1149 exit; 1150 } 1084 1151 $class = &$this->dc['class_table'][$key]; 1085 if (!isset($class)) {1086 echo 'class not found: ' . $key;1087 exit;1088 }1089 1152 $class['name'] = $this->unquoteName($this->getOpVal($op2, $EX)); 1090 if ($opc == XC_DECLARE_INHERITED_CLASS ) {1153 if ($opc == XC_DECLARE_INHERITED_CLASS || $opc == XC_DECLARE_INHERITED_CLASS_DELAYED) { 1091 1154 $ext /= XC_SIZEOF_TEMP_VARIABLE; 1092 1155 $class['parent'] = $T[$ext]; … … 1099 1162 while ($i + 2 < $ic 1100 1163 && $opcodes[$i + 2]['opcode'] == XC_ADD_INTERFACE 1101 && $opcodes[$i + 2]['op1'][' u.var'] == $res['u.var']1164 && $opcodes[$i + 2]['op1']['var'] == $res['var'] 1102 1165 && $opcodes[$i + 1]['opcode'] == XC_FETCH_CLASS) { 1103 1166 $fetchop = &$opcodes[$i + 1]; … … 1165 1228 $offset = $this->getOpVal($op2, $EX); 1166 1229 if (isset($offset)) { 1167 $T[$res[' u.var']]->value[$offset] = $rvalue;1230 $T[$res['var']]->value[$offset] = $rvalue; 1168 1231 } 1169 1232 else { 1170 $T[$res[' u.var']]->value[] = $rvalue;1233 $T[$res['var']]->value[] = $rvalue; 1171 1234 } 1172 1235 } … … 1202 1265 // }}} 1203 1266 case XC_INCLUDE_OR_EVAL: // {{{ 1204 $type = $op2[' u.var']; // hack1267 $type = $op2['var']; // hack 1205 1268 $keyword = $this->includeTypes[$type]; 1206 1269 $resvar = "$keyword(" . $this->getOpVal($op1, $EX) . ")"; … … 1215 1278 $fe = new Decompiler_ForeachBox($op); 1216 1279 $fe->iskey = false; 1217 $T[$res[' u.var']] = $fe;1280 $T[$res['var']] = $fe; 1218 1281 1219 1282 ++ $i; … … 1223 1286 1224 1287 $res = $opcodes[$i]['result']; 1225 $T[$res[' u.var']] = $fe;1288 $T[$res['var']] = $fe; 1226 1289 } 1227 1290 break; 1228 1291 // }}} 1229 1292 case XC_SWITCH_FREE: // {{{ 1230 // unset($T[$op1[' u.var']]);1293 // unset($T[$op1['var']]); 1231 1294 break; 1232 1295 // }}} 1233 1296 case XC_FREE: // {{{ 1234 $free = $T[$op1[' u.var']];1297 $free = $T[$op1['var']]; 1235 1298 if (!is_a($free, 'Decompiler_Array') && !is_a($free, 'Decompiler_Box')) { 1236 1299 $op['php'] = is_object($free) ? $free : $this->unquote($free, '(', ')'); 1237 1300 $lastphpop = &$op; 1238 1301 } 1239 unset($T[$op1[' u.var']], $free);1302 unset($T[$op1['var']], $free); 1240 1303 break; 1241 1304 // }}} … … 1260 1323 } 1261 1324 if (isset($op['cond_false'])) { 1325 echo "TODO(cond_false):\n"; 1262 1326 var_dump($op);// exit; 1263 1327 } 1264 1328 if ($opc == XC_JMPZ_EX || $opc == XC_JMPNZ_EX || $opc == XC_JMPZ) { 1265 $targetop = &$EX['opcodes'][$op2[' u.opline_num']];1329 $targetop = &$EX['opcodes'][$op2['opline_num']]; 1266 1330 if ($opc == XC_JMPNZ_EX) { 1267 1331 $targetop['cond_true'][] = str($rvalue); … … 1291 1355 $lvalue = $this->getOpVal($op['result'], $EX); 1292 1356 if ($opc == XC_RECV_INIT) { 1293 $default = value($op['op2'][' u.constant']);1357 $default = value($op['op2']['constant']); 1294 1358 } 1295 1359 else { … … 1377 1441 if (isset($resvar)) { 1378 1442 if ($istmpres) { 1379 $T[$res[' u.var']] = $resvar;1380 $lastresvar = &$T[$res[' u.var']];1443 $T[$res['var']] = $resvar; 1444 $lastresvar = &$T[$res['var']]; 1381 1445 } 1382 1446 else { … … 1424 1488 switch ($op[$k]['op_type']) { 1425 1489 case XC_IS_UNUSED: 1426 $d[$kk] = '*UNUSED* ' . $op[$k][' u.opline_num'];1490 $d[$kk] = '*UNUSED* ' . $op[$k]['opline_num']; 1427 1491 break; 1428 1492 1429 1493 case XC_IS_VAR: 1430 $d[$kk] = '$' . $op[$k][' u.var'];1494 $d[$kk] = '$' . $op[$k]['var']; 1431 1495 if ($kk != 'res') { 1432 1496 $d[$kk] .= ':' . $this->getOpVal($op[$k], $EX); … … 1435 1499 1436 1500 case XC_IS_TMP_VAR: 1437 $d[$kk] = '#' . $op[$k][' u.var'];1501 $d[$kk] = '#' . $op[$k]['var']; 1438 1502 if ($kk != 'res') { 1439 1503 $d[$kk] .= ':' . $this->getOpVal($op[$k], $EX); … … 1608 1672 if (!empty($class['default_properties'])) { 1609 1673 echo "\n"; 1610 $infos = empty($class['properties_info']) ? null : $class['properties_info'];1611 foreach ( $class['default_properties'] as $name => $v) {1674 $infos = !empty($class['properties_info']) ? $class['properties_info'] : null; 1675 foreach (!empty($class['properties_info']) ? $class['properties_info'] : ($class['default_static_members'] + $class['default_properties']) as $name => $dummy) { 1612 1676 $info = (isset($infos) && isset($infos[$name])) ? $infos[$name] : null; 1613 1677 if (isset($info)) { … … 1620 1684 1621 1685 echo $newindent; 1686 $static = false; 1687 if (isset($info)) { 1688 if ($info['flags'] & ZEND_ACC_STATIC) { 1689 $static = true; 1690 } 1691 } 1692 else if (isset($class['default_static_members'][$name])) { 1693 $static = true; 1694 } 1695 1696 if ($static) { 1697 echo "static "; 1698 } 1699 1700 $mangled = false; 1622 1701 if (PHP_VERSION < 5) { 1623 1702 echo 'var '; … … 1636 1715 case ZEND_ACC_PRIVATE: 1637 1716 echo "private "; 1717 $mangled = true; 1638 1718 break; 1639 1719 case ZEND_ACC_PROTECTED: 1640 1720 echo "protected "; 1721 $mangled = true; 1641 1722 break; 1642 1723 } 1643 if ($info['flags'] & ZEND_ACC_STATIC) {1644 echo "static ";1645 }1646 1724 } 1647 1725 1648 1726 echo '$', $name; 1649 if (isset($v)) { 1727 1728 $key = isset($info) ? $info['name'] . ($mangled ? "\000" : "") : $name; 1729 1730 $value = $class[$static ? 'default_static_members' : 'default_properties'][$key]; 1731 if (isset($value)) { 1650 1732 echo ' = '; 1651 echo str(value($v ));1733 echo str(value($value)); 1652 1734 } 1653 1735 echo ";\n"; … … 1787 1869 define('ZEND_FETCH_CLASS_AUTO', 5); 1788 1870 define('ZEND_FETCH_CLASS_INTERFACE', 6); 1871 define('ZEND_FETCH_CLASS_STATIC', 7); 1789 1872 1790 1873 define('ZEND_EVAL', (1<<0)); … … 1852 1935 'XC_ISSET_ISEMPTY_PROP_OBJ' => -1, 1853 1936 'XC_ISSET_ISEMPTY_VAR' => -1, 1937 'XC_INIT_STATIC_METHOD_CALL' => -1, 1854 1938 'XC_INIT_METHOD_CALL' => -1, 1855 1939 'XC_VERIFY_ABSTRACT_CLASS' => -1, 1856 1940 'XC_DECLARE_CLASS' => -1, 1857 1941 'XC_DECLARE_INHERITED_CLASS' => -1, 1942 'XC_DECLARE_INHERITED_CLASS_DELAYED' => -1, 1858 1943 'XC_ADD_INTERFACE' => -1, 1859 1944 'XC_POST_DEC_OBJ' => -1, -
branches/1.3/Makefile.frag
r695 r726 32 32 disassembler.lo: $(XCACHE_PROC_H) $(srcdir)/processor.c 33 33 34 $(builddir)/opcode_spec.lo: $(srcdir)/xcache.h $(srcdir)/opcode_spec.c $(srcdir)/opcode_spec_def.h $(srcdir)/const_string.h 35 opcode_spec.lo: $(srcdir)/xcache.h $(srcdir)/opcode_spec.c $(srcdir)/opcode_spec_def.h $(srcdir)/const_string.h 36 34 37 $(builddir)/xcache.lo: $(XCACHE_PROC_H) $(srcdir)/xc_shm.h $(srcdir)/stack.h $(srcdir)/xcache_globals.h $(srcdir)/xcache.c $(srcdir)/foreachcoresig.h $(srcdir)/utils.h 35 38 xcache.lo: $(XCACHE_PROC_H) $(srcdir)/xc_shm.h $(srcdir)/stack.h $(srcdir)/xcache_globals.h $(srcdir)/xcache.c $(srcdir)/foreachcoresig.h $(srcdir)/utils.h -
branches/1.3/NEWS
r701 r726 1 1 1.3.2 2011-??-?? 2 2 ======== 3 * memory leak on recompile 4 * disassembler fixes and updates for new PHP 3 5 * win32 build fix 4 6 * improve compatibility with ionCube Loader -
branches/1.3/const_string_opcodes_php6.x.h
r626 r726 1 /* size = 15 4*/1 /* size = 157 */ 2 2 static const char *const xc_opcode_names[] = { 3 3 /* 0 */ "NOP", … … 112 112 /* 109 */ "FETCH_CLASS", 113 113 /* 110 */ "CLONE", 114 /* 111 */ " UNDEF",114 /* 111 */ "RETURN_BY_REF", 115 115 /* 112 */ "INIT_METHOD_CALL", 116 116 /* 113 */ "INIT_STATIC_METHOD_CALL", … … 152 152 /* 149 */ "HANDLE_EXCEPTION", 153 153 /* 150 */ "USER_OPCODE", 154 /* 151 */ "U _NORMALIZE",154 /* 151 */ "UNDEF", 155 155 /* 152 */ "JMP_SET", 156 /* 153 */ "DECLARE_LAMBDA_FUNCTION" 156 /* 153 */ "DECLARE_LAMBDA_FUNCTION", 157 /* 154 */ "ADD_TRAIT", 158 /* 155 */ "BIND_TRAITS", 159 /* 156 */ "SEPARATE" 157 160 }; -
branches/1.3/coverager.c
r625 r726 379 379 static int xc_coverager_get_op_array_size_no_tail(zend_op_array *op_array) /* {{{ */ 380 380 { 381 zend_uint size; 382 383 size = op_array->size; 381 zend_uint last = op_array->last; 384 382 do { 385 383 next_op: 386 if ( size== 0) {384 if (last == 0) { 387 385 break; 388 386 } 389 switch (op_array->opcodes[ size- 1].opcode) {387 switch (op_array->opcodes[last - 1].opcode) { 390 388 #ifdef ZEND_HANDLE_EXCEPTION 391 389 case ZEND_HANDLE_EXCEPTION: … … 393 391 case ZEND_RETURN: 394 392 case ZEND_EXT_STMT: 395 size --;393 --last; 396 394 goto next_op; 397 395 } 398 396 } while (0); 399 return size;397 return last; 400 398 } 401 399 /* }}} */ -
branches/1.3/disassembler.c
r622 r726 6 6 #define return_value dst 7 7 8 /* sandbox {{{ */ 9 #undef TG 10 #undef OG 11 #define TG(x) (sandbox->tmp_##x) 12 #define OG(x) (sandbox->orig_##x) 13 /* }}} */ 14 8 15 #ifndef HAVE_XCACHE_OPCODE_SPEC_DEF 9 16 #error disassembler cannot be built without xcache/opcode_spec_def.h 10 17 #endif 11 static void xc_dasm( zval *dst, zend_op_array *op_array TSRMLS_DC) /* {{{ */18 static void xc_dasm(xc_sandbox_t *sandbox, zval *dst, zend_op_array *op_array TSRMLS_DC) /* {{{ */ 12 19 { 13 20 Bucket *b; … … 16 23 int bufsize = 2; 17 24 char *buf; 18 int keysize;19 25 20 26 xc_compile_result_init_cur(&cr, op_array TSRMLS_CC); … … 33 39 ALLOC_INIT_ZVAL(list); 34 40 array_init(list); 35 xc_dasm_HashTable_zend_function(list, CG(function_table) TSRMLS_CC); 41 b = TG(internal_function_tail) ? TG(internal_function_tail)->pListNext : TG(function_table).pListHead; 42 for (; b; b = b->pListNext) { 43 ALLOC_INIT_ZVAL(zv); 44 array_init(zv); 45 xc_dasm_zend_function(zv, b->pData TSRMLS_CC); 46 47 add_u_assoc_zval_ex(list, BUCKET_KEY_TYPE(b), ZSTR(BUCKET_KEY_S(b)), b->nKeyLength, zv); 48 } 36 49 add_assoc_zval_ex(dst, ZEND_STRS("function_table"), list); 37 50 … … 39 52 ALLOC_INIT_ZVAL(list); 40 53 array_init(list); 41 for (b = CG(class_table)->pListHead; b; b = b->pListNext) { 54 b = TG(internal_class_tail) ? TG(internal_class_tail)->pListNext : TG(class_table).pListHead; 55 for (; b; b = b->pListNext) { 56 int keysize, keyLength; 57 42 58 ALLOC_INIT_ZVAL(zv); 43 59 array_init(zv); … … 53 69 memcpy(buf, BUCKET_KEY_S(b), keysize); 54 70 buf[keysize - 2] = buf[keysize - 1] = ""[0]; 55 key size= b->nKeyLength;71 keyLength = b->nKeyLength; 56 72 #ifdef IS_UNICODE 57 73 if (BUCKET_KEY_TYPE(b) == IS_UNICODE) { 58 74 if (buf[0] == ""[0] && buf[1] == ""[0]) { 59 key size++;75 keyLength ++; 60 76 } 61 77 } else … … 63 79 { 64 80 if (buf[0] == ""[0]) { 65 key size++;81 keyLength ++; 66 82 } 67 83 } 68 add_u_assoc_zval_ex(list, BUCKET_KEY_TYPE(b), ZSTR(buf), b->nKeyLength, zv);84 add_u_assoc_zval_ex(list, BUCKET_KEY_TYPE(b), ZSTR(buf), keyLength, zv); 69 85 } 70 86 efree(buf); … … 97 113 } 98 114 99 xc_dasm( dst, op_array TSRMLS_CC);115 xc_dasm(&sandbox, dst, op_array TSRMLS_CC); 100 116 101 117 /* free */ … … 142 158 } 143 159 144 xc_dasm( dst, op_array TSRMLS_CC);160 xc_dasm(&sandbox, dst, op_array TSRMLS_CC); 145 161 146 162 /* free */ -
branches/1.3/mkstructinfo.awk
r394 r726 50 50 51 51 if (i == 0) { 52 elms = buffer[i];52 elms = "\"" buffer[i] "\""; 53 53 } 54 54 else { 55 elms = elms "," buffer[i];55 elms = elms "," "\"" buffer[i] "\""; 56 56 } 57 57 } -
branches/1.3/opcode_spec.c
r394 r726 20 20 const xc_opcode_spec_t *xc_get_opcode_spec(zend_uchar opcode) 21 21 { 22 #ifndef NDEBUG 23 if (xc_get_opcode_count() != xc_get_opcode_spec_count()) { 24 fprintf(stderr, "count mismatch: xc_get_opcode_count=%d, xc_get_opcode_spec_count=%d\n", xc_get_opcode_count(), xc_get_opcode_spec_count()); 25 } 26 #endif 22 27 assert(xc_get_opcode_count() == xc_get_opcode_spec_count()); 23 28 assert(opcode < xc_get_opcode_spec_count()); -
branches/1.3/opcode_spec_def.h
r626 r726 104 104 #endif 105 105 #ifdef ZEND_ENGINE_2_3 106 OPSPEC( STD, STD, STD, STD) /* 69 INIT_NS_FCALL_BY_NAME */106 OPSPEC( STD, STD, STD, UNUSED) /* 69 INIT_NS_FCALL_BY_NAME */ 107 107 #else 108 108 OPSPEC( UNUSED, STD, OPLINE, UNUSED) /* 69 JMP_NO_CTOR */ … … 147 147 OPSPEC( UNUSED, VAR_2, STD, VAR) /* 97 FETCH_OBJ_UNSET */ 148 148 OPSPEC( UNUSED, STD, STD, VAR) /* 98 FETCH_DIM_TMP_VAR */ 149 150 149 #ifdef ZEND_ENGINE_2 151 150 OPSPEC( UNUSED, UCLASS, STD, TMP) /* 99 FETCH_CONSTANT */ … … 153 152 OPSPEC( UNUSED, STD, UNUSED, TMP) /* 99 FETCH_CONSTANT */ 154 153 #endif 154 #ifdef ZEND_ENGINE_2_3 155 OPSPEC( STD, JMPADDR, STD, UNUSED) /* 100 GOTO */ 156 #else 155 157 OPSPEC( DECLARE, STD, STD, UNUSED) /* 100 DECLARE_FUNCTION_OR_CLASS */ 158 #endif 156 159 OPSPEC( STD, STD, STD, STD) /* 101 EXT_STMT */ 157 160 OPSPEC( STD, STD, STD, STD) /* 102 EXT_FCALL_BEGIN */ … … 165 168 OPSPEC( FCLASS, STD, STD, CLASS) /* 109 FETCH_CLASS */ 166 169 OPSPEC( UNUSED, STD, UNUSED, VAR) /* 110 CLONE */ 170 167 171 OPSPEC( UNUSED, STD, UNUSED, UNUSED) /* 111 INIT_CTOR_CALL */ 172 168 173 OPSPEC( UNUSED, STD, STD, VAR) /* 112 INIT_METHOD_CALL */ 174 # ifdef ZEND_ENGINE_2_3 175 OPSPEC( UNUSED, STD, STD, UNUSED) /* 113 INIT_STATIC_METHOD_CALL */ 176 # else 169 177 OPSPEC( UNUSED, UCLASS, STD, UNUSED) /* 113 INIT_STATIC_METHOD_CALL */ 178 # endif 170 179 OPSPEC( ISSET, STD, FETCH, TMP) /* 114 ISSET_ISEMPTY_VAR */ 171 180 OPSPEC( ISSET, STD, STD, TMP) /* 115 ISSET_ISEMPTY_DIM_OBJ */ 181 172 182 OPSPEC( UNUSED, CLASS, STD, UNUSED) /* 116 IMPORT_FUNCTION */ 173 183 OPSPEC( UNUSED, CLASS, STD, UNUSED) /* 117 IMPORT_CLASS */ … … 186 196 OPSPEC( UNUSED, STD, STD, VAR) /* 130 ASSIGN_BW_AND_OBJ */ 187 197 OPSPEC( UNUSED, STD, STD, VAR) /* 131 ASSIGN_BW_XOR_OBJ */ 198 188 199 OPSPEC( UNUSED, STD, STD, VAR) /* 132 PRE_INC_OBJ */ 189 200 OPSPEC( UNUSED, STD, STD, VAR) /* 133 PRE_DEC_OBJ */ … … 200 211 OPSPEC( DECLARE, STD, STD, UNUSED) /* 143 DECLARE_CONST */ 201 212 #else 202 OPSPEC( UNUSED, STD, UNUSED, UNUSED) /* 143 START_NAMESPACE */ 203 #endif 213 OPSPEC( UNUSED, UNUSED, UNUSED, UNUSED) /* 143 UNDEF-143 */ 214 #endif 215 #ifdef ZEND_ENGINE_2_3 216 OPSPEC( IFACE, CLASS, STD, UNUSED) /* 144 ADD_INTERFACE */ 217 #else 204 218 OPSPEC( IFACE, CLASS, CLASS, UNUSED) /* 144 ADD_INTERFACE */ 219 #endif 220 #ifdef ZEND_ENGINE_2_3 221 OPSPEC( CLASS, STD, STD, OPLINE) /* 145 DECLARE_INHERITED_CLASS_DELAYED */ 222 #else 205 223 OPSPEC( UNUSED, CLASS, STD, UNUSED) /* 145 VERIFY_INSTANCEOF */ 224 #endif 206 225 OPSPEC( UNUSED, CLASS, UNUSED, UNUSED) /* 146 VERIFY_ABSTRACT_CLASS */ 207 226 OPSPEC( UNUSED, STD, STD, VAR) /* 147 ASSIGN_DIM */ 208 227 OPSPEC( ISSET, STD, STD, TMP) /* 148 ISSET_ISEMPTY_PROP_OBJ */ 209 228 OPSPEC( STD, UNUSED, UNUSED, STD) /* 149 HANDLE_EXCEPTION */ 229 OPSPEC( STD, UNUSED, UNUSED, STD) /* 150 USER_OPCODE */ 210 230 # ifdef ZEND_ENGINE_2_3 211 OPSPEC( STD, UNUSED, UNUSED, STD) /* 150 ZEND_USER_OPCODE */212 231 OPSPEC( UNUSED, UNUSED, UNUSED, UNUSED) /* 151 UNDEF */ 213 OPSPEC( UNUSED, STD, JMPADDR, UNUSED) /* 152 JMP_SET */ 214 OPSPEC( UNUSED, STD, STD, UNUSED) /* 153 DECLARE_LAMBDA_FUNCTION */ 232 OPSPEC( UNUSED, STD, JMPADDR, TMP) /* 152 JMP_SET */ 233 OPSPEC( UNUSED, STD, STD, TMP) /* 153 DECLARE_LAMBDA_FUNCTION */ 234 # else 235 OPSPEC( UNUSED, UNUSED, UNUSED, UNUSED) /* 151 UNDEF */ 236 OPSPEC( UNUSED, UNUSED, UNUSED, UNUSED) /* 152 UNDEF */ 237 OPSPEC( UNUSED, UNUSED, UNUSED, UNUSED) /* 153 UNDEF */ 215 238 # endif 239 #else 240 OPSPEC( UNUSED, UNUSED, UNUSED, UNUSED) /* 107 UNDEF */ 241 OPSPEC( UNUSED, UNUSED, UNUSED, UNUSED) /* 108 UNDEF */ 242 OPSPEC( UNUSED, UNUSED, UNUSED, UNUSED) /* 109 UNDEF */ 243 OPSPEC( FCALL, STD, OPLINE, VAR) /* 61 DO_FCALL_BY_FUNC */ 244 OPSPEC(INIT_FCALL, STD, STD, UNUSED) /* 111 INIT_FCALL_BY_FUNC */ 245 OPSPEC( UNUSED, UNUSED, UNUSED, UNUSED) /* 112 UNDEF */ 216 246 #endif 217 247 }; -
branches/1.3/processor/hashtable.m4
r623 r726 65 65 66 66 efree(buf); 67 return; /* no check size */68 67 ', ` 69 68 dnl }}} -
branches/1.3/processor/head.m4
r691 r726 299 299 } 300 300 /* }}} */ 301 /* {{{ field name checker */ 302 IFASSERT(`dnl 303 int xc_check_names(const char *file, int line, const char *functionName, const char **assert_names, int assert_names_count, HashTable *done_names) 304 { 305 int errors = 0; 306 if (assert_names_count) { 307 int i; 308 Bucket *b; 309 310 for (i = 0; i < assert_names_count; ++i) { 311 if (!zend_hash_exists(done_names, assert_names[i], strlen(assert_names[i]) + 1)) { 312 fprintf(stderr 313 , "missing field at %s `#'%d %s`' : %s\n" 314 , file, line, functionName 315 , assert_names[i] 316 ); 317 ++errors; 318 } 319 } 320 321 for (b = done_names->pListHead; b != NULL; b = b->pListNext) { 322 int known = 0; 323 int i; 324 for (i = 0; i < assert_names_count; ++i) { 325 if (strcmp(assert_names[i], BUCKET_KEY_S(b)) == 0) { 326 known = 1; 327 break; 328 } 329 } 330 if (!known) { 331 fprintf(stderr 332 , "unknown field at %s `#'%d %s`' : %s\n" 333 , file, line, functionName 334 , BUCKET_KEY_S(b) 335 ); 336 ++errors; 337 } 338 } 339 } 340 return errors; 341 } 342 ') 343 /* }}} */ 301 344 dnl ================ export API 302 345 /* export: xc_entry_t *xc_processor_store_xc_entry_t(xc_entry_t *src TSRMLS_DC); :export {{{ */ -
branches/1.3/processor/main.m4
r691 r726 164 164 dnl }}} 165 165 dnl {{{ COPYNULL(1:elm) 166 # foreach(VAR, (LIST), STMT)167 m4_define([foreach],168 [m4_pushdef([$1])_foreach([$1], [$2], [$3])m4_popdef([$1])])169 m4_define([_arg1], [$1])170 m4_define([_foreach],171 [ifelse([$2], [()], ,172 [m4_define([$1], _arg1$2)$3[]_foreach([$1],173 (shift$2),174 [$3])])])175 166 define(`COPYNULL', ` 176 167 COPYNULL_EX(`dst->$1', `$2')DONE(`$1') … … 195 186 dnl }}} 196 187 dnl {{{ DONE_* 197 define(`DONE_SIZE', `IFASSERT(` 188 define(`DONE_SIZE', `IFASSERT(`dnl 198 189 done_size += $1`'; 199 190 done_count ++; 200 191 ')') 201 192 define(`DONE', ` 202 define(`ELEMENTS_DONE', defn(`ELEMENTS_DONE')`,$1') 193 define(`ELEMENTS_DONE', defn(`ELEMENTS_DONE')`,"$1"') 194 IFASSERT(`dnl 195 if (zend_hash_exists(&done_names, "$1", sizeof("$1"))) { 196 fprintf(stderr 197 , "duplicate field at %s `#'%d FUNC_NAME`' : %s\n" 198 , __FILE__, __LINE__ 199 , "$1" 200 ); 201 } 202 else { 203 zend_uchar b = 1; 204 zend_hash_add(&done_names, "$1", sizeof("$1"), (void*)&b, sizeof(b), NULL); 205 } 206 ') 203 207 DONE_SIZE(`sizeof(src->$1)') 204 208 ') -
branches/1.3/processor/processor.m4
r646 r726 85 85 #endif 86 86 } while(0); 87 return;88 87 ', ` 89 88 dnl IFDASM else … … 223 222 DISPATCH(zend_uint, class_name_len) 224 223 PROC_ZSTRING_L(, class_name, class_name_len) 224 #ifdef ZEND_ENGINE_2_4 225 DISPATCH(zend_uchar, type_hint) 226 #else 225 227 DISPATCH(zend_bool, array_type_hint) 228 #endif 226 229 DISPATCH(zend_bool, allow_null) 227 230 DISPATCH(zend_bool, pass_by_reference) 231 #ifndef ZEND_ENGINE_2_4 228 232 DISPATCH(zend_bool, return_reference) 229 233 DISPATCH(int, required_num_args) 234 #endif 230 235 ') 231 236 #endif … … 273 278 PROC_ZSTRING_L(, name, name_length) 274 279 DISPATCH(ulong, h) 280 #ifdef ZEND_ENGINE_2_4 281 DISPATCH(int, offset) 282 #endif 275 283 #ifdef ZEND_ENGINE_2_1 276 284 DISPATCH(int, doc_comment_len) … … 285 293 dnl }}} 286 294 DEF_STRUCT_P_FUNC(`zend_class_entry', , `dnl {{{ 295 int i; 287 296 IFCALCCOPY(` 288 297 processor->active_class_entry_src = src; … … 307 316 STRUCT_P(int, refcount) 308 317 #endif 318 #ifndef ZEND_ENGINE_2_4 309 319 DISPATCH(zend_bool, constants_updated) 320 #endif 310 321 #ifdef ZEND_ENGINE_2 311 322 DISPATCH(zend_uint, ce_flags) 312 323 #endif 313 324 314 STRUCT(HashTable, default_properties, HashTable_zval_ptr) 325 #ifdef ZEND_ENGINE_2_4 326 DISPATCH(int, default_properties_count) 327 STRUCT_ARRAY(default_properties_count, zval, default_properties_table) 328 DISPATCH(int, default_static_members_count) 329 STRUCT_ARRAY(default_static_members_count, zval, default_static_members_table) 330 IFCOPY(`dst->static_members_table = &dst->default_static_members_table;') 331 DONE(static_members_table) 332 #else 315 333 IFCOPY(`dst->builtin_functions = src->builtin_functions;') 316 334 DONE(builtin_functions) 317 #ifdef ZEND_ENGINE_2 335 STRUCT(HashTable, default_properties, HashTable_zval_ptr) 336 # ifdef ZEND_ENGINE_2 318 337 STRUCT(HashTable, properties_info, HashTable_zend_property_info) 319 # ifdef ZEND_ENGINE_2_1338 # ifdef ZEND_ENGINE_2_1 320 339 STRUCT(HashTable, default_static_members, HashTable_zval_ptr) 321 340 IFCOPY(`dst->static_members = &dst->default_static_members;') 322 341 DONE(static_members) 323 # else342 # else 324 343 STRUCT_P(HashTable, static_members, HashTable_zval_ptr) 325 # endif 344 # endif 345 # endif 346 #endif /* ZEND_ENGINE_2_4 */ 347 348 #ifdef ZEND_ENGINE_2 326 349 STRUCT(HashTable, constants_table, HashTable_zval_ptr) 327 350 328 351 dnl runtime binding: ADD_INTERFACE will deal with it 352 dnl runtime binding: ADD_TRAIT will deal with it 329 353 IFRESTORE(` 330 354 if (src->num_interfaces) { 331 355 CALLOC(dst->interfaces, zend_class_entry*, src->num_interfaces) 332 356 DONE(`interfaces') 357 # ifdef ZEND_ENGINE_2_4 358 CALLOC(dst->traits, zend_class_entry*, src->num_traits) 359 DONE(`traits') 360 DONE(`trait_aliases') 361 DONE(`trait_precedences') 362 # endif 333 363 } 334 364 else { 335 COPYNULL(interfaces) 365 COPYNULL(`interfaces') 366 # ifdef ZEND_ENGINE_2_4 367 COPYNULL(`traits') 368 COPYNULL(`trait_aliases') 369 COPYNULL(`trait_precedences') 370 # endif 336 371 } 337 372 ') … … 350 385 */ 351 386 DONE(`interfaces') 387 # ifdef ZEND_ENGINE_2_4 388 DONE(`traits') 389 DONE(`trait_aliases') 390 DONE(`trait_precedences') 391 # endif 352 392 } 353 393 else { 354 COPYNULL(interfaces) 394 COPYNULL(`interfaces') 395 # ifdef ZEND_ENGINE_2_4 396 COPYNULL(`traits') 397 COPYNULL(`trait_aliases') 398 COPYNULL(`trait_precedences') 399 # endif 355 400 } 356 401 ') … … 358 403 IFDASM(`', ` 359 404 DONE(`interfaces') 405 # ifdef ZEND_ENGINE_2_4 406 DONE(`traits') 407 DONE(`trait_aliases') 408 DONE(`trait_precedences') 409 # endif 360 410 ') 361 411 ') 362 412 DISPATCH(zend_uint, num_interfaces) 363 413 # ifdef ZEND_ENGINE_2_4 414 DISPATCH(zend_uint, num_traits) 415 # endif 416 417 # ifdef ZEND_ENGINE_2_4 418 DISABLECHECK(` 419 IFRESTORE(`COPY(info.user.filename)', `PROC_STRING(info.user.filename)') 420 DISPATCH(zend_uint, info.user.line_start) 421 DISPATCH(zend_uint, info.user.line_end) 422 DISPATCH(zend_uint, info.user.doc_comment_len) 423 PROC_ZSTRING_L(, info.user.doc_comment, info.user.doc_comment_len) 424 ') 425 DONE(info) 426 # else 364 427 IFRESTORE(`COPY(filename)', `PROC_STRING(filename)') 365 428 DISPATCH(zend_uint, line_start) 366 429 DISPATCH(zend_uint, line_end) 367 # ifdef ZEND_ENGINE_2_1430 # ifdef ZEND_ENGINE_2_1 368 431 DISPATCH(zend_uint, doc_comment_len) 369 432 PROC_ZSTRING_L(, doc_comment, doc_comment_len) 370 #endif 433 # endif 434 # endif 435 371 436 /* # NOT DONE */ 372 437 COPY(serialize_func) … … 376 441 COPY(get_iterator) 377 442 COPY(interface_gets_implemented) 378 # ifdef ZEND_ENGINE_2_3443 # ifdef ZEND_ENGINE_2_3 379 444 COPY(get_static_method) 380 # endif445 # endif 381 446 COPY(serialize) 382 447 COPY(unserialize) … … 388 453 COPY(__set) 389 454 /* should be >5.1 */ 390 # ifdef ZEND_ENGINE_2_1455 # ifdef ZEND_ENGINE_2_1 391 456 COPY(__unset) 392 457 COPY(__isset) 393 # if defined(ZEND_ENGINE_2_2) || PHP_MAJOR_VERSION >= 6458 # if defined(ZEND_ENGINE_2_2) || PHP_MAJOR_VERSION >= 6 394 459 COPY(__tostring) 395 # endif396 # endif460 # endif 461 # endif 397 462 COPY(__call) 398 # ifdef ZEND_CALLSTATIC_FUNC_NAME463 # ifdef ZEND_CALLSTATIC_FUNC_NAME 399 464 COPY(__callstatic) 400 #endif 465 # endif 466 # ifndef ZEND_ENGINE_2_4 401 467 /* # NOT DONE */ 402 468 COPY(module) 403 #else 469 # endif 470 #else /* ZEND_ENGINE_2 */ 404 471 COPY(handle_function_call) 405 472 COPY(handle_property_get) … … 415 482 ') 416 483 dnl }}} 484 #ifdef ZEND_ENGINE_2_4 485 undefine(`UNION_znode_op') 486 define(`UNION_znode_op', `dnl {{{ 487 assert(src->$1_type == IS_CONST || 488 src->$1_type == IS_VAR || 489 src->$1_type == IS_CV || 490 src->$1_type == IS_TMP_VAR || 491 src->$1_type == IS_UNUSED); 492 dnl dirty dispatch 493 DISABLECHECK(` 494 switch (src->$1_type) { 495 case IS_CONST: 496 dnl TODO: fix me, use literals 497 IFDASM(`{ 498 zval *zv; 499 ALLOC_INIT_ZVAL(zv); 500 *zv = ((zend_literal *) src->$1.ptr)->constant; 501 zval_copy_ctor(zv); 502 add_assoc_zval_ex(dst, ZEND_STRS("$1.constant"), zv); 503 } 504 ', ` 505 DISPATCH(zend_uint, $1.constant) 506 ') 507 break; 508 IFCOPY(` 509 IFNOTMEMCPY(` 510 default: 511 *dst = *src; 512 ') 513 ', ` 514 case IS_VAR: 515 case IS_TMP_VAR: 516 case IS_CV: 517 DISPATCH(zend_uint, $1.var) 518 break; 519 case IS_UNUSED: 520 IFDASM(`DISPATCH(zend_uint, $1.var)') 521 DISPATCH(zend_uint, $1.opline_num) 522 break; 523 ') 524 } 525 ') 526 DONE($1) 527 ') 528 dnl }}} 529 #else 417 530 DEF_STRUCT_P_FUNC(`znode', , `dnl {{{ 418 531 DISPATCH(int, op_type) … … 459 572 ') 460 573 DONE(u) 574 #if 0 575 DONE(EA) 576 #endif 461 577 #undef XCACHE_IS_CV 462 578 ') 463 579 dnl }}} 580 #endif 464 581 DEF_STRUCT_P_FUNC(`zend_op', , `dnl {{{ 465 582 DISPATCH(zend_uchar, opcode) 583 #ifdef ZEND_ENGINE_2_4 584 UNION_znode_op(result) 585 UNION_znode_op(op1) 586 UNION_znode_op(op2) 587 #else 466 588 STRUCT(znode, result) 467 589 STRUCT(znode, op1) 468 590 STRUCT(znode, op2) 591 #endif 469 592 DISPATCH(ulong, extended_value) 470 593 DISPATCH(uint, lineno) 471 594 #ifdef ZEND_ENGINE_2_1 595 #ifdef ZEND_ENGINE_2_4 596 DISPATCH(zend_uchar, op1_type) 597 DISPATCH(zend_uchar, op2_type) 598 DISPATCH(zend_uchar, result_type) 599 #endif 472 600 IFCOPY(` 473 601 switch (src->opcode) { … … 476 604 #endif 477 605 case ZEND_JMP: 478 dst->op1.u.jmp_addr = processor->active_opcodes_dst + (src->op1.u.jmp_addr - processor->active_opcodes_src);606 Z_OP(dst->op1).jmp_addr = processor->active_opcodes_dst + (Z_OP(src->op1).jmp_addr - processor->active_opcodes_src); 479 607 break; 480 608 … … 486 614 case ZEND_JMP_SET: 487 615 #endif 488 dst->op2.u.jmp_addr = processor->active_opcodes_dst + (src->op2.u.jmp_addr - processor->active_opcodes_src);616 Z_OP(dst->op2).jmp_addr = processor->active_opcodes_dst + (Z_OP(src->op2).jmp_addr - processor->active_opcodes_src); 489 617 break; 490 618 … … 497 625 ') 498 626 dnl }}} 627 #ifdef ZEND_ENGINE_2_4 628 DEF_STRUCT_P_FUNC(`zend_literal', , `dnl {{{ 629 STRUCT(zval, constant) 630 DISPATCH(zend_ulong, hash_value) 631 DISPATCH(zend_uint, cache_slot) 632 ') 633 dnl }}} 634 #endif 499 635 DEF_STRUCT_P_FUNC(`zend_op_array', , `dnl {{{ 500 636 IFRESTORE(` … … 535 671 DISPATCH(zend_uint, num_args) 536 672 DISPATCH(zend_uint, required_num_args) 673 # ifndef ZEND_ENGINE_2_4 537 674 DISPATCH(zend_bool, pass_rest_by_reference) 675 # endif 538 676 #else 539 677 if (src->arg_types) { … … 541 679 IFCOPY(`memcpy(dst->arg_types, src->arg_types, sizeof(src->arg_types[0]) * (src->arg_types[0]+1));') 542 680 IFDASM(`do { 543 zend_uint ii;544 681 int i; 545 682 zval *zv; … … 567 704 } 568 705 #endif 706 #ifndef ZEND_ENGINE_2_4 569 707 DISPATCH(unsigned char, return_reference) 708 #endif 570 709 /* END of common elements */ 571 710 #ifdef IS_UNICODE … … 584 723 popdef(`AFTER_ALLOC') 585 724 DISPATCH(zend_uint, last) 725 #ifndef ZEND_ENGINE_2_4 586 726 IFCOPY(`dst->size = src->last;DONE(size)', `DISPATCH(zend_uint, size)') 727 #endif 587 728 588 729 #ifdef IS_CV 589 730 STRUCT_ARRAY(last_var, zend_compiled_variable, vars) 590 731 DISPATCH(int, last_var) 732 # ifndef ZEND_ENGINE_2_4 591 733 IFCOPY(`dst->size_var = src->last_var;DONE(size_var)', `DISPATCH(zend_uint, size_var)') 734 # endif 592 735 #else 593 736 dnl zend_cv.m4 is illegal to be made public, don not ask me for it … … 601 744 STRUCT_ARRAY_I(last_brk_cont, zend_brk_cont_element, brk_cont_array) 602 745 DISPATCH(zend_uint, last_brk_cont) 746 #ifndef ZEND_ENGINE_2_4 603 747 DISPATCH(zend_uint, current_brk_cont) 748 #endif 604 749 #ifndef ZEND_ENGINE_2 605 750 DISPATCH(zend_bool, uses_globals) … … 613 758 STRUCT_P(HashTable, static_variables, HashTable_zval_ptr) 614 759 760 #ifndef ZEND_ENGINE_2_4 615 761 COPY(start_op) 616 762 DISPATCH(int, backpatch_count) 763 #endif 617 764 #ifdef ZEND_ENGINE_2_3 618 765 DISPATCH(zend_uint, this_var) 619 766 #endif 620 767 768 #ifndef ZEND_ENGINE_2_4 621 769 DISPATCH(zend_bool, done_pass_two) 770 #endif 622 771 /* 5.0 <= ver < 5.3 */ 623 772 #if defined(ZEND_ENGINE_2) && !defined(ZEND_ENGINE_2_3) … … 647 796 #if defined(HARDENING_PATCH) && HARDENING_PATCH 648 797 DISPATCH(zend_bool, created_by_eval) 798 #endif 799 #ifdef ZEND_ENGINE_2_4 800 DISPATCH(int, last_literal) 801 IFRESTORE(`COPY(literals)', `STRUCT_ARRAY_I(last_literal, zend_literal, literals)') 802 803 COPYNULL(run_time_cache) 804 COPYNULL(last_cache_slot) 649 805 #endif 650 806 } while (0); … … 680 836 ') 681 837 ') 838 682 839 #endif 683 840 -
branches/1.3/processor/struct.m4
r623 r726 30 30 { 31 31 pushdef(`ELEMENTS_DONE') 32 ifdef(`SIZEOF_$1', , `m4_errprint(`AUTOCHECK WARN: $1: missing structinfo, dont panic')define(`SIZEOF_$1', 0)')33 32 IFASSERT(` 34 33 /* {{{ init assert */ 35 ifdef(`SIZEOF_$1', , `m4_errprint(`missing SIZEOF_$1, safe to ignore') define(`SIZEOF_$1', 0)')36 ifdef(`COUNTOF_$1', , `m4_errprint(`missing COUNTOF_$1, safe to ignore') define(`COUNTOF_$1', 0)')34 ifdef(`SIZEOF_$1', , `m4_errprint(`missing SIZEOF_$1, safe to ignore')') 35 ifdef(`COUNTOF_$1', , `m4_errprint(`missing COUNTOF_$1, safe to ignore'))') 37 36 dnl SIZEOF_x COUNTOF_x can be both defined or both not 38 37 ifdef(`SIZEOF_$1', ` … … 48 47 int assert_size = SIZEOF_$1, assert_count = COUNTOF_$1; 49 48 int done_size = 0, done_count = 0; 49 const char *assert_names[] = { ifdef(`ELEMENTSOF_$1', `ELEMENTSOF_$1') }; 50 HashTable done_names; 51 zend_hash_init(&done_names, 0, NULL, NULL, 0); 50 52 /* }}} */ 51 53 IFRESTORE(`assert(xc_is_shm(src));') … … 53 55 do { 54 56 ') 57 ifdef(`SIZEOF_$1', , `m4_errprint(`AUTOCHECK WARN: $1: missing structinfo, dont panic')') 55 58 56 59 ifdef(`USEMEMCPY', `IFCOPY(` … … 68 71 INDENT()fprintf(stderr, "}\n"); 69 72 ') 70 ifdef(`SKIPASSERT_ONCE', `undefine(`SKIPASSERT_ONCE')', ` 73 ifdef(`SKIPASSERT_ONCE', ` 74 undefine(`SKIPASSERT_ONCE') 71 75 IFASSERT(` 72 /* {{{ check assert */ 76 zend_hash_destroy(&done_names); 77 ') 78 ', ` 79 IFASSERT(` 80 /* {{{ check assert */ do { 81 int name_check_errors = xc_check_names(__FILE__, __LINE__, "FUNC_NAME", assert_names, sizeof(assert_names) / sizeof(assert_names[0]), &done_names); 82 zend_hash_destroy(&done_names); 83 73 84 if (done_count != assert_count) { 74 85 fprintf(stderr … … 85 96 ); 86 97 } 87 if ( done_count != assert_count || done_size != assert_size) {98 if (name_check_errors || done_count != assert_count || done_size != assert_size) { 88 99 assert(0); 89 100 } 90 /* }}} */101 } while (0); /* }}} */ 91 102 ') 92 103 ifdef(`ELEMENTSOF_$1', ` -
branches/1.3/utils.c
r708 r726 20 20 21 21 #define OP_ZVAL_DTOR(op) do { \ 22 Z_UNSET_ISREF( (op).u.constant); \23 zval_dtor(& (op).u.constant); \22 Z_UNSET_ISREF(Z_OP_CONSTANT(op)); \ 23 zval_dtor(&Z_OP_CONSTANT(op)); \ 24 24 } while(0) 25 25 xc_compile_result_t *xc_compile_result_init(xc_compile_result_t *cr, /* {{{ */ … … 135 135 zend_op *opline, *end; 136 136 137 #ifndef ZEND_ENGINE_2_4 137 138 if (!op_array->done_pass_two) { 138 139 return 0; 139 140 } 141 #endif 140 142 141 143 opline = op_array->opcodes; … … 148 150 #endif 149 151 case ZEND_JMP: 150 opline->op1.u.opline_num = opline->op1.u.jmp_addr - op_array->opcodes;151 assert( opline->op1.u.opline_num < op_array->last);152 Z_OP(opline->op1).opline_num = Z_OP(opline->op1).jmp_addr - op_array->opcodes; 153 assert(Z_OP(opline->op1).opline_num < op_array->last); 152 154 break; 153 155 case ZEND_JMPZ: … … 158 160 case ZEND_JMP_SET: 159 161 #endif 160 opline->op2.u.opline_num = opline->op2.u.jmp_addr - op_array->opcodes;161 assert( opline->op2.u.opline_num < op_array->last);162 Z_OP(opline->op2).opline_num = Z_OP(opline->op2).jmp_addr - op_array->opcodes; 163 assert(Z_OP(opline->op2).opline_num < op_array->last); 162 164 break; 163 165 } … … 165 167 opline++; 166 168 } 169 #ifndef ZEND_ENGINE_2_4 167 170 op_array->done_pass_two = 0; 171 #endif 168 172 169 173 return 0; … … 174 178 zend_op *opline, *end; 175 179 180 #ifndef ZEND_ENGINE_2_4 176 181 if (op_array->done_pass_two) { 177 182 return 0; 178 183 } 184 #endif 179 185 180 186 /* … … 186 192 end = opline + op_array->last; 187 193 while (opline < end) { 188 if ( opline->op1.op_type== IS_CONST) {189 Z_SET_ISREF( opline->op1.u.constant);190 Z_SET_REFCOUNT( opline->op1.u.constant, 2); /* Make sure is_ref won't be reset */191 192 } 193 if ( opline->op2.op_type== IS_CONST) {194 Z_SET_ISREF( opline->op2.u.constant);195 Z_SET_REFCOUNT( opline->op2.u.constant, 2);194 if (Z_OP_TYPE(opline->op1) == IS_CONST) { 195 Z_SET_ISREF(Z_OP_CONSTANT(opline->op1)); 196 Z_SET_REFCOUNT(Z_OP_CONSTANT(opline->op1), 2); /* Make sure is_ref won't be reset */ 197 198 } 199 if (Z_OP_TYPE(opline->op2) == IS_CONST) { 200 Z_SET_ISREF(Z_OP_CONSTANT(opline->op2)); 201 Z_SET_REFCOUNT(Z_OP_CONSTANT(opline->op2), 2); 196 202 } 197 203 #ifdef ZEND_ENGINE_2_1 … … 201 207 #endif 202 208 case ZEND_JMP: 203 assert( opline->op1.u.opline_num < op_array->last);204 opline->op1.u.jmp_addr = op_array->opcodes + opline->op1.u.opline_num;209 assert(Z_OP(opline->op1).opline_num < op_array->last); 210 Z_OP(opline->op1).jmp_addr = op_array->opcodes + Z_OP(opline->op1).opline_num; 205 211 break; 206 212 case ZEND_JMPZ: … … 211 217 case ZEND_JMP_SET: 212 218 #endif 213 assert( opline->op2.u.opline_num < op_array->last);214 opline->op2.u.jmp_addr = op_array->opcodes + opline->op2.u.opline_num;219 assert(Z_OP(opline->op2).opline_num < op_array->last); 220 Z_OP(opline->op2).jmp_addr = op_array->opcodes + Z_OP(opline->op2).opline_num; 215 221 break; 216 222 } … … 220 226 } 221 227 228 #ifndef ZEND_ENGINE_2_4 222 229 op_array->done_pass_two = 1; 230 #endif 223 231 return 0; 224 232 } … … 226 234 227 235 #ifdef HAVE_XCACHE_OPCODE_SPEC_DEF 228 static void xc_fix_opcode_ex_znode(int tofix, xc_op_spec_t spec, z node *znode, int type TSRMLS_DC) /* {{{ */236 static void xc_fix_opcode_ex_znode(int tofix, xc_op_spec_t spec, zend_uchar *op_type, znode_op *op, int type TSRMLS_DC) /* {{{ */ 229 237 { 230 238 #ifdef ZEND_ENGINE_2 231 if (( znode->op_type != IS_UNUSED && (spec == OPSPEC_UCLASS || spec == OPSPEC_CLASS)) ||239 if ((*op_type != IS_UNUSED && (spec == OPSPEC_UCLASS || spec == OPSPEC_CLASS)) || 232 240 spec == OPSPEC_FETCH) { 233 241 if (tofix) { 234 switch ( znode->op_type) {242 switch (*op_type) { 235 243 case IS_VAR: 236 244 case IS_TMP_VAR: … … 239 247 default: 240 248 /* TODO: data lost, find a way to keep it */ 241 /* assert( znode->op_type == IS_CONST); */242 znode->op_type = IS_TMP_VAR;249 /* assert(*op_type == IS_CONST); */ 250 *op_type = IS_TMP_VAR; 243 251 } 244 252 } 245 253 } 246 switch ( znode->op_type) {254 switch (*op_type) { 247 255 case IS_TMP_VAR: 248 256 case IS_VAR: 249 257 if (tofix) { 250 znode->u.var /= sizeof(temp_variable);258 Z_OP(*op).var /= sizeof(temp_variable); 251 259 } 252 260 else { 253 znode->u.var *= sizeof(temp_variable);261 Z_OP(*op).var *= sizeof(temp_variable); 254 262 } 255 263 } … … 270 278 spec = xc_get_opcode_spec(opline->opcode); 271 279 272 xc_fix_opcode_ex_znode(tofix, spec->op1, & opline->op1, 0 TSRMLS_CC);273 xc_fix_opcode_ex_znode(tofix, spec->op2, & opline->op2, 1 TSRMLS_CC);274 xc_fix_opcode_ex_znode(tofix, spec->res, & opline->result, 2 TSRMLS_CC);280 xc_fix_opcode_ex_znode(tofix, spec->op1, &Z_OP_TYPE(opline->op1), &opline->op1, 0 TSRMLS_CC); 281 xc_fix_opcode_ex_znode(tofix, spec->op2, &Z_OP_TYPE(opline->op2), &opline->op2, 1 TSRMLS_CC); 282 xc_fix_opcode_ex_znode(tofix, spec->res, &Z_OP_TYPE(opline->result), &opline->result, 2 TSRMLS_CC); 275 283 } 276 284 } … … 304 312 #endif 305 313 case ZEND_JMP: 306 next = begin + opline->op1.u.opline_num;314 next = begin + Z_OP(opline->op1).opline_num; 307 315 break; 308 316 309 317 case ZEND_JMPZNZ: 310 next = begin + max( opline->op2.u.opline_num, opline->extended_value);318 next = begin + max(Z_OP(opline->op2).opline_num, opline->extended_value); 311 319 break; 312 320 … … 318 326 case ZEND_JMP_SET: 319 327 #endif 320 next = begin + opline->op2.u.opline_num;328 next = begin + Z_OP(opline->op2).opline_num; 321 329 break; 322 330 … … 371 379 } 372 380 373 parent_name = &( opline - 1)->op2.u.constant;381 parent_name = &(Z_OP_CONSTANT((opline - 1)->op2)); 374 382 TRACE("binding with parent %s", Z_STRVAL_P(parent_name)); 375 383 if (zend_lookup_class(Z_STRVAL_P(parent_name), Z_STRLEN_P(parent_name), &pce TSRMLS_CC) == FAILURE) { … … 387 395 zend_op *fetch_class_opline = opline - 1; 388 396 389 TRACE("%s %p", Z_STRVAL( fetch_class_opline->op2.u.constant), Z_STRVAL(fetch_class_opline->op2.u.constant));397 TRACE("%s %p", Z_STRVAL(Z_OP_CONSTANT(fetch_class_opline->op2)), Z_STRVAL(Z_OP_CONSTANT(fetch_class_opline->op2))); 390 398 OP_ZVAL_DTOR(fetch_class_opline->op2); 391 399 fetch_class_opline->opcode = ZEND_NOP; … … 421 429 } 422 430 423 zend_hash_del(class_table, opline->op1.u.constant.value.str.val, opline->op1.u.constant.value.str.len);431 zend_hash_del(class_table, Z_OP_CONSTANT(opline->op1).value.str.val, Z_OP_CONSTANT(opline->op1).value.str.len); 424 432 OP_ZVAL_DTOR(opline->op1); 425 433 OP_ZVAL_DTOR(opline->op2); … … 512 520 ZESW(&stored_ce_ptr, NULL) 513 521 ) == FAILURE) { 514 CG(zend_lineno) = ZESW(0, cep->line_start);522 CG(zend_lineno) = ZESW(0, Z_CLASS_INFO(*cep).line_start); 515 523 #ifdef IS_UNICODE 516 524 zend_error(E_ERROR, "Cannot redeclare class %R", type, cep->name); -
branches/1.3/xcache.c
r701 r726 931 931 xc_entry_data_php_t *php = (xc_entry_data_php_t *) data; 932 932 933 class_name = opline->op1.u.constant.value.str.val;934 class_len = opline->op1.u.constant.value.str.len;933 class_name = Z_OP_CONSTANT(opline->op1).value.str.val; 934 class_len = Z_OP_CONSTANT(opline->op1).value.str.len; 935 935 if (zend_hash_find(CG(class_table), class_name, class_len, (void **) &cest) == FAILURE) { 936 936 assert(0); … … 2437 2437 } 2438 2438 2439 if (value->type == IS_CONSTANT) { 2439 switch ((Z_TYPE_P(value) & IS_CONSTANT_TYPE_MASK)) { 2440 case IS_CONSTANT: 2440 2441 *return_value = *value; 2441 2442 zval_copy_ctor(return_value); 2442 2443 return_value->type = UNISW(IS_STRING, UG(unicode) ? IS_UNICODE : IS_STRING); 2443 return; 2444 } 2445 2446 if (value->type == IS_CONSTANT_ARRAY) { 2444 break; 2445 2446 case IS_CONSTANT_ARRAY: 2447 2447 *return_value = *value; 2448 2448 zval_copy_ctor(return_value); 2449 2449 return_value->type = IS_ARRAY; 2450 return; 2451 } 2452 2453 RETURN_NULL(); 2450 break; 2451 2452 default: 2453 RETURN_NULL(); 2454 } 2454 2455 } 2455 2456 /* }}} */ … … 2478 2479 } 2479 2480 /* }}} */ 2480 static function_entry xcache_functions[] = /* {{{ */2481 static zend_function_entry xcache_functions[] = /* {{{ */ 2481 2482 { 2482 2483 PHP_FE(xcache_count, NULL) -
branches/1.3/xcache.h
r700 r726 22 22 23 23 #define HAVE_INODE 24 #if !defined(ZEND_ENGINE_2_1) && (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 1 || PHP_MAJOR_VERSION > 5) 24 #if !defined(ZEND_ENGINE_2_4) && (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION == 3 && PHP_RELEASE_VERSION >= 99 || PHP_MAJOR_VERSION > 5) 25 # define ZEND_ENGINE_2_4 26 #endif 27 #if !defined(ZEND_ENGINE_2_3) && (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION == 3 || defined(ZEND_ENGINE_2_4)) 28 # define ZEND_ENGINE_2_3 29 #endif 30 #if !defined(ZEND_ENGINE_2_2) && (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION == 2 || defined(ZEND_ENGINE_2_3)) 31 # define ZEND_ENGINE_2_2 32 #endif 33 #if !defined(ZEND_ENGINE_2_1) && (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION == 1 || defined(ZEND_ENGINE_2_2)) 25 34 # define ZEND_ENGINE_2_1 26 #endif27 #if !defined(ZEND_ENGINE_2_2) && (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 2 || PHP_MAJOR_VERSION > 5)28 # define ZEND_ENGINE_2_229 #endif30 #if !defined(ZEND_ENGINE_2_3) && (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 3 || PHP_MAJOR_VERSION > 5)31 # define ZEND_ENGINE_2_332 35 #endif 33 36 … … 89 92 # define add_assoc_null_ex my_add_assoc_null_ex 90 93 #endif 94 95 #ifdef ZEND_ENGINE_2_4 96 # define Z_OP(op) (op) 97 # define Z_OP_CONSTANT(op) (op).literal->constant 98 # define Z_OP_TYPE(op) op##_##type 99 100 # define Z_CLASS_INFO(className) (className).info.user 101 #else 102 # define Z_OP(op) (op).u 103 # define Z_OP_CONSTANT(op) (op).u.constant 104 # define Z_OP_TYPE(op) (op).op_type 105 typedef znode znode_op; 106 107 # define Z_CLASS_INFO(className) (className) 108 #endif 109 91 110 /* }}} */ 92 111
Note: See TracChangeset
for help on using the changeset viewer.

