Changeset 625 for branches/1.3/utils.c
- Timestamp:
- 2009-07-05T11:01:49+02:00 (4 years ago)
- Location:
- branches/1.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.3
-
branches/1.3/utils.c
r623 r625 500 500 ZESW(&stored_ce_ptr, NULL) 501 501 ); 502 #ifndef ZEND_COMPILE_DELAYED_BINDING 502 503 if (oplineno != -1) { 503 504 xc_do_early_binding(CG(active_op_array), CG(class_table), oplineno TSRMLS_CC); 504 505 } 506 #endif 505 507 } 506 508 else if (zend_u_hash_quick_add(CG(class_table), type, key, len, h, … … 526 528 #define OG(x) (sandbox->orig_##x) 527 529 /* }}} */ 530 <<<<<<< .working 531 ======= 532 #ifdef E_STRICT 533 static 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 528 576 #ifdef ZEND_ENGINE_2_1 529 577 static zend_bool xc_auto_global_callback(char *name, uint name_len TSRMLS_DC) /* {{{ */ … … 625 673 #endif 626 674 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; 627 683 return sandbox; 628 684 } … … 636 692 static void xc_sandbox_install(xc_sandbox_t *sandbox, xc_install_action_t install TSRMLS_DC) /* {{{ */ 637 693 { 638 int i;694 zend_uint i; 639 695 Bucket *b; 640 696 … … 679 735 680 736 if (install != XC_InstallNoBinding) { 737 #ifdef ZEND_COMPILE_DELAYED_BINDING 738 zend_do_delayed_early_binding(CG(active_op_array) TSRMLS_CC); 739 #else 681 740 xc_undo_pass_two(CG(active_op_array) TSRMLS_CC); 682 741 xc_foreach_early_binding_class(CG(active_op_array), xc_early_binding_cb, (void *) sandbox TSRMLS_CC); 683 742 xc_redo_pass_two(CG(active_op_array) TSRMLS_CC); 743 #endif 684 744 } 685 745 … … 735 795 #endif 736 796 797 #ifdef ZEND_COMPILE_IGNORE_INTERNAL_CLASSES 798 CG(compiler_options) = sandbox->orig_compiler_options; 799 #endif 800 737 801 if (sandbox->alloc) { 738 802 efree(sandbox);
Note: See TracChangeset
for help on using the changeset viewer.

