Changeset 189 in svn


Ignore:
Timestamp:
2006-09-20T02:24:42+02:00 (9 years ago)
Author:
Xuefer
Message:

call op_array_ctor handler on restore to be more compatible with other zend_extension

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/processor/head.m4

    r178 r189  
    55
    66#include "php.h"
     7#include "zend_extensions.h"
    78#include "zend_compile.h"
    89#include "zend_API.h"
     
    1920extern unsigned int zend_hash_canary;
    2021#endif
     22extern zend_bool xc_have_op_array_ctor;
     23static void xc_zend_extension_op_array_ctor_handler(zend_extension *extension, zend_op_array *op_array TSRMLS_DC)
     24{
     25    if (extension->op_array_ctor) {
     26        extension->op_array_ctor(op_array);
     27    }
     28}
    2129
    2230define(`SIZEOF_zend_uint', `sizeof(zend_uint)')
  • trunk/processor/processor.m4

    r122 r189  
    474474        STRUCT_P(HashTable, static_variables, HashTable_zval_ptr)
    475475        define(`SKIPASSERT_ONCE')
    476 
    477     IFRESTORE(`
    478 #ifdef ZEND_ENGINE_2
    479         if (dst->scope) {
    480             dst->scope = xc_get_class(processor, (zend_ulong) dst->scope);
    481             xc_fix_method(processor, dst);
    482         }
    483 #endif
    484     ')
    485 
    486476    }
    487477    else
     
    496486    PROC_ZSTRING(, function_name)
    497487#ifdef ZEND_ENGINE_2
    498     IFRESTORE(`
    499         if (dst->scope) {
    500             dst->scope = xc_get_class(processor, (zend_ulong) dst->scope);
    501             xc_fix_method(processor, dst);
    502         }
    503         DONE(scope)
    504     ', `
    505         PROC_CLASS_ENTRY_P(scope)
    506     ')
    507488    DISPATCH(zend_uint, fn_flags)
    508489    dnl mark it as -1 on store, and lookup parent on restore
     
    637618#endif
    638619    } while (0);
     620
     621    IFRESTORE(`
     622#ifdef ZEND_ENGINE_2
     623        if (dst->scope) {
     624            dst->scope = xc_get_class(processor, (zend_ulong) dst->scope);
     625            xc_fix_method(processor, dst);
     626        }
     627        DONE(scope)
     628#endif
     629    ', `
     630#ifdef ZEND_ENGINE_2
     631        PROC_CLASS_ENTRY_P(scope)
     632#endif
     633    ')
     634
     635    IFRESTORE(`
     636        if (xc_have_op_array_ctor) {
     637            zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) xc_zend_extension_op_array_ctor_handler, dst TSRMLS_CC);
     638        }
     639    ')
    639640')
    640641dnl }}}
  • trunk/xcache.c

    r165 r189  
    9696static zend_bool xc_test = 0;
    9797static zend_bool xc_readonly_protection = 0;
     98
     99zend_bool xc_have_op_array_ctor = 0;
    98100
    99101static zend_bool xc_module_gotup = 0;
     
    22812283{
    22822284    char *env;
     2285    zend_extension *ext;
     2286    zend_llist_position lpos;
    22832287
    22842288    xc_module_gotup = 1;
     
    22892293        }
    22902294    }
     2295
     2296    /* cache if there's an op_array_ctor */
     2297    for (ext = zend_llist_get_first_ex(&zend_extensions, &lpos);
     2298            ext;
     2299            ext = zend_llist_get_next_ex(&zend_extensions, &lpos)) {
     2300        if (ext->op_array_ctor) {
     2301            xc_have_op_array_ctor = 1;
     2302            break;
     2303        }
     2304    }
     2305
    22912306
    22922307#ifndef PHP_GINIT
Note: See TracChangeset for help on using the changeset viewer.