summaryrefslogtreecommitdiff
path: root/sapi
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2014-11-18 20:30:43 +0100
committerOndřej Surý <ondrej@sury.org>2014-11-18 20:30:43 +0100
commitf40f1ce174885cd0f526c003eca3fa523e0ef269 (patch)
treece22a7abe1212824c0be6bace0eb49de7249f9f9 /sapi
parent1dc5de7731d1bc41002f9b58f798e93f393e6f08 (diff)
downloadphp-f40f1ce174885cd0f526c003eca3fa523e0ef269.tar.gz
New upstream version 5.6.3+dfsgupstream/5.6.3+dfsg
Diffstat (limited to 'sapi')
-rw-r--r--sapi/cgi/fastcgi.c4
-rw-r--r--sapi/cli/tests/016.phpt2
-rw-r--r--sapi/fpm/fpm/fpm_main.c11
-rw-r--r--sapi/fpm/fpm/fpm_sockets.c85
-rw-r--r--sapi/fpm/fpm/fpm_sockets.h6
-rw-r--r--sapi/fpm/php-fpm.conf.in2
-rw-r--r--sapi/fpm/tests/003.phpt53
-rw-r--r--sapi/litespeed/lsapi_main.c3
-rw-r--r--sapi/phpdbg/phpdbg.c88
-rw-r--r--sapi/phpdbg/phpdbg_cmd.c73
-rw-r--r--sapi/phpdbg/phpdbg_cmd.h1
-rw-r--r--sapi/phpdbg/phpdbg_parser.c211
-rw-r--r--sapi/phpdbg/phpdbg_parser.h16
13 files changed, 290 insertions, 265 deletions
diff --git a/sapi/cgi/fastcgi.c b/sapi/cgi/fastcgi.c
index 8ddc2e457..613366830 100644
--- a/sapi/cgi/fastcgi.c
+++ b/sapi/cgi/fastcgi.c
@@ -1112,7 +1112,7 @@ static inline void fcgi_close(fcgi_request *req, int force, int destroy)
shutdown(req->fd, 1);
/* read the last FCGI_STDIN header (it may be omitted) */
- recv(req->fd, &buf, sizeof(buf), 0);
+ recv(req->fd, (char *)(&buf), sizeof(buf), 0);
}
closesocket(req->fd);
}
@@ -1122,7 +1122,7 @@ static inline void fcgi_close(fcgi_request *req, int force, int destroy)
shutdown(req->fd, 1);
/* read the last FCGI_STDIN header (it may be omitted) */
- recv(req->fd, &buf, sizeof(buf), 0);
+ recv(req->fd, (char *)(&buf), sizeof(buf), 0);
}
close(req->fd);
#endif
diff --git a/sapi/cli/tests/016.phpt b/sapi/cli/tests/016.phpt
index 31c1a40e4..9c28d15a3 100644
--- a/sapi/cli/tests/016.phpt
+++ b/sapi/cli/tests/016.phpt
@@ -59,8 +59,6 @@ foreach ($codes as $key => $code) {
echo "\nDone\n";
?>
---XFAIL--
-https://bugs.php.net/bug.php?id=55496
--EXPECTF--
--------------
Snippet no. 1:
diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c
index cd5492d73..5b96dee03 100644
--- a/sapi/fpm/fpm/fpm_main.c
+++ b/sapi/fpm/fpm/fpm_main.c
@@ -1237,6 +1237,17 @@ static void init_request_info(TSRMLS_D)
SG(request_info).request_uri = orig_script_name;
}
path_info[0] = old;
+ } else if (apache_was_here && env_script_name) {
+ /* Using mod_proxy_fcgi and ProxyPass, apache cannot set PATH_INFO
+ * As we can extract PATH_INFO from PATH_TRANSLATED
+ * it is probably also in SCRIPT_NAME and need to be removed
+ */
+ int snlen = strlen(env_script_name);
+ if (snlen>slen && !strcmp(env_script_name+snlen-slen, path_info)) {
+ _sapi_cgibin_putenv("ORIG_SCRIPT_NAME", orig_script_name TSRMLS_CC);
+ env_script_name[snlen-slen] = 0;
+ SG(request_info).request_uri = _sapi_cgibin_putenv("SCRIPT_NAME", env_script_name TSRMLS_CC);
+ }
}
env_path_info = _sapi_cgibin_putenv("PATH_INFO", path_info TSRMLS_CC);
}
diff --git a/sapi/fpm/fpm/fpm_sockets.c b/sapi/fpm/fpm/fpm_sockets.c
index e056565ea..da14d63d8 100644
--- a/sapi/fpm/fpm/fpm_sockets.c
+++ b/sapi/fpm/fpm/fpm_sockets.c
@@ -39,29 +39,6 @@ struct listening_socket_s {
static struct fpm_array_s sockets_list;
-static int fpm_sockets_resolve_af_inet(char *node, char *service, struct sockaddr_in *addr) /* {{{ */
-{
- struct addrinfo *res;
- struct addrinfo hints;
- int ret;
-
- memset(&hints, 0, sizeof(hints));
- hints.ai_family = AF_INET;
- ret = getaddrinfo(node, service, &hints, &res);
-
- if (ret != 0) {
- zlog(ZLOG_ERROR, "can't resolve hostname '%s%s%s': getaddrinfo said: %s%s%s\n",
- node, service ? ":" : "", service ? service : "",
- gai_strerror(ret), ret == EAI_SYSTEM ? ", system error: " : "", ret == EAI_SYSTEM ? strerror(errno) : "");
- return -1;
- }
-
- *addr = *(struct sockaddr_in *) res->ai_addr;
- freeaddrinfo(res);
- return 0;
-}
-/* }}} */
-
enum { FPM_GET_USE_SOCKET = 1, FPM_STORE_SOCKET = 2, FPM_STORE_USE_SOCKET = 3 };
static void fpm_sockets_cleanup(int which, void *arg) /* {{{ */
@@ -98,14 +75,23 @@ static void fpm_sockets_cleanup(int which, void *arg) /* {{{ */
}
/* }}} */
+static void *fpm_get_in_addr(struct sockaddr *sa) /* {{{ */
+{
+ if (sa->sa_family == AF_INET) {
+ return &(((struct sockaddr_in*)sa)->sin_addr);
+ }
+
+ return &(((struct sockaddr_in6*)sa)->sin6_addr);
+}
+/* }}} */
+
static int fpm_sockets_hash_op(int sock, struct sockaddr *sa, char *key, int type, int op) /* {{{ */
{
if (key == NULL) {
switch (type) {
case FPM_AF_INET : {
- struct sockaddr_in *sa_in = (struct sockaddr_in *) sa;
- key = alloca(sizeof("xxx.xxx.xxx.xxx:ppppp"));
- sprintf(key, "%u.%u.%u.%u:%u", IPQUAD(&sa_in->sin_addr), (unsigned int) ntohs(sa_in->sin_port));
+ key = alloca(INET6_ADDRSTRLEN);
+ inet_ntop(sa->sa_family, fpm_get_in_addr(sa), key, sizeof key);
break;
}
@@ -254,11 +240,14 @@ enum fpm_address_domain fpm_sockets_domain_from_address(char *address) /* {{{ */
static int fpm_socket_af_inet_listening_socket(struct fpm_worker_pool_s *wp) /* {{{ */
{
- struct sockaddr_in sa_in;
+ struct addrinfo hints, *servinfo, *p;
char *dup_address = strdup(wp->config->listen_address);
- char *port_str = strchr(dup_address, ':');
+ char *port_str = strrchr(dup_address, ':');
char *addr = NULL;
+ int addr_len;
int port = 0;
+ int sock;
+ int status;
if (port_str) { /* this is host:port pair */
*port_str++ = '\0';
@@ -274,23 +263,35 @@ static int fpm_socket_af_inet_listening_socket(struct fpm_worker_pool_s *wp) /*
return -1;
}
- memset(&sa_in, 0, sizeof(sa_in));
-
- if (addr) {
- sa_in.sin_addr.s_addr = inet_addr(addr);
- if (sa_in.sin_addr.s_addr == INADDR_NONE) { /* do resolve */
- if (0 > fpm_sockets_resolve_af_inet(addr, NULL, &sa_in)) {
- return -1;
- }
- zlog(ZLOG_NOTICE, "address '%s' resolved as %u.%u.%u.%u", addr, IPQUAD(&sa_in.sin_addr));
+ // strip brackets from address for getaddrinfo
+ if (addr != NULL) {
+ addr_len = strlen(addr);
+ if (addr[0] == '[' && addr[addr_len - 1] == ']') {
+ addr[addr_len - 1] = '\0';
+ addr++;
}
- } else {
- sa_in.sin_addr.s_addr = htonl(INADDR_ANY);
}
- sa_in.sin_family = AF_INET;
- sa_in.sin_port = htons(port);
+
+ memset(&hints, 0, sizeof hints);
+ hints.ai_family = AF_UNSPEC;
+ hints.ai_socktype = SOCK_STREAM;
+
+ if ((status = getaddrinfo(addr, port_str, &hints, &servinfo)) != 0) {
+ zlog(ZLOG_ERROR, "getaddrinfo: %s\n", gai_strerror(status));
+ return -1;
+ }
+
free(dup_address);
- return fpm_sockets_get_listening_socket(wp, (struct sockaddr *) &sa_in, sizeof(struct sockaddr_in));
+
+ for (p = servinfo; p != NULL; p = p->ai_next) {
+ if ((sock = fpm_sockets_get_listening_socket(wp, p->ai_addr, p->ai_addrlen)) != -1) {
+ break;
+ }
+ }
+
+ freeaddrinfo(servinfo);
+
+ return sock;
}
/* }}} */
diff --git a/sapi/fpm/fpm/fpm_sockets.h b/sapi/fpm/fpm/fpm_sockets.h
index 121c016a7..446c78e41 100644
--- a/sapi/fpm/fpm/fpm_sockets.h
+++ b/sapi/fpm/fpm/fpm_sockets.h
@@ -45,10 +45,4 @@ static inline int fd_set_blocked(int fd, int blocked) /* {{{ */
}
/* }}} */
-#define IPQUAD(sin_addr) \
- (unsigned int) ((unsigned char *) &(sin_addr)->s_addr)[0], \
- (unsigned int) ((unsigned char *) &(sin_addr)->s_addr)[1], \
- (unsigned int) ((unsigned char *) &(sin_addr)->s_addr)[2], \
- (unsigned int) ((unsigned char *) &(sin_addr)->s_addr)[3]
-
#endif
diff --git a/sapi/fpm/php-fpm.conf.in b/sapi/fpm/php-fpm.conf.in
index c5f4abc59..631bc46f4 100644
--- a/sapi/fpm/php-fpm.conf.in
+++ b/sapi/fpm/php-fpm.conf.in
@@ -152,6 +152,8 @@ group = @php_fpm_group@
; Valid syntaxes are:
; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific address on
; a specific port;
+; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
+; a specific port;
; 'port' - to listen on a TCP socket to all addresses on a
; specific port;
; '/path/to/unix/socket' - to listen on a unix socket.
diff --git a/sapi/fpm/tests/003.phpt b/sapi/fpm/tests/003.phpt
new file mode 100644
index 000000000..389cb2401
--- /dev/null
+++ b/sapi/fpm/tests/003.phpt
@@ -0,0 +1,53 @@
+--TEST--
+FPM: Test IPv6 support
+--SKIPIF--
+<?php include "skipif.inc"; ?>
+--FILE--
+<?php
+
+include "include.inc";
+
+$logfile = dirname(__FILE__).'/php-fpm.log.tmp';
+
+$cfg = <<<EOT
+[global]
+error_log = $logfile
+[unconfined]
+listen = [::1]:9000
+pm = dynamic
+pm.max_children = 5
+pm.start_servers = 2
+pm.min_spare_servers = 1
+pm.max_spare_servers = 3
+EOT;
+
+$fpm = run_fpm($cfg, $tail);
+if (is_resource($fpm)) {
+ var_dump(fgets($tail));
+ var_dump(fgets($tail));
+ $i = 0;
+ while (($i++ < 30) && !($fp = fsockopen('[::1]', 9000))) {
+ usleep(10000);
+ }
+ if ($fp) {
+ echo "Done\n";
+ fclose($fp);
+ }
+ proc_terminate($fpm);
+ stream_get_contents($tail);
+ fclose($tail);
+ proc_close($fpm);
+}
+
+?>
+--EXPECTF--
+string(%d) "[%d-%s-%d %d:%d:%d] NOTICE: fpm is running, pid %d
+"
+string(%d) "[%d-%s-%d %d:%d:%d] NOTICE: ready to handle connections
+"
+Done
+--CLEAN--
+<?php
+ $logfile = dirname(__FILE__).'/php-fpm.log.tmp';
+ @unlink($logfile);
+?>
diff --git a/sapi/litespeed/lsapi_main.c b/sapi/litespeed/lsapi_main.c
index 789ebf246..425d638f9 100644
--- a/sapi/litespeed/lsapi_main.c
+++ b/sapi/litespeed/lsapi_main.c
@@ -69,7 +69,7 @@
#define SAPI_LSAPI_MAX_HEADER_LENGTH 2048
-static int lsapi_mode = 1;
+static int lsapi_mode = 0;
static char *php_self = "";
static char *script_filename = "";
static int source_highlight = 0;
@@ -1053,6 +1053,7 @@ int main( int argc, char * argv[] )
LSAPI_Init();
LSAPI_Init_Env_Parameters( NULL );
+ lsapi_mode = 1;
slow_script_msec = LSAPI_Get_Slow_Req_Msecs();
diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c
index c881559e6..fa6f84343 100644
--- a/sapi/phpdbg/phpdbg.c
+++ b/sapi/phpdbg/phpdbg.c
@@ -262,24 +262,12 @@ static PHP_FUNCTION(phpdbg_exec)
}
} /* }}} */
-/* {{{ proto void phpdbg_break([integer type, string expression])
+/* {{{ proto void phpdbg_break_next()
instructs phpdbg to insert a breakpoint at the next opcode */
-static PHP_FUNCTION(phpdbg_break)
+static PHP_FUNCTION(phpdbg_break_next)
{
- if (ZEND_NUM_ARGS() > 0) {
- long type = 0;
- char *expr = NULL;
- int expr_len = 0;
- phpdbg_param_t param;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &type, &expr, &expr_len) == FAILURE) {
- return;
- }
-
- phpdbg_parse_param(expr, expr_len, &param TSRMLS_CC);
- phpdbg_do_break(&param TSRMLS_CC);
- phpdbg_clear_param(&param TSRMLS_CC);
-
+ if (zend_parse_parameters_none() != SUCCESS) {
+ return;
} else if (EG(current_execute_data) && EG(active_op_array)) {
zend_ulong opline_num = (EG(current_execute_data)->opline -
EG(active_op_array)->opcodes);
@@ -289,6 +277,48 @@ static PHP_FUNCTION(phpdbg_break)
}
} /* }}} */
+/* {{{ proto void phpdbg_break_file(string file, integer line) */
+static PHP_FUNCTION(phpdbg_break_file)
+{
+ char *file = NULL;
+ int flen = 0;
+ long line;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl", &file, &flen, &line) == FAILURE) {
+ return;
+ }
+
+ phpdbg_set_breakpoint_file(file, line TSRMLS_CC);
+} /* }}} */
+
+/* {{{ proto void phpdbg_break_method(string class, string method) */
+static PHP_FUNCTION(phpdbg_break_method)
+{
+ char *class = NULL,
+ *method = NULL;
+ int clen = 0,
+ mlen = 0;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &class, &clen, &method, &mlen) == FAILURE) {
+ return;
+ }
+
+ phpdbg_set_breakpoint_method(class, method TSRMLS_CC);
+} /* }}} */
+
+/* {{{ proto void phpdbg_break_function(string function) */
+static PHP_FUNCTION(phpdbg_break_function)
+{
+ char *function = NULL;
+ int function_len;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &function, &function_len) == FAILURE) {
+ return;
+ }
+
+ phpdbg_set_breakpoint_symbol(function, function_len TSRMLS_CC);
+} /* }}} */
+
/* {{{ proto void phpdbg_clear(void)
instructs phpdbg to clear breakpoints */
static PHP_FUNCTION(phpdbg_clear)
@@ -338,9 +368,21 @@ static PHP_FUNCTION(phpdbg_prompt)
phpdbg_set_prompt(prompt TSRMLS_CC);
} /* }}} */
-ZEND_BEGIN_ARG_INFO_EX(phpdbg_break_arginfo, 0, 0, 0)
- ZEND_ARG_INFO(0, type)
- ZEND_ARG_INFO(0, expression)
+ZEND_BEGIN_ARG_INFO_EX(phpdbg_break_next_arginfo, 0, 0, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(phpdbg_break_file_arginfo, 0, 0, 2)
+ ZEND_ARG_INFO(0, file)
+ ZEND_ARG_INFO(0, line)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(phpdbg_break_method_arginfo, 0, 0, 2)
+ ZEND_ARG_INFO(0, class)
+ ZEND_ARG_INFO(0, method)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(phpdbg_break_function_arginfo, 0, 0, 1)
+ ZEND_ARG_INFO(0, function)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(phpdbg_color_arginfo, 0, 0, 0)
@@ -361,7 +403,10 @@ ZEND_END_ARG_INFO()
zend_function_entry phpdbg_user_functions[] = {
PHP_FE(phpdbg_clear, phpdbg_clear_arginfo)
- PHP_FE(phpdbg_break, phpdbg_break_arginfo)
+ PHP_FE(phpdbg_break_next, phpdbg_break_next_arginfo)
+ PHP_FE(phpdbg_break_file, phpdbg_break_file_arginfo)
+ PHP_FE(phpdbg_break_method, phpdbg_break_method_arginfo)
+ PHP_FE(phpdbg_break_function, phpdbg_break_function_arginfo)
PHP_FE(phpdbg_exec, phpdbg_exec_arginfo)
PHP_FE(phpdbg_color, phpdbg_color_arginfo)
PHP_FE(phpdbg_prompt, phpdbg_prompt_arginfo)
@@ -660,7 +705,8 @@ const char phpdbg_ini_hardcoded[] =
"log_errors=On\n"
"max_execution_time=0\n"
"max_input_time=-1\n"
-"error_log=\n\0";
+"error_log=\n"
+"output_buffering=off\0";
/* overwriteable ini defaults must be set in phpdbg_ini_defaults() */
#define INI_DEFAULT(name, value) \
diff --git a/sapi/phpdbg/phpdbg_cmd.c b/sapi/phpdbg/phpdbg_cmd.c
index a45513bee..5290639dc 100644
--- a/sapi/phpdbg/phpdbg_cmd.c
+++ b/sapi/phpdbg/phpdbg_cmd.c
@@ -69,79 +69,6 @@ PHPDBG_API const char *phpdbg_get_param_type(const phpdbg_param_t *param TSRMLS_
}
}
-PHPDBG_API phpdbg_param_type phpdbg_parse_param(const char *str, size_t len, phpdbg_param_t *param TSRMLS_DC) /* {{{ */
-{
- char *class_name, *func_name;
-
- if (len == 0) {
- param->type = EMPTY_PARAM;
- goto parsed;
- }
-
- if (phpdbg_is_addr(str)) {
- param->addr = strtoul(str, 0, 16);
- param->type = ADDR_PARAM;
- goto parsed;
-
- } else if (phpdbg_is_numeric(str)) {
- param->num = strtol(str, NULL, 0);
- param->type = NUMERIC_PARAM;
- goto parsed;
-
- } else if (phpdbg_is_class_method(str, len+1, &class_name, &func_name)) {
- param->method.class = class_name;
- param->method.name = func_name;
- param->type = METHOD_PARAM;
- goto parsed;
- } else {
- char *line_pos = strrchr(str, ':');
-
- if (line_pos && phpdbg_is_numeric(line_pos+1)) {
- if (strchr(str, ':') == line_pos) {
- char path[MAXPATHLEN];
-
- memcpy(path, str, line_pos - str);
- path[line_pos - str] = 0;
- *line_pos = 0;
- param->file.name = phpdbg_resolve_path(path TSRMLS_CC);
- param->file.line = strtol(line_pos+1, NULL, 0);
- param->type = FILE_PARAM;
-
- goto parsed;
- }
- }
-
- line_pos = strrchr(str, '#');
-
- if (line_pos && phpdbg_is_numeric(line_pos+1)) {
- if (strchr(str, '#') == line_pos) {
- param->num = strtol(line_pos + 1, NULL, 0);
-
- if (phpdbg_is_class_method(str, line_pos - str, &class_name, &func_name)) {
- param->method.class = class_name;
- param->method.name = func_name;
- param->type = NUMERIC_METHOD_PARAM;
- } else {
- param->len = line_pos - str;
- param->str = estrndup(str, param->len);
- param->type = NUMERIC_FUNCTION_PARAM;
- }
-
- goto parsed;
- }
- }
- }
-
- param->str = estrndup(str, len);
- param->len = len;
- param->type = STR_PARAM;
-
-parsed:
- phpdbg_debug("phpdbg_parse_param(\"%s\", %lu): %s",
- str, len, phpdbg_get_param_type(param TSRMLS_CC));
- return param->type;
-} /* }}} */
-
PHPDBG_API void phpdbg_clear_param(phpdbg_param_t *param TSRMLS_DC) /* {{{ */
{
if (param) {
diff --git a/sapi/phpdbg/phpdbg_cmd.h b/sapi/phpdbg/phpdbg_cmd.h
index 571d065f5..682dd8618 100644
--- a/sapi/phpdbg/phpdbg_cmd.h
+++ b/sapi/phpdbg/phpdbg_cmd.h
@@ -141,7 +141,6 @@ PHPDBG_API void phpdbg_stack_free(phpdbg_param_t *stack);
/*
* Parameter Management
*/
-PHPDBG_API phpdbg_param_type phpdbg_parse_param(const char*, size_t, phpdbg_param_t* TSRMLS_DC);
PHPDBG_API void phpdbg_clear_param(phpdbg_param_t* TSRMLS_DC);
PHPDBG_API void phpdbg_copy_param(const phpdbg_param_t*, phpdbg_param_t* TSRMLS_DC);
PHPDBG_API zend_bool phpdbg_match_param(const phpdbg_param_t *, const phpdbg_param_t * TSRMLS_DC);
diff --git a/sapi/phpdbg/phpdbg_parser.c b/sapi/phpdbg/phpdbg_parser.c
index e34c2f48f..7d05da659 100644
--- a/sapi/phpdbg/phpdbg_parser.c
+++ b/sapi/phpdbg/phpdbg_parser.c
@@ -1,8 +1,8 @@
-/* A Bison parser, made by GNU Bison 2.6.2. */
+/* A Bison parser, made by GNU Bison 2.7.12-4996. */
/* Bison implementation for Yacc-like parsers in C
- Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -44,7 +44,7 @@
#define YYBISON 1
/* Bison version. */
-#define YYBISON_VERSION "2.6.2"
+#define YYBISON_VERSION "2.7.12-4996"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@@ -69,8 +69,8 @@
#define yynerrs phpdbg_nerrs
/* Copy the first part of user declarations. */
-/* Line 336 of yacc.c */
-#line 1 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
+/* Line 371 of yacc.c */
+#line 1 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_parser.y"
/*
@@ -97,7 +97,7 @@ static int yyerror(void ***tsrm_ls, const char *msg);
ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
-/* Line 336 of yacc.c */
+/* Line 371 of yacc.c */
#line 102 "sapi/phpdbg/phpdbg_parser.c"
# ifndef YY_NULL
@@ -118,8 +118,8 @@ ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
/* In a future release of Bison, this section will be replaced
by #include "phpdbg_parser.h". */
-#ifndef PHPDBG_SAPI_PHPDBG_PHPDBG_PARSER_H
-# define PHPDBG_SAPI_PHPDBG_PHPDBG_PARSER_H
+#ifndef YY_PHPDBG_SAPI_PHPDBG_PHPDBG_PARSER_H_INCLUDED
+# define YY_PHPDBG_SAPI_PHPDBG_PHPDBG_PARSER_H_INCLUDED
/* Enabling traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
@@ -128,8 +128,8 @@ ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
extern int phpdbg_debug;
#endif
/* "%code requires" blocks. */
-/* Line 350 of yacc.c */
-#line 31 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
+/* Line 387 of yacc.c */
+#line 31 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_parser.y"
#include "phpdbg.h"
#ifndef YY_TYPEDEF_YY_SCANNER_T
@@ -138,7 +138,7 @@ typedef void* yyscan_t;
#endif
-/* Line 350 of yacc.c */
+/* Line 387 of yacc.c */
#line 143 "sapi/phpdbg/phpdbg_parser.c"
/* Tokens. */
@@ -211,11 +211,11 @@ int phpdbg_parse ();
#endif
#endif /* ! YYPARSE_PARAM */
-#endif /* !PHPDBG_SAPI_PHPDBG_PHPDBG_PARSER_H */
+#endif /* !YY_PHPDBG_SAPI_PHPDBG_PHPDBG_PARSER_H_INCLUDED */
/* Copy the second part of user declarations. */
-/* Line 353 of yacc.c */
+/* Line 390 of yacc.c */
#line 220 "sapi/phpdbg/phpdbg_parser.c"
#ifdef short
@@ -269,24 +269,33 @@ typedef short int yytype_int16;
# if defined YYENABLE_NLS && YYENABLE_NLS
# if ENABLE_NLS
# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
-# define YY_(msgid) dgettext ("bison-runtime", msgid)
+# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
# endif
# endif
# ifndef YY_
-# define YY_(msgid) msgid
+# define YY_(Msgid) Msgid
+# endif
+#endif
+
+#ifndef __attribute__
+/* This feature is available in gcc versions 2.5 and later. */
+# if (! defined __GNUC__ || __GNUC__ < 2 \
+ || (__GNUC__ == 2 && __GNUC_MINOR__ < 5))
+# define __attribute__(Spec) /* empty */
# endif
#endif
/* Suppress unused-variable warnings by "using" E. */
#if ! defined lint || defined __GNUC__
-# define YYUSE(e) ((void) (e))
+# define YYUSE(E) ((void) (E))
#else
-# define YYUSE(e) /* empty */
+# define YYUSE(E) /* empty */
#endif
+
/* Identity function, used to suppress warnings about constant conditions. */
#ifndef lint
-# define YYID(n) (n)
+# define YYID(N) (N)
#else
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
@@ -610,10 +619,10 @@ static const yytype_uint8 yytable[] =
0, 37, 26
};
-#define yypact_value_is_default(yystate) \
- ((yystate) == (-11))
+#define yypact_value_is_default(Yystate) \
+ (!!((Yystate) == (-11)))
-#define yytable_value_is_error(yytable_value) \
+#define yytable_value_is_error(Yytable_value) \
YYID (0)
static const yytype_int8 yycheck[] =
@@ -679,47 +688,18 @@ do \
} \
while (YYID (0))
-
+/* Error token number */
#define YYTERROR 1
#define YYERRCODE 256
-/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
- If N is 0, then set CURRENT to the empty location which ends
- the previous symbol: RHS[0] (always defined). */
-
-#ifndef YYLLOC_DEFAULT
-# define YYLLOC_DEFAULT(Current, Rhs, N) \
- do \
- if (YYID (N)) \
- { \
- (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
- (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
- (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
- (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
- } \
- else \
- { \
- (Current).first_line = (Current).last_line = \
- YYRHSLOC (Rhs, 0).last_line; \
- (Current).first_column = (Current).last_column = \
- YYRHSLOC (Rhs, 0).last_column; \
- } \
- while (YYID (0))
-#endif
-
-#define YYRHSLOC(Rhs, K) ((Rhs)[K])
-
-
/* This macro is provided for backward compatibility. */
-
#ifndef YY_LOCATION_PRINT
# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
#endif
/* YYLEX -- calling `yylex' with the right arguments. */
-
#ifdef YYLEX_PARAM
# define YYLEX yylex (&yylval, YYLEX_PARAM)
#else
@@ -781,11 +761,7 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep, tsrm_ls)
# else
YYUSE (yyoutput);
# endif
- switch (yytype)
- {
- default:
- break;
- }
+ YYUSE (yytype);
}
@@ -1028,7 +1004,6 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
{
YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
YYSIZE_T yysize = yysize0;
- YYSIZE_T yysize1;
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
/* Internationalized format string. */
const char *yyformat = YY_NULL;
@@ -1091,11 +1066,13 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
break;
}
yyarg[yycount++] = yytname[yyx];
- yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
- if (! (yysize <= yysize1
- && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
- return 2;
- yysize = yysize1;
+ {
+ YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
+ if (! (yysize <= yysize1
+ && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+ return 2;
+ yysize = yysize1;
+ }
}
}
}
@@ -1115,10 +1092,12 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
# undef YYCASE_
}
- yysize1 = yysize + yystrlen (yyformat);
- if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
- return 2;
- yysize = yysize1;
+ {
+ YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
+ if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+ return 2;
+ yysize = yysize1;
+ }
if (*yymsg_alloc < yysize)
{
@@ -1176,12 +1155,7 @@ yydestruct (yymsg, yytype, yyvaluep, tsrm_ls)
yymsg = "Deleting";
YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
- switch (yytype)
- {
-
- default:
- break;
- }
+ YYUSE (yytype);
}
@@ -1216,8 +1190,31 @@ yyparse (tsrm_ls)
/* The lookahead symbol. */
int yychar;
+
+#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
+/* Suppress an incorrect diagnostic about yylval being uninitialized. */
+# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
+ _Pragma ("GCC diagnostic push") \
+ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
+ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
+# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
+ _Pragma ("GCC diagnostic pop")
+#else
+/* Default value used for initialization, for pacifying older GCCs
+ or non-GCC compilers. */
+static YYSTYPE yyval_default;
+# define YY_INITIAL_VALUE(Value) = Value
+#endif
+#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+# define YY_IGNORE_MAYBE_UNINITIALIZED_END
+#endif
+#ifndef YY_INITIAL_VALUE
+# define YY_INITIAL_VALUE(Value) /* Nothing. */
+#endif
+
/* The semantic value of the lookahead symbol. */
-YYSTYPE yylval;
+YYSTYPE yylval YY_INITIAL_VALUE(yyval_default);
/* Number of syntax errors so far. */
int yynerrs;
@@ -1248,7 +1245,7 @@ YYSTYPE yylval;
int yyn;
int yyresult;
/* Lookahead token as an internal (translated) token number. */
- int yytoken;
+ int yytoken = 0;
/* The variables used to return semantic value and location from the
action routines. */
YYSTYPE yyval;
@@ -1266,9 +1263,8 @@ YYSTYPE yylval;
Keep to zero when no symbol should be popped. */
int yylen = 0;
- yytoken = 0;
- yyss = yyssa;
- yyvs = yyvsa;
+ yyssp = yyss = yyssa;
+ yyvsp = yyvs = yyvsa;
yystacksize = YYINITDEPTH;
YYDPRINTF ((stderr, "Starting parse\n"));
@@ -1277,13 +1273,6 @@ YYSTYPE yylval;
yyerrstatus = 0;
yynerrs = 0;
yychar = YYEMPTY; /* Cause a token to be read. */
-
- /* Initialize stack pointers.
- Waste one element of value and location stack
- so that they stay on the same level as the state stack.
- The wasted elements are never initialized. */
- yyssp = yyss;
- yyvsp = yyvs;
goto yysetstate;
/*------------------------------------------------------------.
@@ -1424,7 +1413,9 @@ yybackup:
yychar = YYEMPTY;
yystate = yyn;
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
*++yyvsp = yylval;
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
goto yynewstate;
@@ -1462,25 +1453,25 @@ yyreduce:
{
case 3:
/* Line 1802 of yacc.c */
-#line 67 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
+#line 67 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_parser.y"
{ phpdbg_stack_push(PHPDBG_G(parser_stack), &(yyvsp[(1) - (1)])); }
break;
case 5:
/* Line 1802 of yacc.c */
-#line 72 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
+#line 72 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_parser.y"
{ phpdbg_stack_push(PHPDBG_G(parser_stack), &(yyvsp[(1) - (1)])); }
break;
case 6:
/* Line 1802 of yacc.c */
-#line 73 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
+#line 73 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_parser.y"
{ phpdbg_stack_push(PHPDBG_G(parser_stack), &(yyvsp[(2) - (2)])); }
break;
case 7:
/* Line 1802 of yacc.c */
-#line 77 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
+#line 77 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_parser.y"
{
(yyval).type = FILE_PARAM;
(yyval).file.name = (yyvsp[(2) - (3)]).str;
@@ -1490,7 +1481,7 @@ yyreduce:
case 8:
/* Line 1802 of yacc.c */
-#line 82 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
+#line 82 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_parser.y"
{
(yyval).type = NUMERIC_FILE_PARAM;
(yyval).file.name = (yyvsp[(1) - (4)]).str;
@@ -1500,7 +1491,7 @@ yyreduce:
case 9:
/* Line 1802 of yacc.c */
-#line 87 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
+#line 87 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_parser.y"
{
(yyval).type = FILE_PARAM;
(yyval).file.name = malloc((yyvsp[(1) - (4)]).len + (yyvsp[(2) - (4)]).len + 1);
@@ -1515,7 +1506,7 @@ yyreduce:
case 10:
/* Line 1802 of yacc.c */
-#line 97 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
+#line 97 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_parser.y"
{
(yyval).type = NUMERIC_FILE_PARAM;
(yyval).file.name = malloc((yyvsp[(1) - (5)]).len + (yyvsp[(2) - (5)]).len + 1);
@@ -1530,7 +1521,7 @@ yyreduce:
case 11:
/* Line 1802 of yacc.c */
-#line 107 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
+#line 107 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_parser.y"
{
(yyval).type = METHOD_PARAM;
(yyval).method.class = (yyvsp[(1) - (3)]).str;
@@ -1540,7 +1531,7 @@ yyreduce:
case 12:
/* Line 1802 of yacc.c */
-#line 112 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
+#line 112 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_parser.y"
{
(yyval).type = NUMERIC_METHOD_PARAM;
(yyval).method.class = (yyvsp[(1) - (5)]).str;
@@ -1551,7 +1542,7 @@ yyreduce:
case 13:
/* Line 1802 of yacc.c */
-#line 118 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
+#line 118 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_parser.y"
{
(yyval).type = NUMERIC_FUNCTION_PARAM;
(yyval).str = (yyvsp[(1) - (3)]).str;
@@ -1562,7 +1553,7 @@ yyreduce:
case 14:
/* Line 1802 of yacc.c */
-#line 124 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
+#line 124 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_parser.y"
{
(yyval).type = COND_PARAM;
(yyval).str = (yyvsp[(2) - (2)]).str;
@@ -1572,49 +1563,49 @@ yyreduce:
case 15:
/* Line 1802 of yacc.c */
-#line 129 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
+#line 129 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_parser.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 16:
/* Line 1802 of yacc.c */
-#line 130 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
+#line 130 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_parser.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 17:
/* Line 1802 of yacc.c */
-#line 131 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
+#line 131 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_parser.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 18:
/* Line 1802 of yacc.c */
-#line 132 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
+#line 132 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_parser.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 19:
/* Line 1802 of yacc.c */
-#line 133 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
+#line 133 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_parser.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 20:
/* Line 1802 of yacc.c */
-#line 134 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
+#line 134 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_parser.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 21:
/* Line 1802 of yacc.c */
-#line 135 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
+#line 135 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_parser.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 22:
/* Line 1802 of yacc.c */
-#line 139 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
+#line 139 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_parser.y"
{
(yyval).type = EVAL_PARAM;
(yyval).str = (yyvsp[(2) - (2)]).str;
@@ -1624,7 +1615,7 @@ yyreduce:
case 23:
/* Line 1802 of yacc.c */
-#line 144 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
+#line 144 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_parser.y"
{
(yyval).type = SHELL_PARAM;
(yyval).str = (yyvsp[(2) - (2)]).str;
@@ -1634,7 +1625,7 @@ yyreduce:
case 24:
/* Line 1802 of yacc.c */
-#line 149 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
+#line 149 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_parser.y"
{
(yyval).type = RUN_PARAM;
(yyval).len = 0;
@@ -1643,7 +1634,7 @@ yyreduce:
case 25:
/* Line 1802 of yacc.c */
-#line 153 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
+#line 153 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_parser.y"
{
(yyval).type = RUN_PARAM;
(yyval).str = (yyvsp[(2) - (2)]).str;
@@ -1653,7 +1644,7 @@ yyreduce:
/* Line 1802 of yacc.c */
-#line 1657 "sapi/phpdbg/phpdbg_parser.c"
+#line 1648 "sapi/phpdbg/phpdbg_parser.c"
default: break;
}
/* User semantic actions sometimes alter yychar, and that requires
@@ -1816,7 +1807,9 @@ yyerrlab1:
YY_STACK_PRINT (yyss, yyssp);
}
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
*++yyvsp = yylval;
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
/* Shift the error token. */
@@ -1882,8 +1875,8 @@ yyreturn:
}
-/* Line 2048 of yacc.c */
-#line 160 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
+/* Line 2050 of yacc.c */
+#line 160 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_parser.y"
static int yyerror(void ***tsrm_ls, const char *msg) {
diff --git a/sapi/phpdbg/phpdbg_parser.h b/sapi/phpdbg/phpdbg_parser.h
index b3aadb9c6..da5892ac9 100644
--- a/sapi/phpdbg/phpdbg_parser.h
+++ b/sapi/phpdbg/phpdbg_parser.h
@@ -1,8 +1,8 @@
-/* A Bison parser, made by GNU Bison 2.6.2. */
+/* A Bison parser, made by GNU Bison 2.7.12-4996. */
/* Bison interface for Yacc-like parsers in C
- Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -30,8 +30,8 @@
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
-#ifndef PHPDBG_SAPI_PHPDBG_PHPDBG_PARSER_H
-# define PHPDBG_SAPI_PHPDBG_PHPDBG_PARSER_H
+#ifndef YY_PHPDBG_SAPI_PHPDBG_PHPDBG_PARSER_H_INCLUDED
+# define YY_PHPDBG_SAPI_PHPDBG_PHPDBG_PARSER_H_INCLUDED
/* Enabling traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
@@ -40,8 +40,8 @@
extern int phpdbg_debug;
#endif
/* "%code requires" blocks. */
-/* Line 2055 of yacc.c */
-#line 31 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
+/* Line 2060 of yacc.c */
+#line 31 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_parser.y"
#include "phpdbg.h"
#ifndef YY_TYPEDEF_YY_SCANNER_T
@@ -50,7 +50,7 @@ typedef void* yyscan_t;
#endif
-/* Line 2055 of yacc.c */
+/* Line 2060 of yacc.c */
#line 55 "sapi/phpdbg/phpdbg_parser.h"
/* Tokens. */
@@ -123,4 +123,4 @@ int phpdbg_parse ();
#endif
#endif /* ! YYPARSE_PARAM */
-#endif /* !PHPDBG_SAPI_PHPDBG_PHPDBG_PARSER_H */
+#endif /* !YY_PHPDBG_SAPI_PHPDBG_PHPDBG_PARSER_H_INCLUDED */