]> granicus.if.org Git - php/commitdiff
Fix valgrind errors in phpdbg
authorBob Weinand <bobwei9@hotmail.com>
Mon, 3 Aug 2015 22:00:10 +0000 (00:00 +0200)
committerBob Weinand <bobwei9@hotmail.com>
Mon, 3 Aug 2015 22:00:10 +0000 (00:00 +0200)
Revert "We cannot safely assume that all op array will be refcount 0 after execution"
This reverts commit b6936adb58288a0606ed847802d9226cddb41e2b.

This change turns out to not have been a clever idea and was causing more weirdness than it helped...

12 files changed:
Zend/zend_compile.h
Zend/zend_opcode.c
Zend/zend_vm_def.h
Zend/zend_vm_execute.h
sapi/phpdbg/phpdbg.c
sapi/phpdbg/phpdbg_list.c
sapi/phpdbg/phpdbg_list.h
sapi/phpdbg/phpdbg_parser.c
sapi/phpdbg/phpdbg_parser.h
sapi/phpdbg/phpdbg_parser.y
sapi/phpdbg/phpdbg_prompt.c
sapi/phpdbg/phpdbg_prompt.h

index 96a1f950783799eaff8d9b4a589ee59abc7df40b..06796aab831fc6d1362594041d649d44e1c440c7 100644 (file)
@@ -726,7 +726,7 @@ ZEND_API zend_op_array *compile_filename(int type, zval *filename);
 ZEND_API int zend_execute_scripts(int type, zval *retval, int file_count, ...);
 ZEND_API int open_file_for_scanning(zend_file_handle *file_handle);
 ZEND_API void init_op_array(zend_op_array *op_array, zend_uchar type, int initial_ops_size);
-ZEND_API zend_bool destroy_op_array(zend_op_array *op_array);
+ZEND_API void destroy_op_array(zend_op_array *op_array);
 ZEND_API void zend_destroy_file_handle(zend_file_handle *file_handle);
 ZEND_API void zend_cleanup_user_class_data(zend_class_entry *ce);
 ZEND_API void zend_cleanup_internal_class_data(zend_class_entry *ce);
index da401e17b9f7946ef1f79802fdcbc7e19fc3fc4c..347761e9a8a736f2ff73270e2aacda4982fb32bf 100644 (file)
@@ -335,7 +335,7 @@ void zend_class_add_ref(zval *zv)
        ce->refcount++;
 }
 
-ZEND_API zend_bool destroy_op_array(zend_op_array *op_array)
+ZEND_API void destroy_op_array(zend_op_array *op_array)
 {
        zval *literal = op_array->literals;
        zval *end;
@@ -353,12 +353,8 @@ ZEND_API zend_bool destroy_op_array(zend_op_array *op_array)
                op_array->run_time_cache = NULL;
        }
 
-       if (!op_array->refcount) {
-               return 1;
-       }
-
-       if (--(*op_array->refcount) > 0) {
-               return 0;
+       if (!op_array->refcount || --(*op_array->refcount) > 0) {
+               return;
        }
 
        efree_size(op_array->refcount, sizeof(*(op_array->refcount)));
@@ -419,8 +415,6 @@ ZEND_API zend_bool destroy_op_array(zend_op_array *op_array)
                }
                efree(arg_info);
        }
-
-       return 1;
 }
 
 void init_op(zend_op *op)
index 8537a6a178f8d4b6b582c5b4789776c5b0f5900c..3e460d15903cd33d633e63faa0f46c405fb82581 100644 (file)
@@ -2364,9 +2364,8 @@ ZEND_VM_HELPER(zend_leave_helper, ANY, ANY)
                ZEND_VM_LEAVE();
        } else if (ZEND_CALL_KIND_EX(call_info) == ZEND_CALL_NESTED_CODE) {
                zend_detach_symbol_table(execute_data);
-               if (EXPECTED(destroy_op_array(&EX(func)->op_array) != 0)) {
-                       efree_size(EX(func), sizeof(zend_op_array));
-               }
+               destroy_op_array(&EX(func)->op_array);
+               efree_size(EX(func), sizeof(zend_op_array));
                old_execute_data = execute_data;
                execute_data = EG(current_execute_data) = EX(prev_execute_data);
                zend_vm_stack_free_call_frame_ex(call_info, old_execute_data);
@@ -5455,7 +5454,7 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMPVAR|CV, ANY)
                }
 
                call->prev_execute_data = execute_data;
-               i_init_code_execute_data(call, new_op_array, return_value);
+           i_init_code_execute_data(call, new_op_array, return_value);
                if (EXPECTED(zend_execute_ex == execute_ex)) {
                        ZEND_VM_ENTER();
                } else {
@@ -5464,9 +5463,8 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMPVAR|CV, ANY)
                        zend_vm_stack_free_call_frame(call);
                }
 
-               if (EXPECTED(destroy_op_array(new_op_array) != 0)) {
-                       efree_size(new_op_array, sizeof(zend_op_array));
-               }
+               destroy_op_array(new_op_array);
+               efree_size(new_op_array, sizeof(zend_op_array));
                if (UNEXPECTED(EG(exception) != NULL)) {
                        zend_throw_exception_internal(NULL);
                        HANDLE_EXCEPTION();
index 527de7d1967af7087738344697ec6d0eca9fab46..ca7120aa12a6a3bfaf2df67733d7cebeb211367f 100644 (file)
@@ -503,9 +503,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_
                ZEND_VM_LEAVE();
        } else if (ZEND_CALL_KIND_EX(call_info) == ZEND_CALL_NESTED_CODE) {
                zend_detach_symbol_table(execute_data);
-               if (EXPECTED(destroy_op_array(&EX(func)->op_array) != 0)) {
-                       efree_size(EX(func), sizeof(zend_op_array));
-               }
+               destroy_op_array(&EX(func)->op_array);
+               efree_size(EX(func), sizeof(zend_op_array));
                old_execute_data = execute_data;
                execute_data = EG(current_execute_data) = EX(prev_execute_data);
                zend_vm_stack_free_call_frame_ex(call_info, old_execute_data);
@@ -3670,7 +3669,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HAN
                }
 
                call->prev_execute_data = execute_data;
-               i_init_code_execute_data(call, new_op_array, return_value);
+           i_init_code_execute_data(call, new_op_array, return_value);
                if (EXPECTED(zend_execute_ex == execute_ex)) {
                        ZEND_VM_ENTER();
                } else {
@@ -3679,9 +3678,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HAN
                        zend_vm_stack_free_call_frame(call);
                }
 
-               if (EXPECTED(destroy_op_array(new_op_array) != 0)) {
-                       efree_size(new_op_array, sizeof(zend_op_array));
-               }
+               destroy_op_array(new_op_array);
+               efree_size(new_op_array, sizeof(zend_op_array));
                if (UNEXPECTED(EG(exception) != NULL)) {
                        zend_throw_exception_internal(NULL);
                        HANDLE_EXCEPTION();
@@ -29068,7 +29066,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLE
                }
 
                call->prev_execute_data = execute_data;
-               i_init_code_execute_data(call, new_op_array, return_value);
+           i_init_code_execute_data(call, new_op_array, return_value);
                if (EXPECTED(zend_execute_ex == execute_ex)) {
                        ZEND_VM_ENTER();
                } else {
@@ -29077,9 +29075,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLE
                        zend_vm_stack_free_call_frame(call);
                }
 
-               if (EXPECTED(destroy_op_array(new_op_array) != 0)) {
-                       efree_size(new_op_array, sizeof(zend_op_array));
-               }
+               destroy_op_array(new_op_array);
+               efree_size(new_op_array, sizeof(zend_op_array));
                if (UNEXPECTED(EG(exception) != NULL)) {
                        zend_throw_exception_internal(NULL);
                        HANDLE_EXCEPTION();
@@ -40480,7 +40477,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_TMPVAR_HA
                }
 
                call->prev_execute_data = execute_data;
-               i_init_code_execute_data(call, new_op_array, return_value);
+           i_init_code_execute_data(call, new_op_array, return_value);
                if (EXPECTED(zend_execute_ex == execute_ex)) {
                        ZEND_VM_ENTER();
                } else {
@@ -40489,9 +40486,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_TMPVAR_HA
                        zend_vm_stack_free_call_frame(call);
                }
 
-               if (EXPECTED(destroy_op_array(new_op_array) != 0)) {
-                       efree_size(new_op_array, sizeof(zend_op_array));
-               }
+               destroy_op_array(new_op_array);
+               efree_size(new_op_array, sizeof(zend_op_array));
                if (UNEXPECTED(EG(exception) != NULL)) {
                        zend_throw_exception_internal(NULL);
                        HANDLE_EXCEPTION();
index ca86a29fcff8f4a9edc0fc58bdc853c76fc90740..89157562c917d940f2d4ccc5df54e8f6ca2fa65c 100644 (file)
@@ -213,8 +213,8 @@ static PHP_RSHUTDOWN_FUNCTION(phpdbg) /* {{{ */
        zend_hash_destroy(&PHPDBG_G(bp)[PHPDBG_BREAK_METHOD]);
        zend_hash_destroy(&PHPDBG_G(bp)[PHPDBG_BREAK_COND]);
        zend_hash_destroy(&PHPDBG_G(bp)[PHPDBG_BREAK_MAP]);
-       zend_hash_destroy(&PHPDBG_G(seek));
        zend_hash_destroy(&PHPDBG_G(file_sources));
+       zend_hash_destroy(&PHPDBG_G(seek));
        zend_hash_destroy(&PHPDBG_G(registered));
        zend_hash_destroy(&PHPDBG_G(watchpoints));
        zend_llist_destroy(&PHPDBG_G(watchlist_mem));
@@ -234,12 +234,6 @@ static PHP_RSHUTDOWN_FUNCTION(phpdbg) /* {{{ */
                PHPDBG_G(oplog) = NULL;
        }
 
-       if (PHPDBG_G(ops)) {
-               destroy_op_array(PHPDBG_G(ops));
-               efree(PHPDBG_G(ops));
-               PHPDBG_G(ops) = NULL;
-       }
-
        if (PHPDBG_G(oplog_list)) {
                phpdbg_oplog_list *cur = PHPDBG_G(oplog_list);
                do {
@@ -558,8 +552,8 @@ static PHP_FUNCTION(phpdbg_get_executable)
                phpdbg_file_source *source = zend_hash_find_ptr(&PHPDBG_G(file_sources), name);
                if (source) {
                        phpdbg_oplog_fill_executable(
-                               source->op_array,
-                               phpdbg_add_empty_array(Z_ARR_P(return_value), source->op_array->filename),
+                               &source->op_array,
+                               phpdbg_add_empty_array(Z_ARR_P(return_value), source->op_array.filename),
                                by_opcode);
                }
        } ZEND_HASH_FOREACH_END();
index 8369018fc9c76dedb86f4e953fe4ed3bfc4ebefd..c30b81bc64c511c971236c7a5926a62adaec48b4 100644 (file)
@@ -294,35 +294,28 @@ zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type) {
 zend_op_array *phpdbg_init_compile_file(zend_file_handle *file, int type) {
        char *filename = (char *)(file->opened_path ? ZSTR_VAL(file->opened_path) : file->filename);
        char resolved_path_buf[MAXPATHLEN];
-       zend_op_array *ret;
+       zend_op_array *op_array;
        phpdbg_file_source *dataptr;
 
        if (VCWD_REALPATH(filename, resolved_path_buf)) {
                filename = resolved_path_buf;
        }
 
-       ret = PHPDBG_G(init_compile_file)(file, type);
+       op_array = PHPDBG_G(init_compile_file)(file, type);
 
-       if (ret == NULL) {
+       if (op_array == NULL) {
                return NULL;
        }
 
        dataptr = zend_hash_str_find_ptr(&PHPDBG_G(file_sources), filename, strlen(filename));
        ZEND_ASSERT(dataptr != NULL);
 
-       dataptr->op_array = ret;
-       dataptr->destroy_op_array = 1;
-       if (dataptr->op_array) {
-               if (dataptr->op_array->refcount) {
-                       ++*dataptr->op_array->refcount;
-               } else {
-                       dataptr->op_array->refcount = emalloc(sizeof(uint32_t));
-                       *dataptr->op_array->refcount = 2;
-                       dataptr->destroy_op_array = 0;
-               }
+       dataptr->op_array = *op_array;
+       if (dataptr->op_array.refcount) {
+               efree(op_array);
        }
 
-       return ret;
+       return &dataptr->op_array;
 }
 
 void phpdbg_free_file_source(zval *zv) {
@@ -332,12 +325,7 @@ void phpdbg_free_file_source(zval *zv) {
                efree(data->buf);
        }
 
-       if (!data->destroy_op_array) {
-               efree(data->op_array->refcount);
-       }
-       if (!data->destroy_op_array || destroy_op_array(data->op_array)) {
-               efree(data->op_array);
-       }
+       destroy_op_array(&data->op_array);
 
        efree(data);
 }
index 8530ea264dcc568b97ad6b7c723bb00f23948693..04a30e984c8575112e651fa4c003c36d7153ae23 100644 (file)
@@ -48,7 +48,7 @@ typedef struct {
 #if HAVE_MMAP
        void *map;
 #endif
-       zend_op_array *op_array;
+       zend_op_array op_array;
        zend_bool destroy_op_array;
        uint lines;
        uint line[1];
index ed976f0b3f3aed135e971bf301040e1f36947720..0e5f38352905d7dfb338a04bc0c81ce8dba60928 100644 (file)
@@ -1,21 +1,19 @@
+/* A Bison parser, made by GNU Bison 2.7.12-4996.  */
 
-/* A Bison parser, made by GNU Bison 2.4.1.  */
-
-/* Skeleton implementation for Bison's Yacc-like parsers in C
-
-      Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
-   Free Software Foundation, Inc.
-
+/* Bison implementation for Yacc-like parsers in C
+   
+      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
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
-
+   
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-
+   
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
@@ -28,7 +26,7 @@
    special exception, which will cause the skeleton and the resulting
    Bison output files to be licensed under the GNU General Public
    License without this special exception.
-
+   
    This special exception was added by the Free Software Foundation in
    version 2.2 of Bison.  */
 
@@ -46,7 +44,7 @@
 #define YYBISON 1
 
 /* Bison version.  */
-#define YYBISON_VERSION "2.4.1"
+#define YYBISON_VERSION "2.7.12-4996"
 
 /* Skeleton name.  */
 #define YYSKELETON_NAME "yacc.c"
@@ -60,8 +58,6 @@
 /* Pull parsers.  */
 #define YYPULL 1
 
-/* Using locations.  */
-#define YYLSP_NEEDED 0
 
 /* Substitute the variable and function names.  */
 #define yyparse         phpdbg_parse
 #define yydebug         phpdbg_debug
 #define yynerrs         phpdbg_nerrs
 
-
 /* Copy the first part of user declarations.  */
-
-/* Line 189 of yacc.c  */
-#line 1 "sapi/phpdbg/phpdbg_parser.y"
+/* Line 371 of yacc.c  */
+#line 1 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
 
 
 /*
@@ -102,15 +96,22 @@ static int yyerror(const char *msg);
 
 ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
 
+#ifdef _MSC_VER
+#define YYMALLOC malloc
+#define YYFREE free
+#endif
 
 
-/* Line 189 of yacc.c  */
-#line 109 "sapi/phpdbg/phpdbg_parser.c"
+/* Line 371 of yacc.c  */
+#line 107 "sapi/phpdbg/phpdbg_parser.c"
 
-/* Enabling traces.  */
-#ifndef YYDEBUG
-# define YYDEBUG 0
-#endif
+# ifndef YY_NULL
+#  if defined __cplusplus && 201103L <= __cplusplus
+#   define YY_NULL nullptr
+#  else
+#   define YY_NULL 0
+#  endif
+# endif
 
 /* Enabling verbose error messages.  */
 #ifdef YYERROR_VERBOSE
@@ -120,15 +121,20 @@ ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
 # define YYERROR_VERBOSE 1
 #endif
 
-/* Enabling the token table.  */
-#ifndef YYTOKEN_TABLE
-# define YYTOKEN_TABLE 0
+/* In a future release of Bison, this section will be replaced
+   by #include "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
+#endif
+#if YYDEBUG
+extern int phpdbg_debug;
 #endif
-
 /* "%code requires" blocks.  */
-
-/* Line 209 of yacc.c  */
-#line 31 "sapi/phpdbg/phpdbg_parser.y"
+/* Line 387 of yacc.c  */
+#line 36 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
 
 #include "phpdbg.h"
 #ifndef YY_TYPEDEF_YY_SCANNER_T
@@ -137,9 +143,8 @@ typedef void* yyscan_t;
 #endif
 
 
-
-/* Line 209 of yacc.c  */
-#line 143 "sapi/phpdbg/phpdbg_parser.c"
+/* Line 387 of yacc.c  */
+#line 148 "sapi/phpdbg/phpdbg_parser.c"
 
 /* Tokens.  */
 #ifndef YYTOKENTYPE
@@ -168,6 +173,26 @@ typedef void* yyscan_t;
      T_REQ_ID = 276
    };
 #endif
+/* Tokens.  */
+#define T_EVAL 258
+#define T_RUN 259
+#define T_SHELL 260
+#define T_IF 261
+#define T_TRUTHY 262
+#define T_FALSY 263
+#define T_STRING 264
+#define T_COLON 265
+#define T_DCOLON 266
+#define T_POUND 267
+#define T_PROTO 268
+#define T_DIGITS 269
+#define T_LITERAL 270
+#define T_ADDR 271
+#define T_OPCODE 272
+#define T_ID 273
+#define T_INPUT 274
+#define T_UNEXPECTED 275
+#define T_REQ_ID 276
 
 
 
@@ -179,11 +204,26 @@ typedef int YYSTYPE;
 #endif
 
 
-/* Copy the second part of user declarations.  */
+#ifdef YYPARSE_PARAM
+#if defined __STDC__ || defined __cplusplus
+int phpdbg_parse (void *YYPARSE_PARAM);
+#else
+int phpdbg_parse ();
+#endif
+#else /* ! YYPARSE_PARAM */
+#if defined __STDC__ || defined __cplusplus
+int phpdbg_parse (void);
+#else
+int phpdbg_parse ();
+#endif
+#endif /* ! YYPARSE_PARAM */
 
+#endif /* !YY_PHPDBG_SAPI_PHPDBG_PHPDBG_PARSER_H_INCLUDED  */
 
-/* Line 264 of yacc.c  */
-#line 187 "sapi/phpdbg/phpdbg_parser.c"
+/* Copy the second part of user declarations.  */
+
+/* Line 390 of yacc.c  */
+#line 227 "sapi/phpdbg/phpdbg_parser.c"
 
 #ifdef short
 # undef short
@@ -233,27 +273,36 @@ typedef short int yytype_int16;
 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
 
 #ifndef YY_
-# if YYENABLE_NLS
+# 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)
@@ -286,11 +335,12 @@ YYID (yyi)
 #    define alloca _alloca
 #   else
 #    define YYSTACK_ALLOC alloca
-#    if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+#    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
      || defined __cplusplus || defined _MSC_VER)
 #     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-#     ifndef _STDLIB_H
-#      define _STDLIB_H 1
+      /* Use EXIT_SUCCESS as a witness for stdlib.h.  */
+#     ifndef EXIT_SUCCESS
+#      define EXIT_SUCCESS 0
 #     endif
 #    endif
 #   endif
@@ -313,24 +363,24 @@ YYID (yyi)
 #  ifndef YYSTACK_ALLOC_MAXIMUM
 #   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
 #  endif
-#  if (defined __cplusplus && ! defined _STDLIB_H \
+#  if (defined __cplusplus && ! defined EXIT_SUCCESS \
        && ! ((defined YYMALLOC || defined malloc) \
             && (defined YYFREE || defined free)))
 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-#   ifndef _STDLIB_H
-#    define _STDLIB_H 1
+#   ifndef EXIT_SUCCESS
+#    define EXIT_SUCCESS 0
 #   endif
 #  endif
 #  ifndef YYMALLOC
 #   define YYMALLOC malloc
-#   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+#   if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
      || defined __cplusplus || defined _MSC_VER)
 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
 #   endif
 #  endif
 #  ifndef YYFREE
 #   define YYFREE free
-#   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+#   if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
      || defined __cplusplus || defined _MSC_VER)
 void free (void *); /* INFRINGES ON USER NAME SPACE */
 #   endif
@@ -359,23 +409,7 @@ union yyalloc
      ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
       + YYSTACK_GAP_MAXIMUM)
 
-/* Copy COUNT objects from FROM to TO.  The source and destination do
-   not overlap.  */
-# ifndef YYCOPY
-#  if defined __GNUC__ && 1 < __GNUC__
-#   define YYCOPY(To, From, Count) \
-      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
-#  else
-#   define YYCOPY(To, From, Count)             \
-      do                                       \
-       {                                       \
-         YYSIZE_T yyi;                         \
-         for (yyi = 0; yyi < (Count); yyi++)   \
-           (To)[yyi] = (From)[yyi];            \
-       }                                       \
-      while (YYID (0))
-#  endif
-# endif
+# define YYCOPY_NEEDED 1
 
 /* Relocate STACK from its old location to the new one.  The
    local variables YYSIZE and YYSTACKSIZE give the old and new number of
@@ -395,6 +429,26 @@ union yyalloc
 
 #endif
 
+#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
+/* Copy COUNT objects from SRC to DST.  The source and destination do
+   not overlap.  */
+# ifndef YYCOPY
+#  if defined __GNUC__ && 1 < __GNUC__
+#   define YYCOPY(Dst, Src, Count) \
+      __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
+#  else
+#   define YYCOPY(Dst, Src, Count)              \
+      do                                        \
+        {                                       \
+          YYSIZE_T yyi;                         \
+          for (yyi = 0; yyi < (Count); yyi++)   \
+            (Dst)[yyi] = (Src)[yyi];            \
+        }                                       \
+      while (YYID (0))
+#  endif
+# endif
+#endif /* !YYCOPY_NEEDED */
+
 /* YYFINAL -- State number of the termination state.  */
 #define YYFINAL  26
 /* YYLAST -- Last index in YYTABLE.  */
@@ -476,13 +530,13 @@ static const yytype_int8 yyrhs[] =
 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
 static const yytype_uint8 yyrline[] =
 {
-       0,    65,    65,    66,    67,    71,    72,    73,    77,    82,
-      87,    97,   107,   112,   118,   124,   129,   130,   131,   132,
-     133,   134,   135,   139,   140,   144,   149,   154,   158
+       0,    70,    70,    71,    72,    76,    77,    78,    82,    87,
+      92,   102,   112,   117,   123,   129,   134,   135,   136,   137,
+     138,   139,   140,   144,   145,   149,   154,   159,   163
 };
 #endif
 
-#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
+#if YYDEBUG || YYERROR_VERBOSE || 1
 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
    First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
 static const char *const yytname[] =
@@ -496,7 +550,7 @@ static const char *const yytname[] =
   "\"opcode\"", "\"identifier (command or function name)\"",
   "\"input (input string or data)\"", "\"input\"",
   "\"request id (-r %d)\"", "$accept", "input", "parameters", "parameter",
-  "req_id", "full_expression", 0
+  "req_id", "full_expression", YY_NULL
 };
 #endif
 
@@ -527,8 +581,8 @@ static const yytype_uint8 yyr2[] =
        1,     1,     1,     1,     0,     3,     3,     2,     3
 };
 
-/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
-   STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
+/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
+   Performed when YYTABLE doesn't specify something else to do.  Zero
    means the default is an error.  */
 static const yytype_uint8 yydefact[] =
 {
@@ -565,8 +619,7 @@ static const yytype_int8 yypgoto[] =
 
 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
    positive, shift that token.  If negative, reduce the rule which
-   number is the opposite.  If zero, do what YYDEFACT says.
-   If YYTABLE_NINF, syntax error.  */
+   number is the opposite.  If YYTABLE_NINF, syntax error.  */
 #define YYTABLE_NINF -1
 static const yytype_uint8 yytable[] =
 {
@@ -577,6 +630,12 @@ static const yytype_uint8 yytable[] =
       32,    36,    39,    40,     0,     0,    41,    42,    27
 };
 
+#define yypact_value_is_default(Yystate) \
+  (!!((Yystate) == (-16)))
+
+#define yytable_value_is_error(Yytable_value) \
+  YYID (0)
+
 static const yytype_int8 yycheck[] =
 {
        3,     4,     5,     6,     7,     8,    21,     2,     3,    19,
@@ -609,78 +668,50 @@ static const yytype_uint8 yystos[] =
 
 /* Like YYERROR except do call yyerror.  This remains here temporarily
    to ease the transition to the new meaning of YYERROR, for GCC.
-   Once GCC version 2 has supplanted version 1, this can go.  */
+   Once GCC version 2 has supplanted version 1, this can go.  However,
+   YYFAIL appears to be in use.  Nevertheless, it is formally deprecated
+   in Bison 2.4.2's NEWS entry, where a plan to phase it out is
+   discussed.  */
 
 #define YYFAIL         goto yyerrlab
+#if defined YYFAIL
+  /* This is here to suppress warnings from the GCC cpp's
+     -Wunused-macros.  Normally we don't worry about that warning, but
+     some users do, and we want to make it easy for users to remove
+     YYFAIL uses, which will produce warnings from Bison 2.5.  */
+#endif
 
 #define YYRECOVERING()  (!!yyerrstatus)
 
-#define YYBACKUP(Token, Value)                                 \
-do                                                             \
-  if (yychar == YYEMPTY && yylen == 1)                         \
-    {                                                          \
-      yychar = (Token);                                                \
-      yylval = (Value);                                                \
-      yytoken = YYTRANSLATE (yychar);                          \
-      YYPOPSTACK (1);                                          \
-      goto yybackup;                                           \
-    }                                                          \
-  else                                                         \
-    {                                                          \
+#define YYBACKUP(Token, Value)                                  \
+do                                                              \
+  if (yychar == YYEMPTY)                                        \
+    {                                                           \
+      yychar = (Token);                                         \
+      yylval = (Value);                                         \
+      YYPOPSTACK (yylen);                                       \
+      yystate = *yyssp;                                         \
+      goto yybackup;                                            \
+    }                                                           \
+  else                                                          \
+    {                                                           \
       yyerror (YY_("syntax error: cannot back up")); \
       YYERROR;                                                 \
     }                                                          \
 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).  */
-
-#define YYRHSLOC(Rhs, K) ((Rhs)[K])
-#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
-
-
-/* YY_LOCATION_PRINT -- Print the location on the stream.
-   This macro was not mandated originally: define only if we know
-   we won't break user code: when these are the locations we know.  */
-
+/* This macro is provided for backward compatibility. */
 #ifndef YY_LOCATION_PRINT
-# if YYLTYPE_IS_TRIVIAL
-#  define YY_LOCATION_PRINT(File, Loc)                 \
-     fprintf (File, "%d.%d-%d.%d",                     \
-             (Loc).first_line, (Loc).first_column,     \
-             (Loc).last_line,  (Loc).last_column)
-# else
-#  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
-# endif
+# 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
@@ -730,6 +761,8 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep)
     YYSTYPE const * const yyvaluep;
 #endif
 {
+  FILE *yyo = yyoutput;
+  YYUSE (yyo);
   if (!yyvaluep)
     return;
 # ifdef YYPRINT
@@ -738,11 +771,7 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep)
 # else
   YYUSE (yyoutput);
 # endif
-  switch (yytype)
-    {
-      default:
-       break;
-    }
+  YYUSE (yytype);
 }
 
 
@@ -868,7 +897,6 @@ int yydebug;
 #endif
 
 
-
 #if YYERROR_VERBOSE
 
 # ifndef yystrlen
@@ -970,116 +998,146 @@ yytnamerr (char *yyres, const char *yystr)
 }
 # endif
 
-/* Copy into YYRESULT an error message about the unexpected token
-   YYCHAR while in state YYSTATE.  Return the number of bytes copied,
-   including the terminating null byte.  If YYRESULT is null, do not
-   copy anything; just return the number of bytes that would be
-   copied.  As a special case, return 0 if an ordinary "syntax error"
-   message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
-   size calculation.  */
-static YYSIZE_T
-yysyntax_error (char *yyresult, int yystate, int yychar)
-{
-  int yyn = yypact[yystate];
+/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
+   about the unexpected token YYTOKEN for the state stack whose top is
+   YYSSP.
 
-  if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
-    return 0;
-  else
+   Return 0 if *YYMSG was successfully written.  Return 1 if *YYMSG is
+   not large enough to hold the message.  In that case, also set
+   *YYMSG_ALLOC to the required number of bytes.  Return 2 if the
+   required number of bytes is too large to store.  */
+static int
+yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
+                yytype_int16 *yyssp, int yytoken)
+{
+  YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
+  YYSIZE_T yysize = yysize0;
+  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
+  /* Internationalized format string. */
+  const char *yyformat = YY_NULL;
+  /* Arguments of yyformat. */
+  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
+  /* Number of reported tokens (one for the "unexpected", one per
+     "expected"). */
+  int yycount = 0;
+
+  /* There are many possibilities here to consider:
+     - Assume YYFAIL is not used.  It's too flawed to consider.  See
+       <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
+       for details.  YYERROR is fine as it does not invoke this
+       function.
+     - If this state is a consistent state with a default action, then
+       the only way this function was invoked is if the default action
+       is an error action.  In that case, don't check for expected
+       tokens because there are none.
+     - The only way there can be no lookahead present (in yychar) is if
+       this state is a consistent state with a default action.  Thus,
+       detecting the absence of a lookahead is sufficient to determine
+       that there is no unexpected or expected token to report.  In that
+       case, just report a simple "syntax error".
+     - Don't assume there isn't a lookahead just because this state is a
+       consistent state with a default action.  There might have been a
+       previous inconsistent state, consistent state with a non-default
+       action, or user semantic action that manipulated yychar.
+     - Of course, the expected token list depends on states to have
+       correct lookahead information, and it depends on the parser not
+       to perform extra reductions after fetching a lookahead from the
+       scanner and before detecting a syntax error.  Thus, state merging
+       (from LALR or IELR) and default reductions corrupt the expected
+       token list.  However, the list is correct for canonical LR with
+       one exception: it will still contain any token that will not be
+       accepted due to an error action in a later state.
+  */
+  if (yytoken != YYEMPTY)
     {
-      int yytype = YYTRANSLATE (yychar);
-      YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
-      YYSIZE_T yysize = yysize0;
-      YYSIZE_T yysize1;
-      int yysize_overflow = 0;
-      enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
-      char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
-      int yyx;
-
-# if 0
-      /* This is so xgettext sees the translatable formats that are
-        constructed on the fly.  */
-      YY_("syntax error, unexpected %s");
-      YY_("syntax error, unexpected %s, expecting %s");
-      YY_("syntax error, unexpected %s, expecting %s or %s");
-      YY_("syntax error, unexpected %s, expecting %s or %s or %s");
-      YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
-# endif
-      char *yyfmt;
-      char const *yyf;
-      static char const yyunexpected[] = "syntax error, unexpected %s";
-      static char const yyexpecting[] = ", expecting %s";
-      static char const yyor[] = " or %s";
-      char yyformat[sizeof yyunexpected
-                   + sizeof yyexpecting - 1
-                   + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
-                      * (sizeof yyor - 1))];
-      char const *yyprefix = yyexpecting;
-
-      /* Start YYX at -YYN if negative to avoid negative indexes in
-        YYCHECK.  */
-      int yyxbegin = yyn < 0 ? -yyn : 0;
-
-      /* Stay within bounds of both yycheck and yytname.  */
-      int yychecklim = YYLAST - yyn + 1;
-      int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
-      int yycount = 1;
-
-      yyarg[0] = yytname[yytype];
-      yyfmt = yystpcpy (yyformat, yyunexpected);
-
-      for (yyx = yyxbegin; yyx < yyxend; ++yyx)
-       if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
-         {
-           if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
-             {
-               yycount = 1;
-               yysize = yysize0;
-               yyformat[sizeof yyunexpected - 1] = '\0';
-               break;
-             }
-           yyarg[yycount++] = yytname[yyx];
-           yysize1 = yysize + yytnamerr (0, yytname[yyx]);
-           yysize_overflow |= (yysize1 < yysize);
-           yysize = yysize1;
-           yyfmt = yystpcpy (yyfmt, yyprefix);
-           yyprefix = yyor;
-         }
+      int yyn = yypact[*yyssp];
+      yyarg[yycount++] = yytname[yytoken];
+      if (!yypact_value_is_default (yyn))
+        {
+          /* Start YYX at -YYN if negative to avoid negative indexes in
+             YYCHECK.  In other words, skip the first -YYN actions for
+             this state because they are default actions.  */
+          int yyxbegin = yyn < 0 ? -yyn : 0;
+          /* Stay within bounds of both yycheck and yytname.  */
+          int yychecklim = YYLAST - yyn + 1;
+          int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
+          int yyx;
+
+          for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+            if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
+                && !yytable_value_is_error (yytable[yyx + yyn]))
+              {
+                if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
+                  {
+                    yycount = 1;
+                    yysize = yysize0;
+                    break;
+                  }
+                yyarg[yycount++] = yytname[yyx];
+                {
+                  YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
+                  if (! (yysize <= yysize1
+                         && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+                    return 2;
+                  yysize = yysize1;
+                }
+              }
+        }
+    }
 
-      yyf = YY_(yyformat);
-      yysize1 = yysize + yystrlen (yyf);
-      yysize_overflow |= (yysize1 < yysize);
-      yysize = yysize1;
+  switch (yycount)
+    {
+# define YYCASE_(N, S)                      \
+      case N:                               \
+        yyformat = S;                       \
+      break
+      YYCASE_(0, YY_("syntax error"));
+      YYCASE_(1, YY_("syntax error, unexpected %s"));
+      YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
+      YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
+      YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
+      YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
+# undef YYCASE_
+    }
 
-      if (yysize_overflow)
-       return YYSIZE_MAXIMUM;
+  {
+    YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
+    if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+      return 2;
+    yysize = yysize1;
+  }
 
-      if (yyresult)
-       {
-         /* Avoid sprintf, as that infringes on the user's name space.
-            Don't have undefined behavior even if the translation
-            produced a string with the wrong number of "%s"s.  */
-         char *yyp = yyresult;
-         int yyi = 0;
-         while ((*yyp = *yyf) != '\0')
-           {
-             if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
-               {
-                 yyp += yytnamerr (yyp, yyarg[yyi++]);
-                 yyf += 2;
-               }
-             else
-               {
-                 yyp++;
-                 yyf++;
-               }
-           }
-       }
-      return yysize;
+  if (*yymsg_alloc < yysize)
+    {
+      *yymsg_alloc = 2 * yysize;
+      if (! (yysize <= *yymsg_alloc
+             && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
+        *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
+      return 1;
     }
+
+  /* Avoid sprintf, as that infringes on the user's name space.
+     Don't have undefined behavior even if the translation
+     produced a string with the wrong number of "%s"s.  */
+  {
+    char *yyp = *yymsg;
+    int yyi = 0;
+    while ((*yyp = *yyformat) != '\0')
+      if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
+        {
+          yyp += yytnamerr (yyp, yyarg[yyi++]);
+          yyformat += 2;
+        }
+      else
+        {
+          yyp++;
+          yyformat++;
+        }
+  }
+  return 0;
 }
 #endif /* YYERROR_VERBOSE */
 
-
 /*-----------------------------------------------.
 | Release the memory associated to this symbol.  |
 `-----------------------------------------------*/
@@ -1103,36 +1161,15 @@ yydestruct (yymsg, yytype, yyvaluep)
     yymsg = "Deleting";
   YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
 
-  switch (yytype)
-    {
-
-      default:
-       break;
-    }
+  YYUSE (yytype);
 }
 
-/* Prevent warnings from -Wmissing-prototypes.  */
-#ifdef YYPARSE_PARAM
-#if defined __STDC__ || defined __cplusplus
-int yyparse (void *YYPARSE_PARAM);
-#else
-int yyparse ();
-#endif
-#else /* ! YYPARSE_PARAM */
-#if defined __STDC__ || defined __cplusplus
-int yyparse (void);
-#else
-int yyparse ();
-#endif
-#endif /* ! YYPARSE_PARAM */
-
-
 
 
 
-/*-------------------------.
-| yyparse or yypush_parse.  |
-`-------------------------*/
+/*----------.
+| yyparse.  |
+`----------*/
 
 #ifdef YYPARSE_PARAM
 #if (defined __STDC__ || defined __C99__FUNC__ \
@@ -1159,8 +1196,31 @@ yyparse ()
 /* 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;
@@ -1173,7 +1233,7 @@ YYSTYPE yylval;
        `yyss': related to states.
        `yyvs': related to semantic values.
 
-       Refer to the stacks thru separate pointers, to allow yyoverflow
+       Refer to the stacks through separate pointers, to allow yyoverflow
        to reallocate them elsewhere.  */
 
     /* The state stack.  */
@@ -1191,7 +1251,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;
@@ -1209,9 +1269,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"));
@@ -1220,14 +1279,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;
 
 /*------------------------------------------------------------.
@@ -1319,7 +1370,7 @@ yybackup:
 
   /* First try to decide what to do without reference to lookahead token.  */
   yyn = yypact[yystate];
-  if (yyn == YYPACT_NINF)
+  if (yypact_value_is_default (yyn))
     goto yydefault;
 
   /* Not known => get a lookahead token if don't already have one.  */
@@ -1350,8 +1401,8 @@ yybackup:
   yyn = yytable[yyn];
   if (yyn <= 0)
     {
-      if (yyn == 0 || yyn == YYTABLE_NINF)
-       goto yyerrlab;
+      if (yytable_value_is_error (yyn))
+        goto yyerrlab;
       yyn = -yyn;
       goto yyreduce;
     }
@@ -1368,7 +1419,9 @@ yybackup:
   yychar = YYEMPTY;
 
   yystate = yyn;
+  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
   *++yyvsp = yylval;
+  YY_IGNORE_MAYBE_UNINITIALIZED_END
 
   goto yynewstate;
 
@@ -1405,59 +1458,52 @@ yyreduce:
   switch (yyn)
     {
         case 3:
-
-/* Line 1455 of yacc.c  */
-#line 66 "sapi/phpdbg/phpdbg_parser.y"
-    { phpdbg_stack_push(PHPDBG_G(parser_stack), &(yyvsp[(1) - (1)])); ;}
+/* Line 1802 of yacc.c  */
+#line 71 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
+    { phpdbg_stack_push(PHPDBG_G(parser_stack), &(yyvsp[(1) - (1)])); }
     break;
 
   case 5:
-
-/* Line 1455 of yacc.c  */
-#line 71 "sapi/phpdbg/phpdbg_parser.y"
-    { phpdbg_stack_push(PHPDBG_G(parser_stack), &(yyvsp[(1) - (1)])); ;}
+/* Line 1802 of yacc.c  */
+#line 76 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
+    { phpdbg_stack_push(PHPDBG_G(parser_stack), &(yyvsp[(1) - (1)])); }
     break;
 
   case 6:
-
-/* Line 1455 of yacc.c  */
-#line 72 "sapi/phpdbg/phpdbg_parser.y"
-    { phpdbg_stack_push(PHPDBG_G(parser_stack), &(yyvsp[(2) - (2)])); ;}
+/* Line 1802 of yacc.c  */
+#line 77 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
+    { phpdbg_stack_push(PHPDBG_G(parser_stack), &(yyvsp[(2) - (2)])); }
     break;
 
   case 7:
-
-/* Line 1455 of yacc.c  */
-#line 73 "sapi/phpdbg/phpdbg_parser.y"
-    { (yyval) = (yyvsp[(1) - (2)]); ;}
+/* Line 1802 of yacc.c  */
+#line 78 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
+    { (yyval) = (yyvsp[(1) - (2)]); }
     break;
 
   case 8:
-
-/* Line 1455 of yacc.c  */
-#line 77 "sapi/phpdbg/phpdbg_parser.y"
+/* Line 1802 of yacc.c  */
+#line 82 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
     {
                (yyval).type = FILE_PARAM;
                (yyval).file.name = (yyvsp[(2) - (3)]).str;
                (yyval).file.line = (yyvsp[(3) - (3)]).num;
-       ;}
+       }
     break;
 
   case 9:
-
-/* Line 1455 of yacc.c  */
-#line 82 "sapi/phpdbg/phpdbg_parser.y"
+/* Line 1802 of yacc.c  */
+#line 87 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
     {
                (yyval).type = NUMERIC_FILE_PARAM;
                (yyval).file.name = (yyvsp[(1) - (4)]).str;
                (yyval).file.line = (yyvsp[(4) - (4)]).num;
-       ;}
+       }
     break;
 
   case 10:
-
-/* Line 1455 of yacc.c  */
-#line 87 "sapi/phpdbg/phpdbg_parser.y"
+/* Line 1802 of yacc.c  */
+#line 92 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
     {
                (yyval).type = FILE_PARAM;
                (yyval).file.name = malloc((yyvsp[(1) - (4)]).len + (yyvsp[(2) - (4)]).len + 1);
@@ -1467,13 +1513,12 @@ yyreduce:
                        (yyval).file.name[(yyvsp[(1) - (4)]).len + (yyvsp[(2) - (4)]).len] = '\0';
                }
                (yyval).file.line = (yyvsp[(4) - (4)]).num;
-       ;}
+       }
     break;
 
   case 11:
-
-/* Line 1455 of yacc.c  */
-#line 97 "sapi/phpdbg/phpdbg_parser.y"
+/* Line 1802 of yacc.c  */
+#line 102 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
     {
                (yyval).type = NUMERIC_FILE_PARAM;
                (yyval).file.name = malloc((yyvsp[(1) - (5)]).len + (yyvsp[(2) - (5)]).len + 1);
@@ -1483,160 +1528,154 @@ yyreduce:
                        (yyval).file.name[(yyvsp[(1) - (5)]).len + (yyvsp[(2) - (5)]).len] = '\0';
                }
                (yyval).file.line = (yyvsp[(5) - (5)]).num;
-       ;}
+       }
     break;
 
   case 12:
-
-/* Line 1455 of yacc.c  */
-#line 107 "sapi/phpdbg/phpdbg_parser.y"
+/* Line 1802 of yacc.c  */
+#line 112 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
     {
                (yyval).type = METHOD_PARAM;
                (yyval).method.class = (yyvsp[(1) - (3)]).str;
                (yyval).method.name = (yyvsp[(3) - (3)]).str;
-       ;}
+       }
     break;
 
   case 13:
-
-/* Line 1455 of yacc.c  */
-#line 112 "sapi/phpdbg/phpdbg_parser.y"
+/* Line 1802 of yacc.c  */
+#line 117 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
     {
                (yyval).type = NUMERIC_METHOD_PARAM;
                (yyval).method.class = (yyvsp[(1) - (5)]).str;
                (yyval).method.name = (yyvsp[(3) - (5)]).str;
                (yyval).num = (yyvsp[(5) - (5)]).num;
-       ;}
+       }
     break;
 
   case 14:
-
-/* Line 1455 of yacc.c  */
-#line 118 "sapi/phpdbg/phpdbg_parser.y"
+/* Line 1802 of yacc.c  */
+#line 123 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
     {
                (yyval).type = NUMERIC_FUNCTION_PARAM;
                (yyval).str = (yyvsp[(1) - (3)]).str;
                (yyval).len = (yyvsp[(1) - (3)]).len;
                (yyval).num = (yyvsp[(3) - (3)]).num;
-       ;}
+       }
     break;
 
   case 15:
-
-/* Line 1455 of yacc.c  */
-#line 124 "sapi/phpdbg/phpdbg_parser.y"
+/* Line 1802 of yacc.c  */
+#line 129 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
     {
                (yyval).type = COND_PARAM;
                (yyval).str = (yyvsp[(2) - (2)]).str;
                (yyval).len = (yyvsp[(2) - (2)]).len;
-       ;}
+       }
     break;
 
   case 16:
-
-/* Line 1455 of yacc.c  */
-#line 129 "sapi/phpdbg/phpdbg_parser.y"
-    { (yyval) = (yyvsp[(1) - (1)]); ;}
+/* Line 1802 of yacc.c  */
+#line 134 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
+    { (yyval) = (yyvsp[(1) - (1)]); }
     break;
 
   case 17:
-
-/* Line 1455 of yacc.c  */
-#line 130 "sapi/phpdbg/phpdbg_parser.y"
-    { (yyval) = (yyvsp[(1) - (1)]); ;}
+/* Line 1802 of yacc.c  */
+#line 135 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
+    { (yyval) = (yyvsp[(1) - (1)]); }
     break;
 
   case 18:
-
-/* Line 1455 of yacc.c  */
-#line 131 "sapi/phpdbg/phpdbg_parser.y"
-    { (yyval) = (yyvsp[(1) - (1)]); ;}
+/* Line 1802 of yacc.c  */
+#line 136 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
+    { (yyval) = (yyvsp[(1) - (1)]); }
     break;
 
   case 19:
-
-/* Line 1455 of yacc.c  */
-#line 132 "sapi/phpdbg/phpdbg_parser.y"
-    { (yyval) = (yyvsp[(1) - (1)]); ;}
+/* Line 1802 of yacc.c  */
+#line 137 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
+    { (yyval) = (yyvsp[(1) - (1)]); }
     break;
 
   case 20:
-
-/* Line 1455 of yacc.c  */
-#line 133 "sapi/phpdbg/phpdbg_parser.y"
-    { (yyval) = (yyvsp[(1) - (1)]); ;}
+/* Line 1802 of yacc.c  */
+#line 138 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
+    { (yyval) = (yyvsp[(1) - (1)]); }
     break;
 
   case 21:
-
-/* Line 1455 of yacc.c  */
-#line 134 "sapi/phpdbg/phpdbg_parser.y"
-    { (yyval) = (yyvsp[(1) - (1)]); ;}
+/* Line 1802 of yacc.c  */
+#line 139 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
+    { (yyval) = (yyvsp[(1) - (1)]); }
     break;
 
   case 22:
-
-/* Line 1455 of yacc.c  */
-#line 135 "sapi/phpdbg/phpdbg_parser.y"
-    { (yyval) = (yyvsp[(1) - (1)]); ;}
+/* Line 1802 of yacc.c  */
+#line 140 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
+    { (yyval) = (yyvsp[(1) - (1)]); }
     break;
 
   case 23:
-
-/* Line 1455 of yacc.c  */
-#line 139 "sapi/phpdbg/phpdbg_parser.y"
-    { PHPDBG_G(req_id) = (yyvsp[(1) - (1)]).num; ;}
+/* Line 1802 of yacc.c  */
+#line 144 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
+    { PHPDBG_G(req_id) = (yyvsp[(1) - (1)]).num; }
     break;
 
   case 25:
-
-/* Line 1455 of yacc.c  */
-#line 144 "sapi/phpdbg/phpdbg_parser.y"
+/* Line 1802 of yacc.c  */
+#line 149 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
     {
                (yyval).type = EVAL_PARAM;
                (yyval).str = (yyvsp[(3) - (3)]).str;
                (yyval).len = (yyvsp[(3) - (3)]).len;
-       ;}
+       }
     break;
 
   case 26:
-
-/* Line 1455 of yacc.c  */
-#line 149 "sapi/phpdbg/phpdbg_parser.y"
+/* Line 1802 of yacc.c  */
+#line 154 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
     {
                (yyval).type = SHELL_PARAM;
                (yyval).str = (yyvsp[(3) - (3)]).str;
                (yyval).len = (yyvsp[(3) - (3)]).len;
-       ;}
+       }
     break;
 
   case 27:
-
-/* Line 1455 of yacc.c  */
-#line 154 "sapi/phpdbg/phpdbg_parser.y"
+/* Line 1802 of yacc.c  */
+#line 159 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
     {
                (yyval).type = RUN_PARAM;
                (yyval).len = 0;
-       ;}
+       }
     break;
 
   case 28:
-
-/* Line 1455 of yacc.c  */
-#line 158 "sapi/phpdbg/phpdbg_parser.y"
+/* Line 1802 of yacc.c  */
+#line 163 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
     {
                (yyval).type = RUN_PARAM;
                (yyval).str = (yyvsp[(3) - (3)]).str;
                (yyval).len = (yyvsp[(3) - (3)]).len;
-       ;}
+       }
     break;
 
 
-
-/* Line 1455 of yacc.c  */
-#line 1638 "sapi/phpdbg/phpdbg_parser.c"
+/* Line 1802 of yacc.c  */
+#line 1666 "sapi/phpdbg/phpdbg_parser.c"
       default: break;
     }
+  /* User semantic actions sometimes alter yychar, and that requires
+     that yytoken be updated with the new translation.  We take the
+     approach of translating immediately before every use of yytoken.
+     One alternative is translating here after every semantic action,
+     but that translation would be missed if the semantic action invokes
+     YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
+     if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
+     incorrect destructor might then be invoked immediately.  In the
+     case of YYERROR or YYBACKUP, subsequent parser actions might lead
+     to an incorrect destructor call or verbose syntax error message
+     before the lookahead is translated.  */
   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
 
   YYPOPSTACK (yylen);
@@ -1664,6 +1703,10 @@ yyreduce:
 | yyerrlab -- here on detecting error |
 `------------------------------------*/
 yyerrlab:
+  /* Make sure we have latest lookahead translation.  See comments at
+     user semantic actions for why this is necessary.  */
+  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
+
   /* If not already recovering from an error, report this error.  */
   if (!yyerrstatus)
     {
@@ -1671,37 +1714,36 @@ yyerrlab:
 #if ! YYERROR_VERBOSE
       yyerror (YY_("syntax error"));
 #else
+# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
+                                        yyssp, yytoken)
       {
-       YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
-       if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
-         {
-           YYSIZE_T yyalloc = 2 * yysize;
-           if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
-             yyalloc = YYSTACK_ALLOC_MAXIMUM;
-           if (yymsg != yymsgbuf)
-             YYSTACK_FREE (yymsg);
-           yymsg = (char *) YYSTACK_ALLOC (yyalloc);
-           if (yymsg)
-             yymsg_alloc = yyalloc;
-           else
-             {
-               yymsg = yymsgbuf;
-               yymsg_alloc = sizeof yymsgbuf;
-             }
-         }
-
-       if (0 < yysize && yysize <= yymsg_alloc)
-         {
-           (void) yysyntax_error (yymsg, yystate, yychar);
-           yyerror (yymsg);
-         }
-       else
-         {
-           yyerror (YY_("syntax error"));
-           if (yysize != 0)
-             goto yyexhaustedlab;
-         }
+        char const *yymsgp = YY_("syntax error");
+        int yysyntax_error_status;
+        yysyntax_error_status = YYSYNTAX_ERROR;
+        if (yysyntax_error_status == 0)
+          yymsgp = yymsg;
+        else if (yysyntax_error_status == 1)
+          {
+            if (yymsg != yymsgbuf)
+              YYSTACK_FREE (yymsg);
+            yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
+            if (!yymsg)
+              {
+                yymsg = yymsgbuf;
+                yymsg_alloc = sizeof yymsgbuf;
+                yysyntax_error_status = 2;
+              }
+            else
+              {
+                yysyntax_error_status = YYSYNTAX_ERROR;
+                yymsgp = yymsg;
+              }
+          }
+        yyerror (yymsgp);
+        if (yysyntax_error_status == 2)
+          goto yyexhaustedlab;
       }
+# undef YYSYNTAX_ERROR
 #endif
     }
 
@@ -1760,7 +1802,7 @@ yyerrlab1:
   for (;;)
     {
       yyn = yypact[yystate];
-      if (yyn != YYPACT_NINF)
+      if (!yypact_value_is_default (yyn))
        {
          yyn += YYTERROR;
          if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
@@ -1783,7 +1825,9 @@ yyerrlab1:
       YY_STACK_PRINT (yyss, yyssp);
     }
 
+  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
   *++yyvsp = yylval;
+  YY_IGNORE_MAYBE_UNINITIALIZED_END
 
 
   /* Shift the error token.  */
@@ -1807,7 +1851,7 @@ yyabortlab:
   yyresult = 1;
   goto yyreturn;
 
-#if !defined(yyoverflow) || YYERROR_VERBOSE
+#if !defined yyoverflow || YYERROR_VERBOSE
 /*-------------------------------------------------.
 | yyexhaustedlab -- memory exhaustion comes here.  |
 `-------------------------------------------------*/
@@ -1819,8 +1863,13 @@ yyexhaustedlab:
 
 yyreturn:
   if (yychar != YYEMPTY)
-     yydestruct ("Cleanup: discarding lookahead",
-                yytoken, &yylval);
+    {
+      /* Make sure we have latest lookahead translation.  See comments at
+         user semantic actions for why this is necessary.  */
+      yytoken = YYTRANSLATE (yychar);
+      yydestruct ("Cleanup: discarding lookahead",
+                  yytoken, &yylval);
+    }
   /* Do not reclaim the symbols of the rule which action triggered
      this YYABORT or YYACCEPT.  */
   YYPOPSTACK (yylen);
@@ -1844,9 +1893,8 @@ yyreturn:
 }
 
 
-
-/* Line 1675 of yacc.c  */
-#line 165 "sapi/phpdbg/phpdbg_parser.y"
+/* Line 2050 of yacc.c  */
+#line 170 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
 
 
 static int yyerror(const char *msg) {
@@ -1864,8 +1912,11 @@ static int yyerror(const char *msg) {
 }
 
 int phpdbg_do_parse(phpdbg_param_t *stack, char *input) {
+       if (!*input) {
+               return 0;
+       }
+
        phpdbg_init_lexer(stack, input);
 
        return yyparse();
 }
-
index 0c66b27dc0f565b31eddbd1a101f7b93db4c50e7..21b921b5425fdd8ee0f0f66650e372ea48143aa9 100644 (file)
@@ -1,21 +1,19 @@
+/* A Bison parser, made by GNU Bison 2.7.12-4996.  */
 
-/* A Bison parser, made by GNU Bison 2.4.1.  */
-
-/* Skeleton interface for Bison's Yacc-like parsers in C
-
-      Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
-   Free Software Foundation, Inc.
-
+/* Bison interface for Yacc-like parsers in C
+   
+      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
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
-
+   
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-
+   
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
    special exception, which will cause the skeleton and the resulting
    Bison output files to be licensed under the GNU General Public
    License without this special exception.
-
+   
    This special exception was added by the Free Software Foundation in
    version 2.2 of Bison.  */
 
+#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
+#endif
+#if YYDEBUG
+extern int phpdbg_debug;
+#endif
 /* "%code requires" blocks.  */
-
-/* Line 1676 of yacc.c  */
-#line 31 "sapi/phpdbg/phpdbg_parser.y"
+/* Line 2060 of yacc.c  */
+#line 36 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
 
 #include "phpdbg.h"
 #ifndef YY_TYPEDEF_YY_SCANNER_T
@@ -44,9 +50,8 @@ typedef void* yyscan_t;
 #endif
 
 
-
-/* Line 1676 of yacc.c  */
-#line 50 "sapi/phpdbg/phpdbg_parser.h"
+/* Line 2060 of yacc.c  */
+#line 55 "sapi/phpdbg/phpdbg_parser.h"
 
 /* Tokens.  */
 #ifndef YYTOKENTYPE
@@ -75,6 +80,26 @@ typedef void* yyscan_t;
      T_REQ_ID = 276
    };
 #endif
+/* Tokens.  */
+#define T_EVAL 258
+#define T_RUN 259
+#define T_SHELL 260
+#define T_IF 261
+#define T_TRUTHY 262
+#define T_FALSY 263
+#define T_STRING 264
+#define T_COLON 265
+#define T_DCOLON 266
+#define T_POUND 267
+#define T_PROTO 268
+#define T_DIGITS 269
+#define T_LITERAL 270
+#define T_ADDR 271
+#define T_OPCODE 272
+#define T_ID 273
+#define T_INPUT 274
+#define T_UNEXPECTED 275
+#define T_REQ_ID 276
 
 
 
@@ -86,5 +111,18 @@ typedef int YYSTYPE;
 #endif
 
 
+#ifdef YYPARSE_PARAM
+#if defined __STDC__ || defined __cplusplus
+int phpdbg_parse (void *YYPARSE_PARAM);
+#else
+int phpdbg_parse ();
+#endif
+#else /* ! YYPARSE_PARAM */
+#if defined __STDC__ || defined __cplusplus
+int phpdbg_parse (void);
+#else
+int phpdbg_parse ();
+#endif
+#endif /* ! YYPARSE_PARAM */
 
-
+#endif /* !YY_PHPDBG_SAPI_PHPDBG_PHPDBG_PARSER_H_INCLUDED  */
index f25749ceed8387791ed181ab8d9615b475fd16b9..3b2392e48ace734fab25ebf0622971fc425e54b6 100644 (file)
@@ -184,6 +184,10 @@ static int yyerror(const char *msg) {
 }
 
 int phpdbg_do_parse(phpdbg_param_t *stack, char *input) {
+       if (!*input) {
+               return 0;
+       }
+
        phpdbg_init_lexer(stack, input);
 
        return yyparse();
index 4d9bc00779226588bb590cbaeabb33f19c81af45..e2e3250038e88b5fa821b54e46d51ccb9ec6ae1f 100644 (file)
@@ -409,7 +409,7 @@ PHPDBG_COMMAND(exec) /* {{{ */
 
                                if (PHPDBG_G(ops)) {
                                        phpdbg_notice("exec", "type=\"unsetops\"", "Destroying compiled opcodes");
-                                       phpdbg_clean(0);
+                                       zend_hash_clean(&PHPDBG_G(file_sources));
                                }
 
                                PHPDBG_G(exec) = res;
@@ -423,7 +423,7 @@ PHPDBG_COMMAND(exec) /* {{{ */
                                phpdbg_notice("exec", "type=\"set\" context=\"%s\"", "Set execution context: %s", PHPDBG_G(exec));
 
                                if (PHPDBG_G(in_execution)) {
-                                       phpdbg_clean(1);
+                                       PHPDBG_G(flags) |= PHPDBG_IS_CLEANING;
                                        return SUCCESS;
                                }
 
@@ -651,7 +651,7 @@ PHPDBG_COMMAND(run) /* {{{ */
                if (PHPDBG_G(in_execution)) {
                        if (phpdbg_ask_user_permission("Do you really want to restart execution?") == SUCCESS) {
                                phpdbg_startup_run++;
-                               phpdbg_clean(1);
+                               PHPDBG_G(flags) |= PHPDBG_IS_CLEANING;
                        }
                        return SUCCESS;
                }
@@ -733,8 +733,7 @@ PHPDBG_COMMAND(run) /* {{{ */
                }
 
                PHPDBG_G(flags) &= ~PHPDBG_IS_RUNNING;
-
-               phpdbg_clean(1);
+               PHPDBG_G(flags) |= PHPDBG_IS_CLEANING;
        } else {
                phpdbg_error("inactive", "type=\"nocontext\"", "Nothing to execute!");
        }
@@ -1236,10 +1235,9 @@ PHPDBG_COMMAND(clean) /* {{{ */
        phpdbg_writeln("clean", "constants=\"%d\"", "Constants  %d", zend_hash_num_elements(EG(zend_constants)));
        phpdbg_writeln("clean", "includes=\"%d\"", "Includes   %d", zend_hash_num_elements(&EG(included_files)));
 
-       phpdbg_clean(1);
-
        phpdbg_xml("</cleaninfo>");
 
+       PHPDBG_G(flags) |= PHPDBG_IS_CLEANING;
        return SUCCESS;
 } /* }}} */
 
@@ -1389,21 +1387,6 @@ int phpdbg_interactive(zend_bool allow_async_unsafe) /* {{{ */
        return ret;
 } /* }}} */
 
-void phpdbg_clean(zend_bool full) /* {{{ */
-{
-       /* this is implicitly required */
-       if (PHPDBG_G(ops)) {
-               if (destroy_op_array(PHPDBG_G(ops))) {
-                       efree(PHPDBG_G(ops));
-               }
-               PHPDBG_G(ops) = NULL;
-       }
-
-       if (full) {
-               PHPDBG_G(flags) |= PHPDBG_IS_CLEANING;
-       }
-} /* }}} */
-
 /* code may behave weirdly if EG(exception) is set; thus backup it */
 #define DO_INTERACTIVE(allow_async_unsafe) do { \
        const zend_op *backup_opline; \
index 9dda175915eae844a1fca64ffed2f417774790e1..4dd010035c83dc6b0e03e6275c4282016b479e79 100644 (file)
@@ -27,7 +27,6 @@ void phpdbg_init(char *init_file, size_t init_file_len, zend_bool use_default);
 void phpdbg_try_file_init(char *init_file, size_t init_file_len, zend_bool free_init);
 int phpdbg_interactive(zend_bool allow_async_unsafe);
 int phpdbg_compile(void);
-void phpdbg_clean(zend_bool full);
 void phpdbg_force_interruption(void);
 /* }}} */