Show
Ignore:
Timestamp:
06/08/2011 05:45:25 AM (2 years ago)
Author:
moo
Message:

decode optimized if/return

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/Decompiler.class.php

    r819 r820  
    906906            return; 
    907907        } 
     908        if ($firstOp['opcode'] == XC_JMPZ && !empty($firstOp['jmpouts']) 
     909         && $firstOp['jmpouts'][0] - 1 == $range[1] && $opcodes[$firstOp['jmpouts'][0] - 1]['opcode'] == XC_RETURN) { 
     910            $this->beginComplexBlock($EX); 
     911            $this->removeJmpInfo($EX, $range[0]); 
     912            $condition = $this->getOpVal($opcodes[$range[0]]['op1'], $EX); 
     913 
     914            echo $indent, 'if (', str($condition, $EX), ') ', '{', PHP_EOL; 
     915            $this->beginScope($EX); 
     916            $this->recognizeAndDecompileClosedBlocks($EX, $range); 
     917            $this->endScope($EX); 
     918            echo $indent, '}', PHP_EOL; 
     919            $this->endComplexBlock($EX); 
     920            return; 
     921        } 
    908922        // }}} 
    909923        // {{{ try/catch