Changeset 1339 in svn for trunk


Ignore:
Timestamp:
2013-07-22T08:39:28+02:00 (2 years ago)
Author:
Xuefer
Message:

Decompiler: multiple catch support for PHP 5.1-

File:
1 edited

Legend:

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

    r1338 r1339  
    13761376            foreach ($op_array['try_catch_array'] as $try_catch_element) {
    13771377                $catch_op = $try_catch_element['catch_op'];
     1378                $opcodes[$catch_op]['isCatchBegin'] = true;
     1379            }
     1380            foreach ($op_array['try_catch_array'] as $try_catch_element) {
     1381                $catch_op = $try_catch_element['catch_op'];
    13781382                $try_op = $try_catch_element['try_op'];
    1379                 $opcodes[$try_op]['jmpins'][] = $catch_op;
    1380                 $opcodes[$catch_op]['jmpouts'][] = $try_op;
    1381                 $opcodes[$catch_op]['isCatchBegin'] = true;
     1383                do {
     1384                    $opcodes[$try_op]['jmpins'][] = $catch_op;
     1385                    $opcodes[$catch_op]['jmpouts'][] = $try_op;
     1386                    if ($opcodes[$catch_op]['opcode'] == XC_CATCH) {
     1387                        $catch_op = $opcodes[$catch_op]['extended_value'];
     1388                    }
     1389                    else if ($opcodes[$catch_op + 1]['opcode'] == XC_CATCH) {
     1390                        $catch_op = $opcodes[$catch_op + 1]['extended_value'];
     1391                    }
     1392                    else {
     1393                        break;
     1394                    }
     1395                } while ($catch_op <= $last && empty($opcodes[$catch_op]['isCatchBegin']));
    13821396            }
    13831397        }
Note: See TracChangeset for help on using the changeset viewer.