Browse Source

decompiler: process ZEND_CASE opcode, switch/case is not recognized as it used to be however

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

5
Decompiler.class.php

@ -88,6 +88,7 @@ class Decompiler_Code extends Decompiler_Object // {{{
function Decompiler_Code($src)
{
assert('isset($src)');
$this->src = $src;
}
@ -1403,6 +1404,10 @@ class Decompiler
break;
// }}}
case XC_CASE:
$switchValue = $this->getOpVal($op1, $EX);
$caseValue = $this->getOpVal($op2, $EX);
$resvar = $switchValue . ' == ' . $caseValue;
break;
case XC_BRK:
break;
case XC_RECV_INIT:

14
decompilesample.php

@ -66,4 +66,18 @@ class ClassName
echo str_replace(array('a' => 'a', 'b' => 'c'), 'b');
switch ($switch) {
case 'case1':
echo 'case1';
break;
case 'case2':
echo 'case2';
break;
default:
echo 'default';
break;
}
?>

Loading…
Cancel
Save