Browse Source

Decompiler: jmp_set/jmpz adjust

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@760 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
3.0
Xuefer 11 years ago
parent
commit
26a6230a83
  1. 8
      Decompiler.class.php
  2. 5
      decompilesample.php

8
Decompiler.class.php

@ -896,7 +896,7 @@ class Decompiler
$this->dumpop($op, $EX);
continue;
}
// $this->dumpop($op, $EX); //var_dump($op);
// echo $i; $this->dumpop($op, $EX); //var_dump($op);
$resvar = null;
if ((ZEND_ENGINE_2_4 ? ($res['op_type'] & EXT_TYPE_UNUSED) : ($res['EA.type'] & EXT_TYPE_UNUSED)) || $res['op_type'] == XC_IS_UNUSED) {
@ -1499,6 +1499,10 @@ class Decompiler
case XC_JMP_NO_CTOR:
break;
case XC_JMP_SET: // ?:
$resvar = $this->getOpVal($op1, $EX);
$op['cond'] = $resvar;
$op['isjmp'] = true;
break;
case XC_JMPNZ: // while
case XC_JMPZNZ: // for
case XC_JMPZ_EX: // and
@ -1520,7 +1524,7 @@ class Decompiler
echo "TODO(cond_false):\n";
var_dump($op);// exit;
}
if ($opc == XC_JMPZ_EX || $opc == XC_JMPNZ_EX || $opc == XC_JMPZ) {
if ($opc == XC_JMPZ_EX || $opc == XC_JMPNZ_EX) {
$targetop = &$EX['opcodes'][$op2['opline_num']];
if ($opc == XC_JMPNZ_EX) {
$targetop['cond_true'][] = foldToCode($rvalue, $EX);

5
decompilesample.php

@ -205,12 +205,12 @@ $a = $obj->b--;
$a = --$obj->b;
$a = $b xor $c;
$a = !$b;
$a = $b ? $c : $d;
$a = f1() ? f2() : f3();
$a = $b and $c;
$a = $b or $c;
$a = $b && $c;
$a = $b || $c;
$a = $b ? $c : $d;
$a = f1() ? f2() : f3();
try {
echo 'outer try 1';
@ -293,6 +293,7 @@ $this::__construct();
$obj::__construct();
$a = $b ?: $d;
$a = ($b ?: $d) + $c;
$a = f1() ?: f2();
echo 'goto a';

Loading…
Cancel
Save