Changeset dbca5f0 in git


Ignore:
Timestamp:
2006-10-08T06:46:14Z (13 years ago)
Author:
Xuefer <xuefer@…>
Branches:
1.2, 1.3, 3.0, 3.1, 3.2, master, trunk
Children:
dff43a2
Parents:
e12208a
Message:

fixed #45, more robust xc_coverager_get_op_array_size_no_tail

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@228 c26eb9a1-5813-0410-bd6c-c2e55f420ca7

File:
1 edited

Legend:

Unmodified
Added
Removed
  • coverager.c

    rc9591db rdbca5f0  
    396396
    397397    size = op_array->size;
    398 #ifdef ZEND_ENGINE_2
    399     if (op_array->opcodes[size - 1].opcode == ZEND_HANDLE_EXCEPTION) {
    400         size --;
    401 #endif
    402         if (op_array->opcodes[size - 1].opcode == ZEND_RETURN) {
    403             size --;
    404             /* it's not real php statement */
    405             if (op_array->opcodes[size - 1].opcode == ZEND_EXT_STMT) {
     398    do {
     399next_op:
     400        if (size == 0) {
     401            break;
     402        }
     403        switch (op_array->opcodes[size - 1].opcode) {
     404#ifdef ZEND_HANDLE_EXCEPTION
     405            case ZEND_HANDLE_EXCEPTION:
     406#endif
     407            case ZEND_RETURN:
     408            case ZEND_EXT_STMT:
    406409                size --;
    407             }
    408         }   
    409 #ifdef ZEND_ENGINE_2
    410     }
    411 #endif
     410                goto next_op;
     411        }
     412    } while (0);
    412413    return size;
    413414}
Note: See TracChangeset for help on using the changeset viewer.