Browse Source

Decompiler, disassembler: fix unset for PHP 5.0

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@1319 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
3.1
Xuefer 8 years ago
parent
commit
22e80e3194
  1. 9
      lib/Decompiler.class.php
  2. 5
      xcache/xc_opcode_spec_def.h

9
lib/Decompiler.class.php

@ -1640,6 +1640,9 @@ class Decompiler
if ($opc == XC_UNSET_OBJ) {
$dim->isObject = true;
}
else if ($opc == XC_UNSET_DIM_OBJ) {
$dim->isObject = $ext == ZEND_UNSET_OBJ;
}
unset($dim);
$rvalue = $dimbox;
unset($dimbox);
@ -1650,7 +1653,7 @@ class Decompiler
$rvalue = $this->getOpVal($opcodes[$i]['op1'], $EX);
$resvar = str($lvalue, $EX) . ' = ' . str($rvalue);
}
else if ($opc == XC_UNSET_DIM || $opc == XC_UNSET_OBJ) {
else if ($opc == XC_UNSET_DIM || $opc == XC_UNSET_OBJ || $opc == XC_UNSET_DIM_OBJ) {
$op['php'] = "unset(" . str($rvalue, $EX) . ")";
$lastphpop = &$op;
}
@ -2824,6 +2827,10 @@ if (ZEND_ENGINE_2_1) {
define('ZEND_FE_FETCH_BYREF', 1);
define('ZEND_FE_FETCH_WITH_KEY', 2);
}
else {
define('ZEND_UNSET_DIM', 1);
define('ZEND_UNSET_OBJ', 2);
}
define('ZEND_MEMBER_FUNC_CALL', 1<<0);
define('ZEND_CTOR_CALL', 1<<1);

5
xcache/xc_opcode_spec_def.h

@ -84,14 +84,13 @@ static const xc_opcode_spec_t xc_opcode_spec[] = {
/* php 5.1 and up */
OPSPEC( STD, STD, STD, UNUSED) /* 75 UNSET_DIM */
OPSPEC( STD, STD, STD, UNUSED) /* 76 UNSET_OBJ */
OPSPEC( BIT, STD, OPLINE, VAR) /* 77 FE_RESET */
#else
/* <= php 5.0 */
/* though there is no ISSET_ISEMPTY in php 5.0 it's better to leave it here i guess */
OPSPEC( UNUSED, VAR, STD, UNUSED) /* 75 UNSET_DIM_OBJ */
OPSPEC( UNUSED, VAR, ISSET, TMP)
OPSPEC( BIT, STD, UNUSED, VAR)
OPSPEC( UNUSED, VAR, ISSET, TMP) /* 76 UNUSED */
#endif
OPSPEC( BIT, STD, UNUSED, VAR) /* 77 FE_RESET */
OPSPEC( FE, STD, OPLINE, TMP) /* 78 FE_FETCH */
OPSPEC( UNUSED, STD, UNUSED, UNUSED) /* 79 EXIT */
OPSPEC( UNUSED, STD, FETCH, VAR) /* 80 FETCH_R */

Loading…
Cancel
Save