summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFerenc Kovacs <tyrael@php.net>2014-07-02 02:21:53 +0200
committerFerenc Kovacs <tyrael@php.net>2014-07-02 02:21:53 +0200
commita0be642ecf5ec6032254c8e0454afabf1dcbe55f (patch)
tree1961bf25b9f18b625d0771dfa578e3ac4bf1dcbb
parent6c80e90e232c5fbe7159cc250f547a761d4561fe (diff)
parentd5d95f89351a72db7108d05fc9a86c949d4d5084 (diff)
downloadphp-git-a0be642ecf5ec6032254c8e0454afabf1dcbe55f.tar.gz
Merge branch 'PHP-5.6' into PHP-5.6.0
* PHP-5.6: (70 commits) add some missing NEWS entries NEWS block for 5.6.0RC3 Fix ext/pgsql builds with libpq < 7.3. updated libs_version.txt updated libs_version.txt updated libmagic.patch in 5.6+ updated libmagic.patch Fixed possible crash because of race conditions on modifying constants in shared memory remove the NEWS entry for the reverted fpm fix remove the NEWS entry for the reverted fpm fix remove the NEWS entry for the reverted fpm fix Revert "Fix Bug #67530 error_log=syslog ignored" --enable-fpm for the travis build fix the last fpm NEWS entry, the other bug is related, but not the same what we fixed here NEWS NEWS Fix bug #67091: make install fails to install libphp5.so on FreeBSD 10.0 adding NEWS entry for the fix for bug #65641 Updated NEWS file for recent phpdbg fixes Fixed issue krakjoe/phpdbg#94 - List behavior is inconsistent ... Conflicts: NEWS
-rw-r--r--NEWS41
-rw-r--r--Zend/tests/67468.phpt11
-rw-r--r--Zend/tests/bug67368.phpt12
-rw-r--r--Zend/zend_ast.c3
-rw-r--r--Zend/zend_execute.c20
-rw-r--r--Zend/zend_highlight.c2
-rw-r--r--Zend/zend_indent.c2
-rw-r--r--Zend/zend_vm_def.h7
-rw-r--r--Zend/zend_vm_execute.h7
-rw-r--r--build/libtool.m48
-rw-r--r--ext/fileinfo/libmagic.patch323
-rw-r--r--ext/intl/locale/locale_methods.c15
-rw-r--r--ext/intl/tests/bug62082.phpt7
-rw-r--r--ext/intl/tests/bug67397.phpt21
-rw-r--r--ext/intl/tests/dateformat_localtime.phpt2
-rw-r--r--ext/intl/tests/locale_parse_locale2.phpt6
-rw-r--r--ext/mysql/tests/mysql_trace_mode.phpt2
-rw-r--r--ext/mysqli/tests/mysqli_driver.phpt2
-rw-r--r--ext/mysqli/tests/mysqli_report.phpt10
-rw-r--r--ext/mysqli/tests/mysqli_report_wo_ps.phpt6
-rw-r--r--ext/openssl/tests/bug65538_002.phpt1
-rw-r--r--ext/pdo_mysql/tests/bug54929.phpt4
-rw-r--r--ext/pdo_mysql/tests/bug66141.phpt2
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_attr_errmode.phpt2
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_exec.phpt4
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_stmt_multiquery.phpt2
-rw-r--r--ext/pgsql/pgsql.c2
-rw-r--r--ext/spl/spl_array.c2
-rw-r--r--ext/spl/spl_observer.c2
-rw-r--r--ext/spl/tests/SplObjectStorage_unserialize_bad.phpt5
-rw-r--r--ext/standard/info.c8
-rw-r--r--ext/standard/tests/general_functions/bug67498.phpt15
-rw-r--r--sapi/fpm/fpm/fpm_conf.c3
-rw-r--r--sapi/fpm/fpm/fpm_main.c25
-rw-r--r--sapi/phpdbg/Makefile.frag3
-rw-r--r--sapi/phpdbg/config.m42
-rw-r--r--sapi/phpdbg/phpdbg.159
-rw-r--r--sapi/phpdbg/phpdbg.h5
-rw-r--r--sapi/phpdbg/phpdbg_cmd.c6
-rw-r--r--sapi/phpdbg/phpdbg_help.c7
-rw-r--r--sapi/phpdbg/phpdbg_lexer.c1005
-rw-r--r--sapi/phpdbg/phpdbg_lexer.l38
-rw-r--r--sapi/phpdbg/phpdbg_list.c23
-rw-r--r--sapi/phpdbg/phpdbg_parser.c80
-rw-r--r--sapi/phpdbg/phpdbg_parser.y12
-rw-r--r--sapi/phpdbg/phpdbg_prompt.c5
-rw-r--r--sapi/phpdbg/phpdbg_utils.c6
-rwxr-xr-xtravis/compile.sh1
-rw-r--r--win32/build/libs_version.txt2
49 files changed, 1232 insertions, 606 deletions
diff --git a/NEWS b/NEWS
index a8af1ea8d1..14cf68f1dc 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,46 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+03 Jul 2014, PHP 5.6.0 Release Candidate 2
+
+- Core:
+ . Fixed bug #67368 (Memory leak with immediately dereferenced array in class
+ constant). (Laruence)
+ . Fixed bug #67468 (Segfault in highlight_file()/highlight_string()).
+ (Andreas Ferber)
+ . Fixed bug #67091 (make install fails to install libphp5.so on FreeBSD 10.0).
+ (Ferenc)
+ . Fixed bug #67498 (phpinfo() Type Confusion Information Leak Vulnerability).
+ (Stefan Esser)
+
+- FPM:
+ . Fix bug #67531 (syslog cannot be set in pool configuration). (Remi)
+ . Fix bug #67541 (Fix Apache 2.4.10+ SetHandler proxy:fcgi://
+ incompatibilities). (David Zuelke)
+
+- Intl:
+ . Fixed bug #67349 (Locale::parseLocale Double Free). (Stas)
+ . Fixed bug #67397 (Buffer overflow in locale_get_display_name and
+ uloc_getDisplayName (libicu 4.8.1)). (Stas)
+
+- pgsql:
+ . Fix bug #67550 (Error in code "form" instead of "from", pgsql.c, line 756),
+ which affected builds against libpq < 7.3. (Adam)
+
+- phpdbg:
+ . Fix Bug #67499 (readline feature not enabled when build with libedit). (Remi)
+ . Fix issue krakjoe/phpdbg#94 (List behavior is inconsistent). (Bob)
+ . Fix issue krakjoe/phpdbg#97 (The prompt should always ensure it is on a
+ newline). (Bob)
+ . Fix issue krakjoe/phpdbg#98 (break if does not seem to work). (Bob)
+ . Fix issue krakjoe/phpdbg#99 (register function has the same behavior as
+ run). (Bob)
+ . Fix issue krakjoe/phpdbg#100 (No way to list the current stack/frames)
+ (Help entry was missing). (Bob)
+
+- SPL:
+ . Fixed bug #67492 (unserialize() SPL ArrayObject / SPLObjectStorage Type
+ Confusion) (CVE-2014-3515). (Stefan Esser)
+
19 Jun 2014, PHP 5.6.0 Release Candidate 1
- Core:
diff --git a/Zend/tests/67468.phpt b/Zend/tests/67468.phpt
new file mode 100644
index 0000000000..767217644a
--- /dev/null
+++ b/Zend/tests/67468.phpt
@@ -0,0 +1,11 @@
+--TEST--
+Bug #67468 (Segfault in highlight_file()/highlight_string())
+--SKIPIF--
+<?php if(!function_exists("leak")) print "skip only for debug builds"; ?>
+--FILE--
+<?php
+highlight_string("<?php __CLASS__;", true);
+echo "done";
+?>
+--EXPECT--
+done
diff --git a/Zend/tests/bug67368.phpt b/Zend/tests/bug67368.phpt
new file mode 100644
index 0000000000..c92e994b94
--- /dev/null
+++ b/Zend/tests/bug67368.phpt
@@ -0,0 +1,12 @@
+--TEST--
+Bug #67368 (Memory leak with immediately dereferenced array in class constant)
+--INI--
+report_memleaks=1
+--FILE--
+<?php
+class FooBar {
+ const bar = ["bar" => 3]["bar"];
+}
+echo "okey";
+--EXPECTF--
+okey
diff --git a/Zend/zend_ast.c b/Zend/zend_ast.c
index 583a52321b..12f9405523 100644
--- a/Zend/zend_ast.c
+++ b/Zend/zend_ast.c
@@ -328,8 +328,7 @@ ZEND_API void zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *s
{
zval *tmp;
zend_fetch_dimension_by_zval(&tmp, &op1, &op2 TSRMLS_CC);
- *result = *tmp;
- efree(tmp);
+ ZVAL_ZVAL(result, tmp, 1, 1);
}
zval_dtor(&op1);
zval_dtor(&op2);
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index ad92c5fb6f..6ada04e1cb 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -943,6 +943,26 @@ copy_value:
}
}
+static void zval_deep_copy(zval **p)
+{
+ zval *value;
+
+ ALLOC_ZVAL(value);
+ *value = **p;
+ if (Z_TYPE_P(value) == IS_ARRAY) {
+ HashTable *ht;
+
+ ALLOC_HASHTABLE(ht);
+ zend_hash_init(ht, zend_hash_num_elements(Z_ARRVAL_P(value)), NULL, ZVAL_PTR_DTOR, 0);
+ zend_hash_copy(ht, Z_ARRVAL_P(value), (copy_ctor_func_t) zval_deep_copy, NULL, sizeof(zval *));
+ Z_ARRVAL_P(value) = ht;
+ } else {
+ zval_copy_ctor(value);
+ }
+ INIT_PZVAL(value);
+ *p = value;
+}
+
/* Utility Functions for Extensions */
static void zend_extension_statement_handler(const zend_extension *extension, zend_op_array *op_array TSRMLS_DC)
{
diff --git a/Zend/zend_highlight.c b/Zend/zend_highlight.c
index 68f2b7b72d..31d99b7dfe 100644
--- a/Zend/zend_highlight.c
+++ b/Zend/zend_highlight.c
@@ -150,7 +150,7 @@ ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini
case T_DOC_COMMENT:
break;
default:
- efree(token.value.str.val);
+ str_efree(token.value.str.val);
break;
}
}
diff --git a/Zend/zend_indent.c b/Zend/zend_indent.c
index cacdf8df3b..920d412816 100644
--- a/Zend/zend_indent.c
+++ b/Zend/zend_indent.c
@@ -139,7 +139,7 @@ dflt_printout:
case T_WHITESPACE:
break;
default:
- efree(token.value.str.val);
+ str_efree(token.value.str.val);
break;
}
}
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index cd7dbf498d..c3fb86ddd3 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -3422,6 +3422,13 @@ ZEND_VM_HANDLER(64, ZEND_RECV_INIT, ANY, CONST)
if (IS_CONSTANT_TYPE(Z_TYPE_P(assignment_value))) {
Z_SET_REFCOUNT_P(assignment_value, 1);
zval_update_constant(&assignment_value, 0 TSRMLS_CC);
+ } else if (Z_TYPE_P(assignment_value) == IS_ARRAY) {
+ HashTable *ht;
+
+ ALLOC_HASHTABLE(ht);
+ zend_hash_init(ht, zend_hash_num_elements(Z_ARRVAL_P(assignment_value)), NULL, ZVAL_PTR_DTOR, 0);
+ zend_hash_copy(ht, Z_ARRVAL_P(assignment_value), (copy_ctor_func_t) zval_deep_copy, NULL, sizeof(zval *));
+ Z_ARRVAL_P(assignment_value) = ht;
} else {
zval_copy_ctor(assignment_value);
}
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index 29a8c0c80f..3fa94d12af 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -1624,6 +1624,13 @@ static int ZEND_FASTCALL ZEND_RECV_INIT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_
if (IS_CONSTANT_TYPE(Z_TYPE_P(assignment_value))) {
Z_SET_REFCOUNT_P(assignment_value, 1);
zval_update_constant(&assignment_value, 0 TSRMLS_CC);
+ } else if (Z_TYPE_P(assignment_value) == IS_ARRAY) {
+ HashTable *ht;
+
+ ALLOC_HASHTABLE(ht);
+ zend_hash_init(ht, zend_hash_num_elements(Z_ARRVAL_P(assignment_value)), NULL, ZVAL_PTR_DTOR, 0);
+ zend_hash_copy(ht, Z_ARRVAL_P(assignment_value), (copy_ctor_func_t) zval_deep_copy, NULL, sizeof(zval *));
+ Z_ARRVAL_P(assignment_value) = ht;
} else {
zval_copy_ctor(assignment_value);
}
diff --git a/build/libtool.m4 b/build/libtool.m4
index 56658ccbb4..4d948b9078 100644
--- a/build/libtool.m4
+++ b/build/libtool.m4
@@ -1532,10 +1532,6 @@ dgux*)
shlibpath_var=LD_LIBRARY_PATH
;;
-freebsd1*)
- dynamic_linker=no
- ;;
-
freebsd* | dragonfly*)
# DragonFly does not have aout. When/if they implement a new
# versioning mechanism, adjust this.
@@ -5843,10 +5839,6 @@ _LT_EOF
_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
;;
- freebsd1*)
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
-
# FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
# support. Future versions do this automatically, but an explicit c++rt0.o
# does not break anything, and helps significantly (at the cost of a little
diff --git a/ext/fileinfo/libmagic.patch b/ext/fileinfo/libmagic.patch
index bb9a0dafae..8b0b9a8911 100644
--- a/ext/fileinfo/libmagic.patch
+++ b/ext/fileinfo/libmagic.patch
@@ -822,7 +822,16 @@ diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c
}
diff -u libmagic.orig/cdf.c libmagic/cdf.c
--- libmagic.orig/cdf.c Tue Feb 26 17:20:42 2013
-+++ libmagic/cdf.c Tue May 27 22:28:51 2014
++++ libmagic/cdf.c Tue Jul 1 08:57:25 2014
+@@ -35,7 +35,7 @@
+ #include "file.h"
+
+ #ifndef lint
+-FILE_RCSID("@(#)$File: cdf.c,v 1.53 2013/02/26 16:20:42 christos Exp $")
++FILE_RCSID("@(#)$File: cdf.c,v 1.55 2014/02/27 23:26:17 christos Exp $")
+ #endif
+
+ #include <assert.h>
@@ -43,7 +43,17 @@
#include <err.h>
#endif
@@ -841,7 +850,25 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c
#include <string.h>
#include <time.h>
#include <ctype.h>
-@@ -296,7 +306,10 @@
+@@ -267,13 +277,15 @@
+ {
+ const char *b = (const char *)sst->sst_tab;
+ const char *e = ((const char *)p) + tail;
++ size_t ss = sst->sst_dirlen < h->h_min_size_standard_stream ?
++ CDF_SHORT_SEC_SIZE(h) : CDF_SEC_SIZE(h);
+ (void)&line;
+- if (e >= b && (size_t)(e - b) <= CDF_SEC_SIZE(h) * sst->sst_len)
++ if (e >= b && (size_t)(e - b) <= ss * sst->sst_len)
+ return 0;
+ DPRINTF(("%d: offset begin %p < end %p || %" SIZE_T_FORMAT "u"
+ " > %" SIZE_T_FORMAT "u [%" SIZE_T_FORMAT "u %"
+ SIZE_T_FORMAT "u]\n", line, b, e, (size_t)(e - b),
+- CDF_SEC_SIZE(h) * sst->sst_len, CDF_SEC_SIZE(h), sst->sst_len));
++ ss * sst->sst_len, ss, sst->sst_len));
+ errno = EFTYPE;
+ return -1;
+ }
+@@ -296,7 +308,10 @@
if (info->i_fd == -1)
return -1;
@@ -853,7 +880,77 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c
return -1;
return (ssize_t)len;
-@@ -810,6 +823,10 @@
+@@ -352,10 +367,10 @@
+ size_t ss = CDF_SHORT_SEC_SIZE(h);
+ size_t pos = CDF_SHORT_SEC_POS(h, id);
+ assert(ss == len);
+- if (pos > CDF_SEC_SIZE(h) * sst->sst_len) {
++ if (pos + len > CDF_SEC_SIZE(h) * sst->sst_len) {
+ DPRINTF(("Out of bounds read %" SIZE_T_FORMAT "u > %"
+ SIZE_T_FORMAT "u\n",
+- pos, CDF_SEC_SIZE(h) * sst->sst_len));
++ pos + len, CDF_SEC_SIZE(h) * sst->sst_len));
+ return -1;
+ }
+ (void)memcpy(((char *)buf) + offs,
+@@ -455,7 +470,8 @@
+ cdf_count_chain(const cdf_sat_t *sat, cdf_secid_t sid, size_t size)
+ {
+ size_t i, j;
+- cdf_secid_t maxsector = (cdf_secid_t)(sat->sat_len * size);
++ cdf_secid_t maxsector = (cdf_secid_t)((sat->sat_len * size)
++ / sizeof(maxsector));
+
+ DPRINTF(("Chain:"));
+ for (j = i = 0; sid >= 0; i++, j++) {
+@@ -465,8 +481,8 @@
+ errno = EFTYPE;
+ return (size_t)-1;
+ }
+- if (sid > maxsector) {
+- DPRINTF(("Sector %d > %d\n", sid, maxsector));
++ if (sid >= maxsector) {
++ DPRINTF(("Sector %d >= %d\n", sid, maxsector));
+ errno = EFTYPE;
+ return (size_t)-1;
+ }
+@@ -675,11 +691,13 @@
+
+ int
+ cdf_read_short_stream(const cdf_info_t *info, const cdf_header_t *h,
+- const cdf_sat_t *sat, const cdf_dir_t *dir, cdf_stream_t *scn)
++ const cdf_sat_t *sat, const cdf_dir_t *dir, cdf_stream_t *scn,
++ const cdf_directory_t **root)
+ {
+ size_t i;
+ const cdf_directory_t *d;
+
++ *root = NULL;
+ for (i = 0; i < dir->dir_len; i++)
+ if (dir->dir_tab[i].d_type == CDF_DIR_TYPE_ROOT_STORAGE)
+ break;
+@@ -688,6 +706,7 @@
+ if (i == dir->dir_len)
+ goto out;
+ d = &dir->dir_tab[i];
++ *root = d;
+
+ /* If the it is not there, just fake it; some docs don't have it */
+ if (d->d_stream_first_sector < 0)
+@@ -796,7 +815,11 @@
+ if (cdf_check_stream_offset(sst, h, e, 0, __LINE__) == -1)
+ goto out;
+ for (i = 0; i < sh.sh_properties; i++) {
+- size_t ofs = CDF_GETUINT32(p, (i << 1) + 1);
++ size_t ofs, tail = (i << 1) + 1;
++ if (cdf_check_stream_offset(sst, h, p, tail * sizeof(uint32_t),
++ __LINE__) == -1)
++ goto out;
++ ofs = CDF_GETUINT32(p, tail);
+ q = (const uint8_t *)(const void *)
+ ((const char *)(const void *)p + ofs
+ - 2 * sizeof(uint32_t));
+@@ -810,6 +833,10 @@
i, inp[i].pi_id, inp[i].pi_type, q - p, offs));
if (inp[i].pi_type & CDF_VECTOR) {
nelements = CDF_GETUINT32(q, 1);
@@ -864,7 +961,7 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c
o = 2;
} else {
nelements = 1;
-@@ -884,7 +901,9 @@
+@@ -884,7 +911,9 @@
}
DPRINTF(("nelements = %" SIZE_T_FORMAT "u\n",
nelements));
@@ -875,7 +972,7 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c
uint32_t l = CDF_GETUINT32(q, o);
inp[i].pi_str.s_len = l;
inp[i].pi_str.s_buf = (const char *)
-@@ -929,7 +948,7 @@
+@@ -929,7 +958,7 @@
cdf_unpack_summary_info(const cdf_stream_t *sst, const cdf_header_t *h,
cdf_summary_info_header_t *ssi, cdf_property_info_t **info, size_t *count)
{
@@ -884,7 +981,7 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c
const cdf_summary_info_header_t *si =
CAST(const cdf_summary_info_header_t *, sst->sst_tab);
const cdf_section_declaration_t *sd =
-@@ -944,21 +963,13 @@
+@@ -944,21 +973,13 @@
ssi->si_os = CDF_TOLE2(si->si_os);
ssi->si_class = si->si_class;
cdf_swap_class(&ssi->si_class);
@@ -909,7 +1006,7 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c
return 0;
}
-@@ -1132,7 +1143,7 @@
+@@ -1132,7 +1153,7 @@
cdf_directory_t *d;
char name[__arraycount(d->d_name)];
cdf_stream_t scn;
@@ -918,7 +1015,7 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c
static const char *types[] = { "empty", "user storage",
"user stream", "lockbytes", "property", "root storage" };
-@@ -1185,7 +1196,7 @@
+@@ -1185,7 +1206,7 @@
cdf_dump_property_info(const cdf_property_info_t *info, size_t count)
{
cdf_timestamp_t tp;
@@ -927,7 +1024,7 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c
char buf[64];
size_t i, j;
-@@ -1229,7 +1240,11 @@
+@@ -1229,7 +1250,11 @@
break;
case CDF_FILETIME:
tp = info[i].pi_tp;
@@ -941,7 +1038,7 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c
} else {
diff -u libmagic.orig/cdf.h libmagic/cdf.h
--- libmagic.orig/cdf.h Thu Jun 21 00:19:55 2012
-+++ libmagic/cdf.h Tue May 27 22:28:51 2014
++++ libmagic/cdf.h Thu Jun 5 18:05:33 2014
@@ -35,10 +35,12 @@
#ifndef _H_CDF_
#define _H_CDF_
@@ -982,6 +1079,16 @@ diff -u libmagic.orig/cdf.h libmagic/cdf.h
int cdf_read_header(const cdf_info_t *, cdf_header_t *);
void cdf_swap_header(cdf_header_t *);
void cdf_unpack_header(cdf_header_t *, char *);
+@@ -294,7 +300,8 @@
+ int cdf_read_ssat(const cdf_info_t *, const cdf_header_t *, const cdf_sat_t *,
+ cdf_sat_t *);
+ int cdf_read_short_stream(const cdf_info_t *, const cdf_header_t *,
+- const cdf_sat_t *, const cdf_dir_t *, cdf_stream_t *);
++ const cdf_sat_t *, const cdf_dir_t *, cdf_stream_t *,
++ const cdf_directory_t **);
+ int cdf_read_property_info(const cdf_stream_t *, const cdf_header_t *, uint32_t,
+ cdf_property_info_t **, size_t *, size_t *);
+ int cdf_read_summary_info(const cdf_info_t *, const cdf_header_t *,
diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c
--- libmagic.orig/cdf_time.c Thu Jun 21 00:18:33 2012
+++ libmagic/cdf_time.c Fri Feb 21 00:21:27 2014
@@ -2599,8 +2706,13 @@ diff -u libmagic.orig/print.c libmagic/print.c
}
diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
--- libmagic.orig/readcdf.c Tue Jan 7 04:13:42 2014
-+++ libmagic/readcdf.c Tue May 27 22:28:51 2014
-@@ -30,7 +30,11 @@
++++ libmagic/readcdf.c Thu Jun 5 18:05:33 2014
+@@ -26,11 +26,15 @@
+ #include "file.h"
+
+ #ifndef lint
+-FILE_RCSID("@(#)$File: readcdf.c,v 1.37 2014/01/06 13:41:18 rrt Exp $")
++FILE_RCSID("@(#)$File: readcdf.c,v 1.40 2014/03/06 15:23:33 christos Exp $")
#endif
#include <stdlib.h>
@@ -2612,7 +2724,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
#include <string.h>
#include <time.h>
#include <ctype.h>
-@@ -69,6 +73,10 @@
+@@ -69,6 +73,44 @@
{ NULL, NULL, },
};
@@ -2620,10 +2732,49 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
+# define strcasestr strstr
+#endif
+
++static const struct cv {
++ uint64_t clsid[2];
++ const char *mime;
++} clsid2mime[] = {
++ {
++#ifdef PHP_WIN32
++ { 0x00000000000c1084ui64, 0x46000000000000c0ui64 },
++#else
++ { 0x00000000000c1084LLU, 0x46000000000000c0LLU },
++#endif
++ "x-msi",
++ }
++}, clsid2desc[] = {
++ {
++#ifdef PHP_WIN32
++ { 0x00000000000c1084ui64, 0x46000000000000c0ui64 },
++#else
++ { 0x00000000000c1084LLU, 0x46000000000000c0LLU },
++#endif
++ "MSI Installer",
++ },
++};
++
++private const char *
++cdf_clsid_to_mime(const uint64_t clsid[2], const struct cv *cv)
++{
++ size_t i;
++ for (i = 0; cv[i].mime != NULL; i++) {
++ if (clsid[0] == cv[i].clsid[0] && clsid[1] == cv[i].clsid[1])
++ return cv[i].mime;
++ }
++ return NULL;
++}
++
private const char *
cdf_app_to_mime(const char *vbuf, const struct nv *nv)
{
-@@ -91,12 +99,14 @@
+@@ -87,16 +129,21 @@
+
+ private int
+ cdf_file_property_info(struct magic_set *ms, const cdf_property_info_t *info,
+- size_t count)
++ size_t count, const cdf_directory_t *root_storage)
{
size_t i;
cdf_timestamp_t tp;
@@ -2636,10 +2787,22 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
+ memset(&ts, 0, sizeof(ts));
+
++ if (!NOTMIME(ms) && root_storage)
++ str = cdf_clsid_to_mime(root_storage->d_storage_uuid, clsid2mime);
++
for (i = 0; i < count; i++) {
cdf_print_property_name(buf, sizeof(buf), info[i].pi_id);
switch (info[i].pi_type) {
-@@ -162,8 +172,12 @@
+@@ -153,7 +200,7 @@
+ buf, vbuf) == -1)
+ return -1;
+ }
+- } else if (info[i].pi_id ==
++ } else if (str == NULL && info[i].pi_id ==
+ CDF_PROPERTY_NAME_OF_APPLICATION) {
+ str = cdf_app_to_mime(vbuf, app2mime);
+ }
+@@ -162,8 +209,12 @@
case CDF_FILETIME:
tp = info[i].pi_tp;
if (tp != 0) {
@@ -2654,7 +2817,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
cdf_print_elapsed_time(tbuf,
sizeof(tbuf), tp);
if (NOTMIME(ms) && file_printf(ms,
-@@ -171,8 +185,11 @@
+@@ -171,8 +222,11 @@
return -1;
} else {
char *c, *ec;
@@ -2668,6 +2831,91 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
if (c != NULL &&
(ec = strchr(c, '\n')) != NULL)
*ec = '\0';
+@@ -200,7 +254,7 @@
+
+ private int
+ cdf_file_summary_info(struct magic_set *ms, const cdf_header_t *h,
+- const cdf_stream_t *sst)
++ const cdf_stream_t *sst, const cdf_directory_t *root_storage)
+ {
+ cdf_summary_info_header_t si;
+ cdf_property_info_t *info;
+@@ -211,6 +265,8 @@
+ return -1;
+
+ if (NOTMIME(ms)) {
++ const char *str;
++
+ if (file_printf(ms, "Composite Document File V2 Document")
+ == -1)
+ return -1;
+@@ -238,9 +294,15 @@
+ return -2;
+ break;
+ }
+- }
++ if (root_storage) {
++ str = cdf_clsid_to_mime(root_storage->d_storage_uuid, clsid2desc);
++ if (str)
++ if (file_printf(ms, ", %s", str) == -1)
++ return -2;
++ }
++ }
+
+- m = cdf_file_property_info(ms, info, count);
++ m = cdf_file_property_info(ms, info, count, root_storage);
+ free(info);
+
+ return m == -1 ? -2 : m;
+@@ -258,6 +320,7 @@
+ int i;
+ const char *expn = "";
+ const char *corrupt = "corrupt: ";
++ const cdf_directory_t *root_storage;
+
+ info.i_fd = fd;
+ info.i_buf = buf;
+@@ -291,7 +354,8 @@
+ goto out2;
+ }
+
+- if ((i = cdf_read_short_stream(&info, &h, &sat, &dir, &sst)) == -1) {
++ if ((i = cdf_read_short_stream(&info, &h, &sat, &dir, &sst,
++ &root_storage)) == -1) {
+ expn = "Cannot read short stream";
+ goto out3;
+ }
+@@ -312,23 +376,21 @@
+ #ifdef CDF_DEBUG
+ cdf_dump_summary_info(&h, &scn);
+ #endif
+- if ((i = cdf_file_summary_info(ms, &h, &scn)) < 0)
+- expn = "Can't expand summary_info";
++ if ((i = cdf_file_summary_info(ms, &h, &scn, root_storage)) < 0)
++ expn = "Can't expand summary_info";
++
+ if (i == 0) {
+ const char *str = NULL;
+ cdf_directory_t *d;
+ char name[__arraycount(d->d_name)];
+ size_t j, k;
+- for (j = 0; j < dir.dir_len; j++) {
++
++ for (j = 0; str == NULL && j < dir.dir_len; j++) {
+ d = &dir.dir_tab[j];
+ for (k = 0; k < sizeof(name); k++)
+ name[k] = (char)cdf_tole2(d->d_name[k]);
+- if (NOTMIME(ms))
+- str = cdf_app_to_mime(name, name2desc);
+- else
+- str = cdf_app_to_mime(name, name2mime);
+- if (str != NULL)
+- break;
++ str = cdf_app_to_mime(name,
++ NOTMIME(ms) ? name2desc : name2mime);
+ }
+ if (NOTMIME(ms)) {
+ if (str != NULL) {
diff -u libmagic.orig/readelf.c libmagic/readelf.c
--- libmagic.orig/readelf.c Tue Nov 5 16:44:01 2013
+++ libmagic/readelf.c Fri Feb 21 00:21:27 2014
@@ -2915,7 +3163,7 @@ diff -u libmagic.orig/readelf.h libmagic/readelf.h
typedef uint8_t Elf64_Char;
diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
--- libmagic.orig/softmagic.c Thu Feb 13 00:20:53 2014
-+++ libmagic/softmagic.c Sun Mar 9 13:14:07 2014
++++ libmagic/softmagic.c Tue Jul 1 08:57:25 2014
@@ -50,6 +50,11 @@
#include <locale.h>
#endif
@@ -3050,7 +3298,29 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
break; \
} \
-@@ -1178,9 +1162,6 @@
+@@ -931,10 +915,18 @@
+ return 1;
+ }
+ case FILE_PSTRING: {
+- char *ptr1 = p->s, *ptr2 = ptr1 + file_pstring_length_size(m);
++ size_t sz = file_pstring_length_size(m);
++ char *ptr1 = p->s, *ptr2 = ptr1 + sz;
+ size_t len = file_pstring_get_length(m, ptr1);
+- if (len >= sizeof(p->s))
+- len = sizeof(p->s) - 1;
++ if (len >= sizeof(p->s)) {
++ /*
++ * The size of the pascal string length (sz)
++ * is 1, 2, or 4. We need at least 1 byte for NUL
++ * termination, but we've already truncated the
++ * string by p->s, so we need to deduct sz.
++ */
++ len = sizeof(p->s) - sz;
++ }
+ while (len--)
+ *ptr1++ = *ptr2++;
+ *ptr1 = '\0';
+@@ -1178,9 +1170,6 @@
"nbytes=%zu, count=%u)\n", m->type, m->flag, offset, o,
nbytes, count);
mdebug(offset, (char *)(void *)p, sizeof(union VALUETYPE));
@@ -3060,7 +3330,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
}
if (m->flag & INDIR) {
-@@ -1679,9 +1660,6 @@
+@@ -1679,9 +1668,6 @@
if ((ms->flags & MAGIC_DEBUG) != 0) {
mdebug(offset, (char *)(void *)p,
sizeof(union VALUETYPE));
@@ -3070,7 +3340,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
}
}
-@@ -1755,11 +1733,21 @@
+@@ -1755,11 +1741,21 @@
ms->offset = soffset;
if (rv == 1) {
if ((ms->flags & (MAGIC_MIME|MAGIC_APPLE)) == 0 &&
@@ -3095,7 +3365,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
}
return rv;
-@@ -1875,6 +1863,42 @@
+@@ -1875,6 +1871,42 @@
return file_strncmp(a, b, len, flags);
}
@@ -3138,13 +3408,16 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
private int
magiccheck(struct magic_set *ms, struct magic *m)
{
-@@ -2035,63 +2059,151 @@
+@@ -2035,63 +2067,151 @@
break;
}
case FILE_REGEX: {
- int rc;
- regex_t rx;
- char errmsg[512];
+-
+- if (ms->search.s == NULL)
+- return 0;
+ zval *pattern;
+ int options = 0;
+ pcre_cache_entry *pce;
@@ -3281,9 +3554,6 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
+ }
+ }
-- if (ms->search.s == NULL)
-- return 0;
-
- l = 0;
- rc = regcomp(&rx, m->value.s,
- REG_EXTENDED|REG_NEWLINE|
@@ -3318,7 +3588,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
- (size_t)(pmatch[0].rm_eo - pmatch[0].rm_so);
- v = 0;
- break;
--
+
- case REG_NOMATCH:
+ } else {
v = 1;
@@ -3354,4 +3624,3 @@ diff -u libmagic.orig/strcasestr.c libmagic/strcasestr.c
#include <assert.h>
#include <ctype.h>
#include <string.h>
-
diff --git a/ext/intl/locale/locale_methods.c b/ext/intl/locale/locale_methods.c
index 21b5847f2d..f1e184914d 100644
--- a/ext/intl/locale/locale_methods.c
+++ b/ext/intl/locale/locale_methods.c
@@ -269,8 +269,7 @@ static char* get_icu_value_internal( const char* loc_name , char* tag_name, int*
grOffset = findOffset( LOC_GRANDFATHERED , loc_name );
if( grOffset >= 0 ){
if( strcmp(tag_name , LOC_LANG_TAG)==0 ){
- tag_value = estrdup(loc_name);
- return tag_value;
+ return estrdup(loc_name);
} else {
/* Since Grandfathered , no value , do nothing , retutn NULL */
return NULL;
@@ -280,8 +279,8 @@ static char* get_icu_value_internal( const char* loc_name , char* tag_name, int*
if( fromParseLocale==1 ){
/* Handle singletons */
if( strcmp(tag_name , LOC_LANG_TAG)==0 ){
- if( strlen(loc_name)>1 && (isIDPrefix(loc_name) ==1 ) ){
- return (char *)loc_name;
+ if( strlen(loc_name)>1 && (isIDPrefix(loc_name) == 1) ){
+ return estrdup(loc_name);
}
}
@@ -498,6 +497,14 @@ static void get_icu_disp_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAME
RETURN_FALSE;
}
+ if(loc_name_len > ULOC_FULLNAME_CAPACITY) {
+ /* See bug 67397: overlong locale names cause trouble in uloc_getDisplayName */
+ spprintf(&msg , 0, "locale_get_display_%s : name too long", tag_name );
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, msg , 1 TSRMLS_CC );
+ efree(msg);
+ RETURN_FALSE;
+ }
+
if(loc_name_len == 0) {
loc_name = intl_locale_get_default(TSRMLS_C);
}
diff --git a/ext/intl/tests/bug62082.phpt b/ext/intl/tests/bug62082.phpt
index e6ca73e300..dab1252afd 100644
--- a/ext/intl/tests/bug62082.phpt
+++ b/ext/intl/tests/bug62082.phpt
@@ -10,6 +10,7 @@ var_dump(locale_get_display_name(str_repeat("a", 300), null));
var_dump(locale_get_display_name(str_repeat("a", 512), null));
var_dump(locale_get_display_name(str_repeat("a", 600), null));
--EXPECT--
-string(300) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
-string(512) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
-string(600) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+bool(false)
+bool(false)
+bool(false)
+
diff --git a/ext/intl/tests/bug67397.phpt b/ext/intl/tests/bug67397.phpt
new file mode 100644
index 0000000000..b2b2911f8a
--- /dev/null
+++ b/ext/intl/tests/bug67397.phpt
@@ -0,0 +1,21 @@
+--TEST--
+Bug #67397 (Buffer overflow in locale_get_display_name->uloc_getDisplayName (libicu 4.8.1))
+--SKIPIF--
+<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
+--FILE--
+<?php
+
+function ut_main()
+{
+ $ret = var_export(ut_loc_get_display_name(str_repeat('*', 256), 'en_us'), true);
+ $ret .= "\n";
+ $ret .= var_export(intl_get_error_message(), true);
+ return $ret;
+}
+
+include_once( 'ut_common.inc' );
+ut_run();
+?>
+--EXPECTF--
+false
+'locale_get_display_name : name too long: U_ILLEGAL_ARGUMENT_ERROR'
diff --git a/ext/intl/tests/dateformat_localtime.phpt b/ext/intl/tests/dateformat_localtime.phpt
index 79f297db74..4d185c232d 100644
--- a/ext/intl/tests/dateformat_localtime.phpt
+++ b/ext/intl/tests/dateformat_localtime.phpt
@@ -3,6 +3,8 @@ datefmt_localtime_code() icu <= 4.2
--SKIPIF--
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
<?php if(version_compare(INTL_ICU_VERSION, '4.3', '<') != 1) print 'skip'; ?>
+--INI--
+date.timezone=UTC
--FILE--
<?php
diff --git a/ext/intl/tests/locale_parse_locale2.phpt b/ext/intl/tests/locale_parse_locale2.phpt
index 6012862a48..30cc8cc0ae 100644
--- a/ext/intl/tests/locale_parse_locale2.phpt
+++ b/ext/intl/tests/locale_parse_locale2.phpt
@@ -63,7 +63,8 @@ function ut_main()
//Some Invalid Tags:
'de-419-DE',
'a-DE',
- 'ar-a-aaa-b-bbb-a-ccc'
+ 'ar-a-aaa-b-bbb-a-ccc',
+ 'x-AAAAAA',
);
@@ -201,3 +202,6 @@ No values found from Locale parsing.
---------------------
ar-a-aaa-b-bbb-a-ccc:
language : 'ar' ,
+---------------------
+x-AAAAAA:
+private0 : 'AAAAAA' ,
diff --git a/ext/mysql/tests/mysql_trace_mode.phpt b/ext/mysql/tests/mysql_trace_mode.phpt
index 7655975d70..73872de1db 100644
--- a/ext/mysql/tests/mysql_trace_mode.phpt
+++ b/ext/mysql/tests/mysql_trace_mode.phpt
@@ -31,7 +31,7 @@ require_once("clean_table.inc");
--EXPECTF--
Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d
I don\'t mind character sets, do I?\n
-Warning: mysql_query(): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BOGUS_SQL' at line 1 in %s on line %d
+Warning: mysql_query(): You have an error in your SQL syntax; check the manual that corresponds to your %s server version for the right syntax to use near 'BOGUS_SQL' at line 1 in %s on line %d
done!
Warning: Unknown: 1 result set(s) not freed. Use mysql_free_result to free result sets which were requested using mysql_query() in %s on line %d
diff --git a/ext/mysqli/tests/mysqli_driver.phpt b/ext/mysqli/tests/mysqli_driver.phpt
index 023e4d2299..02223809ee 100644
--- a/ext/mysqli/tests/mysqli_driver.phpt
+++ b/ext/mysqli/tests/mysqli_driver.phpt
@@ -110,5 +110,5 @@ require_once('skipifconnectfailure.inc');
print "done!";
?>
--EXPECTF--
-Warning: mysqli_query(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NO_SQL' at line 1 in %s on line %d
+Warning: mysqli_query(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your %s server version for the right syntax to use near 'NO_SQL' at line 1 in %s on line %d
done! \ No newline at end of file
diff --git a/ext/mysqli/tests/mysqli_report.phpt b/ext/mysqli/tests/mysqli_report.phpt
index 4d2d3553d1..3dcf4981b8 100644
--- a/ext/mysqli/tests/mysqli_report.phpt
+++ b/ext/mysqli/tests/mysqli_report.phpt
@@ -284,19 +284,19 @@ require_once('skipifconnectfailure.inc');
require_once("clean_table.inc");
?>
--EXPECTF--
-Warning: mysqli_multi_query(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BAR; FOO' at line 1 in %s on line %d
+Warning: mysqli_multi_query(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your %s server version for the right syntax to use near 'BAR; FOO' at line 1 in %s on line %d
-Warning: mysqli_query(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FOO' at line 1 in %s on line %d
+Warning: mysqli_query(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your %s server version for the right syntax to use near 'FOO' at line 1 in %s on line %d
Warning: mysqli_kill(): processid should have positive value in %s on line %d
-Warning: mysqli_prepare(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FOO' at line 1 in %s on line %d
+Warning: mysqli_prepare(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your %s server version for the right syntax to use near 'FOO' at line 1 in %s on line %d
-Warning: mysqli_real_query(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FOO' at line 1 in %s on line %d
+Warning: mysqli_real_query(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your %s server version for the right syntax to use near 'FOO' at line 1 in %s on line %d
Warning: mysqli_kill(): processid should have positive value in %s on line %d
-Warning: mysqli_stmt_prepare(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FOO' at line 1 in %s on line %d
+Warning: mysqli_stmt_prepare(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your %s server version for the right syntax to use near 'FOO' at line 1 in %s on line %d
[013] Access denied for user '%s'@'%s' (using password: YES)
[016] Access denied for user '%s'@'%s' (using password: YES)
done! \ No newline at end of file
diff --git a/ext/mysqli/tests/mysqli_report_wo_ps.phpt b/ext/mysqli/tests/mysqli_report_wo_ps.phpt
index dae81b21cc..2665793407 100644
--- a/ext/mysqli/tests/mysqli_report_wo_ps.phpt
+++ b/ext/mysqli/tests/mysqli_report_wo_ps.phpt
@@ -104,15 +104,15 @@ if (mysqli_get_server_version($link) >= 50600)
require_once("clean_table.inc");
?>
--EXPECTF--
-Warning: mysqli_multi_query(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BAR; FOO' at line 1 in %s on line %d
+Warning: mysqli_multi_query(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your %s server version for the right syntax to use near 'BAR; FOO' at line 1 in %s on line %d
-Warning: mysqli_query(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FOO' at line 1 in %s on line %d
+Warning: mysqli_query(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your %s server version for the right syntax to use near 'FOO' at line 1 in %s on line %d
Warning: mysqli_change_user(): (%d/%d): Access denied for user '%s'@'%s' (using password: %s) in %s on line %d
Warning: mysqli_kill(): processid should have positive value in %s on line %d
-Warning: mysqli_real_query(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FOO' at line 1 in %s on line %d
+Warning: mysqli_real_query(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your %s server version for the right syntax to use near 'FOO' at line 1 in %s on line %d
Warning: mysqli_kill(): processid should have positive value in %s on line %d
[011] Access denied for user '%s'@'%s' (using password: YES)
diff --git a/ext/openssl/tests/bug65538_002.phpt b/ext/openssl/tests/bug65538_002.phpt
index dfc6f94ff7..1066e01e54 100644
--- a/ext/openssl/tests/bug65538_002.phpt
+++ b/ext/openssl/tests/bug65538_002.phpt
@@ -3,6 +3,7 @@ Bug #65538: SSL context "cafile" disallows URL stream wrappers
--SKIPIF--
<?php
if (!extension_loaded('openssl')) die('skip, openssl required');
+if (getenv("SKIP_ONLINE_TESTS")) die("skip online test");
--FILE--
<?php
$clientCtx = stream_context_create(['ssl' => [
diff --git a/ext/pdo_mysql/tests/bug54929.phpt b/ext/pdo_mysql/tests/bug54929.phpt
index 29fb44182b..84b9e7d04f 100644
--- a/ext/pdo_mysql/tests/bug54929.phpt
+++ b/ext/pdo_mysql/tests/bug54929.phpt
@@ -47,14 +47,14 @@ array(1) {
string(3) "foo"
}
-Warning: PDOStatement::execute(): SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '--'' at line 1 in %s on line %d
+Warning: PDOStatement::execute(): SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your %s server version for the right syntax to use near '--'' at line 1 in %s on line %d
array(3) {
[0]=>
string(5) "42000"
[1]=>
int(1064)
[2]=>
- string(149) "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '--'' at line 1"
+ string(149) "You have an error in your SQL syntax; check the manual that corresponds to your %s server version for the right syntax to use near '--'' at line 1"
}
array(1) {
["f1"]=>
diff --git a/ext/pdo_mysql/tests/bug66141.phpt b/ext/pdo_mysql/tests/bug66141.phpt
index 3a28509314..5c382dfe0e 100644
--- a/ext/pdo_mysql/tests/bug66141.phpt
+++ b/ext/pdo_mysql/tests/bug66141.phpt
@@ -31,7 +31,7 @@ var_dump($quotedInput2);
?>
done
--EXPECTF--
-Warning: PDO::query(): SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'something that throws an exception' at line %d in %s on line %d
+Warning: PDO::query(): SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your %s server version for the right syntax to use near 'something that throws an exception' at line %d in %s on line %d
string(50) "'Something\', 1 as one, 2 as two FROM dual; -- f'"
string(50) "'Something'', 1 as one, 2 as two FROM dual; -- f'"
string(50) "'Something'', 1 as one, 2 as two FROM dual; -- f'"
diff --git a/ext/pdo_mysql/tests/pdo_mysql_attr_errmode.phpt b/ext/pdo_mysql/tests/pdo_mysql_attr_errmode.phpt
index b03708900f..ce6a1ecd26 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_attr_errmode.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_attr_errmode.phpt
@@ -161,6 +161,6 @@ error_reporting=E_ALL
--EXPECTF--
[003] Maybe PDO could indicate that this is not a proper way of setting the ERRMODE...true
-Warning: PDO::query(): SQLSTATE[42000]: Syntax error or access violation: %d You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%s' at line %d in %s on line %d
+Warning: PDO::query(): SQLSTATE[42000]: Syntax error or access violation: %d You have an error in your SQL syntax; check the manual that corresponds to your %s server version for the right syntax to use near '%s' at line %d in %s on line %d
end of execution \ No newline at end of file
diff --git a/ext/pdo_mysql/tests/pdo_mysql_exec.phpt b/ext/pdo_mysql/tests/pdo_mysql_exec.phpt
index 2a0f527180..acd90904f7 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_exec.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_exec.phpt
@@ -179,7 +179,7 @@ $db = MySQLPDOTest::factory();
@$db->exec('DROP TABLE IF EXISTS test');
?>
--EXPECTF--
-Warning: PDO::exec(): SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'THIS IS NOT VALID SQL, I HOPE' at line 1 in %s on line %d
-[016] [42000] 42000 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'THIS IS NOT VALID SQL, I HOPE' at line %d
+Warning: PDO::exec(): SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your %s server version for the right syntax to use near 'THIS IS NOT VALID SQL, I HOPE' at line 1 in %s on line %d
+[016] [42000] 42000 1064 You have an error in your SQL syntax; check the manual that corresponds to your %s server version for the right syntax to use near 'THIS IS NOT VALID SQL, I HOPE' at line %d
[035] With emulated PS it works but makes no sense given that exec() returns sort of affected rows...
done!
diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_multiquery.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_multiquery.phpt
index 56c37c5f1a..52ecc912d4 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_stmt_multiquery.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_multiquery.phpt
@@ -97,6 +97,6 @@ array(1) {
}
Native Prepared Statements...
-Warning: PDO::query(): SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%SSELECT label FROM test ORDER BY id ASC LIMIT 1' at line %d in %s on line %d
+Warning: PDO::query(): SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your %s server version for the right syntax to use near '%SSELECT label FROM test ORDER BY id ASC LIMIT 1' at line %d in %s on line %d
Fatal error: Call to a member function errorInfo() on boolean in %s on line %d
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index d867f433b2..be351297d0 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -783,7 +783,7 @@ static int le_link, le_plink, le_result, le_lofp, le_string;
#endif
#if !HAVE_PQESCAPE_CONN
-#define PQescapeStringConn(conn, to, form, len, error) PQescapeString(to, from, len)
+#define PQescapeStringConn(conn, to, from, len, error) PQescapeString(to, from, len)
#endif
#if HAVE_PQESCAPELITERAL
diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c
index 4191b0db0e..32cdfe6fb4 100644
--- a/ext/spl/spl_array.c
+++ b/ext/spl/spl_array.c
@@ -1804,7 +1804,7 @@ SPL_METHOD(Array, unserialize)
++p;
ALLOC_INIT_ZVAL(pmembers);
- if (!php_var_unserialize(&pmembers, &p, s + buf_len, &var_hash TSRMLS_CC)) {
+ if (!php_var_unserialize(&pmembers, &p, s + buf_len, &var_hash TSRMLS_CC) || Z_TYPE_P(pmembers) != IS_ARRAY) {
zval_ptr_dtor(&pmembers);
goto outexcept;
}
diff --git a/ext/spl/spl_observer.c b/ext/spl/spl_observer.c
index 57ddf492d1..f493154b20 100644
--- a/ext/spl/spl_observer.c
+++ b/ext/spl/spl_observer.c
@@ -914,7 +914,7 @@ SPL_METHOD(SplObjectStorage, unserialize)
++p;
ALLOC_INIT_ZVAL(pmembers);
- if (!php_var_unserialize(&pmembers, &p, s + buf_len, &var_hash TSRMLS_CC)) {
+ if (!php_var_unserialize(&pmembers, &p, s + buf_len, &var_hash TSRMLS_CC) || Z_TYPE_P(pmembers) != IS_ARRAY) {
zval_ptr_dtor(&pmembers);
goto outexcept;
}
diff --git a/ext/spl/tests/SplObjectStorage_unserialize_bad.phpt b/ext/spl/tests/SplObjectStorage_unserialize_bad.phpt
index a525317093..8f0676de3b 100644
--- a/ext/spl/tests/SplObjectStorage_unserialize_bad.phpt
+++ b/ext/spl/tests/SplObjectStorage_unserialize_bad.phpt
@@ -7,6 +7,7 @@ $badblobs = array(
'x:i:2;i:0;,i:1;;i:0;,i:2;;m:a:0:{}',
'x:i:3;O:8:"stdClass":0:{},O:8:"stdClass":0:{};R:2;,i:1;;O:8:"stdClass":0:{},r:2;;m:a:0:{}',
'x:i:3;O:8:"stdClass":0:{},O:8:"stdClass":0:{};r:2;,i:1;;O:8:"stdClass":0:{},r:2;;m:a:0:{}',
+'x:i:1;O:8:"stdClass":0:{},N;;m:s:40:"1234567890123456789012345678901234567890"',
);
foreach($badblobs as $blob) {
try {
@@ -17,6 +18,7 @@ try {
echo $e->getMessage()."\n";
}
}
+echo "DONE\n";
--EXPECTF--
Error at offset 6 of 34 bytes
Error at offset 46 of 89 bytes
@@ -42,4 +44,5 @@ object(SplObjectStorage)#2 (1) {
}
}
}
-
+Error at offset 79 of 78 bytes
+DONE
diff --git a/ext/standard/info.c b/ext/standard/info.c
index 03ced35fb3..0626a7067b 100644
--- a/ext/standard/info.c
+++ b/ext/standard/info.c
@@ -866,16 +866,16 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
php_info_print_table_start();
php_info_print_table_header(2, "Variable", "Value");
- if (zend_hash_find(&EG(symbol_table), "PHP_SELF", sizeof("PHP_SELF"), (void **) &data) != FAILURE) {
+ if (zend_hash_find(&EG(symbol_table), "PHP_SELF", sizeof("PHP_SELF"), (void **) &data) != FAILURE && Z_TYPE_PP(data) == IS_STRING) {
php_info_print_table_row(2, "PHP_SELF", Z_STRVAL_PP(data));
}
- if (zend_hash_find(&EG(symbol_table), "PHP_AUTH_TYPE", sizeof("PHP_AUTH_TYPE"), (void **) &data) != FAILURE) {
+ if (zend_hash_find(&EG(symbol_table), "PHP_AUTH_TYPE", sizeof("PHP_AUTH_TYPE"), (void **) &data) != FAILURE && Z_TYPE_PP(data) == IS_STRING) {
php_info_print_table_row(2, "PHP_AUTH_TYPE", Z_STRVAL_PP(data));
}
- if (zend_hash_find(&EG(symbol_table), "PHP_AUTH_USER", sizeof("PHP_AUTH_USER"), (void **) &data) != FAILURE) {
+ if (zend_hash_find(&EG(symbol_table), "PHP_AUTH_USER", sizeof("PHP_AUTH_USER"), (void **) &data) != FAILURE && Z_TYPE_PP(data) == IS_STRING) {
php_info_print_table_row(2, "PHP_AUTH_USER", Z_STRVAL_PP(data));
}
- if (zend_hash_find(&EG(symbol_table), "PHP_AUTH_PW", sizeof("PHP_AUTH_PW"), (void **) &data) != FAILURE) {
+ if (zend_hash_find(&EG(symbol_table), "PHP_AUTH_PW", sizeof("PHP_AUTH_PW"), (void **) &data) != FAILURE && Z_TYPE_PP(data) == IS_STRING) {
php_info_print_table_row(2, "PHP_AUTH_PW", Z_STRVAL_PP(data));
}
php_print_gpcse_array(ZEND_STRL("_REQUEST") TSRMLS_CC);
diff --git a/ext/standard/tests/general_functions/bug67498.phpt b/ext/standard/tests/general_functions/bug67498.phpt
new file mode 100644
index 0000000000..5b5951b0f8
--- /dev/null
+++ b/ext/standard/tests/general_functions/bug67498.phpt
@@ -0,0 +1,15 @@
+--TEST--
+phpinfo() Type Confusion Information Leak Vulnerability
+--FILE--
+<?php
+$PHP_SELF = 1;
+phpinfo(INFO_VARIABLES);
+
+?>
+==DONE==
+--EXPECTF--
+phpinfo()
+
+PHP Variables
+%A
+==DONE==
diff --git a/sapi/fpm/fpm/fpm_conf.c b/sapi/fpm/fpm/fpm_conf.c
index ae7908642c..34e0480101 100644
--- a/sapi/fpm/fpm/fpm_conf.c
+++ b/sapi/fpm/fpm/fpm_conf.c
@@ -1075,6 +1075,9 @@ static int fpm_conf_process_all_pools() /* {{{ */
}
}
for (kv = wp->config->php_admin_values; kv; kv = kv->next) {
+ if (!strcasecmp(kv->key, "error_log") && !strcasecmp(kv->value, "syslog")) {
+ continue;
+ }
for (p = options; *p; p++) {
if (!strcasecmp(kv->key, *p)) {
fpm_evaluate_full_path(&kv->value, wp, NULL, 0);
diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c
index 93090832f5..2ee1456340 100644
--- a/sapi/fpm/fpm/fpm_main.c
+++ b/sapi/fpm/fpm/fpm_main.c
@@ -1148,19 +1148,6 @@ static void init_request_info(TSRMLS_D)
TRANSLATE_SLASHES(env_document_root);
}
- if (env_path_translated != NULL && env_redirect_url != NULL &&
- env_path_translated != script_path_translated &&
- strcmp(env_path_translated, script_path_translated) != 0) {
- /*
- * pretty much apache specific. If we have a redirect_url
- * then our script_filename and script_name point to the
- * php executable
- */
- script_path_translated = env_path_translated;
- /* we correct SCRIPT_NAME now in case we don't have PATH_INFO */
- env_script_name = env_redirect_url;
- }
-
#ifdef __riscos__
/* Convert path to unix format*/
__riscosify_control |= __RISCOSIFY_DONT_CHECK_DIR;
@@ -1329,7 +1316,7 @@ static void init_request_info(TSRMLS_D)
efree(pt);
}
} else {
- /* make sure path_info/translated are empty */
+ /* make sure original values are remembered in ORIG_ copies if we've changed them */
if (!orig_script_filename ||
(script_path_translated != orig_script_filename &&
strcmp(script_path_translated, orig_script_filename) != 0)) {
@@ -1338,16 +1325,6 @@ static void init_request_info(TSRMLS_D)
}
script_path_translated = _sapi_cgibin_putenv("SCRIPT_FILENAME", script_path_translated TSRMLS_CC);
}
- if (env_redirect_url) {
- if (orig_path_info) {
- _sapi_cgibin_putenv("ORIG_PATH_INFO", orig_path_info TSRMLS_CC);
- _sapi_cgibin_putenv("PATH_INFO", NULL TSRMLS_CC);
- }
- if (orig_path_translated) {
- _sapi_cgibin_putenv("ORIG_PATH_TRANSLATED", orig_path_translated TSRMLS_CC);
- _sapi_cgibin_putenv("PATH_TRANSLATED", NULL TSRMLS_CC);
- }
- }
if (env_script_name != orig_script_name) {
if (orig_script_name) {
_sapi_cgibin_putenv("ORIG_SCRIPT_NAME", orig_script_name TSRMLS_CC);
diff --git a/sapi/phpdbg/Makefile.frag b/sapi/phpdbg/Makefile.frag
index d787b0fb18..b276aaaa53 100644
--- a/sapi/phpdbg/Makefile.frag
+++ b/sapi/phpdbg/Makefile.frag
@@ -26,6 +26,9 @@ install-phpdbg: $(BUILD_BINARY)
@$(mkinstalldirs) $(INSTALL_ROOT)$(localstatedir)/log
@$(mkinstalldirs) $(INSTALL_ROOT)$(localstatedir)/run
@$(INSTALL) -m 0755 $(BUILD_BINARY) $(INSTALL_ROOT)$(bindir)/$(program_prefix)phpdbg$(program_suffix)$(EXEEXT)
+ @echo "Installing phpdbg man page: $(INSTALL_ROOT)$(mandir)/man1/"
+ @$(mkinstalldirs) $(INSTALL_ROOT)$(mandir)/man1
+ @$(INSTALL_DATA) sapi/phpdbg/phpdbg.1 $(INSTALL_ROOT)$(mandir)/man1/$(program_prefix)phpdbg$(program_suffix).1
clean-phpdbg:
@echo "Cleaning phpdbg object files ..."
diff --git a/sapi/phpdbg/config.m4 b/sapi/phpdbg/config.m4
index 1a6640eaca..d78a439af0 100644
--- a/sapi/phpdbg/config.m4
+++ b/sapi/phpdbg/config.m4
@@ -21,7 +21,7 @@ if test "$PHP_PHPDBG" != "no"; then
PHP_PHPDBG_CFLAGS="-D_GNU_SOURCE"
PHP_PHPDBG_FILES="phpdbg.c phpdbg_parser.c phpdbg_lexer.c phpdbg_prompt.c phpdbg_help.c phpdbg_break.c phpdbg_print.c phpdbg_bp.c phpdbg_opcode.c phpdbg_list.c phpdbg_utils.c phpdbg_info.c phpdbg_cmd.c phpdbg_set.c phpdbg_frame.c phpdbg_watch.c phpdbg_btree.c"
- if test "$PHP_READLINE" != "no"; then
+ if test "$PHP_READLINE" != "no" -o "$PHP_LIBEDIT" != "no"; then
PHPDBG_EXTRA_LIBS="$PHP_READLINE_LIBS"
fi
diff --git a/sapi/phpdbg/phpdbg.1 b/sapi/phpdbg/phpdbg.1
new file mode 100644
index 0000000000..5e4d144c83
--- /dev/null
+++ b/sapi/phpdbg/phpdbg.1
@@ -0,0 +1,59 @@
+.TH PHPDBG 1
+.SH NAME
+phpdbg \- The interactive PHP debugger
+.SH SYNOPSIS
+.B phpdbg
+[OPTION]
+[\fB\-e\fIFILE\fR]
+.SH DESCRIPTION
+.B phpdbg
+a lightweight, powerful, easy to use debugging platform for PHP5.
+.SH OPTIONS
+The following switches are implemented (just like cli SAPI):
+.TP
+.BR \-n
+No \fBphp.ini\fR file will be used
+.TP
+.BR \-c \fIpath\fB|\fIfile\fR
+Look for \fBphp.ini\fR file in the directory \fIpath\fR or use the specified \fIfile\fR
+.TP
+.BR \-z \fIfile\fR
+Load Zend extension \fIfile\fR
+.TP
+.BR \-d \fIfoo\fB[=\fIbar\fB]\fR
+Define INI entry \fIfoo\fR with value \fIbar\fR
+.PP The following switches change the default behaviour of phpdbg:
+.TP
+.BR \-v
+Disables quietness
+.TP
+.BR \-s
+Enabled stepping
+.TP
+.BR -e \fIfile\fR
+Sets execution context
+.TP
+.BR \-b
+Disables use of colour on the console
+.TP
+.BR \-I
+Ignore .phpdbginit (default init file)
+.TP
+.BR \-i \fIpath\fB|\ffile\fR
+Override .phpgdbinit location (implies -I)
+.TP
+.BR \-O \fIfile\fR
+Set oplog output to \fIfile\fR
+.TP
+.BR \-q
+Do not print banner on startup
+.TP
+.BR \-r
+Jump straight to run
+.TP
+.BR \-E
+Enable step through eval()
+.SH NOTES
+Passing -rr will cause phpdbg to quit after execution, rather than returning to the console
+.SH AUTHOR
+Written by Felipe Pena, Joe Watkins and Bob Weinand, formatted by Ondřej Surý for Debian project.
diff --git a/sapi/phpdbg/phpdbg.h b/sapi/phpdbg/phpdbg.h
index 12350d5425..eb4faf1f94 100644
--- a/sapi/phpdbg/phpdbg.h
+++ b/sapi/phpdbg/phpdbg.h
@@ -64,10 +64,13 @@
# include "TSRM.h"
#endif
-#ifdef HAVE_LIBREADLINE
+#ifdef LIBREADLINE
# include <readline/readline.h>
# include <readline/history.h>
#endif
+#ifdef HAVE_LIBEDIT
+# include <editline/readline.h>
+#endif
#include "phpdbg_lexer.h"
#include "phpdbg_cmd.h"
diff --git a/sapi/phpdbg/phpdbg_cmd.c b/sapi/phpdbg/phpdbg_cmd.c
index d4ce8ebc55..a45513bee6 100644
--- a/sapi/phpdbg/phpdbg_cmd.c
+++ b/sapi/phpdbg/phpdbg_cmd.c
@@ -792,7 +792,7 @@ PHPDBG_API int phpdbg_stack_execute(phpdbg_param_t *stack, char **why TSRMLS_DC)
PHPDBG_API char* phpdbg_read_input(char *buffered TSRMLS_DC) /* {{{ */
{
char *cmd = NULL;
-#ifndef HAVE_LIBREADLINE
+#if !defined(HAVE_LIBREADLINE) && !defined(HAVE_LIBEDIT)
char buf[PHPDBG_MAX_CMD];
#endif
char *buffer = NULL;
@@ -811,7 +811,7 @@ disconnect:
return NULL;
}
-#ifndef HAVE_LIBREADLINE
+#if !defined(HAVE_LIBREADLINE) && !defined(HAVE_LIBEDIT)
if (!(PHPDBG_G(flags) & PHPDBG_IS_REMOTE)) {
if (!phpdbg_write("%s", phpdbg_get_prompt(TSRMLS_C))) {
goto disconnect;
@@ -850,7 +850,7 @@ readline:
buffer = estrdup(cmd);
-#ifdef HAVE_LIBREADLINE
+#if defined(HAVE_LIBREADLINE) || defined(HAVE_LIBEDIT)
if (!buffered && cmd &&
!(PHPDBG_G(flags) & PHPDBG_IS_REMOTE)) {
free(cmd);
diff --git a/sapi/phpdbg/phpdbg_help.c b/sapi/phpdbg/phpdbg_help.c
index f2d074ded6..1e58dc69ca 100644
--- a/sapi/phpdbg/phpdbg_help.c
+++ b/sapi/phpdbg/phpdbg_help.c
@@ -318,8 +318,9 @@ phpdbg_help_text_t phpdbg_help_text[] = {
"**Information**" CR
" **list** list PHP source" CR
" **info** displays information on the debug session" CR
-" **print** show opcodes " CR
+" **print** show opcodes" CR
" **frame** select a stack frame and print a stack frame summary" CR
+" **back** shows the current backtrace" CR
" **help** provide help on a topic" CR CR
"**Starting and Stopping Execution**" CR
@@ -613,7 +614,7 @@ phpdbg_help_text_t phpdbg_help_text[] = {
{"finish",
"The **finish** command causes control to be passed back to the vm, continuing execution. Any "
"breakpoints that are encountered within the current stack frame will be skipped. Execution "
-"will then continue until the next breakpoint after leaving the stack frame or unitil "
+"will then continue until the next breakpoint after leaving the stack frame or until "
"completion of the script" CR CR
"Note when **step**ping is enabled, any opcode steps within the current stack frame are also "
@@ -629,7 +630,7 @@ phpdbg_help_text_t phpdbg_help_text[] = {
"**Examples**" CR CR
" $P frame 2" CR
-" $P E $count" CR
+" $P ev $count" CR
" Go to frame 2 and print out variable **$count** in that frame" CR CR
"Note that this frame scope is discarded when execution continues, with the execution frame "
diff --git a/sapi/phpdbg/phpdbg_lexer.c b/sapi/phpdbg/phpdbg_lexer.c
index 420dcac042..3092dc396d 100644
--- a/sapi/phpdbg/phpdbg_lexer.c
+++ b/sapi/phpdbg/phpdbg_lexer.c
@@ -96,33 +96,49 @@ yyc_INITIAL:
};
YYDEBUG(0, *YYCURSOR);
- YYFILL(3);
+ YYFILL(4);
yych = *YYCURSOR;
- if (yych <= 0x1F) {
- if (yych <= '\t') {
+ if (yych <= 'D') {
+ if (yych <= '\n') {
if (yych <= 0x00) goto yy6;
if (yych <= 0x08) goto yy11;
+ if (yych >= '\n') goto yy4;
} else {
- if (yych <= '\n') goto yy4;
- if (yych != '\r') goto yy11;
+ if (yych <= '\r') {
+ if (yych <= '\f') goto yy11;
+ } else {
+ if (yych != ' ') goto yy11;
+ }
}
} else {
- if (yych <= 'e') {
- if (yych <= ' ') goto yy2;
- if (yych <= 'd') goto yy11;
- goto yy7;
+ if (yych <= 'd') {
+ if (yych <= 'Q') {
+ if (yych <= 'E') goto yy7;
+ goto yy11;
+ } else {
+ if (yych <= 'R') goto yy10;
+ if (yych <= 'S') goto yy8;
+ goto yy11;
+ }
} else {
- if (yych <= 'q') goto yy11;
- if (yych <= 'r') goto yy9;
- if (yych <= 's') goto yy8;
- goto yy11;
+ if (yych <= 'q') {
+ if (yych <= 'e') goto yy7;
+ goto yy11;
+ } else {
+ if (yych <= 'r') goto yy9;
+ if (yych <= 's') goto yy8;
+ goto yy11;
+ }
}
}
-yy2:
YYDEBUG(2, *YYCURSOR);
++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 128) {
- goto yy19;
+ if ((yych = *YYCURSOR) <= '\f') {
+ if (yych <= 0x08) goto yy3;
+ if (yych <= '\n') goto yy26;
+ } else {
+ if (yych <= '\r') goto yy26;
+ if (yych == ' ') goto yy26;
}
yy3:
YYDEBUG(3, *YYCURSOR);
@@ -134,49 +150,60 @@ yy3:
YYCURSOR = LEX(text);
goto restart;
}
-#line 138 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c"
+#line 154 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c"
yy4:
YYDEBUG(4, *YYCURSOR);
++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 128) {
- goto yy19;
+ if ((yych = *YYCURSOR) <= '\f') {
+ if (yych <= 0x08) goto yy5;
+ if (yych <= '\n') goto yy26;
+ } else {
+ if (yych <= '\r') goto yy26;
+ if (yych == ' ') goto yy26;
}
+yy5:
YYDEBUG(5, *YYCURSOR);
yyleng = (size_t) YYCURSOR - (size_t) yytext;
#line 68 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l"
{
return 0;
}
-#line 151 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c"
+#line 172 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c"
yy6:
YYDEBUG(6, *YYCURSOR);
yych = *++YYCURSOR;
goto yy3;
yy7:
YYDEBUG(7, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'v') goto yy17;
+ yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yych == 'V') goto yy22;
+ if (yych == 'v') goto yy22;
goto yy3;
yy8:
YYDEBUG(8, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'h') goto yy15;
+ yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yych == 'H') goto yy18;
+ if (yych == 'h') goto yy18;
goto yy3;
yy9:
YYDEBUG(9, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
+ if (yybm[0+yych] & 128) {
+ goto yy15;
+ }
+ if (yych == 'U') goto yy12;
if (yych == 'u') goto yy12;
+ goto yy3;
yy10:
YYDEBUG(10, *YYCURSOR);
- yyleng = (size_t) YYCURSOR - (size_t) yytext;
-#line 155 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l"
- {
- YYSETCONDITION(RAW);
- phpdbg_init_param(yylval, EMPTY_PARAM);
- return T_RUN;
-}
-#line 180 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c"
+ yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yych == 'U') goto yy12;
+ if (yych == 'u') goto yy12;
+ goto yy3;
yy11:
YYDEBUG(11, *YYCURSOR);
yych = *++YYCURSOR;
@@ -184,18 +211,62 @@ yy11:
yy12:
YYDEBUG(12, *YYCURSOR);
yych = *++YYCURSOR;
+ if (yych == 'N') goto yy14;
if (yych == 'n') goto yy14;
+yy13:
YYDEBUG(13, *YYCURSOR);
YYCURSOR = YYMARKER;
- goto yy10;
+ goto yy3;
yy14:
YYDEBUG(14, *YYCURSOR);
yych = *++YYCURSOR;
- goto yy10;
+ if (yybm[0+yych] & 128) {
+ goto yy15;
+ }
+ goto yy13;
yy15:
YYDEBUG(15, *YYCURSOR);
++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
YYDEBUG(16, *YYCURSOR);
+ if (yybm[0+yych] & 128) {
+ goto yy15;
+ }
+ YYDEBUG(17, *YYCURSOR);
+ yyleng = (size_t) YYCURSOR - (size_t) yytext;
+#line 155 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l"
+ {
+ YYSETCONDITION(RAW);
+ phpdbg_init_param(yylval, EMPTY_PARAM);
+ return T_RUN;
+}
+#line 245 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c"
+yy18:
+ YYDEBUG(18, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych <= '\f') {
+ if (yych <= 0x08) goto yy13;
+ if (yych >= '\v') goto yy13;
+ } else {
+ if (yych <= '\r') goto yy19;
+ if (yych != ' ') goto yy13;
+ }
+yy19:
+ YYDEBUG(19, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(20, *YYCURSOR);
+ if (yych <= '\f') {
+ if (yych <= 0x08) goto yy21;
+ if (yych <= '\n') goto yy19;
+ } else {
+ if (yych <= '\r') goto yy19;
+ if (yych == ' ') goto yy19;
+ }
+yy21:
+ YYDEBUG(21, *YYCURSOR);
yyleng = (size_t) YYCURSOR - (size_t) yytext;
#line 150 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l"
{
@@ -203,11 +274,32 @@ yy15:
phpdbg_init_param(yylval, EMPTY_PARAM);
return T_SHELL;
}
-#line 207 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c"
-yy17:
- YYDEBUG(17, *YYCURSOR);
+#line 278 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c"
+yy22:
+ YYDEBUG(22, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych <= '\f') {
+ if (yych <= 0x08) goto yy13;
+ if (yych >= '\v') goto yy13;
+ } else {
+ if (yych <= '\r') goto yy23;
+ if (yych != ' ') goto yy13;
+ }
+yy23:
+ YYDEBUG(23, *YYCURSOR);
++YYCURSOR;
- YYDEBUG(18, *YYCURSOR);
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(24, *YYCURSOR);
+ if (yych <= '\f') {
+ if (yych <= 0x08) goto yy25;
+ if (yych <= '\n') goto yy23;
+ } else {
+ if (yych <= '\r') goto yy23;
+ if (yych == ' ') goto yy23;
+ }
+yy25:
+ YYDEBUG(25, *YYCURSOR);
yyleng = (size_t) YYCURSOR - (size_t) yytext;
#line 145 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l"
{
@@ -215,17 +307,22 @@ yy17:
phpdbg_init_param(yylval, EMPTY_PARAM);
return T_EVAL;
}
-#line 219 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c"
-yy19:
- YYDEBUG(19, *YYCURSOR);
+#line 311 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c"
+yy26:
+ YYDEBUG(26, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(20, *YYCURSOR);
- if (yybm[0+yych] & 128) {
- goto yy19;
+ YYDEBUG(27, *YYCURSOR);
+ if (yych <= '\f') {
+ if (yych <= 0x08) goto yy28;
+ if (yych <= '\n') goto yy26;
+ } else {
+ if (yych <= '\r') goto yy26;
+ if (yych == ' ') goto yy26;
}
- YYDEBUG(21, *YYCURSOR);
+yy28:
+ YYDEBUG(28, *YYCURSOR);
yyleng = (size_t) YYCURSOR - (size_t) yytext;
#line 139 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l"
{
@@ -233,7 +330,7 @@ yy19:
goto restart;
}
-#line 237 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c"
+#line 334 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c"
}
/* *********************************** */
yyc_NORMAL:
@@ -272,71 +369,60 @@ yyc_NORMAL:
16, 16, 16, 16, 16, 16, 16, 16,
16, 16, 16, 16, 16, 16, 16, 16,
};
- YYDEBUG(22, *YYCURSOR);
+ YYDEBUG(29, *YYCURSOR);
YYFILL(11);
yych = *YYCURSOR;
- if (yych <= ':') {
- if (yych <= ' ') {
- if (yych <= '\n') {
- if (yych <= 0x00) goto yy29;
- if (yych <= 0x08) goto yy32;
- if (yych >= '\n') goto yy27;
- } else {
- if (yych == '\r') goto yy24;
- if (yych <= 0x1F) goto yy32;
- }
- } else {
- if (yych <= '.') {
- if (yych == '#') goto yy47;
- if (yych <= '-') goto yy32;
- goto yy34;
- } else {
- if (yych <= '/') goto yy32;
- if (yych <= '0') goto yy37;
- if (yych <= '9') goto yy34;
- goto yy49;
- }
- }
- } else {
- if (yych <= 'i') {
- if (yych <= 'd') {
- if (yych == 'Z') goto yy38;
- if (yych <= 'c') goto yy32;
- goto yy39;
- } else {
- if (yych <= 'e') goto yy40;
- if (yych <= 'f') goto yy41;
- if (yych <= 'h') goto yy32;
- goto yy30;
- }
- } else {
- if (yych <= 's') {
- if (yych <= 'm') goto yy32;
- if (yych <= 'n') goto yy42;
- if (yych <= 'o') goto yy43;
- goto yy32;
- } else {
- if (yych <= 'x') {
- if (yych <= 't') goto yy44;
- goto yy32;
- } else {
- if (yych <= 'y') goto yy45;
- if (yych <= 'z') goto yy46;
- goto yy32;
- }
- }
- }
+ YYDEBUG(-1, yych);
+ switch (yych) {
+ case 0x00: goto yy36;
+ case '\t':
+ case '\r':
+ case ' ': goto yy31;
+ case '\n': goto yy34;
+ case '#': goto yy55;
+ case '-': goto yy41;
+ case '.':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy42;
+ case '0': goto yy45;
+ case ':': goto yy57;
+ case 'D':
+ case 'd': goto yy46;
+ case 'E':
+ case 'e': goto yy47;
+ case 'F':
+ case 'f': goto yy48;
+ case 'I':
+ case 'i': goto yy37;
+ case 'N':
+ case 'n': goto yy49;
+ case 'O':
+ case 'o': goto yy50;
+ case 'T':
+ case 't': goto yy51;
+ case 'Y':
+ case 'y': goto yy52;
+ case 'Z': goto yy53;
+ case 'z': goto yy54;
+ default: goto yy39;
}
-yy24:
- YYDEBUG(24, *YYCURSOR);
+yy31:
+ YYDEBUG(31, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(25, *YYCURSOR);
+ YYDEBUG(32, *YYCURSOR);
if (yybm[0+yych] & 8) {
- goto yy24;
+ goto yy31;
}
- YYDEBUG(26, *YYCURSOR);
+ YYDEBUG(33, *YYCURSOR);
yyleng = (size_t) YYCURSOR - (size_t) yytext;
#line 139 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l"
{
@@ -344,33 +430,34 @@ yy24:
goto restart;
}
-#line 348 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c"
-yy27:
- YYDEBUG(27, *YYCURSOR);
+#line 434 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c"
+yy34:
+ YYDEBUG(34, *YYCURSOR);
++YYCURSOR;
if (yybm[0+(yych = *YYCURSOR)] & 8) {
- goto yy24;
+ goto yy31;
}
-yy28:
- YYDEBUG(28, *YYCURSOR);
+yy35:
+ YYDEBUG(35, *YYCURSOR);
yyleng = (size_t) YYCURSOR - (size_t) yytext;
#line 68 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l"
{
return 0;
}
-#line 362 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c"
-yy29:
- YYDEBUG(29, *YYCURSOR);
+#line 448 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c"
+yy36:
+ YYDEBUG(36, *YYCURSOR);
yych = *++YYCURSOR;
- goto yy28;
-yy30:
- YYDEBUG(30, *YYCURSOR);
+ goto yy35;
+yy37:
+ YYDEBUG(37, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if (yych == 'f') goto yy94;
- goto yy33;
-yy31:
- YYDEBUG(31, *YYCURSOR);
+ if (yych == 'F') goto yy106;
+ if (yych == 'f') goto yy106;
+ goto yy40;
+yy38:
+ YYDEBUG(38, *YYCURSOR);
yyleng = (size_t) YYCURSOR - (size_t) yytext;
#line 125 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l"
{
@@ -379,48 +466,56 @@ yy31:
yylval->len = yyleng;
return T_ID;
}
-#line 383 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c"
-yy32:
- YYDEBUG(32, *YYCURSOR);
+#line 470 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c"
+yy39:
+ YYDEBUG(39, *YYCURSOR);
yyaccept = 0;
YYMARKER = ++YYCURSOR;
YYFILL(3);
yych = *YYCURSOR;
-yy33:
- YYDEBUG(33, *YYCURSOR);
+yy40:
+ YYDEBUG(40, *YYCURSOR);
if (yybm[0+yych] & 16) {
- goto yy32;
+ goto yy39;
}
- if (yych <= '9') goto yy31;
- goto yy54;
-yy34:
- YYDEBUG(34, *YYCURSOR);
+ if (yych <= '9') goto yy38;
+ goto yy62;
+yy41:
+ YYDEBUG(41, *YYCURSOR);
+ yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yybm[0+yych] & 32) {
+ goto yy42;
+ }
+ goto yy40;
+yy42:
+ YYDEBUG(42, *YYCURSOR);
yyaccept = 1;
YYMARKER = ++YYCURSOR;
YYFILL(3);
yych = *YYCURSOR;
- YYDEBUG(35, *YYCURSOR);
+ YYDEBUG(43, *YYCURSOR);
if (yybm[0+yych] & 32) {
- goto yy34;
+ goto yy42;
}
if (yych <= 0x1F) {
if (yych <= '\n') {
- if (yych <= 0x00) goto yy36;
- if (yych <= 0x08) goto yy32;
+ if (yych <= 0x00) goto yy44;
+ if (yych <= 0x08) goto yy39;
} else {
- if (yych != '\r') goto yy32;
+ if (yych != '\r') goto yy39;
}
} else {
if (yych <= '#') {
- if (yych <= ' ') goto yy36;
- if (yych <= '"') goto yy32;
+ if (yych <= ' ') goto yy44;
+ if (yych <= '"') goto yy39;
} else {
- if (yych == ':') goto yy54;
- goto yy32;
+ if (yych == ':') goto yy62;
+ goto yy39;
}
}
-yy36:
- YYDEBUG(36, *YYCURSOR);
+yy44:
+ YYDEBUG(44, *YYCURSOR);
yyleng = (size_t) YYCURSOR - (size_t) yytext;
#line 106 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l"
{
@@ -428,164 +523,168 @@ yy36:
yylval->num = atoi(yytext);
return T_DIGITS;
}
-#line 432 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c"
-yy37:
- YYDEBUG(37, *YYCURSOR);
+#line 527 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c"
+yy45:
+ YYDEBUG(45, *YYCURSOR);
yyaccept = 1;
yych = *(YYMARKER = ++YYCURSOR);
if (yybm[0+yych] & 32) {
- goto yy34;
+ goto yy42;
}
if (yych <= 0x1F) {
if (yych <= '\n') {
- if (yych <= 0x00) goto yy36;
- if (yych <= 0x08) goto yy33;
- goto yy36;
+ if (yych <= 0x00) goto yy44;
+ if (yych <= 0x08) goto yy40;
+ goto yy44;
} else {
- if (yych == '\r') goto yy36;
- goto yy33;
+ if (yych == '\r') goto yy44;
+ goto yy40;
}
} else {
if (yych <= '#') {
- if (yych <= ' ') goto yy36;
- if (yych <= '"') goto yy33;
- goto yy36;
+ if (yych <= ' ') goto yy44;
+ if (yych <= '"') goto yy40;
+ goto yy44;
} else {
- if (yych == 'x') goto yy90;
- goto yy33;
+ if (yych == 'x') goto yy102;
+ goto yy40;
}
}
-yy38:
- YYDEBUG(38, *YYCURSOR);
+yy46:
+ YYDEBUG(46, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if (yych == 'E') goto yy87;
- goto yy33;
-yy39:
- YYDEBUG(39, *YYCURSOR);
+ if (yych == 'I') goto yy96;
+ if (yych == 'i') goto yy96;
+ goto yy40;
+yy47:
+ YYDEBUG(47, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if (yych == 'i') goto yy81;
- goto yy33;
-yy40:
- YYDEBUG(40, *YYCURSOR);
+ if (yych == 'N') goto yy91;
+ if (yych == 'n') goto yy91;
+ goto yy40;
+yy48:
+ YYDEBUG(48, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if (yych == 'n') goto yy76;
- goto yy33;
-yy41:
- YYDEBUG(41, *YYCURSOR);
+ if (yych == 'A') goto yy88;
+ if (yych == 'a') goto yy88;
+ goto yy40;
+yy49:
+ YYDEBUG(49, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if (yych == 'a') goto yy73;
- goto yy33;
-yy42:
- YYDEBUG(42, *YYCURSOR);
+ if (yych == 'O') goto yy84;
+ if (yych == 'o') goto yy84;
+ goto yy40;
+yy50:
+ YYDEBUG(50, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if (yych == 'o') goto yy71;
- goto yy33;
-yy43:
- YYDEBUG(43, *YYCURSOR);
+ if (yych <= 'N') {
+ if (yych == 'F') goto yy83;
+ if (yych <= 'M') goto yy40;
+ goto yy77;
+ } else {
+ if (yych <= 'f') {
+ if (yych <= 'e') goto yy40;
+ goto yy83;
+ } else {
+ if (yych == 'n') goto yy77;
+ goto yy40;
+ }
+ }
+yy51:
+ YYDEBUG(51, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if (yych == 'f') goto yy70;
- if (yych == 'n') goto yy66;
- goto yy33;
-yy44:
- YYDEBUG(44, *YYCURSOR);
+ if (yych == 'R') goto yy81;
+ if (yych == 'r') goto yy81;
+ goto yy40;
+yy52:
+ YYDEBUG(52, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if (yych == 'r') goto yy68;
- goto yy33;
-yy45:
- YYDEBUG(45, *YYCURSOR);
+ if (yych == 'E') goto yy76;
+ if (yych == 'e') goto yy76;
+ goto yy40;
+yy53:
+ YYDEBUG(53, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if (yych == 'e') goto yy65;
- goto yy33;
-yy46:
- YYDEBUG(46, *YYCURSOR);
+ if (yych == 'E') goto yy73;
+ goto yy40;
+yy54:
+ YYDEBUG(54, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if (yych == 'e') goto yy53;
- goto yy33;
-yy47:
- YYDEBUG(47, *YYCURSOR);
+ if (yych == 'e') goto yy61;
+ goto yy40;
+yy55:
+ YYDEBUG(55, *YYCURSOR);
++YYCURSOR;
- YYDEBUG(48, *YYCURSOR);
+ YYDEBUG(56, *YYCURSOR);
yyleng = (size_t) YYCURSOR - (size_t) yytext;
#line 84 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l"
{
return T_POUND;
}
-#line 523 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c"
-yy49:
- YYDEBUG(49, *YYCURSOR);
+#line 634 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c"
+yy57:
+ YYDEBUG(57, *YYCURSOR);
++YYCURSOR;
- if ((yych = *YYCURSOR) == ':') goto yy51;
- YYDEBUG(50, *YYCURSOR);
+ if ((yych = *YYCURSOR) == ':') goto yy59;
+ YYDEBUG(58, *YYCURSOR);
yyleng = (size_t) YYCURSOR - (size_t) yytext;
#line 90 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l"
{
return T_COLON;
}
-#line 534 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c"
-yy51:
- YYDEBUG(51, *YYCURSOR);
+#line 645 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c"
+yy59:
+ YYDEBUG(59, *YYCURSOR);
++YYCURSOR;
- YYDEBUG(52, *YYCURSOR);
+ YYDEBUG(60, *YYCURSOR);
yyleng = (size_t) YYCURSOR - (size_t) yytext;
#line 87 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l"
{
return T_DCOLON;
}
-#line 544 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c"
-yy53:
- YYDEBUG(53, *YYCURSOR);
+#line 655 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c"
+yy61:
+ YYDEBUG(61, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if (yych == 'n') goto yy59;
- goto yy33;
-yy54:
- YYDEBUG(54, *YYCURSOR);
+ if (yych == 'n') goto yy67;
+ goto yy40;
+yy62:
+ YYDEBUG(62, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == '/') goto yy56;
-yy55:
- YYDEBUG(55, *YYCURSOR);
+ if (yych == '/') goto yy64;
+yy63:
+ YYDEBUG(63, *YYCURSOR);
YYCURSOR = YYMARKER;
- if (yyaccept <= 3) {
- if (yyaccept <= 1) {
- if (yyaccept <= 0) {
- goto yy31;
- } else {
- goto yy36;
- }
+ if (yyaccept <= 1) {
+ if (yyaccept <= 0) {
+ goto yy38;
} else {
- if (yyaccept <= 2) {
- goto yy64;
- } else {
- goto yy67;
- }
+ goto yy44;
}
} else {
- if (yyaccept <= 5) {
- if (yyaccept <= 4) {
- goto yy72;
- } else {
- goto yy93;
- }
+ if (yyaccept <= 2) {
+ goto yy72;
} else {
- goto yy95;
+ goto yy105;
}
}
-yy56:
- YYDEBUG(56, *YYCURSOR);
+yy64:
+ YYDEBUG(64, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych != '/') goto yy55;
- YYDEBUG(57, *YYCURSOR);
+ if (yych != '/') goto yy63;
+ YYDEBUG(65, *YYCURSOR);
++YYCURSOR;
- YYDEBUG(58, *YYCURSOR);
+ YYDEBUG(66, *YYCURSOR);
yyleng = (size_t) YYCURSOR - (size_t) yytext;
#line 78 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l"
{
@@ -594,52 +693,52 @@ yy56:
yylval->len = yyleng;
return T_PROTO;
}
-#line 598 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c"
-yy59:
- YYDEBUG(59, *YYCURSOR);
+#line 697 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c"
+yy67:
+ YYDEBUG(67, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if (yych != 'd') goto yy33;
- YYDEBUG(60, *YYCURSOR);
+ if (yych != 'd') goto yy40;
+ YYDEBUG(68, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if (yych != '_') goto yy33;
-yy61:
- YYDEBUG(61, *YYCURSOR);
+ if (yych != '_') goto yy40;
+yy69:
+ YYDEBUG(69, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if (yybm[0+yych] & 64) {
- goto yy62;
+ goto yy70;
}
- goto yy33;
-yy62:
- YYDEBUG(62, *YYCURSOR);
+ goto yy40;
+yy70:
+ YYDEBUG(70, *YYCURSOR);
yyaccept = 2;
YYMARKER = ++YYCURSOR;
YYFILL(3);
yych = *YYCURSOR;
- YYDEBUG(63, *YYCURSOR);
+ YYDEBUG(71, *YYCURSOR);
if (yybm[0+yych] & 64) {
- goto yy62;
+ goto yy70;
}
if (yych <= 0x1F) {
if (yych <= '\n') {
- if (yych <= 0x00) goto yy64;
- if (yych <= 0x08) goto yy32;
+ if (yych <= 0x00) goto yy72;
+ if (yych <= 0x08) goto yy39;
} else {
- if (yych != '\r') goto yy32;
+ if (yych != '\r') goto yy39;
}
} else {
if (yych <= '#') {
- if (yych <= ' ') goto yy64;
- if (yych <= '"') goto yy32;
+ if (yych <= ' ') goto yy72;
+ if (yych <= '"') goto yy39;
} else {
- if (yych == ':') goto yy54;
- goto yy32;
+ if (yych == ':') goto yy62;
+ goto yy39;
}
}
-yy64:
- YYDEBUG(64, *YYCURSOR);
+yy72:
+ YYDEBUG(72, *YYCURSOR);
yyleng = (size_t) YYCURSOR - (size_t) yytext;
#line 118 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l"
{
@@ -648,32 +747,53 @@ yy64:
yylval->len = yyleng;
return T_OPCODE;
}
-#line 652 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c"
-yy65:
- YYDEBUG(65, *YYCURSOR);
+#line 751 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c"
+yy73:
+ YYDEBUG(73, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if (yych != 's') goto yy33;
-yy66:
- YYDEBUG(66, *YYCURSOR);
- yyaccept = 3;
+ if (yych != 'N') goto yy40;
+ YYDEBUG(74, *YYCURSOR);
+ yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if (yych <= '\r') {
- if (yych <= 0x08) {
- if (yych >= 0x01) goto yy33;
- } else {
- if (yych <= '\n') goto yy67;
- if (yych <= '\f') goto yy33;
- }
+ if (yych != 'D') goto yy40;
+ YYDEBUG(75, *YYCURSOR);
+ yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yych == '_') goto yy69;
+ goto yy40;
+yy76:
+ YYDEBUG(76, *YYCURSOR);
+ yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yych == 'S') goto yy77;
+ if (yych != 's') goto yy40;
+yy77:
+ YYDEBUG(77, *YYCURSOR);
+ yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yych <= '\f') {
+ if (yych <= 0x08) goto yy40;
+ if (yych >= '\v') goto yy40;
} else {
- if (yych <= ' ') {
- if (yych <= 0x1F) goto yy33;
- } else {
- if (yych != '#') goto yy33;
- }
+ if (yych <= '\r') goto yy78;
+ if (yych != ' ') goto yy40;
}
-yy67:
- YYDEBUG(67, *YYCURSOR);
+yy78:
+ YYDEBUG(78, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(79, *YYCURSOR);
+ if (yych <= '\f') {
+ if (yych <= 0x08) goto yy80;
+ if (yych <= '\n') goto yy78;
+ } else {
+ if (yych <= '\r') goto yy78;
+ if (yych == ' ') goto yy78;
+ }
+yy80:
+ YYDEBUG(80, *YYCURSOR);
yyleng = (size_t) YYCURSOR - (size_t) yytext;
#line 94 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l"
{
@@ -681,42 +801,52 @@ yy67:
yylval->num = 1;
return T_TRUTHY;
}
-#line 685 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c"
-yy68:
- YYDEBUG(68, *YYCURSOR);
+#line 805 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c"
+yy81:
+ YYDEBUG(81, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if (yych != 'u') goto yy33;
- YYDEBUG(69, *YYCURSOR);
+ if (yych == 'U') goto yy82;
+ if (yych != 'u') goto yy40;
+yy82:
+ YYDEBUG(82, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if (yych == 'e') goto yy66;
- goto yy33;
-yy70:
- YYDEBUG(70, *YYCURSOR);
+ if (yych == 'E') goto yy77;
+ if (yych == 'e') goto yy77;
+ goto yy40;
+yy83:
+ YYDEBUG(83, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if (yych != 'f') goto yy33;
-yy71:
- YYDEBUG(71, *YYCURSOR);
- yyaccept = 4;
+ if (yych == 'F') goto yy84;
+ if (yych != 'f') goto yy40;
+yy84:
+ YYDEBUG(84, *YYCURSOR);
+ yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if (yych <= '\r') {
- if (yych <= 0x08) {
- if (yych >= 0x01) goto yy33;
- } else {
- if (yych <= '\n') goto yy72;
- if (yych <= '\f') goto yy33;
- }
+ if (yych <= '\f') {
+ if (yych <= 0x08) goto yy40;
+ if (yych >= '\v') goto yy40;
} else {
- if (yych <= ' ') {
- if (yych <= 0x1F) goto yy33;
- } else {
- if (yych != '#') goto yy33;
- }
+ if (yych <= '\r') goto yy85;
+ if (yych != ' ') goto yy40;
}
-yy72:
- YYDEBUG(72, *YYCURSOR);
+yy85:
+ YYDEBUG(85, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(86, *YYCURSOR);
+ if (yych <= '\f') {
+ if (yych <= 0x08) goto yy87;
+ if (yych <= '\n') goto yy85;
+ } else {
+ if (yych <= '\r') goto yy85;
+ if (yych == ' ') goto yy85;
+ }
+yy87:
+ YYDEBUG(87, *YYCURSOR);
yyleng = (size_t) YYCURSOR - (size_t) yytext;
#line 100 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l"
{
@@ -724,119 +854,130 @@ yy72:
yylval->num = 0;
return T_FALSY;
}
-#line 728 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c"
-yy73:
- YYDEBUG(73, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych != 'l') goto yy33;
- YYDEBUG(74, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych != 's') goto yy33;
- YYDEBUG(75, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych == 'e') goto yy71;
- goto yy33;
-yy76:
- YYDEBUG(76, *YYCURSOR);
+#line 858 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c"
+yy88:
+ YYDEBUG(88, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if (yych != 'a') goto yy33;
- YYDEBUG(77, *YYCURSOR);
+ if (yych == 'L') goto yy89;
+ if (yych != 'l') goto yy40;
+yy89:
+ YYDEBUG(89, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if (yych != 'b') goto yy33;
- YYDEBUG(78, *YYCURSOR);
+ if (yych == 'S') goto yy90;
+ if (yych != 's') goto yy40;
+yy90:
+ YYDEBUG(90, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if (yych != 'l') goto yy33;
- YYDEBUG(79, *YYCURSOR);
+ if (yych == 'E') goto yy84;
+ if (yych == 'e') goto yy84;
+ goto yy40;
+yy91:
+ YYDEBUG(91, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if (yych != 'e') goto yy33;
- YYDEBUG(80, *YYCURSOR);
+ if (yych == 'A') goto yy92;
+ if (yych != 'a') goto yy40;
+yy92:
+ YYDEBUG(92, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if (yych == 'd') goto yy66;
- goto yy33;
-yy81:
- YYDEBUG(81, *YYCURSOR);
+ if (yych == 'B') goto yy93;
+ if (yych != 'b') goto yy40;
+yy93:
+ YYDEBUG(93, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if (yych != 's') goto yy33;
- YYDEBUG(82, *YYCURSOR);
+ if (yych == 'L') goto yy94;
+ if (yych != 'l') goto yy40;
+yy94:
+ YYDEBUG(94, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if (yych != 'a') goto yy33;
- YYDEBUG(83, *YYCURSOR);
+ if (yych == 'E') goto yy95;
+ if (yych != 'e') goto yy40;
+yy95:
+ YYDEBUG(95, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if (yych != 'b') goto yy33;
- YYDEBUG(84, *YYCURSOR);
+ if (yych == 'D') goto yy77;
+ if (yych == 'd') goto yy77;
+ goto yy40;
+yy96:
+ YYDEBUG(96, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if (yych != 'l') goto yy33;
- YYDEBUG(85, *YYCURSOR);
+ if (yych == 'S') goto yy97;
+ if (yych != 's') goto yy40;
+yy97:
+ YYDEBUG(97, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if (yych != 'e') goto yy33;
- YYDEBUG(86, *YYCURSOR);
+ if (yych == 'A') goto yy98;
+ if (yych != 'a') goto yy40;
+yy98:
+ YYDEBUG(98, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if (yych == 'd') goto yy71;
- goto yy33;
-yy87:
- YYDEBUG(87, *YYCURSOR);
+ if (yych == 'B') goto yy99;
+ if (yych != 'b') goto yy40;
+yy99:
+ YYDEBUG(99, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if (yych != 'N') goto yy33;
- YYDEBUG(88, *YYCURSOR);
+ if (yych == 'L') goto yy100;
+ if (yych != 'l') goto yy40;
+yy100:
+ YYDEBUG(100, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if (yych != 'D') goto yy33;
- YYDEBUG(89, *YYCURSOR);
+ if (yych == 'E') goto yy101;
+ if (yych != 'e') goto yy40;
+yy101:
+ YYDEBUG(101, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if (yych == '_') goto yy61;
- goto yy33;
-yy90:
- YYDEBUG(90, *YYCURSOR);
+ if (yych == 'D') goto yy84;
+ if (yych == 'd') goto yy84;
+ goto yy40;
+yy102:
+ YYDEBUG(102, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if (yybm[0+yych] & 128) {
- goto yy91;
+ goto yy103;
}
- goto yy33;
-yy91:
- YYDEBUG(91, *YYCURSOR);
- yyaccept = 5;
+ goto yy40;
+yy103:
+ YYDEBUG(103, *YYCURSOR);
+ yyaccept = 3;
YYMARKER = ++YYCURSOR;
YYFILL(3);
yych = *YYCURSOR;
- YYDEBUG(92, *YYCURSOR);
+ YYDEBUG(104, *YYCURSOR);
if (yybm[0+yych] & 128) {
- goto yy91;
+ goto yy103;
}
if (yych <= 0x1F) {
if (yych <= '\n') {
- if (yych <= 0x00) goto yy93;
- if (yych <= 0x08) goto yy32;
+ if (yych <= 0x00) goto yy105;
+ if (yych <= 0x08) goto yy39;
} else {
- if (yych != '\r') goto yy32;
+ if (yych != '\r') goto yy39;
}
} else {
if (yych <= '#') {
- if (yych <= ' ') goto yy93;
- if (yych <= '"') goto yy32;
+ if (yych <= ' ') goto yy105;
+ if (yych <= '"') goto yy39;
} else {
- if (yych == ':') goto yy54;
- goto yy32;
+ if (yych == ':') goto yy62;
+ goto yy39;
}
}
-yy93:
- YYDEBUG(93, *YYCURSOR);
+yy105:
+ YYDEBUG(105, *YYCURSOR);
yyleng = (size_t) YYCURSOR - (size_t) yytext;
#line 112 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l"
{
@@ -844,27 +985,33 @@ yy93:
yylval->addr = strtoul(yytext, 0, 16);
return T_ADDR;
}
-#line 848 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c"
-yy94:
- YYDEBUG(94, *YYCURSOR);
- yyaccept = 6;
+#line 989 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c"
+yy106:
+ YYDEBUG(106, *YYCURSOR);
+ yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if (yych <= '\r') {
- if (yych <= 0x08) {
- if (yych >= 0x01) goto yy33;
- } else {
- if (yych <= '\n') goto yy95;
- if (yych <= '\f') goto yy33;
- }
+ if (yych <= '\f') {
+ if (yych <= 0x08) goto yy40;
+ if (yych >= '\v') goto yy40;
} else {
- if (yych <= ' ') {
- if (yych <= 0x1F) goto yy33;
- } else {
- if (yych != '#') goto yy33;
- }
+ if (yych <= '\r') goto yy107;
+ if (yych != ' ') goto yy40;
}
-yy95:
- YYDEBUG(95, *YYCURSOR);
+yy107:
+ YYDEBUG(107, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(108, *YYCURSOR);
+ if (yych <= '\f') {
+ if (yych <= 0x08) goto yy109;
+ if (yych <= '\n') goto yy107;
+ } else {
+ if (yych <= '\r') goto yy107;
+ if (yych == ' ') goto yy107;
+ }
+yy109:
+ YYDEBUG(109, *YYCURSOR);
yyleng = (size_t) YYCURSOR - (size_t) yytext;
#line 72 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l"
{
@@ -872,7 +1019,7 @@ yy95:
phpdbg_init_param(yylval, EMPTY_PARAM);
return T_IF;
}
-#line 876 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c"
+#line 1023 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c"
}
/* *********************************** */
yyc_RAW:
@@ -911,29 +1058,29 @@ yyc_RAW:
64, 64, 64, 64, 64, 64, 64, 64,
64, 64, 64, 64, 64, 64, 64, 64,
};
- YYDEBUG(96, *YYCURSOR);
+ YYDEBUG(110, *YYCURSOR);
YYFILL(2);
yych = *YYCURSOR;
if (yybm[0+yych] & 32) {
- goto yy98;
+ goto yy112;
}
- if (yych <= 0x00) goto yy103;
- if (yych == '\n') goto yy101;
- goto yy104;
-yy98:
- YYDEBUG(98, *YYCURSOR);
+ if (yych <= 0x00) goto yy117;
+ if (yych == '\n') goto yy115;
+ goto yy118;
+yy112:
+ YYDEBUG(112, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(99, *YYCURSOR);
+ YYDEBUG(113, *YYCURSOR);
if (yybm[0+yych] & 32) {
- goto yy98;
+ goto yy112;
}
- if (yych <= 0x00) goto yy100;
- if (yych == '\n') goto yy106;
- goto yy104;
-yy100:
- YYDEBUG(100, *YYCURSOR);
+ if (yych <= 0x00) goto yy114;
+ if (yych == '\n') goto yy120;
+ goto yy118;
+yy114:
+ YYDEBUG(114, *YYCURSOR);
yyleng = (size_t) YYCURSOR - (size_t) yytext;
#line 132 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l"
{
@@ -942,45 +1089,45 @@ yy100:
yylval->len = yyleng;
return T_INPUT;
}
-#line 946 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c"
-yy101:
- YYDEBUG(101, *YYCURSOR);
+#line 1093 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c"
+yy115:
+ YYDEBUG(115, *YYCURSOR);
++YYCURSOR;
if (yybm[0+(yych = *YYCURSOR)] & 128) {
- goto yy106;
+ goto yy120;
}
-yy102:
- YYDEBUG(102, *YYCURSOR);
+yy116:
+ YYDEBUG(116, *YYCURSOR);
yyleng = (size_t) YYCURSOR - (size_t) yytext;
#line 68 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l"
{
return 0;
}
-#line 960 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c"
-yy103:
- YYDEBUG(103, *YYCURSOR);
+#line 1107 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c"
+yy117:
+ YYDEBUG(117, *YYCURSOR);
yych = *++YYCURSOR;
- goto yy102;
-yy104:
- YYDEBUG(104, *YYCURSOR);
+ goto yy116;
+yy118:
+ YYDEBUG(118, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(105, *YYCURSOR);
+ YYDEBUG(119, *YYCURSOR);
if (yybm[0+yych] & 64) {
- goto yy104;
+ goto yy118;
}
- goto yy100;
-yy106:
- YYDEBUG(106, *YYCURSOR);
+ goto yy114;
+yy120:
+ YYDEBUG(120, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(107, *YYCURSOR);
+ YYDEBUG(121, *YYCURSOR);
if (yybm[0+yych] & 128) {
- goto yy106;
+ goto yy120;
}
- YYDEBUG(108, *YYCURSOR);
+ YYDEBUG(122, *YYCURSOR);
yyleng = (size_t) YYCURSOR - (size_t) yytext;
#line 139 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l"
{
@@ -988,7 +1135,7 @@ yy106:
goto restart;
}
-#line 992 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c"
+#line 1139 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c"
}
}
#line 168 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l"
diff --git a/sapi/phpdbg/phpdbg_lexer.l b/sapi/phpdbg/phpdbg_lexer.l
index 4d9c837f1e..7b3ce38c47 100644
--- a/sapi/phpdbg/phpdbg_lexer.l
+++ b/sapi/phpdbg/phpdbg_lexer.l
@@ -43,21 +43,21 @@ restart:
/*!re2c
re2c:yyfill:check = 0;
-T_TRUE "true"
-T_YES "yes"
-T_ON "on"
-T_ENABLED "enabled"
-T_FALSE "false"
-T_NO "no"
-T_OFF "off"
-T_DISABLED "disabled"
-T_EVAL "ev"
-T_SHELL "sh"
-T_IF "if"
-T_RUN "run"
+T_TRUE 'true'
+T_YES 'yes'
+T_ON 'on'
+T_ENABLED 'enabled'
+T_FALSE 'false'
+T_NO 'no'
+T_OFF 'off'
+T_DISABLED 'disabled'
+T_EVAL 'ev'
+T_SHELL 'sh'
+T_IF 'if'
+T_RUN 'run'
T_RUN_SHORT "r"
WS [ \r\n\t]+
-DIGITS [0-9\.]+
+DIGITS [-]?[0-9\.]+
ID [^ \r\n\t:#\000]+
ADDR [0][x][a-fA-F0-9]+
OPCODE (ZEND_|zend_)([A-Za-z])+
@@ -69,7 +69,7 @@ INPUT [^\n\000]+
return 0;
}
-<NORMAL>{T_IF} {
+<NORMAL>{T_IF}{WS} {
YYSETCONDITION(RAW);
phpdbg_init_param(yylval, EMPTY_PARAM);
return T_IF;
@@ -91,13 +91,13 @@ INPUT [^\n\000]+
return T_COLON;
}
-<NORMAL>{T_YES}|{T_ON}|{T_ENABLED}|{T_TRUE} {
+<NORMAL>({T_YES}|{T_ON}|{T_ENABLED}|{T_TRUE}){WS} {
phpdbg_init_param(yylval, NUMERIC_PARAM);
yylval->num = 1;
return T_TRUTHY;
}
-<NORMAL>{T_NO}|{T_OFF}|{T_DISABLED}|{T_FALSE} {
+<NORMAL>({T_NO}|{T_OFF}|{T_DISABLED}|{T_FALSE}){WS} {
phpdbg_init_param(yylval, NUMERIC_PARAM);
yylval->num = 0;
return T_FALSY;
@@ -142,17 +142,17 @@ INPUT [^\n\000]+
goto restart;
}
-<INITIAL>{T_EVAL} {
+<INITIAL>{T_EVAL}{WS} {
YYSETCONDITION(RAW);
phpdbg_init_param(yylval, EMPTY_PARAM);
return T_EVAL;
}
-<INITIAL>{T_SHELL} {
+<INITIAL>{T_SHELL}{WS} {
YYSETCONDITION(RAW);
phpdbg_init_param(yylval, EMPTY_PARAM);
return T_SHELL;
}
-<INITIAL>{T_RUN}|{T_RUN_SHORT} {
+<INITIAL>({T_RUN}|{T_RUN_SHORT}){WS} {
YYSETCONDITION(RAW);
phpdbg_init_param(yylval, EMPTY_PARAM);
return T_RUN;
diff --git a/sapi/phpdbg/phpdbg_list.c b/sapi/phpdbg/phpdbg_list.c
index 037c6c38b2..e8db4e605c 100644
--- a/sapi/phpdbg/phpdbg_list.c
+++ b/sapi/phpdbg/phpdbg_list.c
@@ -130,14 +130,14 @@ void phpdbg_list_file(const char *filename, long count, long offset, int highlig
char *opened = NULL;
char buffer[8096] = {0,};
long line = 0;
-
+
php_stream *stream = NULL;
if (VCWD_STAT(filename, &st) == FAILURE) {
phpdbg_error("Failed to stat file %s", filename);
return;
}
-
+
stream = php_stream_open_wrapper(filename, "rb", USE_PATH, &opened);
if (!stream) {
@@ -145,11 +145,17 @@ void phpdbg_list_file(const char *filename, long count, long offset, int highlig
return;
}
+ if (offset < 0) {
+ count += offset;
+ offset = 0;
+ }
+
while (php_stream_gets(stream, buffer, sizeof(buffer)) != NULL) {
+ long linelen = strlen(buffer);
+
++line;
- if (!offset || offset <= line) {
- /* Without offset, or offset reached */
+ if (offset <= line) {
if (!highlight) {
phpdbg_write("%05ld: %s", line, buffer);
} else {
@@ -159,10 +165,15 @@ void phpdbg_list_file(const char *filename, long count, long offset, int highlig
phpdbg_write(">%05ld: %s", line, buffer);
}
}
+
+ if (buffer[linelen - 1] != '\n') {
+ phpdbg_write("\n");
+ }
}
-
- if ((count + (offset-1)) == line)
+
+ if (count > 0 && count + offset - 1 < line) {
break;
+ }
}
php_stream_close(stream);
diff --git a/sapi/phpdbg/phpdbg_parser.c b/sapi/phpdbg/phpdbg_parser.c
index f9a3e4d299..e34c2f48ff 100644
--- a/sapi/phpdbg/phpdbg_parser.c
+++ b/sapi/phpdbg/phpdbg_parser.c
@@ -436,7 +436,7 @@ union yyalloc
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 25
/* YYLAST -- Last index in YYTABLE. */
-#define YYLAST 41
+#define YYLAST 42
/* YYNTOKENS -- Number of terminals. */
#define YYNTOKENS 21
@@ -493,8 +493,8 @@ static const yytype_uint8 yytranslate[] =
static const yytype_uint8 yyprhs[] =
{
0, 0, 3, 5, 7, 8, 10, 13, 17, 22,
- 27, 33, 37, 43, 47, 49, 51, 53, 55, 57,
- 59, 61, 64, 67, 70, 72
+ 27, 33, 37, 43, 47, 50, 52, 54, 56, 58,
+ 60, 62, 64, 67, 70, 72
};
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
@@ -504,9 +504,9 @@ static const yytype_int8 yyrhs[] =
23, 24, -1, 18, 10, 14, -1, 18, 10, 12,
14, -1, 13, 18, 10, 14, -1, 13, 18, 10,
12, 14, -1, 18, 11, 18, -1, 18, 11, 18,
- 12, 14, -1, 18, 12, 14, -1, 17, -1, 16,
- -1, 15, -1, 7, -1, 8, -1, 14, -1, 18,
- -1, 6, 19, -1, 3, 19, -1, 5, 19, -1,
+ 12, 14, -1, 18, 12, 14, -1, 6, 19, -1,
+ 17, -1, 16, -1, 15, -1, 7, -1, 8, -1,
+ 14, -1, 18, -1, 3, 19, -1, 5, 19, -1,
4, -1, 4, 19, -1
};
@@ -514,8 +514,8 @@ static const yytype_int8 yyrhs[] =
static const yytype_uint8 yyrline[] =
{
0, 66, 66, 67, 68, 72, 73, 77, 82, 87,
- 97, 107, 112, 118, 124, 125, 126, 127, 128, 129,
- 130, 134, 139, 144, 149, 153
+ 97, 107, 112, 118, 124, 129, 130, 131, 132, 133,
+ 134, 135, 139, 144, 149, 153
};
#endif
@@ -552,15 +552,15 @@ static const yytype_uint8 yyr1[] =
{
0, 21, 22, 22, 22, 23, 23, 24, 24, 24,
24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
- 24, 25, 25, 25, 25, 25
+ 24, 24, 25, 25, 25, 25
};
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
static const yytype_uint8 yyr2[] =
{
0, 2, 1, 1, 0, 1, 2, 3, 4, 4,
- 5, 3, 5, 3, 1, 1, 1, 1, 1, 1,
- 1, 2, 2, 2, 1, 2
+ 5, 3, 5, 3, 2, 1, 1, 1, 1, 1,
+ 1, 1, 2, 2, 1, 2
};
/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
@@ -568,9 +568,9 @@ static const yytype_uint8 yyr2[] =
means the default is an error. */
static const yytype_uint8 yydefact[] =
{
- 4, 0, 24, 0, 0, 17, 18, 0, 19, 16,
- 15, 14, 20, 0, 2, 5, 3, 22, 25, 23,
- 21, 0, 0, 0, 0, 1, 6, 0, 0, 7,
+ 4, 0, 24, 0, 0, 18, 19, 0, 20, 17,
+ 16, 15, 21, 0, 2, 5, 3, 22, 25, 23,
+ 14, 0, 0, 0, 0, 1, 6, 0, 0, 7,
11, 13, 0, 9, 8, 0, 10, 12
};
@@ -585,16 +585,16 @@ static const yytype_int8 yydefgoto[] =
#define YYPACT_NINF -11
static const yytype_int8 yypact[] =
{
- -3, -10, 10, 11, 12, -11, -11, 14, -11, -11,
- -11, -11, -4, 28, 9, -11, -11, -11, -11, -11,
- -11, 23, 6, 16, 21, -11, -11, 7, 22, -11,
- 25, -11, 24, -11, -11, 26, -11, -11
+ -3, -10, 11, 12, 13, -11, -11, 15, -11, -11,
+ -11, -11, -4, 29, 10, -11, -11, -11, -11, -11,
+ -11, 24, 7, 17, 22, -11, -11, 8, 23, -11,
+ 26, -11, 25, -11, -11, 27, -11, -11
};
/* YYPGOTO[NTERM-NUM]. */
static const yytype_int8 yypgoto[] =
{
- -11, -11, -11, 27, -11
+ -11, -11, -11, 28, -11
};
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
@@ -604,10 +604,10 @@ static const yytype_int8 yypgoto[] =
static const yytype_uint8 yytable[] =
{
1, 2, 3, 4, 5, 6, 22, 23, 24, 17,
- 7, 8, 9, 10, 11, 12, 5, 6, 28, 32,
- 29, 33, 7, 8, 9, 10, 11, 12, 25, 18,
- 19, 20, 21, 27, 30, 31, 34, 35, 36, 0,
- 37, 26
+ 7, 8, 9, 10, 11, 12, 4, 5, 6, 28,
+ 32, 29, 33, 7, 8, 9, 10, 11, 12, 25,
+ 18, 19, 20, 21, 27, 30, 31, 34, 35, 36,
+ 0, 37, 26
};
#define yypact_value_is_default(yystate) \
@@ -619,10 +619,10 @@ static const yytype_uint8 yytable[] =
static const yytype_int8 yycheck[] =
{
3, 4, 5, 6, 7, 8, 10, 11, 12, 19,
- 13, 14, 15, 16, 17, 18, 7, 8, 12, 12,
- 14, 14, 13, 14, 15, 16, 17, 18, 0, 19,
- 19, 19, 18, 10, 18, 14, 14, 12, 14, -1,
- 14, 14
+ 13, 14, 15, 16, 17, 18, 6, 7, 8, 12,
+ 12, 14, 14, 13, 14, 15, 16, 17, 18, 0,
+ 19, 19, 19, 18, 10, 18, 14, 14, 12, 14,
+ -1, 14, 14
};
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
@@ -1563,53 +1563,53 @@ yyreduce:
case 14:
/* Line 1802 of yacc.c */
#line 124 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
- { (yyval) = (yyvsp[(1) - (1)]); }
+ {
+ (yyval).type = COND_PARAM;
+ (yyval).str = (yyvsp[(2) - (2)]).str;
+ (yyval).len = (yyvsp[(2) - (2)]).len;
+ }
break;
case 15:
/* Line 1802 of yacc.c */
-#line 125 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
+#line 129 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 16:
/* Line 1802 of yacc.c */
-#line 126 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
+#line 130 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 17:
/* Line 1802 of yacc.c */
-#line 127 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
+#line 131 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 18:
/* Line 1802 of yacc.c */
-#line 128 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
+#line 132 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 19:
/* Line 1802 of yacc.c */
-#line 129 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
+#line 133 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 20:
/* Line 1802 of yacc.c */
-#line 130 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
+#line 134 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 21:
/* Line 1802 of yacc.c */
-#line 134 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
- {
- (yyval).type = COND_PARAM;
- (yyval).str = (yyvsp[(2) - (2)]).str;
- (yyval).len = (yyvsp[(2) - (2)]).len;
- }
+#line 135 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
+ { (yyval) = (yyvsp[(1) - (1)]); }
break;
case 22:
diff --git a/sapi/phpdbg/phpdbg_parser.y b/sapi/phpdbg/phpdbg_parser.y
index fd81edfc29..702bf78455 100644
--- a/sapi/phpdbg/phpdbg_parser.y
+++ b/sapi/phpdbg/phpdbg_parser.y
@@ -121,6 +121,11 @@ parameter
$$.len = $1.len;
$$.num = $3.num;
}
+ | T_IF T_INPUT {
+ $$.type = COND_PARAM;
+ $$.str = $2.str;
+ $$.len = $2.len;
+ }
| T_OPCODE { $$ = $1; }
| T_ADDR { $$ = $1; }
| T_LITERAL { $$ = $1; }
@@ -131,12 +136,7 @@ parameter
;
full_expression
- : T_IF T_INPUT {
- $$.type = COND_PARAM;
- $$.str = $2.str;
- $$.len = $2.len;
- }
- | T_EVAL T_INPUT {
+ : T_EVAL T_INPUT {
$$.type = EVAL_PARAM;
$$.str = $2.str;
$$.len = $2.len;
diff --git a/sapi/phpdbg/phpdbg_prompt.c b/sapi/phpdbg/phpdbg_prompt.c
index 5379e77586..d91ef3f3f5 100644
--- a/sapi/phpdbg/phpdbg_prompt.c
+++ b/sapi/phpdbg/phpdbg_prompt.c
@@ -732,6 +732,11 @@ PHPDBG_COMMAND(print) /* {{{ */
#else
phpdbg_writeln("Readline\tno");
#endif
+#ifdef HAVE_LIBEDIT
+ phpdbg_writeln("Libedit\t\tyes");
+#else
+ phpdbg_writeln("Libedit\t\tno");
+#endif
phpdbg_writeln("Exec\t\t%s", PHPDBG_G(exec) ? PHPDBG_G(exec) : "none");
phpdbg_writeln("Compiled\t%s", PHPDBG_G(ops) ? "yes" : "no");
diff --git a/sapi/phpdbg/phpdbg_utils.c b/sapi/phpdbg/phpdbg_utils.c
index 98748b202a..3ce2fade17 100644
--- a/sapi/phpdbg/phpdbg_utils.c
+++ b/sapi/phpdbg/phpdbg_utils.c
@@ -400,12 +400,16 @@ PHPDBG_API const char *phpdbg_get_prompt(TSRMLS_D) /* {{{ */
}
/* create cached prompt */
+#ifndef HAVE_LIBEDIT
+ /* TODO: libedit doesn't seems to support coloured prompt */
if ((PHPDBG_G(flags) & PHPDBG_IS_COLOURED)) {
asprintf(
&PHPDBG_G(prompt)[1], "\033[%sm%s\033[0m ",
PHPDBG_G(colors)[PHPDBG_COLOR_PROMPT]->code,
PHPDBG_G(prompt)[0]);
- } else {
+ } else
+#endif
+ {
asprintf(
&PHPDBG_G(prompt)[1], "%s ",
PHPDBG_G(prompt)[0]);
diff --git a/travis/compile.sh b/travis/compile.sh
index 6ad3bfc396..babb945a04 100755
--- a/travis/compile.sh
+++ b/travis/compile.sh
@@ -13,6 +13,7 @@ fi
./configure --quiet \
$DEBUG \
$TS \
+--enable-fpm \
--with-pdo-mysql=mysqlnd \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
diff --git a/win32/build/libs_version.txt b/win32/build/libs_version.txt
index a22823d0a9..0ea0067a62 100644
--- a/win32/build/libs_version.txt
+++ b/win32/build/libs_version.txt
@@ -13,4 +13,4 @@ libssh2-1.4.3
libtidy-20090406
libxslt-1.1.27
libxml-2.9.1
-openssl-1.0.1g
+openssl-1.0.1h