Changeset 1398 in svn for trunk


Ignore:
Timestamp:
2013-09-26T07:14:42Z (2 years ago)
Author:
Xuefer
Message:

fix optimizer for try/catch/finally when either catch/finally is omitted

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r1394 r1398  
    22ChangeLog
    33========
    4  * adds support for PHP_5_5
     4 * added support for PHP_5_5 (cacher, optimizer, disassembler)
    55 * cacher:
    66   * closed #228: allow using var caching for cli to share data between child processes
     
    99 * disassembler:
    1010   * fixed crash with nested sandbox
    11    * improved support for PHP_4 ~ PHP_5_4, adds support for PHP_5_5
     11   * improved support for PHP_4 ~ PHP_5_4, also added support for PHP_5_5
    1212 * admin
    1313   * make mkpassword.php easier for noob
  • trunk/mod_optimizer/xc_optimizer.c

    r1351 r1398  
    494494        zend_uint j;
    495495        zend_try_catch_element *e = &op_array->try_catch_array[i];
    496         for (j = e->try_op; j < e->catch_op; j ++) {
    497             oplineinfos[j].catchbbid = oplineinfos[e->catch_op].bbid;
    498 #   ifdef ZEND_ENGINE_2_5
    499             oplineinfos[j].finallybbid = oplineinfos[e->finally_op].bbid;
     496        zend_uint end = e->catch_op != 0 ? e->catch_op : e->finally_op;
     497        for (j = e->try_op; j < end; j ++) {
     498            oplineinfos[j].catchbbid   = e->catch_op   == 0 ? BBID_INVALID : oplineinfos[e->catch_op  ].bbid;
     499#   ifdef ZEND_ENGINE_2_5
     500            oplineinfos[j].finallybbid = e->finally_op == 0 ? BBID_INVALID : oplineinfos[e->finally_op].bbid;
    500501#   endif
    501502        }
     
    610611            if (bb->catch != BBID_INVALID
    611612#   ifdef ZEND_ENGINE_2_5
    612              && bb->finally != BBID_INVALID
     613             || bb->finally != BBID_INVALID
    613614#   endif
    614615            ) {
    615616                zend_uint try_op = bbs_get(bbs, bbid)->opnum;
    616                 zend_uint catch_op = bbs_get(bbs, bb->catch)->opnum;
    617 #   ifdef ZEND_ENGINE_2_5
    618                 zend_uint finally_op = bbs_get(bbs, bb->finally)->opnum;
     617                zend_uint catch_op   = bb->catch   == BBID_INVALID ? 0 : bbs_get(bbs, bb->catch )->opnum;
     618#   ifdef ZEND_ENGINE_2_5
     619                zend_uint finally_op = bb->finally == BBID_INVALID ? 0 : bbs_get(bbs, bb->finally)->opnum;
    619620#   endif
    620621
Note: See TracChangeset for help on using the changeset viewer.