Browse Source

disassembler: (PHP_5_5) fix tmp var num

master
Xuefer 6 years ago
parent
commit
5ff75525f5
  1. 7
      lib/Decompiler.class.php
  2. 8
      processor/processor.m4
  3. 2
      xcache/xc_utils.c

7
lib/Decompiler.class.php

@ -2087,7 +2087,12 @@ class Decompiler
$class['name'] = unquoteName($this->getOpVal($op2, $EX), $EX);
}
if ($opc == XC_DECLARE_INHERITED_CLASS || $opc == XC_DECLARE_INHERITED_CLASS_DELAYED) {
$ext /= XC_SIZEOF_TEMP_VARIABLE;
if (ZEND_ENGINE_2_5) {
$ext = (0xffffffff - $ext + 1) / XC_SIZEOF_TEMP_VARIABLE - 1;
}
else {
$ext /= XC_SIZEOF_TEMP_VARIABLE;
}
$class['parent'] = $T[$ext];
unset($T[$ext]);
}

8
processor/processor.m4

@ -691,6 +691,14 @@ define(`UNION_znode_op', `dnl {{{
', `
case IS_VAR:
case IS_TMP_VAR:
IFDASM(`
#ifdef ZEND_ENGINE_2_5
add_assoc_long_ex(DST(), XCACHE_STRS("$1.var"), (temp_variable *)0 - (temp_variable *)((int) SRC($1.var)) - 1);
break;
#endif
', `
/* no break */
')
case IS_CV:
PROCESS(zend_uint, $1.var)
break;

2
xcache/xc_utils.c

@ -309,6 +309,7 @@ static void xc_fix_opcode_ex_znode(int tofix, xc_op_spec_t spec, Z_OP_TYPEOF_TYP
*op_type = IS_UNUSED;
}
break;
#ifndef ZEND_ENGINE_2_5
case IS_TMP_VAR:
case IS_VAR:
if (tofix) {
@ -317,6 +318,7 @@ static void xc_fix_opcode_ex_znode(int tofix, xc_op_spec_t spec, Z_OP_TYPEOF_TYP
else {
Z_OP(*op).var *= sizeof(temp_variable);
}
#endif
}
#endif
}

Loading…
Cancel
Save