Changeset 625 for branches/1.3/utils.c


Ignore:
Timestamp:
2009-07-05T11:01:49+02:00 (6 years ago)
Author:
moo
Message:

merged r541:559 from trunk

Location:
branches/1.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/1.3

  • branches/1.3/utils.c

    r623 r625  
    500500                    ZESW(&stored_ce_ptr, NULL)
    501501                    );
     502#ifndef ZEND_COMPILE_DELAYED_BINDING
    502503        if (oplineno != -1) {
    503504            xc_do_early_binding(CG(active_op_array), CG(class_table), oplineno TSRMLS_CC);
    504505        }
     506#endif
    505507    }
    506508    else if (zend_u_hash_quick_add(CG(class_table), type, key, len, h,
     
    526528#define OG(x) (sandbox->orig_##x)
    527529/* }}} */
     530<<<<<<< .working
     531=======
     532#ifdef E_STRICT
     533static void xc_sandbox_error_cb(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args) /* {{{ */
     534{
     535    xc_compilererror_t *compilererror;
     536    xc_sandbox_t *sandbox;
     537    TSRMLS_FETCH();
     538
     539    sandbox = (xc_sandbox_t *) XG(sandbox);
     540    assert(sandbox != NULL);
     541    if (type != E_STRICT) {
     542        /* give up, and user handler is not supported in this case */
     543        zend_uint i;
     544        zend_uint orig_lineno = CG(zend_lineno);
     545        zend_error_cb = sandbox->orig_zend_error_cb;
     546
     547        for (i = 0; i < sandbox->compilererror_cnt; i ++) {
     548            compilererror = &sandbox->compilererrors[i];
     549            CG(zend_lineno) = compilererror->lineno;
     550            zend_error(E_STRICT, "%s", compilererror->error);
     551        }
     552        CG(zend_lineno) = orig_lineno;
     553        sandbox->compilererror_cnt = 0;
     554
     555        sandbox->orig_zend_error_cb(type, error_filename, error_lineno, format, args);
     556        return;
     557    }
     558
     559    if (sandbox->compilererror_cnt <= sandbox->compilererror_size) {
     560        if (sandbox->compilererror_size) {
     561            sandbox->compilererror_size += 16;
     562            sandbox->compilererrors = erealloc(sandbox->compilererrors, sandbox->compilererror_size * sizeof(sandbox->compilererrors));
     563        }
     564        else {
     565            sandbox->compilererror_size = 16;
     566            sandbox->compilererrors = emalloc(sandbox->compilererror_size * sizeof(sandbox->compilererrors));
     567        }
     568    }
     569    compilererror = &sandbox->compilererrors[sandbox->compilererror_cnt++];
     570    compilererror->lineno = error_lineno;
     571    compilererror->error_len = vspprintf(&compilererror->error, 0, format, args);
     572}
     573/* }}} */
     574#endif
     575>>>>>>> .merge-right.r559
    528576#ifdef ZEND_ENGINE_2_1
    529577static zend_bool xc_auto_global_callback(char *name, uint name_len TSRMLS_DC) /* {{{ */
     
    625673#endif
    626674
     675#ifdef ZEND_COMPILE_IGNORE_INTERNAL_CLASSES
     676    sandbox->orig_compiler_options = CG(compiler_options);
     677    /* Using ZEND_COMPILE_IGNORE_INTERNAL_CLASSES for ZEND_FETCH_CLASS_RT_NS_CHECK
     678     */
     679    CG(compiler_options) |= ZEND_COMPILE_IGNORE_INTERNAL_CLASSES | ZEND_COMPILE_DELAYED_BINDING;
     680#endif
     681
     682    XG(sandbox) = (void *) sandbox;
    627683    return sandbox;
    628684}
     
    636692static void xc_sandbox_install(xc_sandbox_t *sandbox, xc_install_action_t install TSRMLS_DC) /* {{{ */
    637693{
    638     int i;
     694    zend_uint i;
    639695    Bucket *b;
    640696
     
    679735
    680736    if (install != XC_InstallNoBinding) {
     737#ifdef ZEND_COMPILE_DELAYED_BINDING
     738        zend_do_delayed_early_binding(CG(active_op_array) TSRMLS_CC);
     739#else
    681740        xc_undo_pass_two(CG(active_op_array) TSRMLS_CC);
    682741        xc_foreach_early_binding_class(CG(active_op_array), xc_early_binding_cb, (void *) sandbox TSRMLS_CC);
    683742        xc_redo_pass_two(CG(active_op_array) TSRMLS_CC);
     743#endif
    684744    }
    685745
     
    735795#endif
    736796
     797#ifdef ZEND_COMPILE_IGNORE_INTERNAL_CLASSES
     798    CG(compiler_options) = sandbox->orig_compiler_options;
     799#endif
     800
    737801    if (sandbox->alloc) {
    738802        efree(sandbox);
Note: See TracChangeset for help on using the changeset viewer.