Changeset 807 for trunk/Decompiler.class.php
- Timestamp:
- 2011-04-27T07:56:54+02:00 (2 years ago)
- File:
-
- 1 edited
-
trunk/Decompiler.class.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Decompiler.class.php
r806 r807 782 782 // }}} 783 783 // {{{ try/catch 784 if (!empty($firstOp['jmpins']) && $opcodes[$firstOp['jmpins'][0]]['opcode'] == XC_JMP 785 && $lastOp['opcode'] == XC_JMP && !empty($lastOp['jmpouts']) && $lastOp['jmpouts'][0] <= $firstOp['jmpins'][0] 786 && !empty($opcodes[$range[1] + 1]['jmpins']) && $opcodes[$opcodes[$range[1] + 1]['jmpins'][0]]['opcode'] == XC_JMPZNZ 787 ) { 788 $nextRange = array($lastOp['jmpouts'][0], $firstOp['jmpins'][0]); 789 $conditionRange = array($range[0], $nextRange[0] - 1); 790 $this->removeJmpInfo($EX, $conditionRange[1]); 791 $bodyRange = array($nextRange[1], $range[1]); 792 $this->removeJmpInfo($EX, $bodyRange[1]); 793 794 $initial = ''; 795 $this->dasmBasicBlock($EX, $conditionRange, $indent . INDENT); 796 $conditionCodes = array(); 797 for ($i = $conditionRange[0]; $i <= $conditionRange[1]; ++$i) { 798 if (isset($opcodes[$i]['php'])) { 799 $conditionCodes[] = str($opcodes[$i]['php'], $EX); 800 } 801 } 802 $conditionCodes[] = str($this->getOpVal($opcodes[$conditionRange[1]]['op1'], $EX), $EX); 803 if (implode(',', $conditionCodes) == 'true') { 804 $conditionCodes = array(); 805 } 806 807 $this->dasmBasicBlock($EX, $nextRange, $indent . INDENT); 808 $nextCodes = array(); 809 for ($i = $nextRange[0]; $i <= $nextRange[1]; ++$i) { 810 if (isset($opcodes[$i]['php'])) { 811 $nextCodes[] = str($opcodes[$i]['php'], $EX); 812 } 813 } 814 $this->beginComplexBlock($EX); 815 echo $indent, 'for (', str($initial, $EX), '; ', implode(', ', $conditionCodes), '; ', implode(', ', $nextCodes), ') ', '{', PHP_EOL; 816 $this->recognizeAndDecompileClosedBlocks($EX, $bodyRange, $indent . INDENT); 817 echo $indent, '}', PHP_EOL; 818 $this->endComplexBlock($EX); 819 return; 820 } 821 // }}} 822 // {{{ try/catch 784 823 if (!empty($firstOp['jmpins']) && !empty($opcodes[$firstOp['jmpins'][0]]['isCatchBegin'])) { 785 824 $catchBlocks = array();
Note: See TracChangeset
for help on using the changeset viewer.

