Changeset 1314 in svn for trunk


Ignore:
Timestamp:
2013-07-15T03:05:24Z (2 years ago)
Author:
Xuefer
Message:

Decompiler, disassembler: update PHP 5.0 support

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Decompiler.class.php

    r1309 r1314  
    263263    public $fetchType;
    264264
    265     function Decompiler_Fetch($src, $type, $globalsrc)
     265    function Decompiler_Fetch($src, $type, $globalSrc)
    266266    {
    267267        $this->src = $src;
    268268        $this->fetchType = $type;
    269         $this->globalsrc = $globalsrc;
     269        $this->globalSrc = $globalSrc;
    270270    }
    271271
     
    274274        switch ($this->fetchType) {
    275275        case ZEND_FETCH_LOCAL:
    276             return '$' . substr($this->src, 1, -1);
     276            return '$' . $this->src;
    277277        case ZEND_FETCH_STATIC:
    278278            if (ZEND_ENGINE_2_3) {
     
    283283        case ZEND_FETCH_GLOBAL:
    284284        case ZEND_FETCH_GLOBAL_LOCK:
    285             return $this->globalsrc;
     285            return $this->globalSrc;
    286286        default:
    287287            var_dump($this->fetchType);
     
    12601260                if (!assert('$blockLast <= $range[1]')) {
    12611261                    var_dump($blockLast, $range[1]);
     1262                    printBacktrace();
    12621263                }
    12631264
     
    15591560                }
    15601561                else {
    1561                     $rvalue = $this->getOpVal($op1, $EX);
    1562                     $globalname = xcache_is_autoglobal($name) ? "\$$name" : "\$GLOBALS[" . str($rvalue) . "]";
    1563                     $rvalue = new Decompiler_Fetch($rvalue, $fetchType, $globalname);
     1562                    $rvalue = isset($op1['constant']) ? $op1['constant'] : $this->getOpVal($op1, $EX);
     1563                    $globalName = xcache_is_autoglobal($name) ? "\$$name" : "\$GLOBALS[" . $this->getOpVal($op1, $EX) . "]";
     1564                    $rvalue = new Decompiler_Fetch($rvalue, $fetchType, $globalName);
    15641565                }
    15651566
     
    15921593            case XC_FETCH_DIM_IS:
    15931594            case XC_ASSIGN_DIM:
    1594             case XC_UNSET_DIM_OBJ: // PHP 4 only
    15951595            case XC_UNSET_DIM:
    15961596            case XC_UNSET_OBJ:
     
    28822882    'XC_JMP_SET_VAR' => -1,
    28832883    'XC_QM_ASSIGN_VAR' => -1,
    2884     'XC_UNSET_DIM_OBJ' => -1,
     2884    'XC_UNSET_DIM' => -1,
     2885    'XC_UNSET_OBJ' => -1,
     2886    'XC_USER_OPCODE' => -1,
    28852887) as $k => $v) {
    28862888    if (!defined($k)) {
  • trunk/xcache/xc_utils.c

    r1298 r1314  
    131131#endif
    132132
    133 #ifdef ZEND_ENGINE_2_1
    134133        switch (opline->opcode) {
    135134#ifdef ZEND_GOTO
     
    157156                break;
    158157        }
    159 #endif
    160158        opline++;
    161159    }
     
    221219        }
    222220#endif
    223 #ifdef ZEND_ENGINE_2_1
    224221        switch (opline->opcode) {
    225222#ifdef ZEND_GOTO
     
    248245        }
    249246        /* ZEND_VM_SET_OPCODE_HANDLER(opline); this is not undone, don't redo. only do this for loader */
    250 #endif
    251247        opline++;
    252248    }
Note: See TracChangeset for help on using the changeset viewer.