Changeset 803 for trunk/Decompiler.class.php
- Timestamp:
- 04/27/2011 06:52:34 AM (2 years ago)
- Files:
-
- 1 modified
-
trunk/Decompiler.class.php (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Decompiler.class.php
r802 r803 609 609 } 610 610 // }}} 611 function getOpVal($op, &$EX, $ tostr = true, $free = false) // {{{611 function getOpVal($op, &$EX, $free = false) // {{{ 612 612 { 613 613 switch ($op['op_type']) { 614 614 case XC_IS_CONST: 615 return foldToCode(value($op['constant']), $EX);615 return value($op['constant']); 616 616 617 617 case XC_IS_VAR: … … 619 619 $T = &$EX['Ts']; 620 620 $ret = $T[$op['var']]; 621 if ($tostr) {622 $ret = foldToCode($ret, $EX);623 }624 621 if ($free && empty($this->keepTs)) { 625 622 unset($T[$op['var']]); … … 753 750 754 751 $this->recognizeAndDecompileClosedBlocks($EX, array($range[0], $range[0]), $indent . INDENT); 755 $op1 = $this->getOpVal($firstOp['op1'], $EX, false,true);752 $op1 = $this->getOpVal($firstOp['op1'], $EX, true); 756 753 757 754 $this->recognizeAndDecompileClosedBlocks($EX, array($range[0] + 1, $range[1]), $indent . INDENT); 758 $op2 = $this->getOpVal($lastOp['op1'], $EX, false,true);755 $op2 = $this->getOpVal($lastOp['op1'], $EX, true); 759 756 760 757 $T[$firstOp['result']['var']] = new Decompiler_Binop($this, $op1, $firstOp['opcode'], $op2); … … 775 772 $condition = $this->getOpVal($firstOp['op1'], $EX); 776 773 $this->recognizeAndDecompileClosedBlocks($EX, $trueRange, $indent . INDENT); 777 $trueValue = $this->getOpVal($opcodes[$trueRange[1]]['op1'], $EX, false,true);774 $trueValue = $this->getOpVal($opcodes[$trueRange[1]]['op1'], $EX, true); 778 775 $this->recognizeAndDecompileClosedBlocks($EX, $falseRange, $indent . INDENT); 779 $falseValue = $this->getOpVal($opcodes[$falseRange[1]]['op1'], $EX, false,true);776 $falseValue = $this->getOpVal($opcodes[$falseRange[1]]['op1'], $EX, true); 780 777 $T[$opcodes[$trueRange[1]]['result']['var']] = new Decompiler_TriOp($condition, $trueValue, $falseValue); 781 778 return false; … … 1479 1476 case XC_UNSET_DIM: 1480 1477 case XC_UNSET_OBJ: 1481 $src = $this->getOpVal($op1, $EX , false);1478 $src = $this->getOpVal($op1, $EX); 1482 1479 if (is_a($src, "Decompiler_ForeachBox")) { 1483 1480 $src->iskey = $this->getOpVal($op2, $EX); … … 1491 1488 else { 1492 1489 if (!is_a($src, "Decompiler_ListBox")) { 1493 $op1val = $this->getOpVal($op1, $EX , false);1490 $op1val = $this->getOpVal($op1, $EX); 1494 1491 $list = new Decompiler_List(isset($op1val) ? $op1val : '$this'); 1495 1492 … … 1540 1537 case XC_ASSIGN: // {{{ 1541 1538 $lvalue = $this->getOpVal($op1, $EX); 1542 $rvalue = $this->getOpVal($op2, $EX , false);1539 $rvalue = $this->getOpVal($op2, $EX); 1543 1540 if (is_a($rvalue, 'Decompiler_ForeachBox')) { 1544 1541 $type = $rvalue->iskey ? 'fe_key' : 'fe_as'; … … 1576 1573 case XC_ASSIGN_REF: // {{{ 1577 1574 $lvalue = $this->getOpVal($op1, $EX); 1578 $rvalue = $this->getOpVal($op2, $EX , false);1575 $rvalue = $this->getOpVal($op2, $EX); 1579 1576 if (is_a($rvalue, 'Decompiler_Fetch')) { 1580 1577 $src = str($rvalue->src, $EX); … … 1710 1707 } 1711 1708 1712 $EX['fbc'] = $this->getOpVal($op2, $EX , false);1709 $EX['fbc'] = $this->getOpVal($op2, $EX); 1713 1710 if (($opc == XC_INIT_STATIC_METHOD_CALL || $opc == XC_INIT_METHOD_CALL) && !isset($EX['fbc'])) { 1714 1711 $EX['fbc'] = '__construct'; … … 1741 1738 break; 1742 1739 case XC_DO_FCALL: 1743 $fname = unquoteName($this->getOpVal($op1, $EX , false), $EX);1740 $fname = unquoteName($this->getOpVal($op1, $EX), $EX); 1744 1741 $args = $this->popargs($EX, $ext); 1745 1742 $resvar = $fname . "($args)"; … … 1871 1868 case XC_INIT_ARRAY: 1872 1869 case XC_ADD_ARRAY_ELEMENT: // {{{ 1873 $rvalue = $this->getOpVal($op1, $EX, false,true);1870 $rvalue = $this->getOpVal($op1, $EX, true); 1874 1871 1875 1872 if ($opc == XC_ADD_ARRAY_ELEMENT) { … … 1928 1925 // }}} 1929 1926 case XC_FE_FETCH: // {{{ 1930 $op['fe_src'] = $this->getOpVal($op1, $EX, false,true);1927 $op['fe_src'] = $this->getOpVal($op1, $EX, true); 1931 1928 $fe = new Decompiler_ForeachBox($op); 1932 1929 $fe->iskey = false; … … 2127 2124 else if (isset($this->binops[$opc])) { // {{{ 2128 2125 $this->usedOps[$opc] = true; 2129 $op1val = $this->getOpVal($op1, $EX , false);2130 $op2val = $this->getOpVal($op2, $EX , false);2126 $op1val = $this->getOpVal($op1, $EX); 2127 $op2val = $this->getOpVal($op2, $EX); 2131 2128 $rvalue = new Decompiler_Binop($this, $op1val, $opc, $op2val); 2132 2129 $resvar = $rvalue;

