summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXinchen Hui <laruence@gmail.com>2020-04-29 18:58:48 +0800
committerXinchen Hui <laruence@gmail.com>2020-04-29 18:58:48 +0800
commit5d3b7ac92c5e7870eb83a39a1b50617c85ea8974 (patch)
treefa1e1cc542e878d2c3b2aceccfade5ecaca3cebc
parent8555c2bff01291e00e4e6af9f0df3b4fe848a390 (diff)
parent67f9b0b754654e76ef8d5b5539fb520541092950 (diff)
downloadphp-git-5d3b7ac92c5e7870eb83a39a1b50617c85ea8974.tar.gz
Merge branch 'PHP-7.4' of git.php.net:/php-src into PHP-7.4
* 'PHP-7.4' of git.php.net:/php-src: Fix #79532: sizeof off_t can be wrong Make 045.phpt busy wait Revert "Fix #79065: DOM classes do not expose properties to Reflection" Bump version Fix #79065: DOM classes do not expose properties to Reflection Fix #79470: PHP incompatible with 3rd party file system on demand
-rw-r--r--Zend/zend_virtual_cwd.c12
-rw-r--r--build/php.m41
-rw-r--r--ext/ffi/tests/bug79532.phpt38
-rw-r--r--ext/pdo_pgsql/pdo_pgsql.c1
-rw-r--r--ext/pdo_pgsql/pgsql_driver.c1
-rw-r--r--ext/pgsql/php_pgsql.h1
-rw-r--r--ext/zend_test/php_test.h1
-rw-r--r--ext/zend_test/test.c8
-rw-r--r--tests/lang/045.phpt8
-rw-r--r--win32/build/config.w32.h.in1
10 files changed, 64 insertions, 8 deletions
diff --git a/Zend/zend_virtual_cwd.c b/Zend/zend_virtual_cwd.c
index 177c66ed7f..e784ffc1f4 100644
--- a/Zend/zend_virtual_cwd.c
+++ b/Zend/zend_virtual_cwd.c
@@ -55,6 +55,14 @@
#define IO_REPARSE_TAG_ONEDRIVE (0x80000021L)
#endif
+# ifndef IO_REPARSE_TAG_ACTIVISION_HSM
+# define IO_REPARSE_TAG_ACTIVISION_HSM (0x00000047L)
+# endif
+
+# ifndef IO_REPARSE_TAG_PROJFS
+# define IO_REPARSE_TAG_PROJFS (0x9000001CL)
+# endif
+
# ifndef VOLUME_NAME_NT
# define VOLUME_NAME_NT 0x2
# endif
@@ -753,7 +761,9 @@ retry:
else if (pbuffer->ReparseTag == IO_REPARSE_TAG_DEDUP ||
/* Starting with 1709. */
(pbuffer->ReparseTag & ~IO_REPARSE_TAG_CLOUD_MASK) == IO_REPARSE_TAG_CLOUD ||
- IO_REPARSE_TAG_ONEDRIVE == pbuffer->ReparseTag) {
+ IO_REPARSE_TAG_ONEDRIVE == pbuffer->ReparseTag ||
+ IO_REPARSE_TAG_ACTIVISION_HSM == pbuffer->ReparseTag ||
+ IO_REPARSE_TAG_PROJFS == pbuffer->ReparseTag) {
isabsolute = 1;
substitutename = malloc((len + 1) * sizeof(char));
if (!substitutename) {
diff --git a/build/php.m4 b/build/php.m4
index 7392876478..51fa37446a 100644
--- a/build/php.m4
+++ b/build/php.m4
@@ -2416,6 +2416,7 @@ AC_DEFUN([PHP_CHECK_STDINT_TYPES], [
AC_CHECK_SIZEOF([long])
AC_CHECK_SIZEOF([long long])
AC_CHECK_SIZEOF([size_t])
+ AC_CHECK_SIZEOF([off_t])
AC_CHECK_TYPES([int8, int16, int32, int64, int8_t, int16_t, int32_t, int64_t, uint8, uint16, uint32, uint64, uint8_t, uint16_t, uint32_t, uint64_t, u_int8_t, u_int16_t, u_int32_t, u_int64_t], [], [], [
#if HAVE_STDINT_H
# include <stdint.h>
diff --git a/ext/ffi/tests/bug79532.phpt b/ext/ffi/tests/bug79532.phpt
new file mode 100644
index 0000000000..b6887dc7cb
--- /dev/null
+++ b/ext/ffi/tests/bug79532.phpt
@@ -0,0 +1,38 @@
+--TEST--
+Bug #79532 (sizeof off_t can be wrong)
+--SKIPIF--
+<?php
+if (!extension_loaded('ffi')) die('skip ffi extension not available');
+if (!extension_loaded('zend-test')) die('skip zend-test extension not available');
+?>
+--FILE--
+<?php
+require_once('utils.inc');
+
+$header = <<<HEADER
+void bug79532(off_t *array, size_t elems);
+HEADER;
+
+if (PHP_OS_FAMILY !== 'Windows') {
+ $ffi = FFI::cdef($header);
+} else {
+ try {
+ $ffi = FFI::cdef($header, 'php_zend_test.dll');
+ } catch (FFI\Exception $ex) {
+ $ffi = FFI::cdef($header, ffi_get_php_dll_name());
+ }
+}
+
+$array = FFI::new("off_t[3]");
+$ffi->bug79532($array, 3);
+var_dump($array);
+?>
+--EXPECTF--
+object(FFI\CData:int%d_t[3])#%d (3) {
+ [0]=>
+ int(0)
+ [1]=>
+ int(1)
+ [2]=>
+ int(2)
+}
diff --git a/ext/pdo_pgsql/pdo_pgsql.c b/ext/pdo_pgsql/pdo_pgsql.c
index 8d60fe420b..8d4158198d 100644
--- a/ext/pdo_pgsql/pdo_pgsql.c
+++ b/ext/pdo_pgsql/pdo_pgsql.c
@@ -29,6 +29,7 @@
#include "php_pdo_pgsql_int.h"
#ifdef HAVE_PG_CONFIG_H
+#undef SIZEOF_OFF_T
#include <pg_config.h>
#endif
diff --git a/ext/pdo_pgsql/pgsql_driver.c b/ext/pdo_pgsql/pgsql_driver.c
index b6f008071c..403bfd611a 100644
--- a/ext/pdo_pgsql/pgsql_driver.c
+++ b/ext/pdo_pgsql/pgsql_driver.c
@@ -31,6 +31,7 @@
#include "pdo/php_pdo_driver.h"
#include "pdo/php_pdo_error.h"
#include "ext/standard/file.h"
+#undef SIZEOF_OFF_T
#include "pg_config.h" /* needed for PG_VERSION */
#include "php_pdo_pgsql.h"
#include "php_pdo_pgsql_int.h"
diff --git a/ext/pgsql/php_pgsql.h b/ext/pgsql/php_pgsql.h
index cecd2cc95b..a6c884d912 100644
--- a/ext/pgsql/php_pgsql.h
+++ b/ext/pgsql/php_pgsql.h
@@ -51,6 +51,7 @@ extern zend_module_entry pgsql_module_entry;
#endif
#ifdef HAVE_PG_CONFIG_H
+#undef SIZEOF_OFF_T
#include <pg_config.h>
#endif
diff --git a/ext/zend_test/php_test.h b/ext/zend_test/php_test.h
index 325484c434..da57f7efc9 100644
--- a/ext/zend_test/php_test.h
+++ b/ext/zend_test/php_test.h
@@ -38,5 +38,6 @@ struct bug79096 {
};
ZEND_API struct bug79096 bug79096(void);
+ZEND_API void bug79532(off_t *array, size_t elems);
#endif
diff --git a/ext/zend_test/test.c b/ext/zend_test/test.c
index b097a2412b..dfae54e880 100644
--- a/ext/zend_test/test.c
+++ b/ext/zend_test/test.c
@@ -328,3 +328,11 @@ struct bug79096 bug79096(void)
b.b = 1;
return b;
}
+
+void bug79532(off_t *array, size_t elems)
+{
+ int i;
+ for (i = 0; i < elems; i++) {
+ array[i] = i;
+ }
+}
diff --git a/tests/lang/045.phpt b/tests/lang/045.phpt
index 44fb801410..e5299ae222 100644
--- a/tests/lang/045.phpt
+++ b/tests/lang/045.phpt
@@ -13,13 +13,7 @@ set_time_limit(1);
register_shutdown_function("plop");
function plop() {
- $ts = time();
- while(true) {
- if ((time()-$ts) > 2) {
- echo "Failed!";
- break;
- }
- }
+ while (true);
}
plop();
?>
diff --git a/win32/build/config.w32.h.in b/win32/build/config.w32.h.in
index 864bc882ff..36a45fb76c 100644
--- a/win32/build/config.w32.h.in
+++ b/win32/build/config.w32.h.in
@@ -101,6 +101,7 @@
# define SIZEOF_SIZE_T 4
# define SIZEOF_PTRDIFF_T 4
#endif
+#define SIZEOF_OFF_T 4
#define HAVE_FNMATCH
#define HAVE_GLOB
#define PHP_SHLIB_SUFFIX "dll"