CVS update: php3

From: Date: Sat, 03 Oct 1998 19:43:19 +0000
Subject: CVS update: php3
Groups: php.dev 
Request: Send a blank email to php-dev+get-1609@lists.php.net to get a copy of this message
Date: Saturday October 3, 1998 @ 15:43 Author: zeev Update of /repository/php3 In directory asf:/u2/tmp/cvs-serv27952 Modified Files: ChangeLog configure.in control_structures_inline.h language-parser.y main.c tls.h Log Message: - Fixed a problem in require() in conjunction with switch(), and in some other cases. Also fixed an identical problem with the call_user_function() API function. - Removed -lpthread when compiling with MySQL support. It caused various serious problems when compiled into Apache. Index: php3/ChangeLog diff -c php3/ChangeLog:1.496 php3/ChangeLog:1.497 *** php3/ChangeLog:1.496 Wed Sep 23 21:06:44 1998 --- php3/ChangeLog Sat Oct 3 15:43:16 1998 *************** *** 1,6 **** --- 1,11 ---- 'PHP 3.0 CHANGE LOG ChangeLog ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? Version 3.0.5 + - Fixed a problem in require() in conjunction with switch(), and in some other + cases. Also fixed an identical problem with the call_user_function() API + function. + - Removed -lpthread when compiling with MySQL support. It caused various + serious problems when compiled into Apache. - Fix in_addr_t check for systems with in_addr_t in netinet/in.h - Add atan2() function Index: php3/configure.in diff -c php3/configure.in:1.259 php3/configure.in:1.260 *** php3/configure.in:1.259 Fri Sep 25 10:07:28 1998 --- php3/configure.in Sat Oct 3 15:43:16 1998 *************** *** 1,4 **** ! dnl $Id: configure.in,v 1.259 1998/09/25 14:07:28 martin Exp $ dnl Process this file with autoconf to produce a configure script. AC_INIT(main.c) --- 1,4 ---- ! dnl $Id: configure.in,v 1.260 1998/10/03 19:43:16 zeev Exp $ dnl Process this file with autoconf to produce a configure script. AC_INIT(main.c) *************** *** 899,907 **** CPPFLAGS="$CPPFLAGS $MYSQL_INCLUDE" AC_CHECK_HEADERS(errmsg.h) CPPFLAGS="$old_CPPFLAGS" - - dnl the MySQL client library is multithreaded on some systems - AC_CHECK_LIB(pthread, pthread_self, [ LIBS="-lpthread $LIBS" ]) else AC_MSG_RESULT(no) dnl Why are we defining HAVE_MYSQL here?? --- 899,904 ---- Index: php3/control_structures_inline.h diff -c php3/control_structures_inline.h:1.188 php3/control_structures_inline.h:1.189 *** php3/control_structures_inline.h:1.188 Sat Sep 19 16:31:45 1998 --- php3/control_structures_inline.h Sat Oct 3 15:43:16 1998 *************** *** 29,35 **** */ ! /* $Id: control_structures_inline.h,v 1.188 1998/09/19 20:31:45 zeev Exp $ */ #ifdef THREAD_SAFE #include "tls.h" --- 29,35 ---- */ ! /* $Id: control_structures_inline.h,v 1.189 1998/10/03 19:43:16 zeev Exp $ */ #ifdef THREAD_SAFE #include "tls.h" *************** *** 70,77 **** extern inline void for_pre_statement(pval *for_token, pval *expr2, pval *expr3 INLINE_TLS); extern inline void for_post_statement(pval *for_token, pval *first_semicolon, pval *second_semicolon, pval *close_parentheses, int *yychar INLINE_TLS); extern inline void cs_return(pval *expr INLINE_TLS); ! extern inline void cs_start_include(pval *include_token INLINE_TLS); ! extern inline void cs_end_include(pval *include_token, pval *expr INLINE_TLS); extern inline void cs_show_source(pval *expr INLINE_TLS); extern inline void cs_pre_boolean_or(pval *left_expr INLINE_TLS); extern inline void cs_post_boolean_or(pval *result, pval *left_expr, pval *right_expr INLINE_TLS); --- 70,77 ---- extern inline void for_pre_statement(pval *for_token, pval *expr2, pval *expr3 INLINE_TLS); extern inline void for_post_statement(pval *for_token, pval *first_semicolon, pval *second_semicolon, pval *close_parentheses, int *yychar INLINE_TLS); extern inline void cs_return(pval *expr INLINE_TLS); ! extern inline void php3cs_start_require(pval *include_token INLINE_TLS); ! extern inline void php3cs_end_require(pval *include_token, pval *expr INLINE_TLS); extern inline void cs_show_source(pval *expr INLINE_TLS); extern inline void cs_pre_boolean_or(pval *left_expr INLINE_TLS); extern inline void cs_post_boolean_or(pval *result, pval *left_expr, pval *right_expr INLINE_TLS); *************** *** 679,685 **** } ! inline void cs_start_include(pval *include_token INLINE_TLS) { /* evaluate the expression even at Execute=0, if it's the first time we see this include(), otherwise, * don't evaluate it. --- 679,685 ---- } ! inline void php3cs_start_require(pval *include_token INLINE_TLS) { /* evaluate the expression even at Execute=0, if it's the first time we see this include(), otherwise, * don't evaluate it. *************** *** 687,694 **** --- 687,699 ---- if (GLOBAL(php3_display_source)) { return; } + stack_push(&GLOBAL(css), &GLOBAL(ExecuteFlag), sizeof(int)); + GLOBAL(php3g_function_state_for_require) = GLOBAL(function_state); + if (!include_token->cs_data.included) { + GLOBAL(function_state).loop_nest_level = GLOBAL(function_state).loop_change_level = GLOBAL(function_state).loop_change_type = 0; + GLOBAL(function_state).returned = 0; GLOBAL(ExecuteFlag) = EXECUTE; GLOBAL(Execute) = SHOULD_EXECUTE; } else { *************** *** 697,703 **** } } ! inline void cs_end_include(pval *include_token, pval *expr INLINE_TLS) { if (GLOBAL(php3_display_source)) { return; --- 702,709 ---- } } ! ! inline void php3cs_end_require(pval *include_token, pval *expr INLINE_TLS) { if (GLOBAL(php3_display_source)) { return; *************** *** 705,710 **** --- 711,718 ---- GLOBAL(ExecuteFlag) = stack_int_top(&GLOBAL(css)); stack_del_top(&GLOBAL(css)); GLOBAL(Execute) = SHOULD_EXECUTE; + GLOBAL(function_state) = GLOBAL(php3g_function_state_for_require); + if (!include_token->cs_data.included) { if (!GLOBAL(php3_display_source)) { include_file(expr,0); Index: php3/language-parser.y diff -c php3/language-parser.y:1.174 php3/language-parser.y:1.175 *** php3/language-parser.y:1.174 Fri Sep 18 12:55:00 1998 --- php3/language-parser.y Sat Oct 3 15:43:17 1998 *************** *** 31,37 **** */ ! /* $Id: language-parser.y,v 1.174 1998/09/18 16:55:00 rasmus Exp $ */ /* --- 31,37 ---- */ ! /* $Id: language-parser.y,v 1.175 1998/10/03 19:43:17 zeev Exp $ */ /* *************** *** 116,121 **** --- 116,122 ---- * soon-to-be-called function symbol table. */ FunctionState function_state; + FunctionState php3g_function_state_for_require; /* to save state when forcing execution in require() evaluation */ /* The following two variables are used when inside class definitions. */ char *class_name=NULL; *************** *** 304,310 **** | PHP_ECHO echo_expr_list ';' | INLINE_HTML { if (GLOBAL(Execute)) { if (php3_header()) PUTS($1.value.str.val); } } | expr ';' { if (GLOBAL(Execute)) pval_destructor(&$1 _INLINE_TLS); } ! | REQUIRE { cs_start_include(&$1 _INLINE_TLS); } expr ';' { cs_end_include(&$1,&$3 _INLINE_TLS); } | HIGHLIGHT_FILE expr ';' { if (GLOBAL(Execute)) cs_show_source(&$2 _INLINE_TLS); } | HIGHLIGHT_STRING '(' expr ')' ';' { if (GLOBAL(Execute)) eval_string(&$3,NULL,1 _INLINE_TLS); } | HIGHLIGHT_STRING '(' expr ',' expr ')' ';' { if (GLOBAL(Execute)) eval_string(&$3,&$5,2 _INLINE_TLS); } --- 305,311 ---- | PHP_ECHO echo_expr_list ';' | INLINE_HTML { if (GLOBAL(Execute)) { if (php3_header()) PUTS($1.value.str.val); } } | expr ';' { if (GLOBAL(Execute)) pval_destructor(&$1 _INLINE_TLS); } ! | REQUIRE { php3cs_start_require(&$1 _INLINE_TLS); } expr ';' { php3cs_end_require(&$1,&$3 _INLINE_TLS); } | HIGHLIGHT_FILE expr ';' { if (GLOBAL(Execute)) cs_show_source(&$2 _INLINE_TLS); } | HIGHLIGHT_STRING '(' expr ')' ';' { if (GLOBAL(Execute)) eval_string(&$3,NULL,1 _INLINE_TLS); } | HIGHLIGHT_STRING '(' expr ',' expr ')' ';' { if (GLOBAL(Execute)) eval_string(&$3,&$5,2 _INLINE_TLS); } *************** *** 742,747 **** --- 743,750 ---- int i; pval class_ptr; int original_shutdown_requested=GLOBAL(shutdown_requested); + int original_execute_flag = GLOBAL(ExecuteFlag); + FunctionState original_function_state = GLOBAL(function_state); /* save the location to go back to */ return_offset.offset = tc_get_current_offset(&GLOBAL(token_cache_manager))-1; *************** *** 756,764 **** } /* Do some magic... */ GLOBAL(ExecuteFlag) = EXECUTE; GLOBAL(Execute) = SHOULD_EXECUTE; - GLOBAL(shutdown_requested) = 0; tc_set_token(&token_cache_manager, func->offset, IC_FUNCTION); if (object) { --- 759,769 ---- } /* Do some magic... */ + GLOBAL(shutdown_requested) = 0; + GLOBAL(function_state).loop_nest_level = GLOBAL(function_state).loop_change_level = GLOBAL(function_state).loop_change_type = 0; + GLOBAL(function_state).returned = 0; GLOBAL(ExecuteFlag) = EXECUTE; GLOBAL(Execute) = SHOULD_EXECUTE; tc_set_token(&token_cache_manager, func->offset, IC_FUNCTION); if (object) { *************** *** 775,781 **** if (GLOBAL(shutdown_requested)) { /* we died during this function call */ return FAILURE; } - GLOBAL(shutdown_requested) = original_shutdown_requested; cs_functioncall_end(retval,function_name,&return_offset,NULL,0); return SUCCESS; } --- 780,789 ---- if (GLOBAL(shutdown_requested)) { /* we died during this function call */ return FAILURE; } cs_functioncall_end(retval,function_name,&return_offset,NULL,0); + GLOBAL(function_state) = original_function_state; + GLOBAL(ExecuteFlag) = original_execute_flag; + GLOBAL(Execute) = SHOULD_EXECUTE; + GLOBAL(shutdown_requested) = original_shutdown_requested; return SUCCESS; } Index: php3/main.c diff -c php3/main.c:1.471 php3/main.c:1.472 *** php3/main.c:1.471 Tue Sep 29 19:33:27 1998 --- php3/main.c Sat Oct 3 15:43:18 1998 *************** *** 29,35 **** +----------------------------------------------------------------------+ */ ! /* $Id: main.c,v 1.471 1998/09/29 23:33:27 shane Exp $ */ /* #define CRASH_DETECTION */ --- 29,35 ---- +----------------------------------------------------------------------+ */ ! /* $Id: main.c,v 1.472 1998/10/03 19:43:18 zeev Exp $ */ /* #define CRASH_DETECTION */ *************** *** 248,254 **** /* is 4K big enough? */ #define PRINTF_BUFFER_SIZE 1024*4 ! /*wrapper for modules to use PHPWRITE */ PHPAPI int php3_write(void *buf, int size) { TLS_VARS; --- 248,254 ---- /* is 4K big enough? */ #define PRINTF_BUFFER_SIZE 1024*4 ! /* wrapper for modules to use PHPWRITE */ PHPAPI int php3_write(void *buf, int size) { TLS_VARS; Index: php3/tls.h diff -c php3/tls.h:1.57 php3/tls.h:1.58 *** php3/tls.h:1.57 Sun Sep 6 16:46:08 1998 --- php3/tls.h Sat Oct 3 15:43:19 1998 *************** *** 82,88 **** Stack css; Stack for_stack; Stack input_source_stack; ! Stack function_state_stack; Stack switch_stack; Stack variable_unassign_stack; HashTable *active_symbol_table; --- 82,88 ---- Stack css; Stack for_stack; Stack input_source_stack; ! Stack function_state_stack; Stack switch_stack; Stack variable_unassign_stack; HashTable *active_symbol_table; *************** *** 91,96 **** --- 91,97 ---- int current_lineno; int include_count; FunctionState function_state; + FunctionState php3g_function_state_for_require; char *class_name; HashTable *class_symbol_table; pval return_value,globals; -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#1609) next »