Browse Source

PHP_6: added goto support

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@515 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
3.0
Xuefer 14 years ago
parent
commit
f304523f89
  1. 3
      processor/processor.m4
  2. 9
      utils.c

3
processor/processor.m4

@ -474,6 +474,9 @@ DEF_STRUCT_P_FUNC(`zend_op', , `dnl {{{
#ifdef ZEND_ENGINE_2_1
IFCOPY(`
switch (src->opcode) {
#ifdef ZEND_GOTO
case ZEND_GOTO:
#endif
case ZEND_JMP:
dst->op1.u.jmp_addr = processor->active_opcodes_dst + (src->op1.u.jmp_addr - processor->active_opcodes_src);
break;

9
utils.c

@ -143,6 +143,9 @@ int xc_undo_pass_two(zend_op_array *op_array TSRMLS_DC) /* {{{ */
while (opline < end) {
#ifdef ZEND_ENGINE_2_1
switch (opline->opcode) {
#ifdef ZEND_GOTO
case ZEND_GOTO:
#endif
case ZEND_JMP:
opline->op1.u.opline_num = opline->op1.u.jmp_addr - op_array->opcodes;
assert(opline->op1.u.opline_num < op_array->last);
@ -193,6 +196,9 @@ int xc_redo_pass_two(zend_op_array *op_array TSRMLS_DC) /* {{{ */
}
#ifdef ZEND_ENGINE_2_1
switch (opline->opcode) {
#ifdef ZEND_GOTO
case ZEND_GOTO:
#endif
case ZEND_JMP:
assert(opline->op1.u.opline_num < op_array->last);
opline->op1.u.jmp_addr = op_array->opcodes + opline->op1.u.opline_num;
@ -293,6 +299,9 @@ int xc_foreach_early_binding_class(zend_op_array *op_array, void (*callback)(zen
end = opline + op_array->last;
while (opline < end) {
switch (opline->opcode) {
#ifdef ZEND_GOTO
case ZEND_GOTO:
#endif
case ZEND_JMP:
next = begin + opline->op1.u.opline_num;
break;

Loading…
Cancel
Save