Compare commits

...
Author SHA1 Message Date
Anatol Belski 38a4b934ca Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  backport the fix for bug #67739
  Fix bug #67705 (extensive backtracking in rule regular expression)
  add test
  Fix bug #67705 (extensive backtracking in rule regular expression)
2014-08-04 10:04:02 +02:00
Anatol Belski dccbb79445 fix macro 2014-08-04 09:28:36 +02:00
Anatol Belski 860f0ca1aa Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6: (46 commits)
  Fix wrong lenght size
  Bug #51096 - Remove unnecessary ? for first/last day of
  Moved streams related functions to xp_ssl.c
  Remove duplicate NEWS
  Update NEWS
  Update NEWS
  Update NEWS
  BFN
  BFN
  Fixed bug #67715 (php-milter does not build and crashes randomly).
  We need to turn off any strict mode here for this warning to show up
  Disable restrictions regarding arrays in constants at run-time. For the discussion around it, see the thread on the mailing list: http://www.mail-archive.com/internals@lists.php.net/msg68245.html
  Revert "Fix bug #67064 in a BC safe way"
  Updated NEWS for #67693
  Updated NEWS for #67693
  Fixed bug #67693 - incorrect push to the empty array
  add missing entry to NEWS
  add missing entries to NEWS
  add NEWS block for the next RC
  NEWS entry for #67713
  ...

Conflicts:
	Zend/zend_language_parser.y
	ext/odbc/php_odbc.c
	ext/openssl/openssl.c
	ext/spl/spl_directory.c
	ext/spl/spl_iterators.c
	ext/sqlite3/sqlite3.c
	ext/standard/array.c
2014-08-04 09:18:42 +02:00
Anatol Belski be8f557e77 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  fix nmake snap when ext name is different in target dll
2014-07-21 14:57:19 +02:00
Anatol Belski 6696cbcc9a Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  force atoll macro usage on windows
2014-07-21 10:07:39 +02:00
Anatol Belski 0ff7fb02e1 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6: (131 commits)
  Enable $ replacement in exif, ldap, pdo_pgsql and tidy
  See bug #67635
  NEWS
  NEWS
  improve previous, add message during configure
  Fixed bug #67635 php links to systemd libraries without using pkg-config
  Improve fix for #66608
  Fixed segfault with empty break
  New added opcodes don't need to be resloved
  Update NEWS
  Update NEWS
  Update NEWS
  Fixed bug #66827 Session raises E_NOTICE when session name variable is array
  implemented copy libs of core exts in phpize mode
  fix copy the ext dll into the prefix path in phpize mode
  fix default prefix in phpize mode
  fix file with zero size usage in phpize mode
  Update NEWS
  Fixed bug #66608 (Incorrect behavior with nested "finally" blocks)
  Enable build without atoll (e.g old AIX flavours)
  ...

Conflicts:
	Zend/zend_opcode.c
	ext/date/php_date.c
	ext/mysqli/mysqli.c
	ext/pgsql/pgsql.c
	ext/session/session.c
	ext/spl/spl_array.c
	ext/standard/http_fopen_wrapper.c
	ext/standard/string.c
	sapi/litespeed/lsapi_main.c
2014-07-21 09:26:43 +02:00
Anatol Belski 96783bdfb7 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  fix integer overflow in {stream,file}_{get,put}_contents()
  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

Conflicts:
	ext/standard/file.c
	ext/standard/streamsfuncs.c
2014-07-02 10:22:09 +02:00
Anatol Belski 1a50c27f99 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6: (170 commits)
  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
  Fix issue krakjoe/phpdbg#97 - list now appends a newline if there is none The prompt should always ensure it is on a newline
  Fixed test
  Inform about back command existence in help - Fixes krakjoe/phpdbg#100 No way to list the current stack/frames
  Fix issue krakjoe/phpdbg#98 break if does not seem to work
  Fix issue krakjoe/phpdbg#99 register function has the same behavior as run
  Fix readline/libedit (Thanks to @remicollet)
  Replace incorrect `E` command with `ev` in watch help
  ...

Conflicts:
	Zend/zend_compile.c
	ext/standard/basic_functions.c
	ext/standard/http_fopen_wrapper.c
	ext/standard/var.c
	ext/tokenizer/tokenizer_data.c
	sapi/phpdbg/phpdbg_list.c
2014-07-01 09:10:36 +02:00
Anatol Belski d4cfc15514 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6: (24 commits)
  drop exec perm on doc files
  fix test for 5.4/5.5
  add test for previous fix
  NEWS
  NEWS
  NEWS
  Fix regression introduce in fix for bug #67118
  update news
  update NEWS
  Fix tests
  Fix possible segfault depending on memory location...
  fix gcov data with some locales (again)
  fix gcov data with some locales (again)
  Update NEWS
  Fixed startup segfault in non-debug builds Fixes issue #87
  Fixed regression introduced by patch for bug #67072
  Fixed bug #67329 fileinfo: NULL pointer deference flaw by processing certain CDF files
  (re)add cve number in NEWS, from 5.4.29
  NEWS
  NEWS
  ...

Conflicts:
	ext/date/php_date.c
2014-06-06 08:59:05 +02:00
Anatol Belski 4dc952b190 fix macro 2014-06-02 08:45:32 +02:00
Anatol Belski 5cd607d1a7 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  Update NEWs
  Update NEWs
  Fixed bug #67359 (Segfault in recursiveDirectoryIterator)
  Check for zero-length keys in spl_array_skip_protected and don't skip them.
  added CVEs in NEWS
  updated libmagic.patch for 5.6+
  updated libmagic.patch for 5.4+
  update NEWS
  Fix bug #67249: printf out-of-bounds read
  5.5.13 release date

Conflicts:
	ext/standard/formatted_print.c
2014-06-02 08:42:24 +02:00
Anatol Belski 4796204a4c Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  Escape non-printable characters in the junit XML output
  Fixed broken XML junit output due to escaping of CDATA sections
  Fix #50444: PDO-ODBC changes for 64-bit
  update NEWS
  backport this piece from 5.6, related to the #66307 fix
  Fixed bug #66307 Fileinfo crashes with powerpoint files
  Fix bug #67328 (fileinfo: numerous file_printf calls resulting in performance degradation)
  Fix bug #67327: fileinfo: CDF infinite loop in nelements DoS
  fix my last commit with some locales
  fix my last commit with some locales
  Update NEWs and add a test
2014-05-27 12:24:23 +02:00
Anatol Belski 9c20452ee0 fix zpp 2014-05-27 12:23:48 +02:00
Anatol Belski 638466a641 fix zpp 2014-05-27 12:22:15 +02:00
Anatol Belski 317e8058e0 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  Fixed issue #183 (TMP_VAR is not only used once)
  Fix broken Junit output with --disable-cgi
  Added folder mark
2014-05-26 08:31:21 +02:00
Anatol Belski 1d28acb437 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  Further test fixes for the fdb2709 breakage.
  Fix broken test caused by fdb2709.
  Fix run-tests.php with Valgrind >= 3.10.0.
  Add microseconds to the serialised form of DateTime objects.
  Improved test for bug #62479
2014-05-24 13:58:35 +02:00
Anatol Belski ce8f7cb794 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  fix typo in ODBC code
  Support for __debugInfo (Joe Watkins)
  Optimize ZEND_POW (Rouven Weßling)
  gcov: tentative fix for broken coverage data after fix for opcache coverage slightly hackish, but works. The idea is that we want to give priority to .gcda files in .libs dirs vs the files in the upper level dir
  gcov: tentative fix for broken coverage data after fix for opcache coverage slightly hackish, but works. The idea is that we want to give priority to .gcda files in .libs dirs vs the files in the upper level dir
  Prevent recursion in ZF2 Parameters class
  5.5.14 now
  Fix bug #67060: use default mode of 660
2014-05-19 09:44:18 +02:00
Anatol Belski 4fb177b916 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  adding NEWS block for beta4
2014-05-14 13:02:08 +02:00
Anatol Belski 1ddecc9d12 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6: (32 commits)
  5.4.30 next
  enable email notifications
  update NEWS
  update NEWS
  update NEWS
  - Updated to version 2014.3 (2014c)
  fix test - output can be chunked
  fix test
  Fixed test for commit 997be125eb
  Add bug fix to NEWS
  Update UPGRADING according to bug fix
  improve CURL tests to allow testing without separate server
  Fixed bug #67199	mb_regex_encoding mishmash
  fix bug #67253: timelib_meridian_with_check out-of-bounds read
  Fix bug #67252: convert_uudecode out-of-bounds read
  Fix bug #67251 - date_parse_from_format out-of-bounds read
  Fix bug #67250 (iptcparse out-of-bounds read)
  Fix bug #67248 (imageaffinematrixget missing check of parameters)
  Fix bug #67247	spl_fixedarray_resize integer overflow
  fix news
  ...

Conflicts:
	ext/gd/gd.c
	ext/standard/iptc.c
2014-05-14 08:21:12 +02:00
Anatol Belski a582692720 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  Allow crypto_method context value in stream_socket_enable_crypto()

Conflicts:
	ext/standard/streamsfuncs.c
2014-05-12 08:55:10 +02:00
Anatol Belski ede2963963 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  Fixed test (it requires ext/hash)
  Fixed tests (they might fail from time to time because of session GC)
  NEWS
  XFAIL-- for bug #67198
  remove useless indirection
  fix bug #67198 (php://input regression)
  rename a constant - old name to new name
  test for bug #67198
  Fix author name on the #63228 patch.

Conflicts:
	ext/standard/php_fopen_wrapper.c
2014-05-07 15:00:18 +02:00
Anatol Belski bc92917e73 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  fixed ZEND_DEBUG usage
  updated libmagic.patch
  added missing stdint header, bug #66907
2014-05-05 08:29:35 +02:00
Anatol Belski 5168611127 fix macros 2014-05-04 21:15:35 +02:00
Anatol Belski 2044884812 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6: (28 commits)
  /me blushes, really hard
  only build and test nts non-debug and ts debug builds as discussed at https://github.com/php/php-src/pull/654
  Fix mysqli build when building against libmysqlclient.
  Fix author name on the #63228 patch.
  Fixed bug #67169: []= after_array_splice incorrect
  Revert "show leaks in their own group" using valgrind would be a bit too much for travis I guess.
  show leaks in their own group
  Use the right path for the suggested PHP invocation in ext_skel.
  Changed to more understandable NEWS message
  one heading is enough
  add new NEWS block for alpha3
  XFAIL the leaking multibyte tests, we should really get to the bottom of this
  Fixed numbering in UPGRADING file
  Updated NEWS for fixed phpdbg issue #85
  Added stdion/stdout/stderr constsnts and their php:// wrappers Fixes issue #85
  Added stdion/stdout/stderr constsnts and their php:// wrappers Fixes issue #85
  add missing NEWS entry to the correct release where it was added
  5.5.12 was released yesterday
  add missing NEWS entry to the correct release where it was added
  Updated NEWS entry for phpdbg
  ...

Conflicts:
	ext/curl/interface.c
2014-05-04 21:12:47 +02:00
Anatol Belski ba19cc7b45 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  Added further notice about removal of IS_CONSTANT_INDEX/ARRAY macros
  Fix bug #67060: use default mode of 660
2014-04-29 23:49:56 +02:00
Anatol Belski 0f42656fed Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  updated NEWS
  updated NEWS
  Fixed bug #66431 Special Character via COM Interface (CP_UTF8)
  Cleanup ZEND_MODULE_API_NO => 20050922
  Fix crashes in GMP serialize/unserialize
  enable gmp for tests
  C89 compat

Conflicts:
	ext/com_dotnet/com_variant.c
2014-04-29 14:05:57 +02:00
Anatol Belski 047a39c946 some more after merge fixes 2014-04-26 00:42:22 +02:00
Anatol Belski e88c8cbb7b fixed macro names 2014-04-26 00:40:58 +02:00
Anatol Belski 14b9658a38 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  removed /EHa as __try/__catch syntax is used anyway
  fix ZEND_DEBUG usage
  fix CFLAGS_PHPDBGS and some formatting
2014-04-26 00:40:16 +02:00
Anatol Belski 36a0950b39 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6: (158 commits)
  fixed test
  updated NEWS
  updated NEWS
  Fixed bug #67118 DateTime constructor crash with invalid data
  update NEWS
  update NEWS
  add a test case previously broken by a bad fix
  Revert "Fixed bug #64604"
  updated libmagic.patch for 5.6+
  updated libmagic.patch
  backport this piece from 5.6, related to the #66307 fix
  updated NEWS
  Fixed bug #66307 Fileinfo crashes with powerpoint files
  use a portable strndup implementation
  fixed C89 compat
  prepare config.w32
  fix dll export
  add parser files to dist
  Fix accepting ill-formed UTF-8 characters
  sapi/litespeed/lsapi_main.c: Fix bug #63228
  ...

Conflicts:
	ext/date/php_date.c
	sapi/phpdbg/phpdbg_bp.c
	sapi/phpdbg/phpdbg_frame.c
	sapi/phpdbg/phpdbg_help.c
	sapi/phpdbg/phpdbg_list.c
	sapi/phpdbg/phpdbg_prompt.c
2014-04-25 19:49:10 +02:00
Anatol Belski 70707a58c9 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  Allow valid multi-byte utf-8 characters to be allowed as file names in phar archives.
  Fix #50444: PDO-ODBC changes for 64-bit
  Fix a compiler warning in php_rand.h
  Fix #66908: php-fpm reload leaks epoll_create() file descriptor
  Fix bug #65701: Do not use cache for file file copy
2014-04-21 08:57:18 +02:00
Anatol Belski 3eaf40c3fc Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  updated libs versions
  added some notes about the win build system
  UPGRADING note about bug #67072
  UPGRADING note about bug #67072
  UPGRADING note about bug #67072
  refixed the test related to bug #67072
  Improved the fix for bug #67072, thanks Nikita
  Fixed test case for 5328d42
  These links to ~helly don't work anymore.
  updated NEWS
  updated NEWS
  Fixed bug #67072 Echoing unserialized "SplFileObject" crash
  updated UPGRADING
  updated UPGRADING
  correct the bug #67081 fix
  updated NEWS
  updated NEWS
  Fixed bug #67081 DOMDocumentType->internalSubset returns entire DOCTYPE tag, not only the subset
2014-04-20 20:30:54 +02:00
Anatol Belski 6162a993dd Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  updated NEWS
  Fixed bug #67079 Missing MIME types for XML/XSL files
  5.4.29 is next
  Fixed bug #66907 Solaris 10 is missing strcasestr and needs substitute
  5.5.12RC1 setup
2014-04-16 10:48:48 +02:00
Anatol Belski 5f79883497 fixed signatures 2014-04-15 08:22:36 -07:00
Anatol Belski 5e750feb21 fix datatypes 2014-04-15 14:01:50 +02:00
Anatol Belski 6e10627d54 fix zpp 2014-04-15 11:34:59 +02:00
Anatol Belski bc2b0d8ba3 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  fix test - doesn't seem to produce warning
  Fix test - on CI somebody could create a process in the meantime
  fix windows build
  Fix #66942: openssl_seal() memory leak
  ws fix
  Fix #66942: openssl_seal() memory leak
  ws fix
  Fix null byte in LDAP bindings
  Fix bug #66171: better handling of symlinks
  Fix null byte in LDAP bindings
  Fix bug #66171: better handling of symlinks
  Fix null byte in LDAP bindings
  Fix bug #66171: better handling of symlinks
  Add test

Conflicts:
	ext/openssl/openssl.c
2014-04-15 10:23:51 +02:00
Anatol Belski 4be58a12d8 fixed prototype 2014-04-15 09:59:01 +02:00
Anatol Belski f166237626 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6: (41 commits)
  fix crash in MINFO when no mysqlnd plugins are loaded
  backported some ext/intl tests from 5.6 into 5.4
  test fixes for ICU 53.1
  Fixed bug #67033 Remove reference to Windows 95
  fix NEWS
  Fixed bug #64604
  Fix #66562: Consistency bug where curl_multi_getcontent behaves different from curl_exec
  Fix bug #66482, replace wrong item name 'priority' with 'process.priority' in php-fpm.conf
  Fix windows build
  Fix bug #66721
  fix apr_psprintf format string from e0df4e3dba
  Fixed bug #67024 - getimagesize should recognize BMP files with negative height
  Bug #66840: Fix broken build when extension built separately
  Reverted to 5a0da281e5 Discussion: http://news.php.net/php.cvs/76836
  Forgot title in phpt for bug #67064
  Updated NEWS
  Fix bug #67064 in a BC safe way You can use an optional parameter now when implementing the Countable interface to get the $mode passed to count().
  Added UPGRAING notice for bug #66015 in BC break section
  Add new zend_hash_* APIs to UPGRADING.INTERNALS
  Add str_* macros to UPGRADING.INTERNALS
  ...

Conflicts:
	Zend/zend_compile.c
	Zend/zend_execute_API.c
	Zend/zend_language_parser.y
	ext/mysqli/mysqli.c
	ext/mysqlnd/mysqlnd.c
	ext/mysqlnd/mysqlnd.h
	ext/mysqlnd/mysqlnd_ps.c
	ext/mysqlnd/mysqlnd_result.c
	ext/mysqlnd/mysqlnd_result.h
	ext/mysqlnd/mysqlnd_structs.h
	ext/mysqlnd/mysqlnd_wireprotocol.c
	ext/mysqlnd/mysqlnd_wireprotocol.h
	ext/opcache/zend_accelerator_util_funcs.c
	ext/spl/spl_observer.c
	ext/standard/array.c
2014-04-15 09:53:02 +02:00
Anatol Belski 9112c2f122 fix prototype 2014-04-10 11:44:28 +02:00
Anatol Belski af53cc6799 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  fix typo
  fix typo
  fix typo
  add a NEWS block for beta2
  add missing entries to NEWS
  abstract namespace for unix sockets is a linux only feature
  Don't test for specific non-zero substr_compare() return value
  Add only_integer_keys option to zend_hash_reindex
  Don't always separate splice replacement array
  Add zend_hash_splice
  Add zend_hash_reindex
  Remove some usages of hashtable internals
  Updated NEWS
  fixed bug66702 : regexiterator's invert flag doesn't work as expected

Conflicts:
	Zend/zend_hash.c
	ext/spl/spl_iterators.c
	ext/standard/array.c
	ext/standard/php_array.h
2014-04-10 10:49:48 +02:00
Anatol Belski abad64c50e Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  Updated NEWS for #67043
  Fixed bug 67043
  cleanup
  Fixes bug #66071: isc_interprete is unsafe and deprecated , it is replaced with fb_iterpret
  updated libs versions
  fixed the test for ICI >= 52.1
  Fix Linux specific fail in error traces Linux apparently does not like memcpy in overlapping regions...
  add missing skip to the output, so we actually skip this test
  fix the test according to how new date code does it
  fix to work on different ICU versions
  multibytes tests still fail, put them in XFAIL

Conflicts:
	ext/standard/string.c
2014-04-09 11:04:50 +02:00
Anatol Belski d308724d19 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  updated NEWS
  updated NEWS
  Fixed bug #66084 simplexml_load_string() mangles empty node name
  cleanup NEWS
  NEWS
  NEWS
  Fix Bug #66736 	fpassthru broken
2014-04-05 09:53:38 +02:00
Anatol Belski 582bf28311 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  NEWS
  NEWS
  Fix bug #66182 	exit in stream filter produces segfault
  NEWS
  NEWS
  Fixed bug #61019 (Out of memory on command stream_get_contents)
  NEWS
  NEWS
  Fix bug #64330
  update NEWS
  updated NEWS
  updated NEWS
  added test for bug #53965
  Fixed bug #53965 <xsl:include> cannot find files w/ relative paths when loaded w/ "file://"
  updated libmagic.patch
  NEWS
  NEWS
  NEWS
  Fixed Bug #66987 Memory corruption in fileinfo ext (bigendian)
2014-04-03 09:12:26 +02:00
Anatol Belski 295cec706e Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  update lib versions
  Remove unneeded string copy. Allow to set ''(empty string values) internal/input/output_encoding for better compatibility. i.e. Runtime INI value changes. More compliance to the RFC. Improve/add encoding handling tests. i.e. Rather than set encoding automagic way, detect it.
  Fix test

Conflicts:
	ext/iconv/iconv.c
	ext/standard/html.c
2014-03-31 11:57:46 +02:00
Anatol Belski ef05ba6411 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  - Updated to version 2014.2 (2014b)
  fix merge issue
  Updated NEWS for #66834
  Call offsetGet() when called with isset() on ArrayObject derivatives
  NEWS
  NEWS
  NEWS
  Fixed bug #66946 extensive backtracking in awk rule regular expression CVE-2013-7345
  Fixed bug #66946 extensive backtracking in awk rule regular expression CVE-2013-7345

Conflicts:
	ext/spl/spl_array.c
2014-03-25 17:37:06 +01:00
Anatol Belski 2fb527660d Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  fix disabling PGO for extensions, rel bug #65715
  more fixes related to bug #65715
  fix some warnings
  PHP-5.6 compatibility for apache2 filter SAPI
  updated NEWS
  updated NEWS
  updated NEWS
  Fixed bug #65715 php5embed.lib isn't provided anymore
2014-03-25 09:03:32 +01:00
Anatol Belski 18405e9dff Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  fix C89 compat
2014-03-22 10:45:56 +01:00
Anatol Belski 4d647197cf fix signature 2014-03-22 10:34:32 +01:00
Anatol Belski 69ae149b4f Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  Revert "Add helper function for updating bucket contents"
  Rename+move zend_hash_apply_deleter and reuse it
  Make zend_hash_apply_deleter() void, to allow reuse
  Add helper function for updating bucket contents
  Remove unnecessary check
  Fixes after merge
  Emit a warning in case of unallowed characters. Fix another place this code is used - reuse
  add info: empty strings are interned
  don't replace with ?, just skip it

Conflicts:
	Zend/zend_hash.c
	ext/mysqlnd/mysqlnd.c
2014-03-22 10:24:11 +01:00
Anatol Belski 10248d3b5a Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  Add default_charset handling
  Updated UPGRADING to add three changes
  OCI8: fix prototypes for oci_field_*().  They can take a column index or name.
  Change test package name ARRAYBINDPKG1 to a per-file unique name to aid parallel testing
  fix compilation error
  fix typo
  Fix problem with mysqli_commt()/mysqli_rollback()
  Restore NEWS and UPGRADING for hash_equals().
  5.5.11RC1 preparation
  Fixed typo
  Add missing E_DEPRECATED error for https://wiki.php.net/rfc/default_encoding

Conflicts:
	ext/mysqli/mysqli_api.c
	ext/mysqlnd/mysqlnd.c
	ext/standard/html.c
2014-03-20 08:47:51 +01:00
Anatol Belski fa6ba0ecdb fix macros 2014-03-19 09:45:22 +01:00
Anatol Belski 87da8f58e2 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  prep for 5.4.27 rc1
  remove obsolete comment
  Fixes to various stream cast on win64
  - Updated to version 2014.1 (2014a)
  Add a test
  Add hash_equals() to perform string comparisons that are not vulnerable to timing attacks.

Conflicts:
	ext/bz2/bz2.c
	ext/standard/streamsfuncs.c
2014-03-19 08:53:59 +01:00
Anatol Belski ed70f02b29 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  Fixed wrong indentation
  Fix phpdbg build on FreeBSD
  Fixed off-by-one in php_url_parse_ex
  Fixed typo in UPGRADING and modified php.ini-* description for encoding related changes
  Add support for PCRE marks
  Update UPGRADING. Add more descriptions about default_charset and encoding related changes. Many thanks to Christopher.
  UPGRADING (openssl updates)
  Support async pgsql connections and non-blocking queries

Conflicts:
	ext/pcre/php_pcre.c
	ext/pgsql/pgsql.c
2014-03-18 14:03:25 +01:00
Anatol Belski 1ad45a3741 fix macros 2014-03-17 11:14:33 +01:00
Anatol Belski 300a8df8f4 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  Fix bug #66873: check if obj->src is set
  updated NEWS
  updated to oniguruma to 5.9.5

Conflicts:
	ext/intl/converter/converter.c
2014-03-17 10:37:46 +01:00
Anatol Belski 78fef11fe5 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  NEWS
  NEWS
  NEWS
  Fixed Bug #66833 Default digest algo is still MD5
  Fix 5.5.10 NEWS
  Typo fix: sicret -> secret
2014-03-14 12:21:20 +01:00
Anatol Belski beac52a78b reorder the struct members which reduces its size by at least 112 bytes 2014-03-13 18:28:22 +01:00
Anatol Belski 39fa14d089 arg count is zend_size_t now, fix type 2014-03-13 18:26:43 +01:00
Anatol Belski 3a66f6343c fix declarations 2014-03-13 05:47:31 -07:00
Anatol Belski af0bc1a306 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  updated libs_version.txt
2014-03-13 11:16:12 +01:00
Anatol Belski 65fcde6651 fix array types for pass by ref 2014-03-13 11:02:05 +01:00
Anatol Belski be0563b5b0 fix macro 2014-03-13 10:50:30 +01:00
Anatol Belski 5ea53dc6df fix zpp 2014-03-13 10:16:19 +01:00
Anatol Belski 3fdbb0d39f Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  Remove unneeded test
  Update NEWS
  Revert "Implement Bug #54649 Create session_serializer_name()"
  Revert "Implemented Request #11100 (session_gc() function)."
  made libgd recognize the 9 version series
  fix include search
  NEWS
  NEWS
  Fix bug  #66887 imagescale - poor quality of scaled image
  NEWS
  Fixed Bug #66893i imagescale ignore method argument
  Add SKIPIF in GMP test
  Fix hash_pbkdf2() with missing $length argument
  typo in NEWS
  typo in NEWS
  NEWS
  NEWS
  Fixed Bug #66890 imagescale segfault
  Updated UPGRADING to cover PDO_pgsql changes

Conflicts:
	ext/gd/gd.c
	ext/hash/hash.c
	ext/session/session.c
2014-03-13 08:38:58 +01:00
Anatol Belski 63d06ce9b0 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  Updated NEWS
  Added new PDO::PGSQL_ATTR_DISABLE_PREPARES that uses PQexecParams
  Deprecated PDO::PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT
  Drop PDO support for extremely old libpq versions
  Fix compile error with theoretically supported versions of libcurl < 7.12.3.

Conflicts:
	ext/pdo_pgsql/pdo_pgsql.c
	ext/pdo_pgsql/pgsql_driver.c
2014-03-12 09:02:39 +01:00
Anatol Belski f224455520 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  fix path separator
2014-03-11 16:30:43 +01:00
Anatol Belski adbb44537a Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  Use /dev/urandom as the default mcrypt_create_iv() source
  Add tests for bug #66872 and gmp_[rem]root
  Fixed mcrypt test case
  Removed bogus loops
  restored the old code in 5.4/5 related to bug #66872

Conflicts:
	ext/mcrypt/mcrypt.c
2014-03-11 15:32:07 +01:00
Anatol Belski 78bbfd7fac Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  Fixed Bug #66875 (Improve performance of multi-row OCI_RETURN_LOB queries)
2014-03-11 09:46:41 +01:00
Anatol Belski bed93450cd Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  updated libsqlite to 3.8.3.1 in 5.5 branch, too
  DI
  Switch from a single flag to a flag byte
  updated libmagic.patch
  updated libmagic.patch
  update NEWS
  fix #66872, invalid argument crashes gmp_testbit
  fix #66872, invalid argument crashes gmp_testbit
  update news
  - fix #66869, Invalid 2nd argument crashes imageaffinematrixget
  add vc12 (2013)
  add vc12 (2013)

Conflicts:
	Zend/zend_ini_scanner.c
	Zend/zend_language_scanner.c
	ext/mysqlnd/mysqlnd_structs.h
2014-03-11 09:26:05 +01:00
Anatol Belski be9c9da186 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  Fix indentation
2014-03-10 12:30:09 +01:00
Anatol Belski 61363d4751 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  Do not remove *.1, it's not generated by make but configure
  Fix typo: entory -> entry
2014-03-10 11:16:19 +01:00
Anatol Belski 8cea765858 more fixes to ext/mcrypt 2014-03-10 11:15:34 +01:00
Anatol Belski 0190e37ec6 partly revert the wrong merge 2014-03-10 09:21:12 +01:00
Anatol Belski 2a2649ed0a after merge fixes 2014-03-09 16:17:44 +01:00
Anatol Belski 7b8ba8e3e3 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6: (43 commits)
  updated NEWS
  removed the libsqlite patch as it's not relevant anymore
  updated bundled libsqlite to 3.8.3.1
  add OPSYS_Z_CPM missing constant
  Update php.ini files (new openssl directives)
  Fixed null termination
  Updated NEWS for #65545
  Updated NEWS for #65545
  Add fread(length) method
  Updated news for #66822
  Allow T_POW in constant expressions
  Fix typo
  Fix #66698: Add fnv1a32 and fnv1a64 hash options
  Fix HTML entity table generation
  Add test for bug #62102 / RFC 2144
  Whitespace.
  Misc cleanup including adding the version number
  Fix order in NEWS
  Add CVE ref (not known at release time)
  Fix NEWS for 5.5.11 fix (really not in 5.5.10)
  ...

Conflicts:
	ext/mcrypt/mcrypt.c
	ext/mysqlnd/mysqlnd.h
	ext/mysqlnd/mysqlnd_ps.c
	ext/mysqlnd/mysqlnd_result.c
	ext/mysqlnd/mysqlnd_result.h
	ext/mysqlnd/mysqlnd_structs.h
	ext/openssl/openssl.c
	ext/openssl/xp_ssl.c
	ext/zip/php_zip.c
2014-03-09 15:00:36 +01:00
Anatol Belski b186b2774a Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  Improves fix for memory leak, keep in sync with upstream.
  Add notice about tsrm_virtual_cwd.h moved to zend_virtual_cwd.h as this introduce need for awfull hacks...
  Fixed NEWS for #60602
  Fixed news for #60602
  Updated news for #60602
  proc_open(): separate environment values that aren't strings
  Added DateTimeImmutable::createFromMutable.
  Sort alphabetically
  Fixed NEWS.
  Capture peer cert even if verify fails
  Windows cert verify improvements + leak fixes
  Updated news for #66535 and #66109
  Updated NEWS for #66535

Conflicts:
	ext/standard/proc_open.c
2014-03-04 19:50:25 +01:00
Anatol Belski 816e21982e Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  turn off some false positives
2014-03-02 13:14:04 +01:00
Anatol Belski 43d15abf72 fixes signed/unsigned in ext/pgsql 2014-03-02 11:55:32 +01:00
Anatol Belski 17a7912eff more signature fixes 2014-03-02 11:37:01 +01:00
Anatol Belski e7a92a913f fixed signatures php_uint_t vs php_size_t for len 2014-03-02 11:30:22 +01:00
Anatol Belski e993862fb5 removed senseless unsigned < 0 check 2014-03-02 11:29:37 +01:00
Anatol Belski 549b251691 more zpp fixes 2014-03-02 11:10:27 +01:00
Anatol Belski 16e4b43f8c fix reading unsigned from zpp 2014-03-02 11:05:11 +01:00
Anatol Belski 7b5c1cd562 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  support for static analyzers other than visual studio
2014-03-01 20:22:03 +01:00
Anatol Belski 586f3a87f0 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  fix wording
  reveal more info on the configure options
  Updated news for #66535 and #66109
2014-03-01 15:12:22 +01:00
Anatol Belski a54d442de1 fixes unsigned < 0 comparsion 2014-03-01 11:30:49 +01:00
Anatol Belski e6ccba4b14 remove temp test files 2014-02-28 21:06:00 +01:00
Anatol Belski 3eeda5e804 fix typo replacement 2014-02-28 20:15:37 +01:00
Anatol Belski 3b37fe3bde Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  don't compare constants on run time
2014-02-28 19:42:31 +01:00
Anatol Belski 65f17d672d fix macros 2014-02-28 19:19:32 +01:00
Anatol Belski 28dbadeb1d Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6: (28 commits)
  substr_compare(): Allow zero length comparison
  Fixed test case title
  [bug 66535] X-PHP-Originating-Script adds newline if no custom headers are given
  Fixed expected output of a few cURL test cases
  Allow NULL as value for CURLOPT_CUSTOMREQUEST option.
  primitive test fixes
  man page: long option name is --strip, not --stripped
  --global have be removed in 5.2
  remove pcntl leftover from the test code
  list the fpm change hat rfc in UPGRADING
  mention the apparmor support in fpm
  typo spotted by Lajos Veres
  update libs_version.txt
  update libs_version.txt
  NEWS
  NEWS
  NEWS
  test for bug #66762
  Fixed Bug #66762 Segfault in mysqli_stmt::bind_result() when link closed
  fix tests broken by 633f898f15
  ...

Conflicts:
	ext/curl/interface.c
	ext/standard/mail.c
	ext/standard/string.c
2014-02-28 19:18:18 +01:00
Anatol Belski 2d83dca7be more descriptor fixes 2014-02-28 18:49:02 +01:00
Anatol Belski 8647f4e7f5 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  Update stack size in tests/func/010.phpt
  Don't add num_additional_args in SEND opcodes
  Disallow use of positional args after unpacking
  Store arg_num in fcall entry
  Introduce zend_function_call_entry structure

Conflicts:
	Zend/zend_compile.c
	Zend/zend_language_parser.y
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
2014-02-26 19:17:23 +01:00
Anatol Belski d753db3a81 after merge fix 2014-02-26 17:01:24 +01:00
Anatol Belski bd9a370701 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6: (22 commits)
  move the default encoding NEWS entry to alpha3, as it was pushed after beta2 was tagged
  rearrange the NEWS blocks a bit
  add NEWS block for 5.6.0 beta1
  restored that test part in ext/openssl to enable notify/wait
  remove echo
  fix stdin reading in new openssl tests
  kick redundant include
  Prevent implicit function declaration when TLSEXT unavailable
  Update NEWS+UPGRADING (openssl)
  Remove test case invalidated by openssl.cafile accessibility change
  Tolerate non-standard newlines when parsing stream CA files
  Remove openssl tests that shouldn't have survived last merge
  Add openssl.cafile ini check when loading cainfo
  Change openssl directives to PHP_INI_PERDIR
  Update openssl tests with new server/client test harness
  Add peer certificate verification on windows
  add news entry
  add news entry
  add clear_env option to FPM config
  add clear_env option to FPM config
  ...

Conflicts:
	ext/openssl/openssl.c
2014-02-26 16:47:49 +01:00
Anatol Belski 05db0cbcc0 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  Use API instead of directly acessing the structure

Conflicts:
	ext/mysqli/mysqli_prop.c
2014-02-25 20:19:04 +01:00
Anatol Belski 1ccc6d0a73 fixed typo 2014-02-25 17:28:12 +01:00
Anatol Belski b643fcddd1 zpp readme adjustment 2014-02-25 11:05:35 +01:00
Anatol Belski 94cfa3a120 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  fixed macro
  add clear_env option to FPM config
  Make sure value is initialized
  We can't dereference dbh if it is NULL
2014-02-24 10:16:31 +01:00
Anatol Belski 734d1b8e6f Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  fix linkage
2014-02-21 23:17:41 +01:00
Anatol Belski 90d31780c9 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  More openssl UPGRADING updates
  Fix build against older OpenSSL libs
  Update NEWS/UPGRADING with openssl additions
2014-02-21 21:55:21 +01:00
Anatol Belski a4de08ea89 fix macro names 2014-02-21 18:21:05 +01:00
Anatol Belski ff5f498f58 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  Mitigate client-initiated SSL renegotiation DoS
2014-02-21 17:52:53 +01:00
Anatol Belski bb9b9d7d29 after merge fix 2014-02-21 17:09:29 +01:00
Anatol Belski 93e8fb39df Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  C89 compat
  Added information about interned strings usage
  Updated opcache version
  Added function opcache_is_script_cached(). (Danack)

Conflicts:
	ext/openssl/xp_ssl.c
2014-02-21 13:56:14 +01:00
Anatol Belski befb267ddf Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  Improve OpenSSL compile flag compatibility, minor updates
  Use crypto method flags; add tlsv1.0 wrapper; add wrapper tests
  Improve server forward secrecy, refactor client SNI
  Add 'honor_cipher_order' server context option
  Add 'capture_session_meta' context option
  Disable TLS compression by default in both clients and servers
  Release ssl buffers
  Add openssl_get_cert_locations() function
  Explicitly set cert verify depth if not specified
  Strengthen default cipher list

Conflicts:
	ext/openssl/openssl.c
	ext/openssl/xp_ssl.c
	ext/standard/file.c
2014-02-21 13:37:35 +01:00
Anatol Belski 175ab77029 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport 2014-02-21 00:25:08 +01:00
Anatol Belski eca2c0462f Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport 2014-02-20 23:12:57 +01:00
Anatol Belski a30ef13ad8 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport 2014-02-20 20:34:12 +01:00
Anatol Belski 465fe9f0de Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport 2014-02-20 02:09:35 +01:00
Anatol Belski cd064187da Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
Conflicts:
	ext/fileinfo/libmagic.patch
	ext/fileinfo/libmagic/readcdf.c
	ext/openssl/openssl.c
2014-02-19 12:42:20 +01:00
Anatol Belski 4dd4f728ce Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
Conflicts:
	ext/json/php_json.h
2014-02-17 12:17:04 +01:00
Anatol Belski 463b450595 after merge fix 2014-02-17 09:21:27 +01:00
Anatol Belski f6c611fd84 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
Conflicts:
	ext/pgsql/pgsql.c
	ext/pgsql/php_pgsql.h
2014-02-17 09:16:13 +01:00
Anatol Belski 558795d02b fix always_populate_raw_data config 2014-02-16 19:29:07 +01:00
Anatol Belski d69911515a Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport 2014-02-16 17:17:19 +01:00
Anatol Belski 88ba1e9eb5 remove some obsolete casts 2014-02-16 15:07:32 +01:00
Anatol Belski c801f53102 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
Conflicts:
	ext/pgsql/pgsql.c
	ext/pgsql/tests/config.inc
2014-02-16 14:50:47 +01:00
Anatol Belski 729079fc66 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
Conflicts:
	ext/mysqli/mysqli_api.c
	ext/pgsql/pgsql.c
2014-02-16 01:06:20 +01:00
Anatol Belski fdc8dbe9d9 remaining backports for ext/* 2014-02-15 23:48:05 +01:00
Anatol Belski 98f03086bb further ext backports 2014-02-15 21:48:15 +01:00
Anatol Belski f2f78bc053 fix wrong backport 2014-02-15 21:41:28 +01:00
Anatol Belski a005010ef6 backported remaining part in main/streams 2014-02-15 21:01:06 +01:00
Anatol Belski 4fc459e424 backported ticks function signature 2014-02-15 20:51:14 +01:00
Anatol Belski 23679f5a01 backport ext/spl 2014-02-15 20:38:36 +01:00
Anatol Belski beb11f69f3 backported sapi/cli 2014-02-15 20:25:37 +01:00
Anatol Belski 1648d83e6d backport ext/date 2014-02-15 20:25:16 +01:00
Anatol Belski f6b64e93dd backported ext/standard 2014-02-15 20:16:05 +01:00
Anatol Belski 533dab176c simple overwrites 2014-02-15 14:41:52 +01:00
Anatol Belski 9a7f242f86 backported main/ 2014-02-15 14:33:11 +01:00
Anatol Belski 2fd7f7c825 backported Zend 2014-02-15 14:04:53 +01:00
Anatol Belski b923de2a8f Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	ext/standard/html.c
2014-02-13 09:22:58 +01:00
Yasuo Ohgaki 9a5cb51ebc Merge branch 'PHP-5.6'
* PHP-5.6:
  Implement RFC https://wiki.php.net/rfc/default_encoding
2014-02-13 11:56:54 +09:00
Anatol Belski 8cda1af604 Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	ext/oci8/oci8.c
2014-02-12 22:30:20 +01:00
Ferenc Kovacs c9e9151bb3 Merge branch 'PHP-5.6'
* PHP-5.6:
  update the alpha2 release date
  Make html_table_gen consistent with html_table.h
2014-02-12 06:40:43 +01:00
Derick Rethans c4e6c12b71 Merge branch 'PHP-5.6' 2014-02-11 11:31:13 +00:00
Anatol Belski d7a5bd11e5 Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	ext/date/php_date.c
2014-02-10 12:52:57 +01:00
Derick Rethans a30ebbdb18 Merge branch 'PHP-5.6' 2014-02-09 15:57:54 -05:00
Anatol Belski e7719f949a fix printf fmt for zend_uint_t 2014-02-09 06:37:08 -08:00
Anatol Belski d55c85d795 fix return of hash num elements 2014-02-09 14:29:10 +01:00
Anatol Belski 33b5108a2b Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-02-09 11:01:26 +01:00
Anatol Belski d5c924750b replace *_STRTOL with STRTOI, etc. 2014-02-09 10:55:52 +01:00
Anatol Belski 110c17f8b8 fix size types 2014-02-08 20:05:49 +01:00
Anatol Belski 9d972d3956 fix implicit type conversion 2014-02-08 20:05:16 +01:00
Anatol Belski 3ea59f0d51 fix size types in zend_ts_hash.* 2014-02-08 20:04:31 +01:00
Nuno Lopes 7b7d2952a6 fix regex to detect valgrind version
New PCRE version got stricter
2014-02-08 07:07:15 -05:00
Anatol Belski da452e33e7 fix some implicit 32 vs 64 bit type conversions 2014-02-07 00:14:01 +01:00
Anatol Belski 06eff86e4d it's actually correct to always use size_t for zend_size_t, even on 32 bit 2014-02-07 00:13:11 +01:00
Anatol Belski 44772c2cb5 Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	Zend/zend_operators.c
2014-02-06 23:17:09 +01:00
Bob Weinand 237c1bf7b5 Merge branch 'PHP-5.6' 2014-02-06 21:32:11 +01:00
Anatol Belski eeea68592f after merge fix 2014-02-06 20:20:39 +01:00
Anatol Belski 7e8616620d Merge remote-tracking branch 'origin/master' into str_size_and_int64
* origin/master:
  Added information in NEWS and UPGRADING
  add T_POW (**) operator
  add NEWS block for 5.6.0alpha3
  updated libs_version.txt
  updated libs_version.txt
  update libs_version.txt

Conflicts:
	Zend/zend_ini_scanner.c
	ext/standard/math.c
2014-02-06 20:20:12 +01:00
Bob Weinand 44dcdd146d Merge branch 'PHP-5.6' 2014-02-06 14:48:56 +01:00
Anatol Belski 205543143f Merge branch 'PHP-5.6'
* PHP-5.6:
  updated libs_version.txt
  updated libs_version.txt
  update libs_version.txt
2014-02-06 09:18:22 +01:00
Anatol Belski a72d90cb6d Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-02-05 20:17:11 +01:00
Anatol Belski 190c7772c1 Merge branch 'PHP-5.6'
* PHP-5.6:
  more tests for ICU >= 52.1 compat
  fix tests for ICU >= 52.1
2014-02-05 20:14:19 +01:00
Anatol Belski bf0d383aba fix tests for ICU >= 52.1 2014-02-05 19:25:33 +01:00
Hannes Magnusson 7d62a321c7 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix year
2014-02-05 10:18:10 -08:00
Anatol Belski b35c788a62 Merge branch 'PHP-5.6'
* PHP-5.6:
  adapt test to curl 7.35.0 upgrade
2014-02-05 15:17:48 +01:00
Anatol Belski ff390d788f Merge branch 'PHP-5.6'
* PHP-5.6:
  move the NEWS entry into the right section
2014-02-05 10:52:17 +01:00
Anatol Belski c907406c79 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-02-05 07:35:14 +01:00
Daniel Lowrey 6c1cdd0814 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed SNI failure from missing Z_STRVAL_PP
2014-02-04 19:13:50 -07:00
Anatol Belski 971a4a52e3 fix flag signness 2014-02-04 18:52:45 +01:00
Anatol Belski 1f8153a533 fix the comment text 2014-02-04 18:09:22 +01:00
Anatol Belski be7934b91b Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-02-04 11:15:54 +01:00
Anatol Belski 60846fab58 Merge branch 'PHP-5.6'
* PHP-5.6:
  updated NEWS
  updated NEWS
2014-02-04 10:39:46 +01:00
Anatol Belski f27eaa1578 Merge branch 'PHP-5.6'
* PHP-5.6:
  pcre tests go with 8.34 upgrade
2014-02-04 10:35:19 +01:00
Anatol Belski 2e8e2db82a Merge branch 'PHP-5.6'
* PHP-5.6:
  pcre upgraded to 8.34
2014-02-04 10:32:09 +01:00
Anatol Belski ac42ddf586 let thread id be 64 bit on win64 2014-02-03 18:44:46 +01:00
Anatol Belski ba32bba8c2 fix some specs for line num 2014-02-03 18:14:31 +01:00
Anatol Belski c98fcaafe7 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-02-03 17:21:30 +01:00
Anatol Belski 798e2e75b5 more cleanups to num args types 2014-02-03 17:03:53 +01:00
Anatol Belski c5668d1fae more cleanup for num args 2014-02-03 15:59:35 +01:00
Anatol Belski 6fb3434592 fix type for op num 2014-02-03 15:03:59 +01:00
Anatol Belski 7af9b01e26 fixed length property types in zend_property_info 2014-02-03 14:23:24 +01:00
Anatol Belski 8903518423 fixed types for num_args at various places 2014-02-03 14:17:15 +01:00
Ferenc Kovacs 0e764dc657 Merge branch 'PHP-5.6' 2014-02-03 04:21:27 +01:00
Anatol Belski 472579280f after merge fix, some datatypes 2014-02-02 20:33:24 +01:00
Anatol Belski 7061c35725 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-02-02 18:46:15 +01:00
krakjoe 6597d86389 Merge branch 'PHP-5.6'
* PHP-5.6:
  windows
2014-02-02 15:14:53 +00:00
krakjoe eacab735e0 Merge branch 'PHP-5.6'
* PHP-5.6:
  clean symbols
2014-02-02 15:10:28 +00:00
krakjoe 8aaec7d1c3 Merge branch 'PHP-5.6'
* PHP-5.6:
  another patch from upstream
2014-02-02 14:59:30 +00:00
krakjoe 202dcc0f6a Merge branch 'PHP-5.6'
* PHP-5.6:
  woops
2014-02-02 14:50:43 +00:00
krakjoe ee42849f8f Merge branch 'PHP-5.6'
* PHP-5.6:
  better use of tmpnam/mkstemp
2014-02-02 14:42:54 +00:00
krakjoe 37f4f132fc Merge branch 'PHP-5.6'
* PHP-5.6:
  update version
2014-02-02 14:05:03 +00:00
krakjoe 4c6816ddf2 Merge branch 'PHP-5.6'
* PHP-5.6:
  remove use of zend directly, avoid leaks/bugs in modules etc
2014-02-02 13:51:05 +00:00
krakjoe dc02b5a1fd Merge branch 'master' of https://git.php.net/repository/php-src 2014-02-02 13:50:54 +00:00
Anatol Belski 15896155c4 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-02-01 20:37:43 +01:00
Daniel Lowrey f08e8772a7 Merge branch 'PHP-5.6'
* PHP-5.6:
  Remove #if PHP_VERSION_ID version checks

Conflicts:
	ext/openssl/xp_ssl.c
2014-02-01 08:25:01 -07:00
Daniel Lowrey 0893a13e32 Remove #if PHP_VERSION_ID version checks 2014-02-01 08:13:53 -07:00
Daniel Lowrey f197dafd1c Merge branch 'PHP-5.6'
* PHP-5.6:
  Use master-agnostic zend_is_true checks

Conflicts:
	ext/openssl/xp_ssl.c
2014-01-31 14:22:35 -07:00
Christopher Jones f65cdd0a46 Fix expectation that zval size was 4 bytes
Various range checks added
2014-01-30 17:45:15 -08:00
Anatol Belski 39c41e6c1d cleanup with --reverse 2014-01-30 17:21:14 -08:00
Anatol Belski 247d7d7b14 add --zpp-vars to script usage out 2014-01-30 21:53:45 +01:00
Anatol Belski d82da76d19 document more on --zpp-vars 2014-01-30 21:50:46 +01:00
Anatol Belski e56176479c added replace.php --zpp-vars
Simple cases on datatype replacements can be handled now
2014-01-30 21:40:43 +01:00
Anatol Belski 31ca11d1b6 more feasible solution for zpp specs using compat.h 2014-01-30 18:26:21 +01:00
Sara Golemon 7f42e62d22 Merge branch 'PHP-5.6'
* PHP-5.6:
  Make html_table_gen consistent with html_table.h
2014-01-30 02:06:30 -08:00
Christopher Jones 66500333cf Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix merge
2014-02-10 17:04:55 -08:00
Christopher Jones 71a82be899 Merge branch 'PHP-5.6'
* PHP-5.6:
  Add Oracle PL/SQL BOOLEAN type support to oci_bind_by_name()
2014-02-10 15:01:37 -08:00
Sara Golemon 45e2a557f1 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Make html_table_gen consistent with html_table.h
2014-01-30 02:05:49 -08:00
Anatol Belski d329b89a55 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-01-30 10:49:14 +01:00
Anatol Belski 5ed1bdf9a5 fix ZTS build 2014-01-30 10:47:58 +01:00
Anatol Belski 2adf9e6235 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-01-30 10:03:40 +01:00
Anatol Belski ae850328a1 mention important compiler warnings, state the changed APIs more precisely 2014-01-30 09:32:24 +01:00
Stanislav Malyshev 11e47b1cdc Merge branch 'PHP-5.6'
* PHP-5.6:
  tests still failing, so xfail for now until fixed
  tests still failing, so xfail for now until fixed
  tests still failing, so xfail for now until fixed
2014-01-29 23:48:44 -08:00
Stanislav Malyshev d76a6a3e4d tests still failing, so xfail for now until fixed 2014-01-29 23:48:44 -08:00
Yasuo Ohgaki 210b444e1d Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug data->fd not set to -1 for open_basedir failure.
2014-01-30 14:17:11 +09:00
Daniel Lowrey ba8cdc855d Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed build breakage from b4b4d9697f
2014-01-29 17:59:46 -07:00
Anatol Belski 0c14569584 after merge fix 2014-01-29 23:21:15 +01:00
Anatol Belski 27868a0966 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-01-29 22:57:53 +01:00
Anatol Belski c91ad8233b fix merge error after b4b4d9697f 2014-01-29 22:50:56 +01:00
Anatol Belski 485e999d9c Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	ext/mysqli/php_mysqli_structs.h
2014-01-29 22:08:50 +01:00
Andrey Hristov 79e0c273b8 Merge branch 'master' of git.php.net:php-src
Conflicts:
	ext/openssl/xp_ssl.c
2014-01-29 15:33:52 +02:00
Andrey Hristov 1c7f54d4f7 Merge branch 'PHP-5.6'
Conflicts:
	NEWS
	ext/openssl/xp_ssl.c
2014-01-29 15:32:02 +02:00
Remi Collet cbb1097770 Merge branch 'PHP-5.6'
* PHP-5.6:
  zip extension version 1.12.4
2014-01-29 14:01:03 +01:00
Anatol Belski 7554d07945 separated zpp and macro replacement 2014-01-29 13:39:02 +01:00
Anatol Belski 9fedc08613 more doc on replace.php 2014-01-29 13:10:57 +01:00
Anatol Belski e2bdd42758 fixed reverse mode for --zpp 2014-01-29 12:52:38 +01:00
Anatol Belski b281016972 some datatype fixes 2014-01-29 12:40:32 +01:00
Anatol Belski e2cab1d888 fixed --zpp and added --zpp-compat 2014-01-29 12:39:19 +01:00
Anatol Belski 236e3188db Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	main/php_ini.c
2014-01-29 10:45:52 +01:00
Remi Collet 83c302840e Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed Request #66574 Allow multiple paths in php_ini_scanned_path
2014-01-29 09:57:22 +01:00
Yasuo Ohgaki 3828b5d83d Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed zend.multibyte tests partially
2014-01-29 15:56:13 +09:00
Anatol Belski 8da5217cd5 Merge remote-tracking branch 'origin/master' into str_size_and_int64
* origin/master:
  Update NEWS/UPGRADING
  Verify peers by default in client socket operations
  add text for the new constants
  add new consts
  Fixed arginfo of PDO::__construct() to match the docs and zend_parse_parameters definition.
  fix *.dsp files related to bug #50333
2014-01-29 00:36:37 +01:00
Anatol Belski 68969026fc reveal implemented replace.php options 2014-01-29 00:35:40 +01:00
Anatol Belski 4347713fd2 more precise info on printf formats and fix some wording 2014-01-29 00:16:47 +01:00
Anatol Belski febe423643 added info about new datatypes in zval 2014-01-28 23:55:39 +01:00
Daniel Lowrey 6edc84fcdf Merge branch 'PHP-5.6'
* PHP-5.6:
  Update NEWS/UPGRADING
  Verify peers by default in client socket operations

Conflicts:
	ext/openssl/xp_ssl.c
2014-01-28 10:36:28 -07:00
Daniel Lowrey 4bc8f94b58 Merge branch 'master' of https://github.com/php/php-src
* 'master' of https://github.com/php/php-src:
  add text for the new constants
  add new consts
2014-01-28 09:53:17 -07:00
Andrey Hristov fb5c7cda5d Merge branch 'master' of git.php.net:php-src 2014-01-28 15:58:08 +02:00
Andrey Hristov 3834771b2e Merge branch 'PHP-5.6'
Conflicts:
	NEWS
	UPGRADING
2014-01-28 15:57:48 +02:00
Andrey Hristov d9078c7c8d Merge branch 'PHP-5.6' 2014-01-28 15:47:50 +02:00
Anatol Belski 90bce9f1e8 word on bit shifting 2014-01-28 14:17:36 +01:00
Bob Weinand 4b8c098f02 Merge branch 'PHP-5.6' 2014-01-28 13:35:13 +01:00
Anatol Belski b1396cc7a5 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix *.dsp files related to bug #50333
2014-01-28 13:10:01 +01:00
Anatol Belski 82857031f0 fix datatype 2014-01-28 12:00:33 +01:00
Anatol Belski b972c10f3c Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-01-28 07:58:50 +01:00
Daniel Lowrey aafce7353e Merge branch '5.6'
* 5.6:
  Update NEWS/UPGRADING
  Prevent invalid SAN peer verification on null byte prefix attack
2014-01-27 15:00:04 -07:00
Yasuo Ohgaki 9f3a98b124 Merge branch 'PHP-5.6'
* PHP-5.6:
  Remove obsolete description
2014-01-27 18:58:06 +09:00
Stanislav Malyshev 473cd4d6a9 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix English and improve by Stas. Thanks :)
  Update source docs
  Revert "Update source docs"
  Update source docs
2014-01-26 17:21:33 -08:00
Stanislav Malyshev 586f379b88 Merge branch 'PHP-5.6'
* PHP-5.6:
  drop precision since trigonometric functions are non-portable
  XFAIL multibyte tests until they are fixed (bug 66582)
2014-01-26 15:51:46 -08:00
Stanislav Malyshev 909ef53e9d Merge branch 'PHP-5.6'
* PHP-5.6:
  drop precision since trigonometric functions are non-portable
2014-01-26 15:16:08 -08:00
Stanislav Malyshev 4e89151159 Merge branch 'PHP-5.6'
* PHP-5.6:
  XFAIL multibyte tests until they are fixed (bug 66582)
2014-01-26 15:12:40 -08:00
Stanislav Malyshev ceca4d2490 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix test
2014-01-26 14:31:43 -08:00
Stanislav Malyshev a0445644e0 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix test
2014-01-26 14:26:26 -08:00
Stanislav Malyshev 8e08f6c28d Merge branch 'PHP-5.6'
* PHP-5.6:
  fix test - new flag ZEND_ACC_HAS_TYPE_HINTS
2014-01-26 12:17:32 -08:00
Stanislav Malyshev c4259f90b1 fix test - new flag ZEND_ACC_HAS_TYPE_HINTS 2014-01-26 12:17:29 -08:00
Anatol Belski d7c02a47fd extended replace.php with --reverse and --zpp 2014-01-26 18:21:05 +01:00
Derick Rethans 6dd41435a3 Merge branch 'PHP-5.6' 2014-01-26 14:02:55 +01:00
Anatol Belski 350d9db222 after merge fixes to ext/ldap 2014-01-26 13:42:06 +01:00
Anatol Belski 4d7f63385b Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-01-26 12:29:45 +01:00
Stanislav Malyshev c2a93ba3af Merge branch 'PHP-5.6'
* PHP-5.6:
  fix test bug62479.phpt
2014-01-25 23:27:48 -08:00
Stanislav Malyshev 1eee68d3f4 Merge branch 'PHP-5.6'
* PHP-5.6:
  Implement ldap_modify_batch.
2014-01-25 22:05:18 -08:00
Anatol Belski 2726001dd0 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-01-25 22:24:37 +01:00
Derick Rethans 0f62b94971 Merge branch 'PHP-5.6' 2014-01-25 16:16:42 +01:00
Anatol Belski 3b61e3ec1e Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	ext/mysqlnd/mysqlnd_ps_codec.c
2014-01-24 22:15:16 +01:00
Ferenc Kovacs a791671f40 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix the primary qa email address and update the list of available people being able to add moderators to our lists
  Revert "Fix #62479: Some chars not parsed in passwords"
  Fix #62479: Some chars not parsed in passwords
2014-01-24 16:13:10 +01:00
Andrey Hristov 3aa6f8bfdd Merge branch 'PHP-5.6' 2014-01-24 12:31:33 +02:00
Andrey Hristov dc6b14149d Merge branch 'PHP-5.6'
Conflicts:
	ext/mysqlnd/mysqlnd_ps_codec.c
2014-01-24 12:15:03 +02:00
Anatol Belski 727fac6290 Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	ext/mysqlnd/mysqlnd_ps_codec.c
2014-01-24 04:20:21 +01:00
Anatol Belski 9debf41bfd some extension to the porting doc 2014-01-24 04:15:50 +01:00
Xinchen Hui 874a0bb7eb Merge branch 'PHP-5.6' 2014-01-24 10:52:22 +08:00
Will Fitch 28e0a2129b Merge branch 'PHP-5.6'
* PHP-5.6:
  Update gitignore and Makefile for additional entries
2014-01-23 21:36:54 -05:00
Christopher Jones daa34699af Add #defines for compatibility with PHP releases prior to the core PHP
type changes.
2014-01-23 11:13:32 -08:00
Andrey Hristov 7072db5a6b FIx failing tests because of operator precedence 2014-01-23 18:20:13 +02:00
Anatol Belski 4be5d97f3d fixed merge error in ext/oci8 2014-01-23 01:10:13 +01:00
Anatol Belski c0e5d95ca6 added convert_to_int_ex 2014-01-23 01:07:44 +01:00
Christopher Jones ab5405e800 Fixes to ext/oci8 2014-01-23 00:25:55 +01:00
Anatol Belski 2741cf56a4 missed header 2014-01-22 15:16:35 -08:00
Anatol Belski aa6f6ca864 fixed ZEND_INT_FMT 2014-01-22 15:11:39 -08:00
Anatol Belski 2bdb887975 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-01-22 23:47:05 +01:00
Anatol Belski 4904be6d94 Merge branch 'PHP-5.6'
* PHP-5.6:
  refixed that test for 5.5+
  5.5.10 next
2014-01-22 23:31:09 +01:00
Anatol Belski d21056176a missing piece of code from the mainstream 2014-01-22 22:19:02 +01:00
Anatol Belski 806e540a4f Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-01-22 15:43:09 +01:00
Anatol Belski 03dfe0d5e0 Merge branch 'PHP-5.6'
* PHP-5.6:
  fixed test
2014-01-22 15:41:45 +01:00
Anatol Belski 529060dbc9 after merge fix ext\session 2014-01-22 14:55:25 +01:00
Anatol Belski 374a796daa renamed the compat macros 2014-01-22 14:51:47 +01:00
Anatol Belski dcdf236467 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix zts
2014-01-22 12:05:27 +01:00
Anatol Belski bb45daeb75 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-01-22 11:56:50 +01:00
Anatol Belski 74fff1512a Merge branch 'PHP-5.6'
* PHP-5.6:
  fixed missing usleep() prototype in pgsql
2014-01-22 11:54:16 +01:00
Yasuo Ohgaki 36a7f48e84 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed previous commit may delete unwanted cookies. Sync tests from upper branches.
  Re-fixed bug #66469
2014-01-22 19:23:52 +09:00
Anatol Belski ff42d2a644 after merge fix and more revamp on ext\session 2014-01-22 09:54:04 +01:00
Anatol Belski 8a43325b38 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-01-22 09:29:30 +01:00
Yasuo Ohgaki 9cefeea860 Merge branch 'PHP-5.6'
* PHP-5.6:
  Re-fixed bug #66469
2014-01-22 13:49:13 +09:00
Stanislav Malyshev d5f79e40e5 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix CVE ref for bug #66060
  fix CVE ref for bug #66060
  fix buglet in makedist
  5.4.26 next
  fix news
2014-01-21 13:29:13 -08:00
Anatol Belski a40c20f764 Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	ext/mysqlnd/mysqlnd_result.c
2014-01-21 17:17:27 +01:00
Anatol Belski 4b7148711b Merge branch 'PHP-5.6'
* PHP-5.6:
  fixed post deactivate signature in ext\libxml
2014-01-21 17:15:12 +01:00
Johannes Schlüter 676864684b Merge branch 'PHP-5.6' 2014-01-21 16:40:13 +01:00
David Soria Parra 807d937e91 Merge branch 'PHP-5.6'
* PHP-5.6:
  Change automaticaly to automatically
2014-01-21 16:20:14 +01:00
Ferenc Kovacs 2bf13b2042 Merge branch 'PHP-5.6' 2014-01-21 11:21:28 +01:00
Ferenc Kovacs 15acd4ee50 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix these tests so they properly clean up after themselves.
2014-01-21 02:29:11 +01:00
Anatol Belski 5b83f7252a Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-01-20 17:39:53 +01:00
Anatol Belski 9673f66da6 range checks for ext\bz2 2014-01-20 17:24:09 +01:00
Remi Collet a3541301eb Merge branch 'PHP-5.6'
* PHP-5.6:
  Skip those test which fails on ARM architecture
  dos2unix
2014-01-20 14:44:43 +01:00
Xinchen Hui aaad97675a Merge branch 'PHP-5.6' 2014-01-20 21:25:42 +08:00
Anatol Belski 89a9acea1f Merge branch 'PHP-5.6'
* PHP-5.6:
  fixed glob compilation with vc12
2014-01-20 10:13:22 +01:00
Anatol Belski d501707248 Merge branch 'PHP-5.6'
* PHP-5.6:
  support for Visual C+ 2013
2014-01-20 10:05:37 +01:00
Remi Collet 5b5b9b9239 Merge branch 'PHP-5.6'
* PHP-5.6:
  Skip readline tests which fail with libedit Add specific libedit test (output slightly differs)
2014-01-20 09:39:39 +01:00
Remi Collet 3b82a477b0 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed Bug #66412 readline_clear_history() with libedit causes segfault after #65714
2014-01-20 08:41:04 +01:00
Yasuo Ohgaki fd45f1eb78 Merge branch 'PHP-5.6'
* PHP-5.6:
  Enable zend.multibyte tests. Tipcal configuration works, but most tests fail.
2014-01-19 13:33:27 +09:00
Anatol Belski e3cfbef33f Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	ext/pdo_pgsql/pgsql_driver.c
2014-01-19 02:17:07 +01:00
Anatol Belski d788a85736 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix C89 compat
2014-01-19 02:05:38 +01:00
Will Fitch 9eb4bc2f84 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix #62479: Some chars not parsed in passwords
2014-01-18 19:49:06 -05:00
Anatol Belski bc7dc1913c Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-01-19 01:35:02 +01:00
Will Fitch 4e5195f82c Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix bug #66509: copy() arginfo incorrect since 5.4
2014-01-18 11:57:34 -05:00
Nikita Popov 89eab884d9 Merge branch 'PHP-5.6' 2014-01-18 14:44:57 +01:00
Johannes Schlüter 84efb8fc71 Merge branch 'PHP-5.6' 2014-01-18 13:53:15 +01:00
Anatol Belski f5d48e8524 partial revamp ext/intl 2014-01-17 23:52:19 +01:00
Adam Harvey 86096a99ec Merge branch 'PHP-5.6' 2014-01-17 20:29:31 +08:00
Michael Wallner f1fc5a5bf5 Merge branch 'PHP-5.6'
* PHP-5.6:
  Clarify always_populate_raw_post_data situation in 5.6
2014-01-17 12:19:17 +01:00
Anatol Belski ee039d5a1a Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-01-17 11:12:14 +01:00
Anatol Belski deb56c010e Merge branch 'PHP-5.6' 2014-01-17 11:08:21 +01:00
Antony Dovgal cfce5a4d02 Merge branch 'master' of https://git.php.net/repository/php-src
* 'master' of https://git.php.net/repository/php-src:
  forked the test for bug #66481
2014-01-17 12:22:34 +04:00
Antony Dovgal a053e69991 fix indentation 2014-01-17 12:22:07 +04:00
Anatol Belski feb4eb850d Merge branch 'PHP-5.6'
* PHP-5.6:
  forked the test for bug #66481
2014-01-17 03:32:26 +01:00
Antony Dovgal 998f506b6d Merge branch 'fpm-apparmor-fixed' of https://github.com/notti/php-src
* 'fpm-apparmor-fixed' of https://github.com/notti/php-src:
  Add some basic and apparmor tests to fpm
  Add --force-stderr to fpm
  Add apparmor change hat functionality to fpm
2014-01-16 17:36:03 +04:00
Anatol Belski 24850c5662 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-01-16 10:16:04 +01:00
Xinchen Hui 7691926bbe Merge branch 'PHP-5.6' 2014-01-16 14:42:14 +08:00
Anatol Belski 49c20cdfcb Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-01-16 07:32:33 +01:00
Yasuo Ohgaki 7b5b2b4efa Merge branch 'PHP-5.6'
* PHP-5.6:
  Bug #66481 Segfaults on session_name()
2014-01-16 11:35:57 +09:00
Dmitry Stogov 511a375e60 Merge branch 'PHP-5.6'
* PHP-5.6:
  Log information about cached scripts and keys
2014-01-15 12:15:41 +04:00
Anatol Belski 208e580ebc Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	ext/pgsql/pgsql.c
2014-01-15 08:29:12 +01:00
Dmitry Stogov 61028ad45e Merge branch 'PHP-5.6'
* PHP-5.6:
  We don't know PHP_5_6_X_API_NO yet
2014-01-15 11:11:01 +04:00
Yasuo Ohgaki e4f1eee6c3 Merge branch 'PHP-5.6'
* PHP-5.6:
  Added pg_lo_truncate() and 64bit large object support from PostgreSQL 9.3 and up
2014-01-15 14:39:56 +09:00
Yasuo Ohgaki a92c5b14cf Merge branch 'PHP-5.6'
* PHP-5.6:
  Always initialize pg_version() result array elements to prevent failed test with older postgresql servers. Add missing client_encoding element.
2014-01-15 14:28:08 +09:00
Yasuo Ohgaki ee4e5ce2cf Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed pg_version() crash with older postgresql
2014-01-15 13:32:43 +09:00
Yasuo Ohgaki 42c134df4b Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed session module is sending multiple set-cookie headers when session.use_strict_mode=1
2014-01-15 11:07:51 +09:00
Anatol Belski 3213959080 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-01-14 17:23:59 +01:00
Xinchen Hui aca07343ce Merge branch 'PHP-5.6' 2014-01-14 22:34:53 +08:00
Anatol Belski 4f71b9022d fix printf spec 2014-01-14 05:59:40 -08:00
Anatol Belski d384422f27 Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	ext/mysqlnd/mysqlnd_ps_codec.c
2014-01-14 09:51:34 +01:00
Anatol Belski 25e57e702b fix uninitialized value 2014-01-14 09:47:27 +01:00
Anatol Belski 0c04890354 more fixes after merge 2014-01-14 09:45:46 +01:00
Anatol Belski 5866c701a2 after merge fix 2014-01-14 09:15:55 +01:00
Anatol Belski 28c917923d Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	ext/mysqlnd/mysqlnd_ps_codec.c
2014-01-14 09:10:38 +01:00
Anatol Belski 614a69fe1d Merge branch 'str_size_and_int64' of git.php.net:php-src into str_size_and_int64 2014-01-14 08:59:36 +01:00
Yasuo Ohgaki 681e1a5ce0 Merge branch 'PHP-5.6'
* PHP-5.6:
  Made pg_version() return full connection info.
2014-01-14 10:16:43 +09:00
Paul Tarjan d599d36d49 Dont ignore errors from FT_Get_Glyph 2014-01-13 16:30:48 -08:00
Andrey Hristov bbc37e78e8 Merge branch 'master' of git.php.net:php-src 2014-01-14 01:32:36 +02:00
Andrey Hristov 73008bb5ce More refactoring of the big function generating execute requests 2014-01-14 01:31:16 +02:00
Anatol Belski aeec64b7f4 fixed a typo 2014-01-13 23:12:58 +01:00
Anatol Belski f92f7f05e9 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-01-13 22:08:35 +01:00
Dmitry Stogov 5980e987d2 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed ZTS build
2014-01-13 23:11:36 +04:00
Anatol Belski 7010a933d1 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-01-13 18:58:45 +01:00
Anatol Belski 25dfcf4fdd small corrections 2014-01-13 18:56:43 +01:00
Anatol Belski de137e5a8d Merge branch 'PHP-5.6'
* PHP-5.6:
  forked test for win32
2014-01-13 17:13:11 +01:00
Dmitry Stogov 127eb33b84 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #66461 (PHP crashes if opcache.interned_strings_buffer=0)
2014-01-13 18:07:26 +04:00
Anatol Belski 972a6bd0f7 Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	ext/opcache/Optimizer/pass1_5.c
2014-01-13 14:29:14 +01:00
Anatol Belski e15f7decd1 further porting notes 2014-01-13 14:23:39 +01:00
Dmitry Stogov e141592da6 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #66440 (Optimisation of conditional JMPs based on pre-evaluate constant function calls)
2014-01-13 16:16:57 +04:00
Dmitry Stogov f5182741a6 Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  move common code into a function
2014-01-13 15:36:37 +04:00
Dmitry Stogov 3458dac342 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #66471 (Keep backward compatibility)
2014-01-13 15:36:06 +04:00
Anatol Belski 21643019c0 Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	ext/mysqlnd/mysqlnd_ps_codec.c
2014-01-13 12:29:30 +01:00
Anatol Belski bd5a5e7f7a added ptrdiff_t notes and some other porting doc improvements 2014-01-13 12:22:01 +01:00
Anatol Belski 85ff0a75e3 ws and some note corrections 2014-01-13 12:04:25 +01:00
Anatol Belski e5613c17fc more on porting 2014-01-13 11:55:53 +01:00
Andrey Hristov cf9966671c Merge branch 'master' of git.php.net:php-src 2014-01-13 12:40:59 +02:00
Andrey Hristov 01d5e28057 move common code into a function 2014-01-13 12:40:39 +02:00
Anatol Belski 7957d672bc Merge remote-tracking branch 'origin/master' into str_size_and_int64
* origin/master:
  Fixed bug #66474 (Optimizer bug in constant string to boolean conversion)
2014-01-13 10:45:19 +01:00
Anatol Belski f7e5a97076 further writing on PECL_PORTING 2014-01-13 10:44:36 +01:00
Dmitry Stogov aab2e8eb7e Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #66474 (Optimizer bug in constant string to boolean conversion)
2014-01-13 12:08:23 +04:00
Anatol Belski 4560d412bb reworked compat.h 2014-01-13 04:08:46 +01:00
Anatol Belski 2487493f83 added compat.h 2014-01-12 15:48:47 +01:00
Anatol Belski 3957288cf7 rrenamed the readme file 2014-01-12 14:02:18 +01:00
Anatol Belski b1ea854100 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-01-12 12:03:53 +01:00
Anatol Belski fba53c888b started the porting docs/tools 2014-01-12 12:00:12 +01:00
Bob Weinand a86e869ee8 Merge branch 'PHP-5.6' 2014-01-12 02:00:37 +01:00
Anatol Belski fd09f3f059 Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	Zend/zend_language_parser.y
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
2014-01-11 16:30:35 +01:00
Nikita Popov 4facc35413 Merge branch 'PHP-5.6' 2014-01-11 12:54:08 +01:00
Anatol Belski 5122ece265 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-01-11 00:25:13 +01:00
Johannes Schlüter 82dfe1acc8 Merge branch 'PHP-5.6' 2014-01-10 16:04:29 +01:00
Anatol Belski 5fefc0ce47 reverted erroneous patch in array_sum() 2014-01-10 14:56:03 +01:00
Anatol Belski aaccf60fea Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-01-09 16:30:25 +01:00
Anatol Belski 9aaea81cfe Merge branch 'PHP-5.6'
* PHP-5.6:
  fixed EOL in the test
2014-01-09 15:29:16 +01:00
Anatol Belski 3572a0482d Merge branch 'PHP-5.6'
* PHP-5.6:
  added testcase from bug #65371
2014-01-09 15:25:18 +01:00
Dmitry Stogov 83b00bbd08 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed ADD_INTERNED_STRING() logic to support strings that are already interned. (Terry)
2014-01-09 13:50:12 +04:00
Anatol Belski 6951bea25e revamped ext/shmop 2014-01-09 09:51:21 +01:00
Anatol Belski 9dd5099566 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-01-09 08:26:42 +01:00
Anatol Belski 2a468115e3 revamp mysqlnd, mysqli, mysql and pdo_mysql 2014-01-09 04:18:37 +01:00
Anatol Belski 8edaa10eab fixed the 'p' modifier when %p is used 2014-01-09 04:17:38 +01:00
Gernot Vormayr e9883779a0 Add some basic and apparmor tests to fpm 2014-01-07 00:21:24 +01:00
Gernot Vormayr 32d9409a24 Add --force-stderr to fpm 2014-01-07 00:19:01 +01:00
Scott MacVicar 6fe34014f0 Merge branch 'PHP-5.6'
* PHP-5.6:
  [libxml] Unit test for libxml_disable_entity_loader()
2014-01-06 17:06:33 +00:00
Scott MacVicar 28beaaad9c Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  [libxml] Unit test for libxml_disable_entity_loader()
2014-01-06 17:05:34 +00:00
Scott MacVicar 42f084c692 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  [libxml] Unit test for libxml_disable_entity_loader()
2014-01-06 17:05:16 +00:00
Scott MacVicar 24cc7c0be2 [libxml] Unit test for libxml_disable_entity_loader()
Summary:
Test to make sure libxml_disable_entity_loader() is behaving.
2014-01-06 17:04:54 +00:00
Anatol Belski 47df90a765 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-01-05 23:06:08 +01:00
Anatol Belski e797e058c5 Merge branch 'PHP-5.6'
* PHP-5.6:
  one more extension for the basename test
2014-01-05 19:22:11 +01:00
Anatol Belski ac875f8f7e Merge branch 'PHP-5.6'
* PHP-5.6:
  improved the fix for bug #66395
  Fixed bug #66009 Failed compilation of PHP extension with C++ std library using VS 2012
  updated NEWS
  Fixed bug #66009 Failed compilation of PHP extension with C++ std library using VS 2012
2014-01-05 19:13:40 +01:00
Anatol Belski 4ff4837966 Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	Zend/zend.c
	Zend/zend_ini_scanner.c
2014-01-04 02:17:11 +01:00
Anatol Belski 19aafe43b2 Fixed bug #66009 Failed compilation of PHP extension with C++ std library using VS 2012
Visual Studio 2012 includes sanity checks for C++11 features, see
http://msdn.microsoft.com/en-us/library/vstudio/bb531344(v=vs.110).aspx
To fix the 'inline' keyword redefinition for C++ in debug mode, the
new macros ZEND_WIN32_KEEP_INLINE is introduced, ZEND_WIN32_FORCE_INLINE is
automatically appended in release mode.
2014-01-04 01:41:49 +01:00
Nikita Popov 250ee4c17a Merge branch 'PHP-5.6' 2014-01-04 01:30:44 +01:00
Anatol Belski 6e7d24dd14 Merge branch 'PHP-5.6'
* PHP-5.6:
  updated NEWS
2014-01-03 22:45:09 +01:00
Anatol Belski b502c0a3dc Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #66395 basename function doesn't remove drive letter
2014-01-03 22:39:17 +01:00
Xinchen Hui b209c27302 Merge branch 'PHP-5.6' 2014-01-03 11:37:32 +08:00
Xinchen Hui af6c11c5f0 Bump year 2014-01-03 11:11:57 +08:00
Xinchen Hui 0f53e37494 Merge branch 'PHP-5.6' 2014-01-03 11:09:07 +08:00
Derick Rethans c9f909cd42 Merge branch 'PHP-5.6' 2014-01-02 12:52:26 +00:00
Derick Rethans 63d390cdf9 Merge branch 'PHP-5.6' 2014-01-02 12:47:52 +00:00
Anatol Belski 826064410c Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	ext/gmp/gmp.c
2014-01-02 09:55:25 +01:00
krakjoe 9e4ab7c53f Merge branch 'PHP-5.6'
* PHP-5.6:
  fix #66375 bad logic in sapi header callback routine
2014-01-01 13:01:41 +00:00
Felipe Pena 57a6209051 Merge branch 'PHP-5.6'
* PHP-5.6:
  - Fixed bug #66381 (__ss_family was changed on AIX 5.3)
2014-01-01 09:57:03 -02:00
Nikita Popov 73db3cda8b Merge branch 'PHP-5.6' 2013-12-30 14:41:45 +01:00
Michael Wallner 79d1c70e99 This should be an empty merge.
Merge branch 'PHP-5.6'

* PHP-5.6:
  update php.ini-*
  Add E_DEPRECATED when populating $HTTP_RAW_POST_DATA
  add 'never'
  fix type
  fix type; add tests for -1
  s/BOOLEAN/ENTRY/
  re-introduce always_populate_raw_post_data
2013-12-30 14:32:25 +01:00
Nikita Popov 056f3441fd Merge branch 'PHP-5.6' 2013-12-30 13:59:55 +01:00
Anatol Belski 9ac081f295 after merge fixes to ext/zip 2013-12-30 10:48:14 +01:00
Anatol Belski 4e9b54757a fixes after merge and some opcache revamp 2013-12-30 10:42:05 +01:00
Anatol Belski d40315a09d Merge remote-tracking branch 'origin/master' into str_size_and_int64 2013-12-30 10:12:32 +01:00
Anatol Belski bcfee0ada4 Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	ext/opcache/Optimizer/zend_optimizer.c
	ext/opcache/Optimizer/zend_optimizer_internal.h
	ext/zip/php_zip.c
2013-12-30 10:07:08 +01:00
Remi Collet a3c7971f94 Merge branch 'PHP-5.6'
* PHP-5.6:
  missing file from libzip 0.11.2
2013-12-30 10:00:19 +01:00
Remi Collet 7844fb292c Merge branch 'PHP-5.6'
* PHP-5.6:
  fix compat for PHP ABI changes
2013-12-30 08:47:23 +01:00
Remi Collet 717dcdaa67 Merge branch 'PHP-5.6'
* PHP-5.6:
  NEWS
2013-12-30 07:45:17 +01:00
Remi Collet 764190c1d6 Merge branch 'PHP-5.6'
* PHP-5.6:
  Sync with pecl/zip 1.12.4dev
2013-12-30 07:38:45 +01:00
Xinchen Hui 6b34343479 Merge branch 'PHP-5.6' 2013-12-30 11:07:42 +08:00
Xinchen Hui 8b72df0608 Merge branch 'PHP-5.6' 2013-12-30 10:58:56 +08:00
Xinchen Hui 408ae9a452 Merge branch 'PHP-5.6' 2013-12-30 10:52:21 +08:00
Anatol Belski b923ee32c9 added ZEND_ABS and revamped some related stuff 2013-12-29 16:39:15 +01:00
Anatol Belski 1085d21693 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2013-12-28 17:30:23 +01:00
Remi Collet bd3e5aab1d Merge branch 'PHP-5.6'
* PHP-5.6:
  minor fix on previous
2013-12-28 14:29:38 +01:00
Remi Collet 8785e22bca Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #66356 (Heap Overflow Vulnerability in imagecrop())
2013-12-28 14:26:24 +01:00
Anatol Belski 4aca887f8b other place with 64 bit << and hash size 2013-12-28 13:58:22 +01:00
Anatol Belski 10cd3f86b7 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2013-12-28 02:36:45 +01:00
Anatol Belski b8b4591265 fix bit shift 64 vs 32 bit vars 2013-12-28 00:38:49 +01:00
Anatol Belski e2df932ef0 revamp the hash api once more 2013-12-27 23:28:22 +01:00
krakjoe 50f09d8256 Merge branch 'PHP-5.6'
* PHP-5.6:
  update version output
2013-12-27 18:04:06 +00:00
Anatol Belski 173bd989cd fix macros conflicts when included intsafe.h 2013-12-27 17:32:46 +01:00
Anatol Belski d0ab1e4ea4 Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	ext/gd/gd.c
2013-12-27 17:01:29 +01:00
Xinchen Hui fb4678f1ac Merge branch 'PHP-5.6' 2013-12-27 20:46:08 +08:00
Xinchen Hui c0476ff44b Merge branch 'PHP-5.6' 2013-12-27 14:11:41 +08:00
Xinchen Hui 1a4863d560 Merge branch 'PHP-5.6' 2013-12-27 14:07:15 +08:00
Anatol Belski 8d0b174eea removed accidentially merged in files 2013-12-26 13:33:38 +01:00
Anatol Belski 3e65d7dad0 Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	Zend/zend_compile.c
2013-12-26 13:06:49 +01:00
Dmitry Stogov 65fd18fd88 Merge branch 'PHP-5.6'
* PHP-5.6:
  Improved empty string handling. Now ZE uses an interned string instead of allocation new empty string each time. (Some extensions might need to be fixed using str_efree() instead of efree() to support interned strings).

Conflicts:
	NEWS
	Zend/zend_extensions.h
	Zend/zend_modules.h
2013-12-26 14:51:05 +04:00
Xinchen Hui d6713f3989 Fixed warning "No new line at end of file" 2013-12-26 17:45:37 +08:00
Dmitry Stogov ef56cfb991 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed ZEND_MM_MEM_TYPE=mmap_zero
2013-12-26 11:53:03 +04:00
Anatol Belski a5720b4493 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2013-12-25 23:45:53 +01:00
Anatol Belski c676f5b36d Merge branch 'PHP-5.6'
* PHP-5.6:
  fix c89 compat
2013-12-25 23:44:24 +01:00
Anatol Belski 734c28d242 Merge branch 'PHP-5.6'
* PHP-5.6:
  brought the ext/sybase_ct/config.w32 up to date
2013-12-25 23:31:17 +01:00
Anatol Belski d031758b49 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2013-12-25 22:40:03 +01:00
Anatol Belski 1dc85bfa6c revamp ext/sybase_ct 2013-12-25 22:33:11 +01:00
Xinchen Hui bd0a8f31a4 Merge branch 'master' of git.php.net:php-src 2013-12-25 15:36:45 +08:00
Xinchen Hui 03e36cd5b8 Merge branch 'PHP-5.6' 2013-12-25 15:35:02 +08:00
Stanislav Malyshev b3c43a1aec Merge branch 'PHP-5.6'
* PHP-5.6:
  5.4.25 next
2013-12-24 22:23:55 -08:00
Anatol Belski 79eb697f48 Merge branch 'master' into str_size_and_int64 2013-12-24 22:04:07 +01:00
Anatol Belski 0493099786 next wave on fixes for ext/phpdbg 2013-12-24 21:59:44 +01:00
Anatol Belski 3af0ee0ea3 Merge branch 'PHP-5.6'
* PHP-5.6:
  fixed incompatible pointer in phpdbg on win64
2013-12-24 21:09:45 +01:00
Bob Weinand c02acf3c29 Merge branch 'PHP-5.6' 2013-12-24 13:20:12 +01:00
Anatol Belski 5ae8f624a1 basic fixes to sapi/phpdbg 2013-12-24 02:44:53 -08:00
Anatol Belski 713b69adf8 added credits note 2013-12-24 02:44:53 -08:00
Anatol Belski 87f348a1e7 basic fixes to sapi/fpm 2013-12-24 02:44:53 -08:00
Anatol Belski 4267b15630 Z_STRLEN vs Z_STRSIZE 2013-12-24 02:44:53 -08:00
Joe Watkins 5aba79affa update credits 2013-12-24 02:44:53 -08:00
Bob Weinand 62f0ffb34e Added breaking upon fatal-ish error 2013-12-24 02:44:53 -08:00
Stanislav Malyshev 4363b38657 fix NEWS file for master 2013-12-24 02:44:53 -08:00
Bob Weinand 09e6ef3986 Fixed credits in phpdbg.* files 2013-12-24 02:44:52 -08:00
Joe Watkins ca8ff0725b update credits 2013-12-24 09:04:32 +00:00
Joe Watkins e07dfa96b3 Merge branch 'master' of https://git.php.net/repository/php-src
* 'master' of https://git.php.net/repository/php-src:
  Fixed credits in phpdbg.* files
  Added breaking upon fatal-ish error
  fix NEWS file for master
  credits file for phpdbg
  Fixed credits in phpdbg.* files
  reformat
  credits file
2013-12-24 09:03:55 +00:00
Bob Weinand ad358593a8 Merge branch 'PHP-5.6' 2013-12-24 00:37:20 +01:00
Stanislav Malyshev 6daa84f199 fix NEWS file for master 2013-12-23 15:25:38 -08:00
Anatol Belski 2f77629f72 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2013-12-23 23:41:29 +01:00
Anatol Belski e540839c8b Merge branch 'master' into str_size_and_int64
Conflicts:
	Zend/zend_vm_execute.h
	ext/opcache/Optimizer/pass1_5.c
	ext/opcache/ZendAccelerator.h
2013-12-23 23:39:42 +01:00
Joe Watkins 056f6fd895 Merge branch 'PHP-5.6'
* PHP-5.6:
  credits file for phpdbg
2013-12-23 22:37:36 +00:00
Anatol Belski 63ea29a206 fixed tests using 'expected to be long' vs 'expected to be integer' 2013-12-23 14:28:02 -08:00
Anatol Belski a06a89dba6 removed the all style function arg formats 'l', 's', 'p' 2013-12-23 14:24:34 -08:00
Stanislav Malyshev 392f6830a1 Merge branch 'PHP-5.6'
* PHP-5.6:
  restore NEWS to the state of 6c5e93fe17
2013-12-23 14:10:44 -08:00
Anatol Belski 389b4d411e fix typo after merge 2013-12-23 20:31:40 +01:00
Dmitry Stogov 276b9767e4 Fixed bug #66338 (Optimization binding of class constants is not safely opcacheable) 2013-12-23 20:30:30 +01:00
Dmitry Stogov c699696c43 Fixed bug #66334 (Memory Leak in new pass1_5.c optimizations). (Terry) 2013-12-23 20:30:27 +01:00
krakjoe 8d64f0ee71 missing, apparently 2013-12-23 20:25:58 +01:00
Dmitry Stogov 67eccf8617 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #66338 (Optimization binding of class constants is not safely opcacheable)
2013-12-23 16:54:54 +04:00
Dmitry Stogov bd88bed670 Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  removed outdated IsDebuggerPresent declaration
2013-12-23 16:05:38 +04:00
Dmitry Stogov 209ec406ca Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #66334 (Memory Leak in new pass1_5.c optimizations). (Terry)
2013-12-23 16:05:18 +04:00
Anatol Belski ea7a70708f removed outdated IsDebuggerPresent declaration
This piece of code seems to retain compatibility with some windows
versions before 2000. Today it's not relevant anymore and only
produces a warning C4273 because of the conflicting prototype. In
VC9 the declaration is present in winbase.h:4142, but available
is it already in winxp. Here's the doc link
http://msdn.microsoft.com/en-us/library/windows/desktop/ms680345(v=vs.85).aspx
2013-12-23 12:34:30 +01:00
Dmitry Stogov 1c462a4e4d Added suggestion about opcache.revalidate_freq setting in development environment 2013-12-23 12:34:27 +01:00
Dmitry Stogov 9c5a902106 Fixed Issue #140: "opcache.enable_file_override" doesn't respect "opcache.revalidate_freq" 2013-12-23 12:34:26 +01:00
Sara Golemon 78f2ded86a Bump ZEND_MODULE_API_NO due to the TSRMLS change to zend_is_true() 2013-12-23 12:30:16 +01:00
krakjoe a2e77fb258 opcodes 2013-12-23 12:29:01 +01:00
krakjoe 07e97f919d missing, apparently 2013-12-23 12:28:59 +01:00
krakjoe f9affb5ae9 stop warnings from unused opcode map 2013-12-23 12:24:11 +01:00
Felipe Pena aaca4ede15 - Fixed bug #66311 (Stack smashing protection kills PDO/ODBC queries) patch by: michael at orlitzky dot com 2013-12-23 12:17:15 +01:00
Anatol Belski f4a96983e1 Merge branch 'PHP-5.6'
* PHP-5.6:
  removed outdated IsDebuggerPresent declaration
2013-12-23 12:01:26 +01:00
Dmitry Stogov 62fa84a031 Merge branch 'PHP-5.6'
* PHP-5.6:
  Added suggestion about opcache.revalidate_freq setting in development environment
2013-12-23 13:11:22 +04:00
Dmitry Stogov 5bc9e006e8 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed Issue #140: "opcache.enable_file_override" doesn't respect "opcache.revalidate_freq"
  fix news
  opcodes
  opcodes

Conflicts:
	NEWS
2013-12-23 12:52:27 +04:00
Sara Golemon 6a2a2b52f9 Bump ZEND_MODULE_API_NO due to the TSRMLS change to zend_is_true() 2013-12-22 14:10:59 -08:00
krakjoe befdd1770a fix news 2013-12-22 14:34:29 +00:00
krakjoe 523a6b50ae fix news file 2013-12-22 13:27:38 +00:00
krakjoe 8ce521a6a7 missing, apparently 2013-12-22 13:19:35 +00:00
krakjoe 621862a192 Merge branch 'PHP-5.6'
* PHP-5.6:
  stop warnings from unused opcode map
  - BFN

Conflicts:
	NEWS
	Zend/zend_vm_opcodes.h
2013-12-22 13:15:40 +00:00
Felipe Pena e700cbff22 Merge branch 'PHP-5.6'
* PHP-5.6:
  - Fixed bug #66311 (Stack smashing protection kills PDO/ODBC queries) patch by: michael at orlitzky dot com
2013-12-22 09:43:29 -02:00
Anatol Belski 85251eccaf Merge remote-tracking branch 'origin/master' into str_size_and_int64 2013-12-22 11:57:14 +01:00
Anatol Belski e11fbd979f next wave of revamp in Zend 2013-12-22 11:54:30 +01:00
Bob Weinand 2bf271bbb0 Merge branch 'PHP-5.6' 2013-12-22 01:08:47 +01:00
Bob Weinand 5b1f6caaf0 Merge branch 'PHP-5.6' 2013-12-22 00:57:31 +01:00
Anatol Belski 94fcc9e8c7 Merge branch 'master' into str_size_and_int64 2013-12-21 21:49:03 +01:00
Bob Weinand 0cc89be244 Merge branch 'PHP-5.6' 2013-12-21 21:33:15 +01:00
Anatol Belski b77d6bb2b4 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2013-12-21 20:46:42 +01:00
Bob Weinand e2b75e5bb7 Merge branch 'PHP-5.6' 2013-12-21 19:32:41 +01:00
Christopher Jones 1b1b706818 Merge branch 'PHP-5.6'
* PHP-5.6:
  Align 'configure --help' columns
  Added NEWS and UPGRADING info for phpdbg
2013-12-20 10:05:52 -08:00
Anatol Belski 3f2f1b2661 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2013-12-20 14:47:15 +01:00
Bob Weinand 3926362d30 Merge branch 'master' of https://git.php.net/push/php-src 2013-12-20 14:36:28 +01:00
Bob Weinand f500be8838 Merge branch 'PHP-5.6' 2013-12-20 14:35:40 +01:00
Anatol Belski b0a551ee14 final remove of the temporary int64/strlen configure options 2013-12-20 09:06:31 +01:00
Anatol Belski f2fc935502 next wave on semantical replacements long vs. int 2013-12-19 23:32:58 -08:00
Anatol Belski 98e273bb03 Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	ext/zip/php_zip.c
2013-12-19 22:18:18 +01:00
Boris Lytochkin ba51a375ae Merge branch '5.6'
* 5.6:
  Fixed SNMP_ERR_TOOBIG handling for bulk walk operations. (Boris Lytochkin)
2013-12-20 00:47:26 +04:00
Derick Rethans db025b3789 Merge branch 'PHP-5.6' 2013-12-19 19:01:08 +00:00
Derick Rethans e1a5edaac2 Merge branch 'PHP-5.5' 2013-12-19 18:58:48 +00:00
Anatol Belski 88456894b9 Merge branch 'str_size_and_int64' of https://git.php.net/push/php-src into str_size_and_int64 2013-12-19 08:44:56 -08:00
Anatol Belski 6125278290 more semantical replacements LONG vs. INT 2013-12-19 08:40:41 -08:00
Anatol Belski 6b8a78eb5f added comment 2013-12-19 14:28:00 +01:00
Anatol Belski f58d0b35ed massive update semantical LONG vs INT replacements 2013-12-19 05:07:37 -08:00
Remi Collet e75b967610 Merge branch 'PHP-5.6'
* PHP-5.6:
  NEWS
  save a few memory
  Fixed Bug #66321 (ZipArchive::open() ze_obj->filename_len not real)
2013-12-19 10:56:25 +01:00
Michael Wallner 551569262b Merge branch 'PHP-5.6'
* PHP-5.6:
  Update NEWS handling section of README.GIT-RULES
2013-12-19 10:10:09 +01:00
krakjoe ce4ba54583 test commit 2013-12-19 10:08:51 +01:00
Anatol Belski 5d263adf4c fixed duplicated include 2013-12-19 08:48:27 +01:00
Anatol Belski a16217d4a4 added file header 2013-12-19 08:43:11 +01:00
Anatol Belski a981798d8e add missing header 2013-12-18 15:31:06 -08:00
Anatol Belski cfb76d53f7 correct fix for ext/opcache regarding zend_size_t replacements 2013-12-18 15:29:04 -08:00
Anatol Belski e9224fc81b reverted the previous wrong patch 2013-12-18 15:28:23 -08:00
Anatol Belski 5f3e76dfe5 fixes ext/opcache after too much replacement 2013-12-18 15:21:34 -08:00
Anatol Belski ba5a1995bb Merge branch 'str_size_and_int64' of https://git.php.net/push/php-src into str_size_and_int64 2013-12-18 15:08:07 -08:00
Anatol Belski af362b20c6 zend_size_t for *.cpp files as well 2013-12-18 15:07:30 -08:00
Anatol Belski f62aa10f3e Merge branch 'str_size_and_int64' of git.php.net:php-src into str_size_and_int64 2013-12-19 00:03:49 +01:00
Anatol Belski 942f91ff0f fix zend_size_t type def 2013-12-19 00:03:12 +01:00
Anatol Belski 8709cc6d60 size_t part for *.l files 2013-12-18 14:56:40 -08:00
Anatol Belski 0b8f946ea5 size_t part for *.y files 2013-12-18 14:53:48 -08:00
Anatol Belski d5daea505f size_t part for win32/ 2013-12-18 14:50:32 -08:00
Anatol Belski b1abe4ca21 mass replacement for zend_size_t/php_size_t 2013-12-18 14:46:44 -08:00
Anatol Belski 6d938321ff prepare for zend_size_t 2013-12-18 14:22:47 -08:00
Anatol Belski df7db6519c Merge remote-tracking branch 'origin/master' into str_size_and_int64 2013-12-18 17:07:00 +01:00
Bob Weinand b11b3d201f Fixed ZTS build. Needed to bump API version number. 2013-12-18 16:44:20 +01:00
Dmitry Stogov 26096aa73f Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed reavlidate_path=1 behavior to avoid caching of symlinks values.
2013-12-18 19:22:05 +04:00
Anatol Belski 74aea4e471 fix after merge 2013-12-18 15:18:02 +01:00
Anatol Belski 8432557dcd Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	Zend/zend.c
	Zend/zend.h
	Zend/zend_execute.h
	Zend/zend_vm_execute.h
	main/SAPI.h
2013-12-18 15:07:42 +01:00
Felipe Pena a8a36b7d52 - Fixed build 2013-12-18 08:28:44 -02:00
Anatol Belski fcb28ea97f automated platform dependent zend_int_t declarations 2013-12-18 10:52:14 +01:00
Kalle Sommer Nielsen aed4b086ac Eliminate the TSRMLS_FETCH() calls in the ticks functions and hook 2013-12-18 09:32:26 +01:00
Kalle Sommer Nielsen c83598119b Kill a TSRMLS_FETCH() in php_stream_context_set() by passing TSRMLS_CC to it
# For mysqlnd: Relevant PHP_API_VERSION are put in place for cross version compatibility
2013-12-18 09:19:24 +01:00
Kalle Sommer Nielsen d02340bb39 Kill a TSRMLS_FETCH() call in sapi/caudium 2013-12-18 09:11:15 +01:00
Kalle Sommer Nielsen f883d3cc7a We might as well re-use the TSRMLS parameters here as they are available in PHP_FUNCTION anyway to save a TSRMLS_FETCH() call 2013-12-18 09:10:45 +01:00
Kalle Sommer Nielsen ed5a8d510f Pass the TSRMLS parameters to the sapi flush hook, this shaves off a few TSRMLS_FETCH() calls in our various SAPIs 2013-12-18 09:06:39 +01:00
Kalle Sommer Nielsen f70f89c1b1 Kill another TSRMLS_FECH() in sapi/roxen 2013-12-18 09:05:01 +01:00
Kalle Sommer Nielsen 520d969fea Fix these SAPI hooks so that the TSRMLS parameters are correctly passed as required by the sapi struct
# Not sure if this builds either
2013-12-18 09:01:44 +01:00
Kalle Sommer Nielsen 432e91f112 Bump year
# Wonder if this is even working anymore
2013-12-18 08:55:19 +01:00
Kalle Sommer Nielsen e6b471933c Kill yet another TSRMLS_FETCH() inside the CLI HTTP server 2013-12-18 08:17:49 +01:00
Kalle Sommer Nielsen bd58146ad6 Kill another TSRMLS_FETCH() in the zend extension loading code 2013-12-18 07:59:47 +01:00
Kalle Sommer Nielsen 2eb9bd316d Merge branch 'master' of https://git.php.net/push/php-src 2013-12-18 07:27:14 +01:00
Kalle Sommer Nielsen d14670ccdb Eliminate another TSRMLS_FETCH() in i_zend_is_true()
# Affected extensions have all been updated, ext/opcache and ext/zip
# both have macros for cross version compatibility
2013-12-18 07:25:05 +01:00
Anatol Belski 9576330979 updated libmagic.patch 2013-12-17 13:30:17 -08:00
Anatol Belski 4cdcbeec76 basic fixes to ext/interbase 2013-12-17 11:17:12 +01:00
Anatol Belski 8aa7f84dd2 basic fixes to ext/sybase_ct 2013-12-17 10:58:13 +01:00
Anatol Belski 83edc59d13 fix datatype to hold read bytes 2013-12-17 10:20:34 +01:00
Anatol Belski dc45cfe401 fix function signature 2013-12-17 10:17:14 +01:00
Anatol Belski b90cc170b6 revamp ext/pdo_firebird 2013-12-17 10:14:55 +01:00
Anatol Belski 1337ba8a62 fixed conflicting function signatures in ext/com_dotnet 2013-12-17 10:06:11 +01:00
Anatol Belski 170c4d1fe6 Z_STRLEN vs Z_STRSIZE 2013-12-17 09:26:07 +01:00
Anatol Belski 167fdaa0e7 regenerated zend_vm_execute.h after merge 2013-12-17 09:05:29 +01:00
Anatol Belski 3e90132341 Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	Zend/zend_compile.c
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
	ext/opcache/Optimizer/pass1_5.c
	ext/pdo_odbc/odbc_stmt.c
2013-12-17 09:01:11 +01:00
Anatol Belski c0f1e6946d Merge branch 'PHP-5.6'
* PHP-5.6:
  fixed possibly uninitialized value usage
2013-12-17 08:45:49 +01:00
Xinchen Hui 72389dd53f Merge branch 'PHP-5.6' 2013-12-17 15:37:26 +08:00
Xinchen Hui a9c503bc27 Merge branch 'PHP-5.6' 2013-12-17 15:10:56 +08:00
Xinchen Hui ac719610f4 Merge branch 'PHP-5.6' 2013-12-17 15:06:36 +08:00
Stanislav Malyshev 5613d70ee8 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix bug #65873 - Integer overflow in exif_read_data()
2013-12-16 11:38:00 -08:00
David Soria Parra d7d0ceb90d Merge branch 'PHP-5.6' 2013-12-16 10:28:11 -08:00
Anatol Belski a56274b3f1 Merge branch 'str_size_and_int64' of git.php.net:php-src into str_size_and_int64 2013-12-16 17:31:13 +01:00
Anatol Belski 68d3353e5c basic fixes to ext/mssql 2013-12-16 17:26:32 +01:00
Anatol Belski 409498f03c fixed conflicting types in func definition 2013-12-16 08:13:35 -08:00
Anatol Belski d51ff1322d revamp ext/opcache 2013-12-16 12:56:32 +01:00
Dmitry Stogov 82d67af60d Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  Fix tests expecting specific resource IDs
  fixed parameter order for zend_throw_exception_ex call
  Fix doc (svn -> git)
  Fix tests expecting specific resource IDs
  Test pushing
  Updated release process
2013-12-16 13:12:55 +04:00
Anatol Belski ca25f3d829 revamp ext/phar 2013-12-15 13:58:39 +01:00
Anatol Belski 34848ccae7 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2013-12-15 12:08:39 +01:00
Xinchen Hui 48dcc43488 Merge branch 'PHP-5.6' 2013-12-15 16:51:43 +08:00
Xinchen Hui 304d97933f Merge branch 'issue-phpt-resourceid-wincache' of https://github.com/EricSten/php-src 2013-12-15 16:26:11 +08:00
Anatol Belski 897d11658a fixed parameter order for zend_throw_exception_ex call 2013-12-14 20:55:32 +01:00
DQNEO 964141f781 Fix doc (svn -> git) 2013-12-14 20:55:31 +01:00
Anatol Belski fc4761a07c Merge branch 'PHP-5.6'
* PHP-5.6:
  fixed parameter order for zend_throw_exception_ex call
  Fix doc (svn -> git)
  Test pushing
2013-12-14 20:48:44 +01:00
Anatol Belski 2cfb1c5bb9 basic fixes to ext/pdo_oci 2013-12-14 11:49:42 +01:00
Anatol Belski e0c5db0970 basic fixes to ext/oci8 2013-12-14 11:39:47 +01:00
Anatol Belski 4c68e81018 fixed sapi/embed 2013-12-14 00:26:56 +01:00
Anatol Belski 009528ba43 revamp sapi/cgi 2013-12-13 22:24:23 +01:00
Anatol Belski 7266938012 use php_socket_t where possible in ext/cli 2013-12-13 22:16:12 +01:00
Eric Stenson 50377b5bf2 Fix tests expecting specific resource IDs
When Wincache or APC are installed, the resource IDs are not the same.
This is because Wincache takes a few resource objects for itself.  As a
result, these tests become false positives.

On Windows boxes, the microtime precision is not granular enough
to reliably register a difference if two calls to uniqid() are made
concurrently.  This is a fix to the uniqid() test to avoid the false
positive when run on Windows machines.  Also, added a test to exercise
the 'more_entropy' variant of uniqid().
2013-12-13 10:42:32 -08:00
Anatol Belski 389188df7f Merge remote-tracking branch 'origin/master' into str_size_and_int64 2013-12-13 17:54:17 +01:00
Anatol Belski 3c494e25e3 Merge branch 'str_size_and_int64' of git.php.net:php-src into str_size_and_int64 2013-12-13 17:49:16 +01:00
Anatol Belski f4d27d83ac basic fixes to ext/imap 2013-12-13 17:47:23 +01:00
Anatol Belski bb5f5e1671 fix function signature 2013-12-13 07:19:16 -08:00
Anatol Belski 4973f3a312 fixed ext/pdo_dblib 2013-12-13 07:19:16 -08:00
Anatol Belski 37594963b3 Merge branch 'str_size_and_int64' of git.php.net:php-src into str_size_and_int64 2013-12-13 15:36:36 +01:00
Anatol Belski 4651c74405 fixed ext/skeleton 2013-12-13 15:35:37 +01:00
Anatol Belski d2ed9b3d30 fixed ext/sysvsem and ext/sysvshm 2013-12-13 06:32:08 -08:00
Anatol Belski 79c06bb896 fixed ext/sysvmsg 2013-12-13 06:15:47 -08:00
Anatol Belski e64e7e6ffc fixed ext/recode 2013-12-13 06:02:59 -08:00
Anatol Belski 872734be58 fix datatype 2013-12-13 05:58:12 -08:00
Anatol Belski 1040cdf8fc fixed ext/readline 2013-12-13 05:51:49 -08:00
Julien Pauli 735f930bac Merge branch 'PHP-5.6'
* PHP-5.6:
  Updated release process
2013-12-13 13:30:30 +01:00
Anatol Belski 985d8f0436 Merge branch 'str_size_and_int64' of https://git.php.net/push/php-src into str_size_and_int64 2013-12-13 04:10:45 -08:00
Anatol Belski 512cbad00c basic fixes to ext/pspell 2013-12-13 04:10:17 -08:00
Anatol Belski 316fd8aab6 Merge branch 'str_size_and_int64' of git.php.net:php-src into str_size_and_int64 2013-12-13 12:28:18 +01:00
Anatol Belski 931071aa97 fixed function signature 2013-12-13 12:27:58 +01:00
Anatol Belski d87dc25b71 fixed ext/pcntl 2013-12-13 03:26:29 -08:00
Anatol Belski 3a8ee7800c fixed ext/posix 2013-12-13 03:26:04 -08:00
Anatol Belski 73a7351a2c fixed ext/dba 2013-12-13 02:55:38 -08:00
Anatol Belski 936124742b fixed function signature 2013-12-13 11:09:30 +01:00
Anatol Belski 1007374254 Merge branch 'str_size_and_int64' of git.php.net:php-src into str_size_and_int64 2013-12-13 11:03:14 +01:00
Anatol Belski f806f4d060 Merge branch 'master' into str_size_and_int64 2013-12-13 10:45:27 +01:00
Dmitry Stogov 9b829c92b5 Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  Use zend_error_noreturn here
  OCI8 build change: Fix source variable definition for C89 compatibility
  Kill another TSRMLS_FETCH() in zend_indent()
  Eliminate another straight forward TSRMLS_FETCH() in zend_startup_module()
  Fix build
  Add Tests for #65784 in 5.5
  Disallowed JMP into a finally block.
  Update NEWS for 5.5.7 release
  Fixed bug #65784 (Segfault with finally).
2013-12-13 11:15:38 +04:00
Xinchen Hui 914de05bf5 Merge branch 'PHP-5.6' 2013-12-13 11:37:53 +08:00
Christopher Jones e92ea13bff Merge branch 'PHP-5.6'
* PHP-5.6:
  OCI8 build change: Fix source variable definition for C89 compatibility
2013-12-12 15:23:23 -08:00
Kalle Sommer Nielsen 1433dec2d0 Kill another TSRMLS_FETCH() in zend_indent() 2013-12-12 22:09:38 +01:00
Kalle Sommer Nielsen 0fc8e6af0a Eliminate another straight forward TSRMLS_FETCH() in zend_startup_module()
# For THTTPD:
# The code that uses a call to this function is for older versions of PHP anyway so its not covered

# For Zend OpCache:
# Added a new define for 5.6 and wrapped the code around that so its still compatible with older version
2013-12-12 20:30:45 +01:00
Kalle Sommer Nielsen 4411641b1e Fix build 2013-12-12 20:25:10 +01:00
Xinchen Hui 8708b13d62 Merge remote-tracking branch 'origin/PHP-5.6' 2013-12-13 01:50:22 +08:00
Xinchen Hui 6a299514f8 Merge branch 'PHP-5.6'
Conflicts:
	NEWS
2013-12-13 00:54:36 +08:00
Xinchen Hui 0fbb421ec1 Merge branch 'PHP-5.6' 2013-12-13 00:15:11 +08:00
Dmitry Stogov fd4a7388d7 Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  fix test
2013-12-12 16:46:15 +04:00
Michael Wallner c0e87e9bb1 Merge branch 'PHP-5.5'
* PHP-5.5:
  fix test
2013-12-12 12:10:08 +01:00
Anatol Belski bdc565e67a revamp ext/dom 2013-12-12 11:50:45 +01:00
Dmitry Stogov 9d08f09e06 Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  remove always_populate_raw_post_data INI entries from master, UPGRADING.INTERNALS coming shortly
2013-12-12 14:42:19 +04:00
Michael Wallner bc1c2b3b31 remove always_populate_raw_post_data INI entries from master, UPGRADING.INTERNALS coming shortly 2013-12-12 11:33:06 +01:00
Dmitry Stogov a23bcba875 Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  Fixed bug #65486 mysqli_poll() is broken on Win x64
2013-12-12 13:59:37 +04:00
Dmitry Stogov 8738e6d86f Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed tests
  Fixed ext/soap/tests/bugs/bug54911.phpt
2013-12-12 13:55:42 +04:00
Anatol Belski e0c7899ddd Merge branch 'master' into str_size_and_int64 2013-12-12 10:52:52 +01:00
Anatol Belski 58b754ca4a Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #65486 mysqli_poll() is broken on Win x64
2013-12-12 10:46:36 +01:00
Anatol Belski fa2a2c88fd revamp ext/pdo_mysql 2013-12-11 23:39:43 +01:00
Anatol Belski 6d5c56367d revamp ext/pdo 2013-12-11 23:39:18 +01:00
Anatol Belski a1803faea2 revamp ext/pgsql 2013-12-11 20:04:04 +01:00
Anatol Belski adb70b9923 Merge branch 'master' into str_size_and_int64 2013-12-11 19:29:21 +01:00
Anatol Belski 05fe153f49 revamp ext/soap 2013-12-11 19:23:17 +01:00
Bob Weinand 98d929290c Merge branch 'PHP-5.6'
* PHP-5.6:
  Added one more test for constant scalar expressions
2013-12-11 19:20:10 +01:00
Anatol Belski fa1802381f Merge branch 'PHP-5.6'
* PHP-5.6:
  added missing prototype
2013-12-11 14:16:22 +01:00
Anatol Belski 2301e190e7 Merge branch 'master' into str_size_and_int64 2013-12-11 13:48:38 +01:00
Anatol Belski 2f707bf246 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix dir separator in cve-2013-6420 test
2013-12-11 13:33:59 +01:00
Anatol Belski d3f9debcae Merge branch 'master' into str_size_and_int64 2013-12-11 12:44:05 +01:00
Anatol Belski 4670d46a42 additional range checks for ext/sockets 2013-12-11 12:41:12 +01:00
Ard Biesheuvel 9a5944d960 Merge branch 'PHP-5.6' 2013-12-11 08:51:27 +01:00
Stanislav Malyshev 35b8f57906 Merge branch 'PHP-5.6'
* PHP-5.6:
  5.3.29-dev
  Fix CVE-2013-6420 - memory corruption in openssl_x509_parse
2013-12-10 11:36:33 -08:00
Anatol Belski 19161b8d4e fix function params 2013-12-10 20:00:59 +01:00
Anatol Belski 27990438f1 Merge branch 'master' into str_size_and_int64
Conflicts:
	Zend/zend_builtin_functions.c
	ext/opcache/Optimizer/pass1_5.c
	ext/reflection/php_reflection.c
	ext/soap/soap.c
2013-12-10 19:46:40 +01:00
Remi Collet 8e29235b6c Merge branch 'PHP-5.6'
* PHP-5.6:
  NEWS
  Fixed Bug #66218 zend_register_functions breaks reflection
2013-12-10 16:10:48 +01:00
Anatol Belski 34e5236836 more range checks for ext/sqlite3 2013-12-10 15:40:19 +01:00
Dmitry Stogov ad4f0c7812 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #66112 (Use after free condition in SOAP extension). (martin dot koegler at brz dot gv dot at)
2013-12-10 17:59:20 +04:00
Anatol Belski 77d4db3957 fixed return 2013-12-10 14:15:29 +01:00
Dmitry Stogov d439b3970a Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #66251 (Constants get statically bound at compile time when Optimized)
2013-12-10 17:05:23 +04:00
Anatol Belski a697297f5f more range checks for ext/tidy 2013-12-10 13:41:49 +01:00
Dmitry Stogov 90c5689b59 Merge branch 'PHP-5.6'
* PHP-5.6:
  Revered func_get_args() changes, because they were not completly transparent and broke some tricky PHP code that worked because of luck before php-5.5.6 (see Bug #66107). The changes are going to be kept in PHP-5.6.
2013-12-10 16:08:56 +04:00
Dmitry Stogov 6eaf57eb3c Merge branch 'PHP-5.6'
* PHP-5.6:
2013-12-10 16:07:53 +04:00
Dmitry Stogov 1dafdaa31b Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  Zend: fix overflow handling bug in non-x86 fast_add_function()
2013-12-10 15:15:46 +04:00
Dmitry Stogov 78265a44c5 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed memory leaks introdused by: 	commit 611da37617 	Author: Igor Wiedler <igor@wiedler.ch> 	Date:   Sat Nov 9 13:48:23 2013 -0500
2013-12-10 15:15:11 +04:00
Ard Biesheuvel c786c30108 Merge branch 'PHP-5.6' 2013-12-10 12:12:44 +01:00
Anatol Belski 5acc0c0c5b revamp ext/xmlreader 2013-12-10 11:42:56 +01:00
Dmitry Stogov b260cb92e4 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #66252 (Problems in AST evaluation invalidating valid parent:: reference. Constant expessions have to be evaluated in context of defining class).
2013-12-10 14:21:38 +04:00
Anatol Belski da62a38244 revamp ext/xsl 2013-12-10 10:15:47 +01:00
Dmitry Stogov 6b6a4e466a Merge branch 'PHP-5.6'
* PHP-5.6:
  Arguments passed to user function have to be properly allocated on heap
2013-12-10 13:03:24 +04:00
Anatol Belski f195339006 revamp range checks in ext/xml 2013-12-10 09:34:45 +01:00
Ard Biesheuvel 21fd125343 Merge branch 'PHP-5.6' 2013-12-09 17:04:05 +01:00
Anatol Belski f7f8c590a5 Merge remote-tracking branch 'bukka/str_size_and_int64_openssl' into str_size_and_int64 2013-12-09 11:30:07 +01:00
Anatol Belski 757c93dd85 Z_STRLEN vs Z_STRSIZE after automerge 2013-12-09 11:18:40 +01:00
Anatol Belski 325224832b Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	Zend/zend_compile.c
	Zend/zend_compile.h
2013-12-09 10:20:04 +01:00
Stanislav Malyshev 912be12432 Merge branch 'PHP-5.6'
* PHP-5.6:
  Replace invalid code with a proper #error
2013-12-08 16:26:34 -08:00
Jakub Zelenka d3acd878d0 Merge branch 'str_size_and_int64' into str_size_and_int64_openssl 2013-12-08 16:21:40 +00:00
Jakub Zelenka f9816d6729 Remove explicit casts to and from 64bit types 2013-12-08 16:17:55 +00:00
Adam Harvey b97156113e Merge branch 'PHP-5.6'
* PHP-5.6:
  Switch to using freetype-config for freetype detection.
2013-12-07 19:42:00 -08:00
Anatol Belski 31a4d08d37 fix repeated compiler warnings 2013-12-07 08:57:02 +01:00
Anatol Belski 20217b04b4 added macros for integer constants to append appropriate suffix 2013-12-07 08:55:31 +01:00
Anatol Belski 3982b3eccf recap fixes for ext/standard 2013-12-07 00:53:14 +01:00
Anatol Belski 0494cf46cf fixes to rand 2013-12-06 22:12:28 +01:00
Anatol Belski 8b7a8aff13 Merge branch 'str_size_and_int64' of git.php.net:php-src into str_size_and_int64 2013-12-06 11:43:45 +01:00
Anatol Belski 9510451fb1 remaining fixes to ext/zlib
datatypes for globals
%pd format
2013-12-06 11:42:30 +01:00
Ferenc Kovacs e3ebe995c9 Merge branch 'PHP-5.6' 2013-12-06 11:07:36 +01:00
Michael Wallner d81d61fcc4 Merge branch 'PHP-5.6'
* PHP-5.6:
  BFN
2013-12-06 10:39:18 +01:00
Michael Wallner 01a13bb8c1 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #61645 (fopen and O_NONBLOCK)
  fix possibly uninitialized value
  Use 'user@example.com' rather than 'user@company.com' in tests
2013-12-06 10:34:11 +01:00
Anatol Belski 7fdf6b51d2 Merge branch 'master' into str_size_and_int64 2013-12-06 09:55:50 +01:00
Anatol Belski c253fbda9a fix conflicting types 2013-12-05 16:13:30 -08:00
Anatol Belski adb1e38468 integrated %pd into more ported extensions 2013-12-05 14:35:06 +01:00
Anatol Belski e881537089 integrated %pd into ext/spl 2013-12-05 13:28:22 +01:00
Anatol Belski 122805100a removed warnings in newly implemented pcre range cehcks 2013-12-05 12:38:11 +01:00
Anatol Belski 4d703a4225 added range check for pcre ini entries 2013-12-05 12:08:19 +01:00
Anatol Belski a0622d7c68 implemented %pd format for snprintf and spprintf
php_int_t var = 42;
php_printf("%pd", var);
2013-12-05 12:05:46 +01:00
Anatol Belski 42b1222754 Merge branch 'master' into str_size_and_int64 2013-12-05 08:37:37 +01:00
Adam Harvey de3b9bc77c Renumber the comments in php_request_shutdown() to be in order.
What, me OCD?
2013-12-04 14:29:45 -08:00
Jakub Zelenka fbfae33e39 Add missing overflow checks 2013-12-04 19:01:39 +00:00
Andrey Hristov 0cb38a3d26 Merge branch 'master' of git.php.net:php-src
Conflicts:
	NEWS
2013-12-04 18:32:32 +02:00
Sara Golemon 9adfcea241 Use 'user@example.com' rather than 'user@company.com' in tests
Using some arbitrary 3rd party's domain name is clowny,
even if it never tries to send.
2013-12-04 07:51:43 -08:00
Michael Wallner ecf95a4cc5 BFN 2013-12-05 11:30:52 +01:00
Michael Wallner 44ff944b37 Merge branch 'dba'
* dba:
  fix bug #62490
  more test fixes
  fix test
  fix php_stream_copy_to_stream_ex usage
  add missing clean section
  remove test for already removed feature
2013-12-05 11:27:26 +01:00
Michael Wallner 5a420c8680 fix bug #62490
inifiles delete handler did not return false if the key was not found
2013-12-05 11:04:25 +01:00
Andrey Hristov 406d5a5ecc Merge branch 'PHP-5.6'
Conflicts:
	NEWS
	UPGRADING
2013-12-04 16:20:03 +02:00
Anatol Belski 7228ac190a fixed ext/bcmath 2013-12-04 15:06:32 +01:00
Anatol Belski 3142989a14 finer fixes for ext/opcache 2013-12-04 14:07:27 +01:00
Anatol Belski 3930766e79 basic fixes to ext/opcache 2013-12-04 12:04:07 +01:00
Anatol Belski 55023a87b0 Merge branch 'master' into str_size_and_int64 2013-12-04 09:10:43 +01:00
Sara Golemon e51ddf9dc8 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix php_module_startup() when loading more than one additional module
2013-12-03 18:21:40 -08:00
Adam Harvey 8f11f7f179 Merge branch 'PHP-5.6'
* PHP-5.6:
  Remove 128.0.0.0/16 and 191.255.0.0/16 from the reserved list.
2013-12-03 14:54:24 -08:00
Anatol Belski 72e7a63485 basic fixes for ext/ldap 2013-12-03 22:43:37 +01:00
Anatol Belski c14d14e0d6 fix uninitialized variable 2013-12-03 22:03:11 +01:00
Anatol Belski fbb87ace85 basic fixes to ext/snmp 2013-12-03 21:31:55 +01:00
Anatol Belski fd6e5766ce basic fixes for ext/pdo_pgsql 2013-12-03 18:21:06 +01:00
Michael Wallner f0c85fab45 more test fixes 2013-12-03 18:18:40 +01:00
Michael Wallner b0415856fd fix test 2013-12-03 17:55:26 +01:00
Michael Wallner 9e309a2d10 fix php_stream_copy_to_stream_ex usage 2013-12-03 17:55:18 +01:00
Michael Wallner a7f0465c0b add missing clean section 2013-12-03 17:07:40 +01:00
Michael Wallner f4912e3a96 remove test for already removed feature 2013-12-03 16:57:35 +01:00
Anatol Belski 8e11fa2251 basic fixes to ext/odbc 2013-12-03 16:54:15 +01:00
Anatol Belski 727d14b8dd basic fixes to ext/ftp 2013-12-03 12:09:12 +01:00
Anatol Belski b13e715581 basic fixes to ext/pdo_mysql 2013-12-03 11:44:18 +01:00
Anatol Belski 0ee45382cd basic fixes to ext/pdo_firebird 2013-12-03 11:18:12 +01:00
Anatol Belski 71be6bc5ec more fixes to ext/pdo and ext/pdo_pgsql 2013-12-03 10:52:55 +01:00
Sebastian Bergmann d1baf6c9d7 Leftover: Bump version to 5.7.0 2013-12-03 10:19:11 +01:00
Nikita Popov b3265e2108 Support gmp_remroot() on GMP 4.1 2013-12-03 10:19:10 +01:00
Anatol Belski e23b051be0 basic fixes to ext/pdo_pgsql 2013-12-03 09:53:22 +01:00
Anatol Belski 7193efebed basic fixes to ext/pdo_sqlite 2013-12-03 09:51:01 +01:00
Anatol Belski da7d62ea8a basic fixes for ext/pdo 2013-12-03 09:24:45 +01:00
Sebastian Bergmann 48cc47d55a Leftover: Bump version to 5.7.0 2013-12-03 07:42:37 +01:00
Anatol Belski 2fc14d515e some more fixes to ext/pgsql 2013-12-03 01:33:43 +01:00
Anatol Belski f7df15ea53 basic fixes for ext/pgsql 2013-12-02 21:10:33 +01:00
Jakub Zelenka 8710929b78 Fix typo 2013-12-02 19:54:25 +00:00
Jakub Zelenka 1488acb304 Add digest data_len overflow checks and few other fixes 2013-12-02 19:50:23 +00:00
Nikita Popov a87233f98a Merge branch 'PHP-5.6' 2013-12-02 20:11:34 +01:00
Anatol Belski ce6945eb55 basic fixes to ext/shmop 2013-12-02 18:18:24 +01:00
Anatol Belski a68477f758 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2013-12-02 17:48:31 +01:00
Michael Wallner c23a1f78b4 Merge branch 'PHP-5.6'
* PHP-5.6:
  BFN
  Fix bug #65196
2013-12-02 17:03:30 +01:00
Michael Wallner 7cd702640d Fix Bug #64776 The XSLT extension is not thread safe. 2013-12-02 15:01:24 +01:00
Michael Wallner df484b0008 Merge branch 'PHP-5.6'
* PHP-5.6:
  BFN
  fix bug #49634x
2013-12-02 12:19:03 +01:00
Dmitry Stogov f8148a3905 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed tests
2013-12-02 12:05:49 +04:00
Dmitry Stogov 86c806a36e Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed ability to build non-specialized GOTO VM
2013-12-02 11:03:57 +04:00
Anatol Belski d7827068e8 fix the length var datatype 2013-12-01 23:17:47 +01:00
Anatol Belski 8f91e77245 Merge branch 'master' into str_size_and_int64 2013-12-01 23:10:01 +01:00
Jakub Zelenka 7e85b12b53 Merge branch 'str_size_and_int64' into str_size_and_int64_openssl
Conflicts:
	ext/openssl/openssl.c
2013-12-01 20:04:58 +00:00
Jakub Zelenka b34ce97417 add some overflow checks and use correct msg formatting in openssl 2013-12-01 19:53:45 +00:00
Nikita Popov 1acee05579 Merge branch 'PHP-5.6' 2013-12-01 13:48:09 +01:00
Anatol Belski 6b9396bd8e Merge branch 'master' into str_size_and_int64
Conflicts:
	ext/date/php_date.c
2013-12-01 12:31:48 +01:00
Anatol Belski 66a42402d9 more fixes for ext/mysql 2013-12-01 12:22:52 +01:00
Anatol Belski ae2103ba40 basic fixes for ext/mysql 2013-12-01 09:45:26 +01:00
Anatol Belski eb922c6c9c more fixes for ext/mysqli 2013-11-30 21:51:21 +01:00
Anatol Belski d76d415f55 fix mysqlnd for bigint 2013-11-30 21:49:41 +01:00
Anatol Belski f3703d86f7 started to fix ext/mysqli 2013-11-30 15:58:57 +01:00
Anatol Belski ef216c21fd started to fix ext/mysqlnd 2013-11-30 14:59:18 +01:00
Felipe Pena cb9000f15e Merge branch 'master' of git.php.net:/php-src 2013-11-30 11:41:23 -02:00
Felipe Pena 52611a2c7e Merge branch 'PHP-5.6'
* PHP-5.6:
  - Fixed bug #65923 (ext/socket assumes AI_V4MAPPED is defined)
2013-11-30 11:41:01 -02:00
Nikita Popov 508738251f Merge branch 'PHP-5.6' 2013-11-30 13:41:22 +01:00
Anatol Belski 004d4630b4 basic fixes to ext/sqlite3 2013-11-30 12:39:09 +01:00
Nikita Popov 2e0a960e97 Merge branch 'PHP-5.6' 2013-11-29 23:59:21 +01:00
Nikita Popov 065c8e77e2 Merge branch 'PHP-5.6' 2013-11-29 23:32:14 +01:00
Anatol Belski 628135641d basic fixes ext/xmlrpc 2013-11-29 23:06:40 +01:00
Anatol Belski 22779fa66b fixed ext/tokenizer 2013-11-29 22:54:58 +01:00
Anatol Belski 9c16a4b96d fixed ext/tidy 2013-11-29 22:48:55 +01:00
Anatol Belski f119cd8f2d basic fixes to ext/sockets 2013-11-29 21:02:36 +01:00
Anatol Belski e094c64b67 finer fixes to ext/soap 2013-11-29 20:26:07 +01:00
Anatol Belski 9a834807bc fixed compilation after merging master 2013-11-29 17:12:35 +01:00
Anatol Belski d8fa7f4990 Merge branch 'str_size_and_int64' of git.php.net:php-src into str_size_and_int64 2013-11-29 17:00:24 +01:00
Anatol Belski 40f9958c08 Merge branch 'master' into str_size_and_int64
Conflicts:
	Zend/zend_hash.c
	ext/gmp/gmp.c
	ext/pcre/php_pcre.c
2013-11-29 17:00:11 +01:00
Anatol Belski 132bd2130d basic fix for ext/soap 2013-11-29 16:55:00 +01:00
Anatol Belski eabdd0e4a5 fixed ext/mcrypt 2013-11-29 16:12:36 +01:00
Anatol Belski 23019318b1 finer fixes for ext/json 2013-11-29 13:00:29 +01:00
Anatol Belski 3ffecac916 basic fixes for ext/json 2013-11-29 11:47:48 +01:00
Anatol Belski e6bf5ffeba fixed ext/gmp 2013-11-29 10:19:40 +01:00
Dmitry Stogov f65e652f9f Merge branch 'PHP-5.6'
* PHP-5.6:
  Added validation of class names in the autoload process
2013-11-29 12:55:38 +04:00
Anatol Belski 9f9e691c28 fixed ext/gettext 2013-11-29 09:47:00 +01:00
Anatol Belski 3659dcd98c further fixes for ext/gd 2013-11-29 09:18:13 +01:00
Anatol Belski 51d78c2533 basic fixes for ext/gd 2013-11-29 08:53:32 +01:00
Nikita Popov 0eb519de66 Merge branch 'PHP-5.6' 2013-11-29 00:10:13 +01:00
Anatol Belski 57db68e03d fixed ext/fileinfo
XXX update libmagic.patch
2013-11-28 23:44:24 +01:00
Dmitry Stogov f92eba241e Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  Fixed bug #65199 (Wrong Day of Week) and fixed bug #63391 (Incorrect/inconsistent day of week prior to the year 1600)
  Marking those two as XFAIL for now.
  Fixed a few DST changeover issues.
  Move add/sub to timelib.
  Fix backwards transition diffs.
  Split up tests into their different categories.
  Group those tests a bit better, as some of the bd ones wanted a "ST" feature that doesn't exist yet.
  Fixed forward transitions in diffs.
  Always reset those parameters.
  Fixed "Forward Transition" construction of DateTime objects.
2013-11-29 00:59:47 +04:00
Dmitry Stogov 77cdda452d Merge branch 'PHP-5.6'
* PHP-5.6:
  Avoid interned hash key duplication and hash key length recaclulation
2013-11-29 00:59:26 +04:00
Anatol Belski ef54a95b71 fixed ext/wddx 2013-11-28 20:00:27 +01:00
Anatol Belski 262fca3a39 fixed ext/xml 2013-11-28 19:46:08 +01:00
Anatol Belski d9a036cc30 fixed ext/xsl 2013-11-28 19:18:38 +01:00
Anatol Belski 9e5c10e487 fixed ext/zip 2013-11-28 19:02:34 +01:00
Anatol Belski d8fbc23002 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2013-11-28 17:44:47 +01:00
Anatol Belski 91e6fb75d5 fix after automerge 2013-11-28 17:44:05 +01:00
Derick Rethans 38574614c5 Merge branch 'PHP-5.6' 2013-11-28 16:33:23 +00:00
Anatol Belski 5ced3db971 Merge branch 'master' into str_size_and_int64
Conflicts:
	Zend/zend.h
	Zend/zend_hash.c
	Zend/zend_hash.h
	Zend/zend_language_parser.y
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
2013-11-28 17:27:59 +01:00
Anatol Belski a7862de2db fixed ext/filter 2013-11-28 17:16:25 +01:00
Derick Rethans 0d65cd50dd Merge branch 'master' of git.php.net:php-src 2013-11-28 14:45:56 +00:00
Derick Rethans b6ef87f803 Merge branch 'PHP-5.6' 2013-11-28 14:45:38 +00:00
Dmitry Stogov a1193b23b6 Merge branch 'PHP-5.6'
* PHP-5.6:
  Removed unused "pHashFunction" argument in _zend_hash_init() and family (must be 99% source compatible)
2013-11-28 18:42:57 +04:00
Anatol Belski fd7d31973a basic fixes for ext/exif 2013-11-28 14:36:20 +01:00
Dmitry Stogov 609efa2623 Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  Updated NEWS for Constant Scalar Exprs RFC
  Moved arrays again to "static_scalar:" & little cleanup
  Renaming
  Constant expressions refactoring
  Removed operations on constant arrays. They make no sense as constants are not allowed to be arrays. And as just properties are allowed to; no problem, we still don't need operations on any constant array.
  Added a few more operators
  Whitespace fix
  converted several switches to ifs and made more opcache friendly
  Fatal error about self referencing constants fixed
  Fixed mem leaks, added tests and ternary operator
  Working commit for constant scalar expressions (with constants). Tests will follow.
2013-11-28 17:03:59 +04:00
Dmitry Stogov 7fa9032d0b Merge branch 'PHP-5.6'
* PHP-5.6:
  Some rare deprecated cases replaced by ZEND_ASSERT() (some extensions might need to be fixed)
  Removed duplicated hash function implementation (100% source compatible)
2013-11-28 17:03:28 +04:00
Anatol Belski 4e2ddbc397 fixed ext/enchant 2013-11-28 13:59:55 +01:00
Bob Weinand be5b98ef0d Merge branch 'PHP-5.6' 2013-11-28 13:53:00 +01:00
Anatol Belski 1e2cc15845 fixed ext/curl 2013-11-28 13:45:09 +01:00
Anatol Belski 46448539b0 fixed ext/ctype 2013-11-28 09:53:00 +01:00
Anatol Belski 3f7522a652 Merge branch 'master' into str_size_and_int64 2013-11-28 09:29:12 +01:00
Anatol Belski de453dbef6 reverted a couple of things in ext/phar for now, but all tests pass now 2013-11-28 09:23:02 +01:00
Dmitry Stogov 98f3c410d9 Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  Fixed bug #53879 (DateTime::createFromFormat() fails to parse cookie expiration date)
2013-11-28 11:46:11 +04:00
Dmitry Stogov fe451e9a72 Merge branch 'PHP-5.6'
* PHP-5.6:
  Don't check argument types for internal functions without type hinting
2013-11-28 11:45:47 +04:00
Anatol Belski d135198559 next portion of fixes for ext/phar 2013-11-27 23:35:42 +01:00
Anatol Belski 2c3cc2e107 fixed the rdev stat array member again for streams 2013-11-27 23:34:27 +01:00
Derick Rethans e7a6d0b163 Merge branch 'PHP-5.6' 2013-11-27 22:01:16 +00:00
Anatol Belski ef52220617 basic fixes for ext/phar 2013-11-27 20:08:34 +01:00
Dmitry Stogov 45d399b96e Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed tests
2013-11-27 21:04:23 +04:00
Dmitry Stogov fca64efd62 Merge branch 'PHP-5.6'
* PHP-5.6:
  Removed deprecated AI_SET_PTR()s
2013-11-27 20:32:21 +04:00
Anatol Belski 0fd48b2f48 final ext/session fixes 2013-11-27 15:33:40 +01:00
Anatol Belski bec270ffc8 fix function definition 2013-11-27 04:58:57 -08:00
Anatol Belski b9c19f5d74 first shot for ext/calendar
At the first glance the extension could be fixed for bigger timestamps,
but that's not the goal right now. One test fail yet on win 64
2013-11-27 13:35:26 +01:00
Dmitry Stogov bc68ab8b57 Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  NEWS
  Fixed bug #66060 (Heap buffer over-read in DateInterval)
2013-11-27 14:58:08 +04:00
Dmitry Stogov a3cb536d24 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #65969 (Chain assignment with T_LIST failure)
2013-11-27 14:56:48 +04:00
Remi Collet 42a35c9b8b Merge branch 'PHP-5.6'
* PHP-5.6:
  NEWS
  Fixed bug #66060 (Heap buffer over-read in DateInterval)
2013-11-27 11:16:18 +01:00
Anatol Belski 8115844674 basic fixes to ext/hash 2013-11-27 10:33:08 +01:00
Julien Pauli e9f2de918d Merge branch 'PHP-5.6'
* PHP-5.6:
  5.5.8-dev now
2013-11-27 10:33:05 +01:00
Stanislav Malyshev 3baad45b21 Merge branch 'PHP-5.6'
* PHP-5.6:
2013-11-27 00:19:30 -08:00
Stanislav Malyshev b64ac1faa3 Merge branch 'PHP-5.5'
* PHP-5.5:
  5.4.24-dev now
2013-11-27 00:15:03 -08:00
George Wang 9960ecc5cd update to LSAPI 6.6 2013-11-26 18:53:35 -05:00
Anatol Belski 0336763311 fixed ext/xmlwriter 2013-11-26 22:47:36 +01:00
Anatol Belski def8981190 fixed ext/xmlwriter 2013-11-26 22:36:35 +01:00
Anatol Belski 74f9e6309c fixed ext/dom for int64 branch 2013-11-26 22:25:22 +01:00
Anatol Belski 1d2150ca4f fixed some warning in ext/openssl 2013-11-26 21:36:41 +01:00
Anatol Belski 358fae9347 more param parsing fixes, overseen stuff 2013-11-26 21:13:14 +01:00
Anatol Belski 54797a9b15 fixed intl calendar param parsing 2013-11-26 21:13:13 +01:00
Andrey Hristov dd7c33d0c9 Merge branch 'master' of git.php.net:php-src 2013-11-26 20:10:17 +02:00
Anatol Belski 4c96b94873 Merge branch 'master' into str_size_and_int64 2013-11-26 19:09:31 +01:00
Anatol Belski 943ba2bf07 first x64 fixes for ext/openssl 2013-11-26 19:05:35 +01:00
Dmitry Stogov 0d61202427 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed opcahce_reset() crash when opcache.protect_memory is set
2013-11-26 21:59:19 +04:00
Dmitry Stogov ccd1babbfc Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  Fixed a wrong test
2013-11-26 21:43:51 +04:00
Dmitry Stogov bbdcbbdba5 Merge branch 'PHP-5.6'
* PHP-5.6:
  Added an optimization of class constants and constant calls to some internal functions
  Added an optimization of class constants and constant calls to some internal functions

Conflicts:
	NEWS
2013-11-26 21:43:19 +04:00
Andrey Hristov 9c036b13f9 Merge branch 'PHP-5.5' 2013-11-26 19:37:43 +02:00
Dmitry Stogov 1d65e8f135 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #66176 (Invalid constant substitution)
  Fixed bug #66176 (Invalid constant substitution)
2013-11-26 21:03:34 +04:00
Julien Pauli 8b83b48e98 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed a wrong test
2013-11-26 17:44:52 +01:00
Anatol Belski e5998bbda2 correct error datatype 2013-11-26 17:36:34 +01:00
Anatol Belski d508a094ae fixed 32 bit unsigned to int64 casts 2013-11-26 17:35:25 +01:00
Dmitry Stogov 34a55790f2 Merge branch 'PHP-5.6'
* PHP-5.6:
  Revert NEWS
  Fixed bug #66176 (Invalid constant substitution)
2013-11-26 17:49:38 +04:00
Anatol Belski f88a3e7fb9 first shot fixing ext/com_dotnet 2013-11-26 12:43:58 +01:00
Anatol Belski e2f2a3fcb5 Merge branch 'master' into str_size_and_int64 2013-11-26 10:59:55 +01:00
Anatol Belski 7e856fb09b fixed ext/bz2 2013-11-26 10:54:36 +01:00
Dmitry Stogov 854c9abcd4 Merge branch 'PHP-5.6'
* PHP-5.6:
  Added test
2013-11-26 12:14:22 +04:00
Dmitry Stogov b3ce714cbf Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #65559 (Opcache: cache not cleared if changes occur while running)
2013-11-26 11:37:05 +04:00
Anatol Belski a45082e78d fixed ext/intl 2013-11-25 21:59:09 +01:00
Andrey Hristov 36a3011613 Merge branch 'PHP-5.5' 2013-11-25 21:33:14 +02:00
Anatol Belski 8e50280163 updated datatypes in apache handler globals 2013-11-25 18:06:09 +01:00
Anatol Belski 0938a6266a fixes so file_get_contents() works again, and some more 2013-11-25 16:21:14 +01:00
Dmitry Stogov 704b24d048 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed compatibility with old PHP versions
  Fixed bug #65915 (Inconsistent results with require return value)
2013-11-25 14:12:11 +04:00
Anatol Belski 923518fab8 fix erroneous paste in 2013-11-25 07:39:37 +01:00
Anatol Belski 5300caade1 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2013-11-25 00:46:03 +01:00
Anatol Belski c6adc039a1 more datatype fixes 2013-11-25 00:44:33 +01:00
Anatol Belski a218f8f3a4 ZEND_INT_FMT and some more for ext/standard 2013-11-25 00:43:05 +01:00
Anatol Belski 3198533e92 ZEND_INT_FMT again 2013-11-24 22:28:58 +01:00
Anatol Belski d8c7d69543 printf int format fixes 2013-11-24 22:10:57 +01:00
Jakub Zelenka 215811e3fd fix openssl (testing required) 2013-11-24 21:03:55 +00:00
Anatol Belski 08bbd2b510 fixed ini and functions in assert.c 2013-11-24 19:56:32 +01:00
Anatol Belski 9cc9a10efd one more walk through in Zend, fixed (or broken) things being overseen 2013-11-24 18:55:26 +01:00
Anatol Belski cbf40edf06 fixed range check 2013-11-24 18:47:03 +01:00
Anatol Belski a73c8812a1 one more walk through in Zend, fixed things being overseen 2013-11-24 16:06:47 +01:00
Anatol Belski 9238345922 started to fix ext/session 2013-11-23 10:06:42 +01:00
Anatol Belski 4a6981433d fixed ini_set for integers 2013-11-23 09:52:33 +01:00
Anatol Belski 639924fa2c first shot to fix session 2013-11-22 15:55:21 +01:00
Anatol Belski db40b1c037 fix return datatype 2013-11-22 12:26:39 +01:00
Anatol Belski 52afd818eb fixed apache2 handler 2013-11-22 11:39:33 +01:00
Anatol Belski 28cb72f480 made zend list to use 64 bit indexes 2013-11-22 08:51:13 +01:00
Anatol Belski 7f0d637de4 Merge branch 'PHP-5.6'
* PHP-5.6:
  fixed test
  export more Zend API
2013-11-21 21:29:51 +01:00
Andrey Hristov e09e45eb86 Merge branch 'PHP-5.5' 2013-11-21 21:30:36 +02:00
Anatol Belski f88c30507c fixed param parsing in mbstring 2013-11-21 18:33:16 +01:00
Anatol Belski 015d179e49 converted simplexml ext 2013-11-21 16:17:10 +01:00
Anatol Belski 607f97cefa fixed libxml 2013-11-21 15:08:39 +01:00
Anatol Belski 51003463ef first shot for php-cgi for size_t and php_int_t 2013-11-21 13:26:56 +01:00
Anatol Belski fb27e16f01 fixed the skipif part 2013-11-21 11:54:35 +01:00
Anatol Belski c63f8bdfba now, as it works correct, fix the test 2013-11-20 17:49:40 +01:00
Anatol Belski 5e3d047a07 removed debugbreak 2013-11-20 17:15:01 +01:00
Anatol Belski 7156c5cb39 datatype fixes for iconv 2013-11-20 17:11:10 +01:00
Anatol Belski 6a60a03859 Merge branch 'master' into str_size_and_int64
Conflicts:
	Zend/zend_operators.h
2013-11-20 10:17:19 +01:00
Anatol Belski 6f2d32fd1f Merge branch 'PHP-5.6'
* PHP-5.6:
  permanently deactivate that place, not on runtime only
2013-11-20 10:12:29 +01:00
Yasuo Ohgaki bccead024d Merge branch 'PHP-5.6'
* PHP-5.6:
  added a test to cover distinction between boolean return value of unserialize function and deserializing serialized boolean
2013-11-20 07:25:45 +09:00
Jeff Welch b2ca20312d Fixed tests that fail with non-default serialize_precision configurations.
See:

 * https://bugs.php.net/bug.php?id=64760
 * 4dc4302
2013-11-20 06:17:57 +09:00
Anatol Belski 726d803375 fixed key length datatype 2013-11-19 14:51:20 +01:00
Anatol Belski e7b54a3aa7 fixed datatypes for some basic globals members 2013-11-19 14:13:23 +01:00
Anatol Belski f7bd3db224 Merge branch 'master' into str_size_and_int64 2013-11-19 13:42:51 +01:00
Anatol Belski aee386bb30 fix range check related to #45877 2013-11-19 13:40:43 +01:00
Remi Collet b41a2755c4 Merge branch 'PHP-5.6'
* PHP-5.6:
  avoid doing a stream_select on a closed stream
2013-11-19 12:43:00 +01:00
Anatol Belski d34f4454f0 fixed zlib param parsing 2013-11-19 10:38:54 +01:00
Andrea Faulds e68792dbb2 Merge branch 'PHP-5.6'
* PHP-5.6:
  Updated NEWS
  Removed UPGRADING note
  Rewrote test using tcp instead of http:// stream
  Implemented FR #65917 (getallheaders() is not supported by the built-in...)
2013-11-18 21:54:00 +00:00
Anatol Belski 0cac40e879 moved the check to the right place and fixed wording 2013-11-18 17:28:48 +01:00
Anatol Belski c398bdd4a3 runtime checks for various lengths in pcre 2013-11-18 14:03:55 +01:00
kovacs.ferenc a833f7d460 Merge branch 'PHP-5.6' 2013-11-18 12:39:40 +01:00
Anatol Belski 365603916e fixed one more stat() occurrence 2013-11-18 09:39:42 +01:00
Anatol Belski 383ddcde2b Merge branch 'master' into str_size_and_int64 2013-11-18 09:10:22 +01:00
Kalle Sommer Nielsen 9e3551ba1f Eliminated the TSRMLS_FETCH() in zend_set_memory_limit() 2013-11-18 01:36:17 +01:00
krakjoe f046189e34 export more Zend API 2013-11-17 22:39:31 +00:00
Xinchen Hui b93f8e6277 Merge branch 'PHP-5.6' 2013-11-17 17:20:27 +08:00
Xinchen Hui 5a282136a3 Merge branch 'PHP-5.5' 2013-11-17 17:11:20 +08:00
Christopher Jones 3e4e173296 Merge branch 'PHP-5.6'
* PHP-5.6:
  Update NEWS
  This is CLI web server change.  Added some common MIME types to the existing lookup list, pending a more thorough lookup solution, if anyone wants to do that.  Ref http://news.php.net/php.internals/69990
2013-11-15 12:38:18 -08:00
Anatol Belski bfa6d8d87d Merge branch 'str_size_and_int64' of git.php.net:php-src into str_size_and_int64 2013-11-15 11:07:58 +01:00
Anatol Belski ae576a4309 fix zend_off_t when int64 is disabled 2013-11-15 01:44:18 -08:00
Anatol Belski 18e4e5b350 Merge branch 'master' into str_size_and_int64 2013-11-15 10:04:53 +01:00
Remi Collet a37ff1fa4b Merge branch 'PHP-5.6'
* PHP-5.6:
  NEWS
  Fix Bug #65714 	PHP cli forces the tty to cooked mode
2013-11-15 09:53:23 +01:00
Adam Harvey 6cf46f49e3 Merge branch 'PHP-5.6' 2013-11-14 10:53:02 -08:00
Anatol Belski a80567a929 fixed undefined behaviour in array_sum
The exact situation is when passing same pointer twice to
fast_add_function(). This prorably has to be fixed in mainstream too.
2013-11-14 14:59:08 +01:00
Anatol Belski e93c9ae26a fixed serialize/unserialize
- almost correct datatype fixes
2013-11-13 18:37:57 +01:00
Anatol Belski 6b229d541a fixed ext/date for php_int_t usage 2013-11-13 15:22:56 +01:00
Remi Collet b6f76adef4 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix failed test with recent glibc
  5.5.7 now
2013-11-13 13:21:28 +01:00
Anatol Belski bd81a99ab3 Merge branch 'master' into str_size_and_int64 2013-11-13 12:44:00 +01:00
Anatol Belski 15bb12b269 fixed "struct stat" usage in main, cli and ext/standard 2013-11-13 12:39:12 +01:00
Nikita Popov b8525baecf Merge branch 'PHP-5.6' 2013-11-12 22:04:45 +01:00
Anatol Belski 468b2923ca fixed stat usage, yet core only
- defined php_stat_t as replacement for struct stat
- on _WIN64 use _fstat64
2013-11-12 21:10:23 +01:00
Anatol Belski e9c7342a80 Merge branch 'master' into str_size_and_int64 2013-11-12 10:57:47 +01:00
Anatol Belski ef1c2ffaf0 more fixes to spl 2013-11-12 10:56:01 +01:00
Anatol Belski ae1fb8dc4b fixes to spl 2013-11-12 10:22:06 +01:00
Anatol Belski 266a428a59 use appropriate seek() and tell() on _WIN64 2013-11-12 00:41:58 +01:00
Anatol Belski f90fe17424 define platform dependent zend_off_t 2013-11-12 00:24:52 +01:00
Anatol Belski 570b1041e9 fixes to pow() 2013-11-11 14:23:58 +01:00
Anatol Belski 2cbd452cfb fixed parse_url() 2013-11-11 12:49:57 +01:00
Anatol Belski ebc2816318 fixed range() 2013-11-11 11:52:44 +01:00
Anatol Belski c23baba693 fixed array_product() 2013-11-11 09:44:24 +01:00
Anatol Belski 7e20b13d86 fixed array_slice() 2013-11-11 09:40:29 +01:00
Adam Harvey 91cb087727 Merge branch 'PHP-5.6'
* PHP-5.6:
  Update NEWS and remove the unnecessary UPGRADING note.
  UPGRADING and NEWS
  Better test: Check combined leading/trailing
  Fixed whitespace part of bug #64874 ("json_decode handles whitespace and case-sensitivity incorrectly")
2013-11-10 16:16:38 -05:00
Anatol Belski 57ce464a1c fixed *scanf() family 2013-11-10 18:59:07 +01:00
Anatol Belski 094c93b6f8 fixed *printf() family 2013-11-10 18:02:25 +01:00
Anatol Belski b7705365a2 fix explode() 2013-11-10 17:09:51 +01:00
Anatol Belski 3069b384e1 Merge branch 'master' into str_size_and_int64 2013-11-10 15:14:03 +01:00
Anatol Belski c0b112c68d one more fix to pack/unpack 2013-11-10 14:40:00 +01:00
Anatol Belski 7cf68266b3 fixed unpack 2013-11-10 14:02:38 +01:00
Anatol Belski 637e9fc5bb fix 64 bit integer values 2013-11-10 13:58:09 +01:00
Remi Collet fac240b5d1 Merge branch 'PHP-5.6'
* PHP-5.6:
  missing 'config.h' in 5dc37b3
2013-11-10 07:10:48 +01:00
Rasmus Lerdorf 7e01935dc2 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix broken test

Conflicts:
	NEWS
2013-11-09 09:49:09 -08:00
Adam Harvey 90d4ae4da8 Make all code paths in json_determine_array_type() return constants.
This is a purely cosmetic change, but the current behaviour of returning
PHP_JSON_OUTPUT_ARRAY and 1 looks weird.
2013-11-09 12:15:37 -05:00
Anatol Belski 36cbe38201 reverted compare funcs and return values, should be int anyway 2013-11-09 13:16:15 +01:00
Anatol Belski ad675f6ac2 Merge branch 'master' into str_size_and_int64
Conflicts:
	main/php_version.h
2013-11-09 11:03:04 +01:00
Anatol Belski 7c5af3884a fix index insert 2013-11-09 10:56:51 +01:00
Anatol Belski c58f9eea11 fix array related compare functions 2013-11-09 10:30:55 +01:00
Anatol Belski c2e228b77d too much for a compare func 2013-11-09 09:18:42 +01:00
Anatol Belski 27a86a4402 fixed 64 bit pass by ref 2013-11-09 02:09:14 +01:00
Anatol Belski 5615326e1f fixed fetching $this 2013-11-08 22:36:30 +01:00
Dmitry Stogov 43cb6ba763 Merge branch 'PHP-5.5'
* PHP-5.5:
  Fixed issue #115 (path issue when using phar). Fixed issue #149 (Phar mount points not working with OPcache enabled).

Conflicts:
	NEWS
2013-11-08 16:37:28 +04:00
Dmitry Stogov 8f097fb466 Merge branch 'PHP-5.6'
* PHP-5.6:
  Added tests for PHAR/OPCahce incompatibilities

Conflicts:
	NEWS
2013-11-08 14:16:40 +04:00
Xinchen Hui 6357cdaecf Merge branch 'PHP-5.5' 2013-11-08 15:33:57 +08:00
Xinchen Hui 4c13992f0d Merge branch 'PHP-5.5' 2013-11-08 15:09:08 +08:00
Rasmus Lerdorf 911ba0293a Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix bug #65946 - pdo_sql_parser.c permanently converts values bound to strings
  bump API versions
2013-11-07 18:10:39 -08:00
Anatol Belski 11d4bcd706 remaining replacements ulong vs zend_uint_t 2013-11-07 19:41:57 +01:00
Anatol Belski df312c5ddf fix macros 2013-11-07 18:24:06 +01:00
Anatol Belski de99f93aa5 fix datatype for hash vars 2013-11-07 17:47:48 +01:00
Rasmus Lerdorf 308edceb51 Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src: (304 commits)
  OCI8 build change: Fix source variable definition for C89 compatibility
  bump version, empty NEWS, UPGRADING and UPGRADING.INTERNALS
  bump API versions
  configure output alignment
  Add a couple more test cases to parse_url() tests
  fix missing change from 'tcp_socket' to the more common 'server'
  fix many parallel test issues
  Cleanup temp test file
  Revert "Fixed issue #115 (path issue when using phar)."
  Update LiteSpeed SAPI code to V6.4
  Fixed typo in Makefile.frag
  updated NEWS
  Remove outdate codes, make it clearer, although just a bit..
  Update NEWS
  Fixed Bug #66034 (Segmentation Fault when constructor of PDO statement throws an exception)
  NEWS + UPGRADING
  Sync ext/zip with pecl/zip version 1.3.2 - update libzip to version 1.11.1. We don't use any private symbol anymore - new method ZipArchive::setPassword($password) - add --with-libzip option to build with system libzip
  Fixed coredump due to abnormal implemention of phar
  Fix English here
  limit virtual_cwd_activate() duplicated call to ZTS only
  ...
2013-11-07 07:55:44 -08:00
Anatol Belski 98c6e0d535 first shot for 64 bit array indexes, more broken things to fix 2013-11-07 14:03:36 +01:00
Christopher Jones 0d506131af OCI8 build change: Fix source variable definition for C89 compatibility 2013-11-06 10:37:22 -08:00
Ferenc Kovacs d17b684b91 bump version, empty NEWS, UPGRADING and UPGRADING.INTERNALS 2013-11-06 14:03:24 +01:00
Ferenc Kovacs 117955daf6 bump API versions 2013-11-06 14:03:24 +01:00
Remi Collet 1d93f396bb configure output alignment 2013-11-06 13:38:53 +01:00
Anatol Belski dd360d6336 use max int to out the array index 2013-11-04 19:49:41 +01:00
Anatol Belski 446cfd3e1c fix stream_wrapper_register() 2013-11-04 11:12:10 +01:00
Anatol Belski 48e63da659 fixes to array funcs 2013-11-04 10:45:58 +01:00
Anatol Belski 642a8b870a Fixes mem size format for error msg, fixes also Zend\tests\bug55509.phpt 2013-11-04 09:57:29 +01:00
Anatol Belski e243a26b4c Merge branch 'master' into str_size_and_int64
* master: (30 commits)
  Fixed coredump due to abnormal implemention of phar
  Fix English here
  Fix bug #66008
  Removed unnecessary GC checks
  Add crypt() change in UPGRADING
  Fix bug #65997 by switching to Serializable for GMP
  Fix compile warning in GMP
  Fix ZTS build
  updated libs_versions.txt
  Implemented Change crypt() behavior w/o salt RFC
  Update NEWS
  Update NEWS
  Fixed Bug 64760 var_export() does not use full precision for floating-point numbers
  add bundled libzip LICENSE, as required by BSD License terms
  Avoid copy in func_get_arg()
  - Updated to version 2013.8 (2013h)
  Use zval* instead of zval**
  Increased limit for opcache.max_accelerated_files to 1,000,000. (Chris)
  Improved performance of array_merge() by eliminating useless copying
  Improved performance of func_get_args() by eliminating useless copying
  ...

Conflicts:
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
2013-11-04 09:19:52 +01:00
Anatol Belski 1ba7ceee17 fixed hex integer interpretation 2013-10-28 10:27:36 +01:00
Anatol Belski 0c21ecf159 force the multiply macros to use zend_int_t 2013-10-28 10:26:39 +01:00
Anatol Belski 3889019638 Merge branch 'master' into str_size_and_int64
* master:
  fix limitation of upload size == (U)INT_MAX in CGI
  Link to more readmes
  test commit
  - test3
  - test commit 2
  - test commit1
2013-10-28 09:10:55 +01:00
Anatol Belski d5e835737c fixed binary int representation 2013-10-27 16:41:38 +01:00
Anatol Belski 20ff7a2d68 some strtol replacements 2013-10-27 11:05:40 +01:00
Anatol Belski 23390de0e7 fix strlen macros 2013-10-26 11:48:19 -07:00
Anatol Belski 4fc7dc6eae Merge branch 'master' into str_size_and_int64
* master: (79 commits)
  ldap_escape() notes
  Increment version number, since this will be 5.5.6.
  Added Zend Debugger to the note about the load order (by trash4you at online dot de)
  Added a LICENSE file to make it easier for PECL binary distributions to conform with the license.
  Fix Coverity issue reporting wrong sizeof()
  Fixed bug #65939 (Space before ";" breaks php.ini parsing). (brainstorm at nopcode dot org)
  exif NEWS
  add tests for bug #62523
  Merged PR #293 (Exif crash on unknown encoding was fixed) By: 	Draal Conflicts: 	configure.in 	main/php_version.h
  fix bug #65936 (dangling context pointer causes crash)
  remove TRAVIS check in test source
  Fixed compilation warning
  Just SKIP that test on travis
  Fixed issue #115 (path issue when using phar).
  fix memory leak on error (from Coverity scan)
  fix argument type & remove warning
  fix const warnings in intl methods
  Fix coverity issue with -1 returned by findOffset not being handled by getPreferredTag
  fix possibility of access to *storedType without initialization
  Fix coverity issue with -1 returned by findOffset not being handled by getPreferredTag
  ...

Conflicts:
	Zend/zend_compile.c
	ext/intl/collator/collator_create.c
	ext/intl/locale/locale_methods.c
	ext/intl/msgformat/msgformat_format.c
	ext/intl/msgformat/msgformat_parse.c
2013-10-25 04:19:27 -07:00
Anatol Belski f0fdb82f83 bigger memory_limit should work now on 64 bit windows 2013-10-16 10:48:03 -07:00
Anatol Belski 4a5fee1b36 fix broken master merge 2013-10-16 06:10:00 -07:00
Anatol Belski 4b6d784962 Merge branch 'str_size_and_int64' of https://github.com/weltling/php-src into str_size_and_int64
Conflicts:
	NEWS
	UPGRADING
	UPGRADING.INTERNALS
	Zend/zend_API.c
	Zend/zend_compile.c
	Zend/zend_compile.h
	Zend/zend_constants.h
	Zend/zend_exceptions.c
	Zend/zend_exceptions.h
	Zend/zend_execute.c
	Zend/zend_language_scanner.c
	Zend/zend_language_scanner.l
	Zend/zend_operators.c
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
	ext/date/lib/parse_date.c
	ext/date/php_date.c
	ext/imap/config.m4
	ext/oci8/config.m4
	ext/oci8/oci8.c
	ext/oci8/oci8_dtrace.d
	ext/oci8/oci8_interface.c
	ext/oci8/oci8_lob.c
	ext/oci8/oci8_statement.c
	ext/oci8/package.xml
	ext/oci8/php_oci8.h
	ext/reflection/php_reflection.c
	ext/spl/spl_directory.c
	ext/spl/spl_fixedarray.c
	ext/standard/file.c
	ext/standard/http_fopen_wrapper.c
	ext/standard/info.c
	ext/standard/string.c
	main/php_variables.c
	main/streams/streams.c
2013-10-16 06:02:27 -07:00
Anatol Belski 4e537ca4ca fix broken merge from master 2013-10-16 03:38:14 -07:00
Stanislav Malyshev 941887359b 5.4.21 now 2013-10-16 03:21:55 -07:00
Dmitry Stogov ed36099a0b Fixed bug #65561 (Zend Opcache on Solaris 11 x86 needs ZEND_MM_ALIGNMENT=4). (Terry Ellison) 2013-10-16 03:21:49 -07:00
Anatol Belski 615756c8ab fixed ext/iconv 2013-10-16 03:20:34 -07:00
Joey Smith e6095aa4cb Expose fputcsv's escape_char to userland
Allows users to assert that something other than the backslash
should be considered an escape char; also follows the RFC 4180
recommendation that fields containing a " be enclosed.
2013-10-16 03:18:19 -07:00
Anatol Belski 983db235b0 fixed decrement 2013-10-16 03:14:25 -07:00
Anatol Belski 582f52c173 fixed numeric string comparsion 2013-10-16 03:14:24 -07:00
Anatol Belski c47840d92b some more linux fixes 2013-10-16 03:14:23 -07:00
Anatol Belski 8949c825c7 fixed configure.in 2013-10-16 03:14:22 -07:00
Anatol Belski 68ec5a9b89 ext/intl further fixes 2013-10-16 03:14:22 -07:00
Anatol Belski 866d33e1e9 ext/intl further converting 2013-10-16 03:14:21 -07:00
Anatol Belski 52a74bbdd6 more fixes to ext/intl 2013-10-16 03:14:20 -07:00
Anatol Belski 05593baf9a Z_STRLEN vs Z_STRSIZE in ext/intl 2013-10-16 03:14:20 -07:00
Anatol Belski 457f28c354 adapted args in ext/intl 2013-10-16 03:14:19 -07:00
Anatol Belski 9e4a7835c5 fixed the mb_regex* stuff 2013-10-16 03:14:18 -07:00
Anatol Belski 1f261538e8 fixed sapi filter usage 2013-10-16 03:14:17 -07:00
Anatol Belski 80d8037531 replaced all the arg formats and Z_STRLEN
won't work yet, just initial work to be done
2013-10-16 03:14:17 -07:00
Anatol Belski 659d7ca634 fixed set process_title() 2013-10-16 03:14:16 -07:00
Anatol Belski 84e13901b0 fix pcre usage in spl 2013-10-16 03:14:15 -07:00
Anatol Belski 69ea580aad fixed ext/pcre internal stuff
Now only the flaw is pcrelib itself as it works with int for
string length and offsets. Bigger stuff won't work anyway, but
if there are some issue there are just a few places like pcre_exec()
where we can explicitly cast to int.
2013-10-16 03:14:15 -07:00
Anatol Belski af4924eaea adapted all the function arg formats in ext/zlib 2013-10-16 03:14:13 -07:00
Anatol Belski 1015a29997 some more fixes to zend operators 2013-10-16 03:14:12 -07:00
Anatol Belski 889b8d75fe added ZEND_INT_FMT 2013-10-16 03:14:12 -07:00
Anatol Belski 34818356fc some fixes to constants, var_dump and var_export 2013-10-16 03:14:11 -07:00
Anatol Belski dfec5cf775 first fixes to ext/spl, yet incomplete 2013-10-16 03:12:49 -07:00
Anatol Belski a5cda49fe9 fixes to reflection 2013-10-16 03:10:52 -07:00
Anatol Belski 3b55e60245 fixes to ereg 2013-10-16 03:10:51 -07:00
Anatol Belski 4f6e709a67 more fixes to ext/date 2013-10-16 03:10:50 -07:00
Anatol Belski b24f226e93 replaced arg formats in pcre 2013-10-16 03:10:50 -07:00
Anatol Belski 41e0c7b1f6 fixed sapi.h 2013-10-16 03:10:49 -07:00
Anatol Belski 4ea8803533 replaced all arg formats in ext/standard 2013-10-16 03:10:48 -07:00
Anatol Belski f8923bb076 replaced all the int params in the datetime 2013-10-16 03:09:52 -07:00
Anatol Belski d3f87d0ffc adapted the function args for ereg
And that actually seems to be it, all tests pass so far. So lets
see how it goes in the fture, too easy but seems to be done for now .
2013-10-16 03:09:51 -07:00
Anatol Belski 179d696b35 trivial fix spl_autoload_functions() 2013-10-16 03:09:50 -07:00
Anatol Belski 4be4279c83 final fix for hebrev() 2013-10-16 03:09:50 -07:00
Anatol Belski 832e9653d1 fix build 2013-10-16 03:09:49 -07:00
Anatol Belski 469b9e44fb fixed file_put_contents() 2013-10-16 03:09:48 -07:00
Anatol Belski b7f8723065 fixed fwrite 2013-10-16 03:09:47 -07:00
Anatol Belski a8959d76c8 fixed "s" vs "S" for soundex 2013-10-16 03:09:45 -07:00
Anatol Belski 734f9e58f9 partial fix to hebrev 2013-10-16 03:09:44 -07:00
Anatol Belski 5b6f0092f4 fixed unpack() 2013-10-16 03:09:44 -07:00
Anatol Belski d7d84804e6 fixed str_pad() 2013-10-16 03:09:43 -07:00
Anatol Belski 12951f8bbd lost condition 2013-10-16 03:09:42 -07:00
Anatol Belski 6fc93dfa6c fixed str_split() 2013-10-16 03:09:41 -07:00
Anatol Belski a61c753006 Fixed substr(), but no kidding now.
all the signed/unsigned arithmetic needs clear understanding
2013-10-16 03:09:41 -07:00
Anatol Belski 51ddf600fe small correction to substr 2013-10-16 03:08:26 -07:00
Anatol Belski df0a28baab fixed strstr() 2013-10-16 03:08:26 -07:00
Anatol Belski c9280f1e1c fixed substr() 2013-10-16 03:08:25 -07:00
Anatol Belski f4c91f0aa8 adapted all the zend_parse_parameters() calls 2013-10-16 03:08:24 -07:00
Anatol Belski 5d1c130506 changes to dns.c 2013-10-16 03:08:22 -07:00
Anatol Belski ec49b23a4d fixes for types to ext/standard with types ... some stuff is broken now 2013-10-16 03:08:21 -07:00
Anatol Belski 63cf4c45ca more fixes to string.c 2013-10-16 03:05:14 -07:00
Anatol Belski 010b8114cc more for cli sapi 2013-10-16 03:05:13 -07:00
Anatol Belski dec724e98d fixes to main/ 2013-10-16 03:05:13 -07:00
Anatol Belski 646b5d306c fixes after merging master 2013-10-16 03:02:34 -07:00
Anatol Belski 6a16702e30 Fixes for sizeof int 2013-10-16 02:57:39 -07:00
Anatol Belski f7730bd47e made lang scanner use zend_int.h and regenerated it 2013-10-16 02:57:38 -07:00
Anatol Belski c10c568d0f added zend_int.h to zend*.dsp 2013-10-16 02:37:13 -07:00
Anatol Belski 91058553c8 adjusted zend_types.h 2013-10-16 02:37:13 -07:00
Anatol Belski 631628baad added zend_int.h 2013-10-16 02:37:12 -07:00
Anatol Belski f6cf006496 the very first porting try, many things not worky 2013-10-16 02:37:11 -07:00
Anatol Belski baf3937c37 fixes to zend 2013-10-16 02:35:31 -07:00
Anatol Belski 0e3420bf8f more fixes to streams 2013-10-16 02:34:31 -07:00
Anatol Belski 0020a89c43 fixes to SAPI.c 2013-10-16 02:32:22 -07:00
Anatol Belski 9f294bf282 fixes to plain stream wrapper 2013-10-16 02:32:21 -07:00
Anatol Belski 5748286990 fixes to xp_socket.c 2013-10-16 02:32:20 -07:00
Anatol Belski b610404004 fixes to zend_ini and output 2013-10-16 02:32:19 -07:00
Anatol Belski 74a68df77c fix uuencode 2013-10-16 02:32:18 -07:00
Anatol Belski 42fdfacae6 fix base64 stuff 2013-10-16 02:32:17 -07:00
Anatol Belski 98ec9fdd51 fixes to url processing stuff 2013-10-16 02:32:17 -07:00
Anatol Belski 6221ea90cb huge fix to spl and more 2013-10-16 02:32:16 -07:00
Anatol Belski 86c9a6f901 fix 's' vs 'S' for datetime 2013-10-16 02:31:20 -07:00
Anatol Belski dc43044ffb string sze_t fix for internal strings 2013-10-16 02:31:20 -07:00
Anatol Belski 0d0eec58f1 strig size_t fixes to zend_alloc.* 2013-10-16 02:31:19 -07:00
Anatol Belski a296d61c05 trivial fixes to ext\standard 2013-10-16 02:31:18 -07:00
Anatol Belski 2f39ef6596 trivial fixes to spl 2013-10-16 02:30:28 -07:00
Anatol Belski 4f62adfb2c fix spl_autoload_* 2013-10-16 02:30:27 -07:00
Anatol Belski 43e05efd3b windows fixes 2013-10-16 02:30:27 -07:00
Anthony Ferrara 2cf827b52a Get core test suite to really pass, fully. Woot 2013-10-16 02:30:26 -07:00
Anthony Ferrara 0cd95c1ee0 Get basic language tests to all pass (minus xfails) 2013-10-16 02:30:25 -07:00
Anthony Ferrara 6484eaf77e Better test coverage 2013-10-16 02:26:33 -07:00
Anthony Ferrara e6f90ecc27 It compiles. Sort-of. In a way. Yeah. But nothing works. Sigh 2013-10-16 02:24:40 -07:00
Anthony Ferrara 1d861341a0 More work, get strings working, sort-of... 2013-10-16 01:58:11 -07:00
Anthony Ferrara 10ff0829d4 Refactor file.c to use new string types 2013-10-16 01:56:47 -07:00
Anthony Ferrara c224e239bd Re-do a lot of it using a conditional define, and legacy type information for APIs 2013-10-16 01:55:06 -07:00
Adam Harvey 59ebbf5109 Allow CURLOPT_FOLLOWLOCATION to be used with open_basedir.
Newer versions of libcurl prevent file:// location response headers by default,
which means that the open_basedir check is unnecessary — the fact
CURLOPT_REDIR_PROTOCOLS can't set CURLPROTO_FILE with open_basedir enabled
means that there's no possibility of breaching the open_basedir restriction,
and this allows HTTP redirects to be followed automatically.

Implements FR #65646 (re-enable CURLOPT_FOLLOWLOCATION with open_basedir or
safe_mode).
2013-10-16 01:34:31 -07:00
Adam Harvey 04c823d287 Tinker with the wording of the short_open_tag description.
I'm still not thrilled with this, but it's a bit better and addresses the
issues noted in bug #65644. Plus, it now mentions the decoupling of <?=.
2013-10-16 01:34:30 -07:00
Adam Harvey 5c50e69814 Handle CLI server request headers case insensitively.
Fixes bug #65633 (built-in server treat some http headers as case-sensitive).
2013-10-16 01:29:42 -07:00
unknown f074ad207c ensure that the defined interpolation method is used by the generic scaling functions 2013-10-16 01:29:06 -07:00
Dmitry Stogov 4d86b8b507 Fixed issue #128 (opcache_invalidate segmentation fault) 2013-10-16 01:28:23 -07:00
Christopher Jones 32a8ad32e7 Remove obsolete flag 2013-10-16 01:28:22 -07:00
Christopher Jones 814b1985bc Update DTrace probes 2013-10-16 01:28:22 -07:00
Christopher Jones f453122b73 Add test for oci_set_* error changes 2013-10-16 01:28:21 -07:00
Christopher Jones 66db31f5c6 Make oci_set_*($connection,...) errors retrievable via oci_error($connection).
Improve some error handling to produce error text on some rare edge cases.
Disambiguate the Oracle library function call return status values from ORA error numbers.
Review and unify error data types.
2013-10-16 01:28:20 -07:00
Christopher Jones 388928ee24 Cast time_t since some "dtrace -G" invocations fail on time_t arguments 2013-10-16 01:26:09 -07:00
Stanislav Malyshev 49c9e595f6 5.4.21 now 2013-10-16 01:26:08 -07:00
Gustavo André dos Santos Lopes f1a05e788c Update NEWS/UPGRADING with info about incompat ctx 2013-10-16 01:24:01 -07:00
Xinchen Hui fd91996c55 Typo.... 2013-10-16 01:24:00 -07:00
Xinchen Hui f16cdc0d50 Add a XFAIL test for #64896 2013-10-16 01:24:00 -07:00
Gustavo André dos Santos Lopes 765cdb22cf Implement phase 1 of rfc/incompat_ctx
Just changing the error level of the message from E_STRICT to
E_DEPRECATED. This comes one version later than the timeline
mentioned in the RFC.

Oddly, there were no tests for this ‘feature’. I added a simple
one.
2013-10-16 01:23:59 -07:00
Nikita Popov 7f17c8c11e Make use of direct returns in some places 2013-10-16 01:23:58 -07:00
Nikita Popov cc0e733baa Always pass return_value_ptr to internal functions
Previous some places passed return_value_ptr only if the function
returned by reference. Now return_value_ptr is always set, even
for functions returning by-value.

This allows you to return zvals without copying their contents. For
this purpose two new macros RETVAL_ZVAL_FAST and RETURN_ZVAL_FAST
are added:

    RETVAL_ZVAL_FAST(zv); /* Analog to RETVAL_ZVAL(zv, 1, 0) */
    RETURN_ZVAL_FAST(zv); /* Analog to RETURN_ZVAL(zv, 1, 0) */

These macros behave similarly to the non-FAST versions with
copy=1 and dtor=0, with the difference that the FAST versions
will try return the zval without copying by utilizing return_value_ptr.
2013-10-16 01:23:57 -07:00
Christopher Jones 93b6c4f2bb Allow OCI8 to be DTrace-enabled independently of core PHP's DTrace
status.  The proviso is OCI8 must be built "shared" when DTrace is
enabled.  This implementation (i) works around an incomplete core PHP
solution for extension tracing (ii) avoid any issues with DOF section
location and the complexities of needing to merge all provider .d
files for static builds (iii) allows OCI8 to be DTrace-enabled when
doing PECL installs of OCI8 on PHP versions without core PHP DTrace
support.

This is an initial patch i.e. it will undergo further testing.
2013-10-16 01:23:57 -07:00
Christopher Jones e9782f3a10 OCI8: remove unused ext/oci8/config.m4 macro 2013-10-16 01:23:56 -07:00
Christopher Jones 6bb30e2aec OCI8 whitespace: remove tabs embedded in code 2013-10-16 01:23:55 -07:00
Remi Collet a296e3d032 Fixed bug #65564 stack-buffer-overflow in DateTimeZone stuff caught by AddressSanitizer 2013-10-16 01:23:54 -07:00
Remi Collet 3df4c3eb70 Fixed Bug #65564 stack-buffer-overflow in DateTimeZone stuff caught by AddressSanitizer 2013-10-16 01:22:56 -07:00
Xinchen Hui 2e560a331d Fixed bug #60598 (cli/apache sapi segfault on objects manipulation) 2013-10-16 01:21:34 -07:00
Yasuo Ohgaki 9628ac34a6 Remove ini dependency in test 2013-10-16 01:20:56 -07:00
Dmitry Stogov 7fcd3e2721 Fixed bug #65510 (5.5.2 crashes in _get_zval_ptr_ptr_var) 2013-10-16 01:20:55 -07:00
Dmitry Stogov 58606fc10d Fixed bug #61759 (class_alias() should accept classes with leading backslashes). (Julien) 2013-10-16 01:20:13 -07:00
Dmitry Stogov 08c2e821cc Fixed compatibility with php-5.2 2013-10-16 01:19:17 -07:00
Dmitry Stogov 5352788b44 Fixed bug #65561 (Zend Opcache on Solaris 11 x86 needs ZEND_MM_ALIGNMENT=4). (Terry Ellison) 2013-10-16 01:19:16 -07:00
Xinchen Hui db11ad2e94 Avoid compiler warning 2013-10-16 01:18:36 -07:00
Adam Harvey acbfd16ddf Fix bug #65579 (Using traits with get_class_methods causes segfault).
Specifically, this checks if there are trait aliases defined in the class scope
before attempting to dereference the first trait alias. This handles the case
where a trait alias was used in a child trait but no aliases exist in the
concrete class.
2013-10-16 01:18:36 -07:00
Anatol Belski 132505cd52 removed the /Wp64 switch as we use true 64 bit compiler now 2013-10-16 01:17:54 -07:00
Anatol Belski f350f3c9b8 updated lib versions, the vc11 ones only matter now 2013-10-16 01:17:12 -07:00
Christopher Jones 16ef7e80a8 OCI8 2.0: add oci8-check-connection probe and do some renaming 2013-10-16 01:17:11 -07:00
Anatol Belski cf22d7c06b fixed ext/iconv 2013-10-16 01:17:10 -07:00
Xinchen Hui c4edc6e277 Fixed compiler warnings
warning: 'local_dval' may be used uninitialized in this function
[-Wmaybe-uninitialized]

warning: 'dval2' may be used uninitialized in this function
[-Wmaybe-uninitialized]
2013-10-16 01:17:09 -07:00
Christopher Jones 6a2c44c811 Use "__" consistently in OCI8 DTrace probe definitions. It maps to "-" in the probe name. 2013-10-16 01:16:12 -07:00
Christopher Jones fb03ad89ef Leave it to DTrace FBT to trace underlying library calls 2013-10-16 01:16:11 -07:00
Nikita Popov 66de4151e7 Evaluate ZVAL_ZVAL arguments only once
Also remove some isref/refcount assignments, which are no longer
necessary (as ZVAL_COPY_VALUE is used now).
2013-10-16 01:16:11 -07:00
Dmitry Stogov e8b7f9f011 Fixed compilation warning 2013-10-16 01:16:10 -07:00
gron1987 62b0f1d0fc Fix bug #65554 in DateTime, when use it with D/l in format and textual day have dot at the end 2013-10-16 01:16:09 -07:00
Stanislav Malyshev 66dd725ac7 fix mysql tests & mark nextRowset problematic tests 2013-10-16 01:14:27 -07:00
Joey Smith 7f22f40541 Expose fputcsv's escape_char to userland
Allows users to assert that something other than the backslash
should be considered an escape char; also follows the RFC 4180
recommendation that fields containing a " be enclosed.
2013-10-16 01:14:23 -07:00
Stanislav Malyshev e636bea3f7 fix mysql init 2013-10-16 01:12:01 -07:00
Stanislav Malyshev ef30289ead add openssl 2013-10-16 01:12:00 -07:00
Stanislav Malyshev b0aed8f9d3 add mysql settings 2013-10-16 01:11:59 -07:00
root c74f0c613d Test extension xmlrpc encode type double and string decode type string and int 2013-10-16 01:11:23 -07:00
Ole Markus With 32776ad023 Stricter libc-client symlink check 2013-10-16 01:11:22 -07:00
Michael M Slusarz 674fb57896 Fix #65483: quoted-printable encode stream filter incorrectly encoding spaces 2013-10-16 01:11:21 -07:00
Alexander Moskaliov 39c8f8a205 Remove semicolon 2013-10-16 01:11:21 -07:00
Alexander Moskalev 66174837ef Fix DateInterval->days value
when object was created not from DateTime::diff()
2013-10-16 01:11:20 -07:00
Anatol Belski b8213906ff fixed decrement 2013-08-26 07:31:10 -07:00
Anatol Belski 4b484e0278 fixed numeric string comparsion 2013-08-26 07:06:31 -07:00
Anatol Belski 1b523d9c93 Merge branch 'string_size_refactor_take_2' into str_size_and_int64 2013-08-26 05:44:35 -07:00
Anatol Belski a0dfabed1f some more linux fixes 2013-08-26 05:54:33 -07:00
Anatol Belski 61a1a3e39b fixed configure.in 2013-08-26 05:19:14 -07:00
Anatol Belski 6e4395b586 ext/intl further fixes 2013-08-26 04:33:07 -07:00
Anatol Belski 9c81da4170 ext/intl further converting 2013-08-26 01:52:31 -07:00
Anatol Belski 14f8e16870 more fixes to ext/intl 2013-08-24 07:32:28 -07:00
Anatol Belski 07b87a2a7f Z_STRLEN vs Z_STRSIZE in ext/intl 2013-08-24 07:02:28 -07:00
Anatol Belski 1492bc1d60 adapted args in ext/intl 2013-08-24 05:08:22 -07:00
Anatol Belski 2545fbbdc2 fixed the mb_regex* stuff 2013-08-24 03:24:06 -07:00
Anatol Belski 2bf8f91b87 fixed sapi filter usage 2013-08-24 03:04:35 -07:00
Anatol Belski 9382c75061 replaced all the arg formats and Z_STRLEN
won't work yet, just initial work to be done
2013-08-24 02:54:21 -07:00
Anatol Belski 644278c1a3 Merge branch 'master' of https://github.com/php/php-src into string_size_refactor_take_2 2013-08-23 09:07:58 -07:00
Anatol Belski 3d49768cc2 fixed set process_title() 2013-08-23 07:12:56 -07:00
Anatol Belski 2a28a30c4d fix pcre usage in spl 2013-08-23 06:47:18 -07:00
Anatol Belski f2a4f31bf4 fixed ext/pcre internal stuff
Now only the flaw is pcrelib itself as it works with int for
string length and offsets. Bigger stuff won't work anyway, but
if there are some issue there are just a few places like pcre_exec()
where we can explicitly cast to int.
2013-08-23 06:37:51 -07:00
Anatol Belski 6b474bbcf6 adapted all the function arg formats in ext/zlib 2013-08-23 04:21:02 -07:00
Anatol Belski 03bee19890 some more fixes to zend operators 2013-08-23 04:03:21 -07:00
Anatol Belski ba52352363 added ZEND_INT_FMT 2013-08-23 03:32:35 -07:00
Anatol Belski 3cbf45c510 some fixes to constants, var_dump and var_export 2013-08-23 02:34:14 -07:00
Anatol Belski 262de5d054 first fixes to ext/spl, yet incomplete 2013-08-23 01:56:16 -07:00
Anatol Belski ff233b591c fixes to reflection 2013-08-23 01:26:17 -07:00
Anatol Belski 3aed22ae8e fixes to ereg 2013-08-23 01:14:02 -07:00
Anatol Belski ebd2fc6b3f more fixes to ext/date 2013-08-23 01:08:35 -07:00
Anatol Belski 427cde5da6 replaced arg formats in pcre 2013-08-23 00:56:10 -07:00
Anatol Belski 570adc16e7 fixed sapi.h 2013-08-22 11:02:24 -07:00
Anatol Belski aae79a684d replaced all arg formats in ext/standard 2013-08-22 10:51:29 -07:00
Anatol Belski 0f892ce613 replaced all the int params in the datetime 2013-08-22 09:38:05 -07:00
Anatol Belski 261938b5e0 Merge branch 'string_size_refactor_take_2' into str_size_and_int64
Conflicts:
	ext/standard/string.c
2013-08-22 09:13:46 -07:00
Anatol Belski 5efaa8f7b9 adapted the function args for ereg
And that actually seems to be it, all tests pass so far. So lets
see how it goes in the fture, too easy but seems to be done for now .
2013-08-22 08:45:08 -07:00
Anatol Belski 320e82b603 trivial fix spl_autoload_functions() 2013-08-22 06:48:55 -07:00
Anatol Belski bfb0e87e2b final fix for hebrev() 2013-08-22 06:06:24 -07:00
Anatol Belski 5351aa9ac1 Merge branch 'string_size_refactor_take_2' of https://github.com/weltling/php-src into string_size_refactor_take_2 2013-08-22 03:45:28 -07:00
Anatol Belski 569cbd2081 fix build 2013-08-22 03:59:09 -07:00
Anatol Belski 764054c2eb Merge branch 'master' of https://github.com/php/php-src into string_size_refactor_take_2 2013-08-22 01:40:20 -07:00
Anatol Belski 5c6428b0b9 fixed file_put_contents() 2013-08-22 01:27:08 -07:00
Anatol Belski ea56c2dcfd fixed fwrite 2013-08-22 00:54:45 -07:00
Anatol Belski 09c3b6c1b6 fixed "s" vs "S" for soundex 2013-08-22 00:45:16 -07:00
Anatol Belski bda11c6bd2 partial fix to hebrev 2013-08-21 04:30:54 -07:00
Anatol Belski c8fbe078a1 fixed unpack() 2013-08-21 03:54:13 -07:00
Anatol Belski 2d44a04a83 fixed str_pad() 2013-08-21 01:35:40 -07:00
Anatol Belski d6c59e1d7e lost condition 2013-08-21 00:33:47 -07:00
Anatol Belski e2070d1409 Merge branch 'master' of https://github.com/php/php-src into string_size_refactor_take_2 2013-08-21 00:28:43 -07:00
Anatol Belski d871982507 Merge branch 'string_size_refactor_take_2' of https://github.com/ircmaxell/php-src into string_size_refactor_take_2 2013-08-21 00:28:19 -07:00
Anatol Belski c8acebe674 fixed str_split() 2013-08-21 00:27:07 -07:00
Anthony Ferrara dc29937050 Merge pull request #5 from weltling/string_size_refactor_take_2
String size refactor take 2, partial fixes to ext/standard
2013-08-17 12:42:52 -07:00
Anatol Belski 91ceb295da Fixed substr(), but no kidding now.
all the signed/unsigned arithmetic needs clear understanding
2013-08-17 10:10:15 -07:00
Anatol Belski 99442a301d small correction to substr 2013-08-17 04:22:09 -07:00
Anatol Belski 6b067db5fb fixed strstr() 2013-08-17 03:53:07 -07:00
Anatol Belski 5c754227a7 fixed substr() 2013-08-16 08:10:14 -07:00
Anatol Belski a7a797b455 adapted all the zend_parse_parameters() calls 2013-08-16 02:37:08 -07:00
Anatol Belski 715b040f46 Merge branch 'master' of https://github.com/php/php-src into string_size_refactor_take_2
Conflicts:
	Zend/zend_exceptions.c
	ext/date/php_date.c
	ext/standard/string.c
	ext/standard/url_scanner_ex.c
	ext/standard/url_scanner_ex.re
	main/rfc1867.c
2013-08-16 01:45:50 -07:00
Anatol Belski 1e53ccdf7a fixed merge mistake 2013-08-13 07:59:56 -07:00
Anthony Ferrara 221b9d44a8 Merge pull request #4 from weltling/string_size_refactor_take_2
String size refactor take 2
2013-08-13 07:36:50 -07:00
Anatol Belski 0773ab461e changes to dns.c 2013-08-13 01:26:05 -07:00
Anatol Belski ccf2069c18 Merge branch 'string_size_refactor_take_2' into str_size_and_int64
Conflicts:
	Zend/zend_constants.h
2013-08-13 01:10:09 -07:00
Anatol Belski 6478088a2c Merge branch 'master' of https://github.com/php/php-src into string_size_refactor_take_2
Conflicts:
	Zend/zend_operators.h
	main/SAPI.h
	main/rfc1867.c
	main/streams/php_stream_transport.h
	main/streams/streams.c
	main/streams/transports.c
	main/streams/xp_socket.c
2013-08-13 01:07:12 -07:00
Anatol Belski a95f8dbac2 fixes for types to ext/standard with types ... some stuff is broken now 2013-07-29 09:04:56 -07:00
Anatol Belski 88960bba1e more fixes to string.c 2013-07-29 04:50:47 -07:00
Anatol Belski 62c1f4127b more for cli sapi 2013-07-29 02:39:44 -07:00
Anatol Belski cd955c183b fixes to main/ 2013-07-29 02:16:39 -07:00
Anatol Belski dc0b9d716e Merge branch 'master' of https://github.com/php/php-src into string_size_refactor_take_2
Conflicts:
	Zend/zend_constants.h
	ext/standard/info.c
2013-07-29 01:47:45 -07:00
Anatol Belski 03cae613f0 fixes after merging master 2013-07-18 03:53:51 -07:00
Anatol Belski 9f177207fc Merge branch 'string_size_refactor_take_2' into str_size_and_int64 2013-07-18 03:22:12 -07:00
Anatol Belski 46e07a6fd7 Merge branch 'master' of https://github.com/php/php-src into string_size_refactor_take_2
Conflicts:
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
2013-07-18 03:20:13 -07:00
Anatol Belski 231eaa3919 Fixes for sizeof int 2013-07-18 02:58:55 -07:00
Anatol Belski 13cb1b7e4a made lang scanner use zend_int.h and regenerated it 2013-07-18 02:52:15 -07:00
Anatol Belski 4bcc5a87d7 added zend_int.h to zend*.dsp 2013-07-18 01:09:03 -07:00
Anatol Belski 0605bebdb6 adjusted zend_types.h 2013-07-18 01:05:27 -07:00
Anatol Belski ec0300ec25 added zend_int.h 2013-07-18 01:04:37 -07:00
Anatol Belski 8b8f7d4a5a the very first porting try, many things not worky 2013-07-17 09:48:13 -07:00
Anatol Belski a5302f286e Merge branch 'string_size_refactor_take_2' into str_size_and_int64
* string_size_refactor_take_2:
  fixes to zend
  more fixes to streams
  fixes to SAPI.c
  fixes to plain stream wrapper
  fixes to xp_socket.c
  fixes to zend_ini and output
2013-07-17 09:24:21 -07:00
Anatol Belski d4c546b956 fixes to zend 2013-07-17 09:11:51 -07:00
Anatol Belski 9703f57bd1 more fixes to streams 2013-07-17 06:30:28 -07:00
Anatol Belski cc3ec2936c fixes to SAPI.c 2013-07-17 06:06:35 -07:00
Anatol Belski 06fe769905 fixes to plain stream wrapper 2013-07-17 05:50:33 -07:00
Anatol Belski c292a18514 fixes to xp_socket.c 2013-07-17 04:53:56 -07:00
Anatol Belski eb5ab08267 fixes to zend_ini and output 2013-07-17 03:31:17 -07:00
Anthony Ferrara 6bd00eda6b Merge pull request #2 from weltling/string_size_refactor_take_2
Fixes by the end of the day
2013-07-15 09:36:03 -07:00
Anatol Belski 5ae81ec123 fix uuencode 2013-07-11 08:12:30 -07:00
Anatol Belski 8f7abf4371 fix base64 stuff 2013-07-11 07:02:58 -07:00
Anatol Belski e17ef23c2c fixes to url processing stuff 2013-07-11 06:57:22 -07:00
Anatol Belski a9b623aa0b huge fix to spl and more 2013-07-11 05:37:09 -07:00
Anatol Belski 7331e4c9c8 Merge branch 'master' of https://github.com/php/php-src into string_size_refactor_take_2 2013-07-11 03:00:30 -07:00
Anatol Belski 42c8f29277 fix 's' vs 'S' for datetime 2013-07-11 02:58:53 -07:00
Anatol Belski 59d95c1537 Merge branch 'master' of https://github.com/php/php-src into string_size_refactor_take_2 2013-07-10 01:09:28 -07:00
Anatol Belski 309d3b512e Merge branch 'string_size_refactor_take_2' of https://github.com/ircmaxell/php-src into string_size_refactor_take_2 2013-07-10 01:09:01 -07:00
Anatol Belski 03ed6fc0b1 string sze_t fix for internal strings 2013-07-10 00:43:19 -07:00
Anatol Belski acd85d48f0 strig size_t fixes to zend_alloc.* 2013-07-09 06:13:08 -07:00
Anthony Ferrara 3744ff7c18 Merge pull request #1 from weltling/string_size_refactor_take_2
windows fixes
2013-07-05 05:26:40 -07:00
Anatol Belski 8db3e3738c trivial fixes to ext\standard 2013-07-04 09:35:05 -07:00
Anatol Belski bf18c56fb7 trivial fixes to spl 2013-07-04 08:50:58 -07:00
Anatol Belski 890345eda0 fix spl_autoload_* 2013-07-04 06:41:48 -07:00
Anatol Belski ca0e018c95 windows fixes 2013-07-04 04:27:40 -07:00
Anthony Ferrara f4c4fe417a Get core test suite to really pass, fully. Woot 2013-07-02 11:51:45 -04:00
Anthony Ferrara 3db6b5112f Get basic language tests to all pass (minus xfails) 2013-07-02 11:27:48 -04:00
Anthony Ferrara 91abad1e1b Better test coverage 2013-07-02 10:20:01 -04:00
Anthony Ferrara 6e008d40c2 It compiles. Sort-of. In a way. Yeah. But nothing works. Sigh 2013-07-02 09:46:30 -04:00
Gernot Vormayr a90a93f1a4 Add apparmor change hat functionality to fpm 2013-07-02 13:06:02 +02:00
Anthony Ferrara 66845fb6a5 More work, get strings working, sort-of... 2013-07-01 17:59:11 -04:00
Anthony Ferrara 89aea2f103 Refactor file.c to use new string types 2013-07-01 17:15:25 -04:00
Anthony Ferrara ea58b542d6 Re-do a lot of it using a conditional define, and legacy type information for APIs 2013-07-01 16:53:54 -04:00
1006 changed files with 34037 additions and 32140 deletions

No files matched your search

+35 -31
View File
@@ -58,13 +58,14 @@ Type specifiers
zend_fcall_info and zend_fcall_info_cache)
h - array (returned as HashTable*)
H - array or HASH_OF(object) (returned as HashTable*)
l - long (long)
L - long, limits out-of-range numbers to LONG_MAX/LONG_MIN (long)
i - php_int_t (zend_int_t), platform dependent
I - php_int_t, limits out-of-range numbers to ZEND_INT_MAX/ZEND_INT_MIN (zend_int_t),
platform dependent
o - object of any type (zval*)
O - object of specific type given by class entry (zval*, zend_class_entry)
p - valid path (string without null bytes in the middle) and its length (char*, int)
P - valid path (string without null bytes in the middle) and its length (char*, php_size_t)
r - resource (zval*)
s - string (with possible null bytes) and its length (char*, int)
S - string (with possible null bytes) and its length (char*, php_size_t)
z - the actual zval (zval*)
Z - the actual zval (zval**)
* - variable arguments list (0 or more)
@@ -79,30 +80,33 @@ Type specifiers
! - the parameter it follows can be of specified type or NULL. If NULL is
passed and the output for such type is a pointer, then the output
pointer is set to a native NULL pointer.
For 'b', 'l' and 'd', an extra argument of type zend_bool* must be
passed after the corresponding bool*, long* or double* arguments,
For 'b', 'i' and 'd', an extra argument of type zend_bool* must be
passed after the corresponding bool*, php_int_t* or double* arguments,
respectively. A non-zero value will be written to the zend_bool iif a
PHP NULL is passed.
Note on 64bit compatibility
---------------------------
Please do not forget that int and long are two different things on 64bit
OSes (int is 4 bytes and long is 8 bytes), so make sure you pass longs to "l"
and ints to strings length (i.e. for "s" you need to pass char * and int),
not the other way round!
Remember: "l" is the only case when you need to pass long (and that's why
it's "l", not "i" btw).
Please do not forget that php_int_t and php_size_t are platform dependent,
you can consult Zend/zend_int.h for which type exactly these are mapped to.
In previous versions, long was used for integers and int for string
sizes. Now make sure you pass php_int_t to "i" and php_size_t to strings length
(i.e. for "S" you need to pass char * and php_size_t), not the other way round!
Remember: "i" is the only case when you need to pass platform depnedent integer
(and that's why it's "i", not "l" anymore). The old formats 'l' and 's' aren't
supported anymore. Passing int instead of php_size_t, or long instead of
php_int_t is wrong.
Both mistakes cause memory corruptions and segfaults on 64bit OSes:
1)
char *str;
long str_len; /* XXX THIS IS WRONG!! Use int instead. */
zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len)
int str_len; /* XXX THIS IS WRONG!! Use php_size_t instead. */
zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &str, &str_len)
2)
int num; /* XXX THIS IS WRONG!! Use long instead. */
zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &num)
long num; /* XXX THIS IS WRONG!! Use php_int_t instead. */
zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "i", &num)
If you're in doubt, use check_parameters.php script to the parameters
and their types (it can be found in ./scripts/dev/ directory of PHP sources):
@@ -112,12 +116,12 @@ and their types (it can be found in ./scripts/dev/ directory of PHP sources):
Examples
--------
/* Gets a long, a string and its length, and a zval */
long l;
/* Gets a php_int_t, a string and its length, and a zval */
php_int_t i;
char *s;
int s_len;
php_size_t s_len;
zval *param;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lsz",
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "iSz",
&l, &s, &s_len, &param) == FAILURE) {
return;
}
@@ -150,8 +154,8 @@ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/!",
return;
}
/* Get either a set of 3 longs or a string. */
long l1, l2, l3;
/* Get either a set of 3 php_int_t vars or a string. */
php_int_t i1, i2, i3;
char *s;
/*
* The function expects a pointer to a integer in this case, not a long
@@ -160,13 +164,13 @@ char *s;
* properly, leading to random crashes on platforms like
* Tru64 or Linux/Alpha.
*/
int length;
php_size_t length;
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC,
"lll", &l1, &l2, &l3) == SUCCESS) {
/* manipulate longs */
"iii", &i1, &i2, &i3) == SUCCESS) {
/* manipulate php_int_t */
} else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC,
"s", &s, &length) == SUCCESS) {
"S", &s, &length) == SUCCESS) {
/* manipulate string */
} else {
/* output error */
@@ -197,11 +201,11 @@ if (varargs) {
/* Function that accepts a string, followed by varargs (1 or more) */
char *str;
int str_len;
php_size_t str_len;
int i, num_varargs;
zval ***varargs = NULL;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s+", &str, &str_len, &varargs, &num_varargs) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S+", &str, &str_len, &varargs, &num_varargs) == FAILURE) {
return;
}
@@ -214,13 +218,13 @@ if (varargs) {
}
/* Function that takes an array, followed by varargs, and ending with a long */
long num;
/* Function that takes an array, followed by varargs, and ending with a php_int_t */
php_int_t num;
zval *array;
int i, num_varargs;
zval ***varargs = NULL;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a*l", &array, &varargs, &num_varargs, &num) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a*i", &array, &varargs, &num_varargs, &num) == FAILURE) {
return;
}
+1 -1
View File
@@ -64,7 +64,7 @@ typedef int ts_rsrc_id;
/* Define THREAD_T and MUTEX_T */
#ifdef TSRM_WIN32
# define THREAD_T DWORD
# define THREAD_T UINT_PTR
# define MUTEX_T CRITICAL_SECTION *
#elif defined(GNUPTH)
# define THREAD_T pth_t
+4
View File
@@ -375,6 +375,10 @@ SOURCE=.\zend_istdiostream.h
# End Source File
# Begin Source File
SOURCE=.\zend_int.h
# End Source File
# Begin Source File
SOURCE=".\zend_language_parser.h"
# End Source File
# Begin Source File
+1 -1
View File
@@ -130,7 +130,7 @@ int main()
exit(1);
}
], [
AC_DEFINE([ZEND_DVAL_TO_LVAL_CAST_OK], 1, [Define if double cast to long preserves least significant bits])
AC_DEFINE([ZEND_DVAL_TO_IVAL_CAST_OK], 1, [Define if double cast to long preserves least significant bits])
AC_MSG_RESULT(yes)
], [
AC_MSG_RESULT(no)
+4
View File
@@ -405,6 +405,10 @@ SOURCE=.\zend_iterators.h
# End Source File
# Begin Source File
SOURCE=.\zend_int.h
# End Source File
# Begin Source File
SOURCE=".\zend_language_parser.h"
# End Source File
# Begin Source File
+47 -47
View File
@@ -46,22 +46,22 @@
/* true multithread-shared globals */
ZEND_API zend_class_entry *zend_standard_class_def = NULL;
ZEND_API int (*zend_printf)(const char *format, ...);
ZEND_API zend_size_t (*zend_printf)(const char *format, ...);
ZEND_API zend_write_func_t zend_write;
ZEND_API FILE *(*zend_fopen)(const char *filename, char **opened_path TSRMLS_DC);
ZEND_API int (*zend_stream_open_function)(const char *filename, zend_file_handle *handle TSRMLS_DC);
ZEND_API void (*zend_block_interruptions)(void);
ZEND_API void (*zend_unblock_interruptions)(void);
ZEND_API void (*zend_ticks_function)(int ticks);
ZEND_API void (*zend_error_cb)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args);
int (*zend_vspprintf)(char **pbuf, size_t max_len, const char *format, va_list ap);
ZEND_API void (*zend_error_cb)(int type, const char *error_filename, const zend_size_t error_lineno, const char *format, va_list args);
zend_size_t (*zend_vspprintf)(char **pbuf, zend_size_t max_len, const char *format, va_list ap);
ZEND_API char *(*zend_getenv)(char *name, size_t name_len TSRMLS_DC);
ZEND_API char *(*zend_resolve_path)(const char *filename, int filename_len TSRMLS_DC);
ZEND_API char *(*zend_resolve_path)(const char *filename, zend_size_t filename_len TSRMLS_DC);
void (*zend_on_timeout)(int seconds TSRMLS_DC);
static void (*zend_message_dispatcher_p)(long message, const void *data TSRMLS_DC);
static int (*zend_get_configuration_directive_p)(const char *name, uint name_length, zval *contents);
static void (*zend_message_dispatcher_p)(zend_int_t message, const void *data TSRMLS_DC);
static int (*zend_get_configuration_directive_p)(const char *name, zend_size_t name_length, zval *contents);
static ZEND_INI_MH(OnUpdateErrorReporting) /* {{{ */
{
@@ -127,7 +127,7 @@ ZEND_API zval zval_used_for_init; /* True global variable */
/* version information */
static char *zend_version_info;
static uint zend_version_info_length;
static zend_size_t zend_version_info_length;
#define ZEND_CORE_VERSION_INFO "Zend Engine v" ZEND_VERSION ", Copyright (c) 1998-2014 Zend Technologies\n"
#define PRINT_ZVAL_INDENT 4
@@ -136,8 +136,8 @@ static void print_hash(zend_write_func_t write_func, HashTable *ht, int indent,
zval **tmp;
char *string_key;
HashPosition iterator;
ulong num_key;
uint str_len;
zend_uint_t num_key;
zend_size_t str_len;
int i;
for (i = 0; i < indent; i++) {
@@ -155,8 +155,8 @@ static void print_hash(zend_write_func_t write_func, HashTable *ht, int indent,
case HASH_KEY_IS_STRING:
if (is_object) {
const char *prop_name, *class_name;
int prop_len;
int mangled = zend_unmangle_property_name_ex(string_key, str_len - 1, &class_name, &prop_name, &prop_len);
zend_size_t prop_len;
zend_size_t mangled = zend_unmangle_property_name_ex(string_key, str_len - 1, &class_name, &prop_name, &prop_len);
ZEND_WRITE_EX(prop_name, prop_len);
if (class_name && mangled == SUCCESS) {
@@ -172,10 +172,10 @@ static void print_hash(zend_write_func_t write_func, HashTable *ht, int indent,
ZEND_WRITE_EX(string_key, str_len-1);
}
break;
case HASH_KEY_IS_LONG:
case HASH_KEY_IS_INT:
{
char key[25];
snprintf(key, sizeof(key), "%ld", num_key);
snprintf(key, sizeof(key), ZEND_INT_FMT, num_key);
ZEND_PUTS_EX(key);
}
break;
@@ -198,8 +198,8 @@ static void print_flat_hash(HashTable *ht TSRMLS_DC) /* {{{ */
zval **tmp;
char *string_key;
HashPosition iterator;
ulong num_key;
uint str_len;
zend_uint_t num_key;
zend_size_t str_len;
int i = 0;
zend_hash_internal_pointer_reset_ex(ht, &iterator);
@@ -212,8 +212,8 @@ static void print_flat_hash(HashTable *ht TSRMLS_DC) /* {{{ */
case HASH_KEY_IS_STRING:
ZEND_PUTS(string_key);
break;
case HASH_KEY_IS_LONG:
zend_printf("%ld", num_key);
case HASH_KEY_IS_INT:
zend_printf(ZEND_INT_FMT, num_key);
break;
}
ZEND_PUTS("] => ");
@@ -231,26 +231,26 @@ ZEND_API void zend_make_printable_zval(zval *expr, zval *expr_copy, int *use_cop
}
switch (Z_TYPE_P(expr)) {
case IS_NULL:
Z_STRLEN_P(expr_copy) = 0;
Z_STRSIZE_P(expr_copy) = 0;
Z_STRVAL_P(expr_copy) = STR_EMPTY_ALLOC();
break;
case IS_BOOL:
if (Z_LVAL_P(expr)) {
Z_STRLEN_P(expr_copy) = 1;
if (Z_IVAL_P(expr)) {
Z_STRSIZE_P(expr_copy) = 1;
Z_STRVAL_P(expr_copy) = estrndup("1", 1);
} else {
Z_STRLEN_P(expr_copy) = 0;
Z_STRSIZE_P(expr_copy) = 0;
Z_STRVAL_P(expr_copy) = STR_EMPTY_ALLOC();
}
break;
case IS_RESOURCE:
Z_STRVAL_P(expr_copy) = (char *) emalloc(sizeof("Resource id #") - 1 + MAX_LENGTH_OF_LONG);
Z_STRLEN_P(expr_copy) = snprintf(Z_STRVAL_P(expr_copy), sizeof("Resource id #") - 1 + MAX_LENGTH_OF_LONG, "Resource id #%ld", Z_LVAL_P(expr));
Z_STRVAL_P(expr_copy) = (char *) emalloc(sizeof("Resource id #") - 1 + MAX_LENGTH_OF_ZEND_INT);
Z_STRSIZE_P(expr_copy) = snprintf(Z_STRVAL_P(expr_copy), sizeof("Resource id #") - 1 + MAX_LENGTH_OF_ZEND_INT, "Resource id #" ZEND_INT_FMT, Z_IVAL_P(expr));
break;
case IS_ARRAY:
zend_error(E_NOTICE, "Array to string conversion");
Z_STRLEN_P(expr_copy) = sizeof("Array") - 1;
Z_STRVAL_P(expr_copy) = estrndup("Array", Z_STRLEN_P(expr_copy));
Z_STRSIZE_P(expr_copy) = sizeof("Array") - 1;
Z_STRVAL_P(expr_copy) = estrndup("Array", Z_STRSIZE_P(expr_copy));
break;
case IS_OBJECT:
{
@@ -288,7 +288,7 @@ ZEND_API void zend_make_printable_zval(zval *expr, zval *expr_copy, int *use_cop
zval_ptr_dtor(&z);
}
zend_error(EG(exception) ? E_ERROR : E_RECOVERABLE_ERROR, "Object of class %s could not be converted to string", Z_OBJCE_P(expr)->name);
Z_STRLEN_P(expr_copy) = 0;
Z_STRSIZE_P(expr_copy) = 0;
Z_STRVAL_P(expr_copy) = STR_EMPTY_ALLOC();
}
break;
@@ -308,13 +308,13 @@ ZEND_API void zend_make_printable_zval(zval *expr, zval *expr_copy, int *use_cop
}
/* }}} */
ZEND_API int zend_print_zval(zval *expr, int indent) /* {{{ */
ZEND_API zend_size_t zend_print_zval(zval *expr, int indent) /* {{{ */
{
return zend_print_zval_ex(zend_write, expr, indent);
}
/* }}} */
ZEND_API int zend_print_zval_ex(zend_write_func_t write_func, zval *expr, int indent) /* {{{ */
ZEND_API zend_size_t zend_print_zval_ex(zend_write_func_t write_func, zval *expr, int indent) /* {{{ */
{
zval expr_copy;
int use_copy;
@@ -323,17 +323,17 @@ ZEND_API int zend_print_zval_ex(zend_write_func_t write_func, zval *expr, int in
if (use_copy) {
expr = &expr_copy;
}
if (Z_STRLEN_P(expr) == 0) { /* optimize away empty strings */
if (Z_STRSIZE_P(expr) == 0) { /* optimize away empty strings */
if (use_copy) {
zval_dtor(expr);
}
return 0;
}
write_func(Z_STRVAL_P(expr), Z_STRLEN_P(expr));
write_func(Z_STRVAL_P(expr), Z_STRSIZE_P(expr));
if (use_copy) {
zval_dtor(expr);
}
return Z_STRLEN_P(expr);
return Z_STRSIZE_P(expr);
}
/* }}} */
@@ -355,7 +355,7 @@ ZEND_API void zend_print_flat_zval_r(zval *expr TSRMLS_DC) /* {{{ */
{
HashTable *properties = NULL;
const char *class_name = NULL;
zend_uint clen;
zend_size_t clen;
if (Z_OBJ_HANDLER_P(expr, get_class_name)) {
Z_OBJ_HANDLER_P(expr, get_class_name)(expr, &class_name, &clen, 0 TSRMLS_CC);
@@ -413,7 +413,7 @@ ZEND_API void zend_print_zval_r_ex(zend_write_func_t write_func, zval *expr, int
{
HashTable *properties;
const char *class_name = NULL;
zend_uint clen;
zend_size_t clen;
int is_temp;
if (Z_OBJ_HANDLER_P(expr, get_class_name)) {
@@ -621,7 +621,7 @@ static void php_scanner_globals_ctor(zend_php_scanner_globals *scanner_globals_p
void zend_init_opcodes_handlers(void);
static zend_bool php_auto_globals_create_globals(const char *name, uint name_len TSRMLS_DC) /* {{{ */
static zend_bool php_auto_globals_create_globals(const char *name, zend_size_t name_len TSRMLS_DC) /* {{{ */
{
zval *globals;
@@ -870,7 +870,7 @@ void zenderror(const char *error) /* {{{ */
/* }}} */
BEGIN_EXTERN_C()
ZEND_API void _zend_bailout(char *filename, uint lineno) /* {{{ */
ZEND_API void _zend_bailout(char *filename, zend_size_t lineno) /* {{{ */
{
TSRMLS_FETCH();
@@ -890,7 +890,7 @@ END_EXTERN_C()
void zend_append_version_info(const zend_extension *extension) /* {{{ */
{
char *new_info;
uint new_info_length;
zend_size_t new_info_length;
new_info_length = sizeof(" with v, , by \n")
+ strlen(extension->name)
@@ -981,7 +981,7 @@ ZEND_API void zend_deactivate(TSRMLS_D) /* {{{ */
/* }}} */
BEGIN_EXTERN_C()
ZEND_API void zend_message_dispatcher(long message, const void *data TSRMLS_DC) /* {{{ */
ZEND_API void zend_message_dispatcher(zend_int_t message, const void *data TSRMLS_DC) /* {{{ */
{
if (zend_message_dispatcher_p) {
zend_message_dispatcher_p(message, data TSRMLS_CC);
@@ -990,7 +990,7 @@ ZEND_API void zend_message_dispatcher(long message, const void *data TSRMLS_DC)
/* }}} */
END_EXTERN_C()
ZEND_API int zend_get_configuration_directive(const char *name, uint name_length, zval *contents) /* {{{ */
ZEND_API int zend_get_configuration_directive(const char *name, zend_size_t name_length, zval *contents) /* {{{ */
{
if (zend_get_configuration_directive_p) {
return zend_get_configuration_directive_p(name, name_length, contents);
@@ -1025,7 +1025,7 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
zval *retval;
zval *z_error_type, *z_error_message, *z_error_filename, *z_error_lineno, *z_context;
const char *error_filename;
uint error_lineno;
zend_size_t error_lineno;
zval *orig_user_error_handler;
zend_bool in_compilation;
zend_class_entry *saved_class_entry;
@@ -1150,21 +1150,21 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
# endif
#endif
va_copy(usr_copy, args);
Z_STRLEN_P(z_error_message) = zend_vspprintf(&Z_STRVAL_P(z_error_message), 0, format, usr_copy);
Z_STRSIZE_P(z_error_message) = zend_vspprintf(&Z_STRVAL_P(z_error_message), 0, format, usr_copy);
#ifdef va_copy
va_end(usr_copy);
#endif
Z_TYPE_P(z_error_message) = IS_STRING;
Z_LVAL_P(z_error_type) = type;
Z_TYPE_P(z_error_type) = IS_LONG;
Z_IVAL_P(z_error_type) = type;
Z_TYPE_P(z_error_type) = IS_INT;
if (error_filename) {
ZVAL_STRING(z_error_filename, error_filename, 1);
}
Z_LVAL_P(z_error_lineno) = error_lineno;
Z_TYPE_P(z_error_lineno) = IS_LONG;
Z_IVAL_P(z_error_lineno) = error_lineno;
Z_TYPE_P(z_error_lineno) = IS_INT;
if (!EG(active_symbol_table)) {
zend_rebuild_symbol_table(TSRMLS_C);
@@ -1211,7 +1211,7 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
if (call_user_function_ex(CG(function_table), NULL, orig_user_error_handler, &retval, 5, params, 1, NULL TSRMLS_CC) == SUCCESS) {
if (retval) {
if (Z_TYPE_P(retval) == IS_BOOL && Z_LVAL_P(retval) == 0) {
if (Z_TYPE_P(retval) == IS_BOOL && Z_IVAL_P(retval) == 0) {
zend_error_cb(type, error_filename, error_lineno, format, args);
}
zval_ptr_dtor(&retval);
@@ -1302,7 +1302,7 @@ ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval **retval, int file_co
zend_file_handle *file_handle;
zend_op_array *orig_op_array = EG(active_op_array);
zval **orig_retval_ptr_ptr = EG(return_value_ptr_ptr);
long orig_interactive = CG(interactive);
zend_int_t orig_interactive = CG(interactive);
va_start(files, file_count);
for (i = 0; i < file_count; i++) {
@@ -1378,7 +1378,7 @@ ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval **retval, int file_co
ZEND_API char *zend_make_compiled_string_description(const char *name TSRMLS_DC) /* {{{ */
{
const char *cur_filename;
int cur_lineno;
zend_size_t cur_lineno;
char *compiled_string_description;
if (zend_is_compiling(TSRMLS_C)) {
+40 -40
View File
@@ -266,14 +266,14 @@ char *alloca ();
#define LONG_MIN (- LONG_MAX - 1)
#endif
#if SIZEOF_LONG == 4
#define MAX_LENGTH_OF_LONG 11
static const char long_min_digits[] = "2147483648";
#elif SIZEOF_LONG == 8
#define MAX_LENGTH_OF_LONG 20
static const char long_min_digits[] = "9223372036854775808";
#if SIZEOF_ZEND_INT == 4
#define MAX_LENGTH_OF_ZEND_INT 11
static const char int_min_digits[] = "2147483648";
#elif SIZEOF_ZEND_INT == 8
#define MAX_LENGTH_OF_ZEND_INT 20
static const char int_min_digits[] = "9223372036854775808";
#else
#error "Unknown SIZEOF_LONG"
#error "Unknown SIZEOF_ZEND_INT"
#endif
#define MAX_LENGTH_OF_DOUBLE 32
@@ -320,11 +320,11 @@ typedef struct _zend_object {
#include "zend_ast.h"
typedef union _zvalue_value {
long lval; /* long value */
zend_int_t lval; /* long value */
double dval; /* double value */
struct {
char *val;
int len;
zend_size_t len;
} str;
HashTable *ht; /* hash table value */
zend_object_value obj;
@@ -443,12 +443,12 @@ typedef struct _zend_unserialize_data zend_unserialize_data;
struct _zend_trait_method_reference {
const char* method_name;
unsigned int mname_len;
zend_size_t mname_len;
zend_class_entry *ce;
const char* class_name;
unsigned int cname_len;
zend_size_t cname_len;
};
typedef struct _zend_trait_method_reference zend_trait_method_reference;
@@ -466,7 +466,7 @@ struct _zend_trait_alias {
* name for method to be added
*/
const char* alias;
unsigned int alias_len;
zend_size_t alias_len;
/**
* modifiers to be set on trait method
@@ -478,7 +478,7 @@ typedef struct _zend_trait_alias zend_trait_alias;
struct _zend_class_entry {
char type;
const char *name;
zend_uint name_length;
zend_size_t name_length;
struct _zend_class_entry *parent;
int refcount;
zend_uint ce_flags;
@@ -512,11 +512,11 @@ struct _zend_class_entry {
zend_object_value (*create_object)(zend_class_entry *class_type TSRMLS_DC);
zend_object_iterator *(*get_iterator)(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC);
int (*interface_gets_implemented)(zend_class_entry *iface, zend_class_entry *class_type TSRMLS_DC); /* a class implements this interface */
union _zend_function *(*get_static_method)(zend_class_entry *ce, char* method, int method_len TSRMLS_DC);
union _zend_function *(*get_static_method)(zend_class_entry *ce, char* method, zend_size_t method_len TSRMLS_DC);
/* serializer callbacks */
int (*serialize)(zval *object, unsigned char **buffer, zend_uint *buf_len, zend_serialize_data *data TSRMLS_DC);
int (*unserialize)(zval **object, zend_class_entry *ce, const unsigned char *buf, zend_uint buf_len, zend_unserialize_data *data TSRMLS_DC);
int (*serialize)(zval *object, unsigned char **buffer, zend_size_t *buf_len, zend_serialize_data *data TSRMLS_DC);
int (*unserialize)(zval **object, zend_class_entry *ce, const unsigned char *buf, zend_size_t buf_len, zend_unserialize_data *data TSRMLS_DC);
zend_class_entry **interfaces;
zend_uint num_interfaces;
@@ -529,10 +529,10 @@ struct _zend_class_entry {
union {
struct {
const char *filename;
zend_uint line_start;
zend_uint line_end;
zend_size_t line_start;
zend_size_t line_end;
const char *doc_comment;
zend_uint doc_comment_len;
zend_size_t doc_comment_len;
} user;
struct {
const struct _zend_function_entry *builtin_functions;
@@ -543,29 +543,29 @@ struct _zend_class_entry {
#include "zend_stream.h"
typedef struct _zend_utility_functions {
void (*error_function)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 4, 0);
int (*printf_function)(const char *format, ...) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 1, 2);
int (*write_function)(const char *str, uint str_length);
void (*error_function)(int type, const char *error_filename, const zend_size_t error_lineno, const char *format, va_list args) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 4, 0);
zend_size_t (*printf_function)(const char *format, ...) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 1, 2);
zend_size_t (*write_function)(const char *str, zend_size_t str_length);
FILE *(*fopen_function)(const char *filename, char **opened_path TSRMLS_DC);
void (*message_handler)(long message, const void *data TSRMLS_DC);
void (*message_handler)(zend_int_t message, const void *data TSRMLS_DC);
void (*block_interruptions)(void);
void (*unblock_interruptions)(void);
int (*get_configuration_directive)(const char *name, uint name_length, zval *contents);
int (*get_configuration_directive)(const char *name, zend_size_t name_length, zval *contents);
void (*ticks_function)(int ticks);
void (*on_timeout)(int seconds TSRMLS_DC);
int (*stream_open_function)(const char *filename, zend_file_handle *handle TSRMLS_DC);
int (*vspprintf_function)(char **pbuf, size_t max_len, const char *format, va_list ap);
char *(*getenv_function)(char *name, size_t name_len TSRMLS_DC);
char *(*resolve_path_function)(const char *filename, int filename_len TSRMLS_DC);
zend_size_t (*vspprintf_function)(char **pbuf, zend_size_t max_len, const char *format, va_list ap);
char *(*getenv_function)(char *name, zend_size_t name_len TSRMLS_DC);
char *(*resolve_path_function)(const char *filename, zend_size_t filename_len TSRMLS_DC);
} zend_utility_functions;
typedef struct _zend_utility_values {
char *import_use_extension;
uint import_use_extension_length;
zend_size_t import_use_extension_length;
zend_bool html_errors;
} zend_utility_values;
typedef int (*zend_write_func_t)(const char *str, uint str_length);
typedef int (*zend_write_func_t)(const char *str, zend_size_t str_length);
#undef MIN
#undef MAX
@@ -581,7 +581,7 @@ typedef int (*zend_write_func_t)(const char *str, uint str_length);
/* data types */
/* All data types <= IS_BOOL have their constructor/destructors skipped */
#define IS_NULL 0
#define IS_LONG 1
#define IS_INT 1
#define IS_DOUBLE 2
#define IS_BOOL 3
#define IS_ARRAY 4
@@ -612,7 +612,7 @@ void zend_post_startup(TSRMLS_D);
void zend_set_utility_values(zend_utility_values *utility_values);
BEGIN_EXTERN_C()
ZEND_API void _zend_bailout(char *filename, uint lineno);
ZEND_API void _zend_bailout(char *filename, zend_size_t lineno);
END_EXTERN_C()
#define zend_bailout() _zend_bailout(__FILE__, __LINE__)
@@ -646,8 +646,8 @@ END_EXTERN_C()
BEGIN_EXTERN_C()
ZEND_API char *get_zend_version(void);
ZEND_API void zend_make_printable_zval(zval *expr, zval *expr_copy, int *use_copy);
ZEND_API int zend_print_zval(zval *expr, int indent);
ZEND_API int zend_print_zval_ex(zend_write_func_t write_func, zval *expr, int indent);
ZEND_API zend_size_t zend_print_zval(zval *expr, int indent);
ZEND_API zend_size_t zend_print_zval_ex(zend_write_func_t write_func, zval *expr, int indent);
ZEND_API void zend_print_zval_r(zval *expr, int indent TSRMLS_DC);
ZEND_API void zend_print_flat_zval_r(zval *expr TSRMLS_DC);
ZEND_API void zend_print_zval_r_ex(zend_write_func_t write_func, zval *expr, int indent TSRMLS_DC);
@@ -695,18 +695,18 @@ END_EXTERN_C()
#define ZEND_PUTC(c) zend_write(&(c), 1)
BEGIN_EXTERN_C()
extern ZEND_API int (*zend_printf)(const char *format, ...) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 1, 2);
extern ZEND_API zend_size_t (*zend_printf)(const char *format, ...) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 1, 2);
extern ZEND_API zend_write_func_t zend_write;
extern ZEND_API FILE *(*zend_fopen)(const char *filename, char **opened_path TSRMLS_DC);
extern ZEND_API void (*zend_block_interruptions)(void);
extern ZEND_API void (*zend_unblock_interruptions)(void);
extern ZEND_API void (*zend_ticks_function)(int ticks);
extern ZEND_API void (*zend_error_cb)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 4, 0);
extern ZEND_API void (*zend_error_cb)(int type, const char *error_filename, const zend_size_t error_lineno, const char *format, va_list args) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 4, 0);
extern ZEND_API void (*zend_on_timeout)(int seconds TSRMLS_DC);
extern ZEND_API int (*zend_stream_open_function)(const char *filename, zend_file_handle *handle TSRMLS_DC);
extern int (*zend_vspprintf)(char **pbuf, size_t max_len, const char *format, va_list ap);
extern ZEND_API char *(*zend_getenv)(char *name, size_t name_len TSRMLS_DC);
extern ZEND_API char *(*zend_resolve_path)(const char *filename, int filename_len TSRMLS_DC);
extern zend_size_t (*zend_vspprintf)(char **pbuf, zend_size_t max_len, const char *format, va_list ap);
extern ZEND_API char *(*zend_getenv)(char *name, zend_size_t name_len TSRMLS_DC);
extern ZEND_API char *(*zend_resolve_path)(const char *filename, zend_size_t filename_len TSRMLS_DC);
ZEND_API void zend_error(int type, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
@@ -733,9 +733,9 @@ END_EXTERN_C()
#endif
BEGIN_EXTERN_C()
ZEND_API void zend_message_dispatcher(long message, const void *data TSRMLS_DC);
ZEND_API void zend_message_dispatcher(zend_int_t message, const void *data TSRMLS_DC);
ZEND_API int zend_get_configuration_directive(const char *name, uint name_length, zval *contents);
ZEND_API int zend_get_configuration_directive(const char *name, zend_size_t name_length, zval *contents);
END_EXTERN_C()
/* Messages for applications of Zend */
+176 -169
View File
File diff suppressed because it is too large. Load diff
+96 -96
View File
@@ -28,7 +28,7 @@
#include "zend_operators.h"
#include "zend_variables.h"
#include "zend_execute.h"
#include "zend_types.h"
BEGIN_EXTERN_C()
@@ -171,7 +171,7 @@ typedef struct _zend_fcall_info_cache {
#define INIT_OVERLOADED_CLASS_ENTRY_EX(class_container, class_name, class_name_len, functions, handle_fcall, handle_propget, handle_propset, handle_propunset, handle_propisset) \
{ \
const char *cl_name = class_name; \
int _len = class_name_len; \
zend_size_t _len = class_name_len; \
class_container.name = zend_new_interned_string(cl_name, _len+1, 0 TSRMLS_CC); \
if (class_container.name == cl_name) { \
class_container.name = zend_strndup(cl_name, _len); \
@@ -281,15 +281,15 @@ ZEND_API zend_class_entry *zend_register_internal_class_ex(zend_class_entry *cla
ZEND_API zend_class_entry *zend_register_internal_interface(zend_class_entry *orig_class_entry TSRMLS_DC);
ZEND_API void zend_class_implements(zend_class_entry *class_entry TSRMLS_DC, int num_interfaces, ...);
ZEND_API int zend_register_class_alias_ex(const char *name, int name_len, zend_class_entry *ce TSRMLS_DC);
ZEND_API int zend_register_class_alias_ex(const char *name, zend_size_t name_len, zend_class_entry *ce TSRMLS_DC);
#define zend_register_class_alias(name, ce) \
zend_register_class_alias_ex(name, sizeof(name)-1, ce TSRMLS_CC)
#define zend_register_ns_class_alias(ns, name, ce) \
zend_register_class_alias_ex(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, ce TSRMLS_CC)
ZEND_API int zend_disable_function(char *function_name, uint function_name_length TSRMLS_DC);
ZEND_API int zend_disable_class(char *class_name, uint class_name_length TSRMLS_DC);
ZEND_API int zend_disable_function(char *function_name, zend_size_t function_name_length TSRMLS_DC);
ZEND_API int zend_disable_class(char *class_name, zend_size_t class_name_length TSRMLS_DC);
ZEND_API void zend_wrong_param_count(TSRMLS_D);
@@ -300,51 +300,51 @@ ZEND_API void zend_wrong_param_count(TSRMLS_D);
#define IS_CALLABLE_STRICT (IS_CALLABLE_CHECK_IS_STATIC)
ZEND_API zend_bool zend_is_callable_ex(zval *callable, zval *object_ptr, uint check_flags, char **callable_name, int *callable_name_len, zend_fcall_info_cache *fcc, char **error TSRMLS_DC);
ZEND_API zend_bool zend_is_callable_ex(zval *callable, zval *object_ptr, uint check_flags, char **callable_name, zend_size_t *callable_name_len, zend_fcall_info_cache *fcc, char **error TSRMLS_DC);
ZEND_API zend_bool zend_is_callable(zval *callable, uint check_flags, char **callable_name TSRMLS_DC);
ZEND_API zend_bool zend_make_callable(zval *callable, char **callable_name TSRMLS_DC);
ZEND_API const char *zend_get_module_version(const char *module_name);
ZEND_API int zend_get_module_started(const char *module_name);
ZEND_API int zend_declare_property(zend_class_entry *ce, const char *name, int name_length, zval *property, int access_type TSRMLS_DC);
ZEND_API int zend_declare_property_ex(zend_class_entry *ce, const char *name, int name_length, zval *property, int access_type, const char *doc_comment, int doc_comment_len TSRMLS_DC);
ZEND_API int zend_declare_property_null(zend_class_entry *ce, const char *name, int name_length, int access_type TSRMLS_DC);
ZEND_API int zend_declare_property_bool(zend_class_entry *ce, const char *name, int name_length, long value, int access_type TSRMLS_DC);
ZEND_API int zend_declare_property_long(zend_class_entry *ce, const char *name, int name_length, long value, int access_type TSRMLS_DC);
ZEND_API int zend_declare_property_double(zend_class_entry *ce, const char *name, int name_length, double value, int access_type TSRMLS_DC);
ZEND_API int zend_declare_property_string(zend_class_entry *ce, const char *name, int name_length, const char *value, int access_type TSRMLS_DC);
ZEND_API int zend_declare_property_stringl(zend_class_entry *ce, const char *name, int name_length, const char *value, int value_len, int access_type TSRMLS_DC);
ZEND_API int zend_declare_property(zend_class_entry *ce, const char *name, zend_size_t name_length, zval *property, int access_type TSRMLS_DC);
ZEND_API int zend_declare_property_ex(zend_class_entry *ce, const char *name, zend_size_t name_length, zval *property, int access_type, const char *doc_comment, zend_size_t doc_comment_len TSRMLS_DC);
ZEND_API int zend_declare_property_null(zend_class_entry *ce, const char *name, zend_size_t name_length, int access_type TSRMLS_DC);
ZEND_API int zend_declare_property_bool(zend_class_entry *ce, const char *name, zend_size_t name_length, zend_int_t value, int access_type TSRMLS_DC);
ZEND_API int zend_declare_property_int(zend_class_entry *ce, const char *name, zend_size_t name_length, zend_int_t value, int access_type TSRMLS_DC);
ZEND_API int zend_declare_property_double(zend_class_entry *ce, const char *name, zend_size_t name_length, double value, int access_type TSRMLS_DC);
ZEND_API int zend_declare_property_string(zend_class_entry *ce, const char *name, zend_size_t name_length, const char *value, int access_type TSRMLS_DC);
ZEND_API int zend_declare_property_stringl(zend_class_entry *ce, const char *name, zend_size_t name_length, const char *value, zend_size_t value_len, int access_type TSRMLS_DC);
ZEND_API int zend_declare_class_constant(zend_class_entry *ce, const char *name, size_t name_length, zval *value TSRMLS_DC);
ZEND_API int zend_declare_class_constant_null(zend_class_entry *ce, const char *name, size_t name_length TSRMLS_DC);
ZEND_API int zend_declare_class_constant_long(zend_class_entry *ce, const char *name, size_t name_length, long value TSRMLS_DC);
ZEND_API int zend_declare_class_constant_bool(zend_class_entry *ce, const char *name, size_t name_length, zend_bool value TSRMLS_DC);
ZEND_API int zend_declare_class_constant_double(zend_class_entry *ce, const char *name, size_t name_length, double value TSRMLS_DC);
ZEND_API int zend_declare_class_constant_stringl(zend_class_entry *ce, const char *name, size_t name_length, const char *value, size_t value_length TSRMLS_DC);
ZEND_API int zend_declare_class_constant_string(zend_class_entry *ce, const char *name, size_t name_length, const char *value TSRMLS_DC);
ZEND_API int zend_declare_class_constant(zend_class_entry *ce, const char *name, zend_size_t name_length, zval *value TSRMLS_DC);
ZEND_API int zend_declare_class_constant_null(zend_class_entry *ce, const char *name, zend_size_t name_length TSRMLS_DC);
ZEND_API int zend_declare_class_constant_int(zend_class_entry *ce, const char *name, zend_size_t name_length, zend_int_t value TSRMLS_DC);
ZEND_API int zend_declare_class_constant_bool(zend_class_entry *ce, const char *name, zend_size_t name_length, zend_bool value TSRMLS_DC);
ZEND_API int zend_declare_class_constant_double(zend_class_entry *ce, const char *name, zend_size_t name_length, double value TSRMLS_DC);
ZEND_API int zend_declare_class_constant_stringl(zend_class_entry *ce, const char *name, zend_size_t name_length, const char *value, zend_size_t value_length TSRMLS_DC);
ZEND_API int zend_declare_class_constant_string(zend_class_entry *ce, const char *name, zend_size_t name_length, const char *value TSRMLS_DC);
ZEND_API void zend_update_class_constants(zend_class_entry *class_type TSRMLS_DC);
ZEND_API void zend_update_property(zend_class_entry *scope, zval *object, const char *name, int name_length, zval *value TSRMLS_DC);
ZEND_API void zend_update_property_null(zend_class_entry *scope, zval *object, const char *name, int name_length TSRMLS_DC);
ZEND_API void zend_update_property_bool(zend_class_entry *scope, zval *object, const char *name, int name_length, long value TSRMLS_DC);
ZEND_API void zend_update_property_long(zend_class_entry *scope, zval *object, const char *name, int name_length, long value TSRMLS_DC);
ZEND_API void zend_update_property_double(zend_class_entry *scope, zval *object, const char *name, int name_length, double value TSRMLS_DC);
ZEND_API void zend_update_property_string(zend_class_entry *scope, zval *object, const char *name, int name_length, const char *value TSRMLS_DC);
ZEND_API void zend_update_property_stringl(zend_class_entry *scope, zval *object, const char *name, int name_length, const char *value, int value_length TSRMLS_DC);
ZEND_API void zend_update_property(zend_class_entry *scope, zval *object, const char *name, zend_size_t name_length, zval *value TSRMLS_DC);
ZEND_API void zend_update_property_null(zend_class_entry *scope, zval *object, const char *name, zend_size_t name_length TSRMLS_DC);
ZEND_API void zend_update_property_bool(zend_class_entry *scope, zval *object, const char *name, zend_size_t name_length, zend_int_t value TSRMLS_DC);
ZEND_API void zend_update_property_int(zend_class_entry *scope, zval *object, const char *name, zend_size_t name_length, zend_int_t value TSRMLS_DC);
ZEND_API void zend_update_property_double(zend_class_entry *scope, zval *object, const char *name, zend_size_t name_length, double value TSRMLS_DC);
ZEND_API void zend_update_property_string(zend_class_entry *scope, zval *object, const char *name, zend_size_t name_length, const char *value TSRMLS_DC);
ZEND_API void zend_update_property_stringl(zend_class_entry *scope, zval *object, const char *name, zend_size_t name_length, const char *value, zend_size_t value_length TSRMLS_DC);
ZEND_API int zend_update_static_property(zend_class_entry *scope, const char *name, int name_length, zval *value TSRMLS_DC);
ZEND_API int zend_update_static_property_null(zend_class_entry *scope, const char *name, int name_length TSRMLS_DC);
ZEND_API int zend_update_static_property_bool(zend_class_entry *scope, const char *name, int name_length, long value TSRMLS_DC);
ZEND_API int zend_update_static_property_long(zend_class_entry *scope, const char *name, int name_length, long value TSRMLS_DC);
ZEND_API int zend_update_static_property_double(zend_class_entry *scope, const char *name, int name_length, double value TSRMLS_DC);
ZEND_API int zend_update_static_property_string(zend_class_entry *scope, const char *name, int name_length, const char *value TSRMLS_DC);
ZEND_API int zend_update_static_property_stringl(zend_class_entry *scope, const char *name, int name_length, const char *value, int value_length TSRMLS_DC);
ZEND_API int zend_update_static_property(zend_class_entry *scope, const char *name, zend_size_t name_length, zval *value TSRMLS_DC);
ZEND_API int zend_update_static_property_null(zend_class_entry *scope, const char *name, zend_size_t name_length TSRMLS_DC);
ZEND_API int zend_update_static_property_bool(zend_class_entry *scope, const char *name, zend_size_t name_length, zend_int_t value TSRMLS_DC);
ZEND_API int zend_update_static_property_int(zend_class_entry *scope, const char *name, zend_size_t name_length, zend_int_t value TSRMLS_DC);
ZEND_API int zend_update_static_property_double(zend_class_entry *scope, const char *name, zend_size_t name_length, double value TSRMLS_DC);
ZEND_API int zend_update_static_property_string(zend_class_entry *scope, const char *name, zend_size_t name_length, const char *value TSRMLS_DC);
ZEND_API int zend_update_static_property_stringl(zend_class_entry *scope, const char *name, zend_size_t name_length, const char *value, zend_size_t value_length TSRMLS_DC);
ZEND_API zval *zend_read_property(zend_class_entry *scope, zval *object, const char *name, int name_length, zend_bool silent TSRMLS_DC);
ZEND_API zval *zend_read_property(zend_class_entry *scope, zval *object, const char *name, zend_size_t name_length, zend_bool silent TSRMLS_DC);
ZEND_API zval *zend_read_static_property(zend_class_entry *scope, const char *name, int name_length, zend_bool silent TSRMLS_DC);
ZEND_API zval *zend_read_static_property(zend_class_entry *scope, const char *name, zend_size_t name_length, zend_bool silent TSRMLS_DC);
ZEND_API zend_class_entry *zend_get_class_entry(const zval *zobject TSRMLS_DC);
ZEND_API int zend_get_object_classname(const zval *object, const char **class_name, zend_uint *class_name_len TSRMLS_DC);
ZEND_API int zend_get_object_classname(const zval *object, const char **class_name, zend_size_t *class_name_len TSRMLS_DC);
ZEND_API char *zend_get_type_by_const(int type);
#define getThis() (this_ptr)
@@ -365,7 +365,7 @@ ZEND_API char *zend_get_type_by_const(int type);
#define object_init(arg) _object_init((arg) ZEND_FILE_LINE_CC TSRMLS_CC)
#define object_init_ex(arg, ce) _object_init_ex((arg), (ce) ZEND_FILE_LINE_CC TSRMLS_CC)
#define object_and_properties_init(arg, ce, properties) _object_and_properties_init((arg), (ce), (properties) ZEND_FILE_LINE_CC TSRMLS_CC)
ZEND_API int _array_init(zval *arg, uint size ZEND_FILE_LINE_DC);
ZEND_API int _array_init(zval *arg, zend_uint_t size ZEND_FILE_LINE_DC);
ZEND_API int _object_init(zval *arg ZEND_FILE_LINE_DC TSRMLS_DC);
ZEND_API int _object_init_ex(zval *arg, zend_class_entry *ce ZEND_FILE_LINE_DC TSRMLS_DC);
ZEND_API int _object_and_properties_init(zval *arg, zend_class_entry *ce, HashTable *properties ZEND_FILE_LINE_DC TSRMLS_DC);
@@ -376,16 +376,16 @@ ZEND_API void zend_merge_properties(zval *obj, HashTable *properties, int destro
/* no longer supported */
ZEND_API int add_assoc_function(zval *arg, const char *key, void (*function_ptr)(INTERNAL_FUNCTION_PARAMETERS));
ZEND_API int add_assoc_long_ex(zval *arg, const char *key, uint key_len, long n);
ZEND_API int add_assoc_null_ex(zval *arg, const char *key, uint key_len);
ZEND_API int add_assoc_bool_ex(zval *arg, const char *key, uint key_len, int b);
ZEND_API int add_assoc_resource_ex(zval *arg, const char *key, uint key_len, int r);
ZEND_API int add_assoc_double_ex(zval *arg, const char *key, uint key_len, double d);
ZEND_API int add_assoc_string_ex(zval *arg, const char *key, uint key_len, char *str, int duplicate);
ZEND_API int add_assoc_stringl_ex(zval *arg, const char *key, uint key_len, char *str, uint length, int duplicate);
ZEND_API int add_assoc_zval_ex(zval *arg, const char *key, uint key_len, zval *value);
ZEND_API int add_assoc_int_ex(zval *arg, const char *key, zend_size_t key_len, zend_int_t n);
ZEND_API int add_assoc_null_ex(zval *arg, const char *key, zend_size_t key_len);
ZEND_API int add_assoc_bool_ex(zval *arg, const char *key, zend_size_t key_len, int b);
ZEND_API int add_assoc_resource_ex(zval *arg, const char *key, zend_size_t key_len, int r);
ZEND_API int add_assoc_double_ex(zval *arg, const char *key, zend_size_t key_len, double d);
ZEND_API int add_assoc_string_ex(zval *arg, const char *key, zend_size_t key_len, char *str, int duplicate);
ZEND_API int add_assoc_stringl_ex(zval *arg, const char *key, zend_size_t key_len, char *str, zend_size_t length, int duplicate);
ZEND_API int add_assoc_zval_ex(zval *arg, const char *key, zend_size_t key_len, zval *value);
#define add_assoc_long(__arg, __key, __n) add_assoc_long_ex(__arg, __key, strlen(__key)+1, __n)
#define add_assoc_int(__arg, __key, __n) add_assoc_int_ex(__arg, __key, strlen(__key)+1, __n)
#define add_assoc_null(__arg, __key) add_assoc_null_ex(__arg, __key, strlen(__key) + 1)
#define add_assoc_bool(__arg, __key, __b) add_assoc_bool_ex(__arg, __key, strlen(__key)+1, __b)
#define add_assoc_resource(__arg, __key, __r) add_assoc_resource_ex(__arg, __key, strlen(__key)+1, __r)
@@ -400,47 +400,47 @@ ZEND_API int add_assoc_zval_ex(zval *arg, const char *key, uint key_len, zval *v
#define add_next_index_unset(__arg) add_next_index_null(__arg)
#define add_property_unset(__arg, __key) add_property_null(__arg, __key)
ZEND_API int add_index_long(zval *arg, ulong idx, long n);
ZEND_API int add_index_null(zval *arg, ulong idx);
ZEND_API int add_index_bool(zval *arg, ulong idx, int b);
ZEND_API int add_index_resource(zval *arg, ulong idx, int r);
ZEND_API int add_index_double(zval *arg, ulong idx, double d);
ZEND_API int add_index_string(zval *arg, ulong idx, const char *str, int duplicate);
ZEND_API int add_index_stringl(zval *arg, ulong idx, const char *str, uint length, int duplicate);
ZEND_API int add_index_zval(zval *arg, ulong index, zval *value);
ZEND_API int add_index_int(zval *arg, zend_uint_t idx, zend_int_t n);
ZEND_API int add_index_null(zval *arg, zend_uint_t idx);
ZEND_API int add_index_bool(zval *arg, zend_uint_t idx, int b);
ZEND_API int add_index_resource(zval *arg, zend_uint_t idx, int r);
ZEND_API int add_index_double(zval *arg, zend_uint_t idx, double d);
ZEND_API int add_index_string(zval *arg, zend_uint_t idx, const char *str, int duplicate);
ZEND_API int add_index_stringl(zval *arg, zend_uint_t idx, const char *str, zend_size_t length, int duplicate);
ZEND_API int add_index_zval(zval *arg, zend_uint_t index, zval *value);
ZEND_API int add_next_index_long(zval *arg, long n);
ZEND_API int add_next_index_int(zval *arg, zend_int_t n);
ZEND_API int add_next_index_null(zval *arg);
ZEND_API int add_next_index_bool(zval *arg, int b);
ZEND_API int add_next_index_resource(zval *arg, int r);
ZEND_API int add_next_index_double(zval *arg, double d);
ZEND_API int add_next_index_string(zval *arg, const char *str, int duplicate);
ZEND_API int add_next_index_stringl(zval *arg, const char *str, uint length, int duplicate);
ZEND_API int add_next_index_stringl(zval *arg, const char *str, zend_size_t length, int duplicate);
ZEND_API int add_next_index_zval(zval *arg, zval *value);
ZEND_API int add_get_assoc_string_ex(zval *arg, const char *key, uint key_len, const char *str, void **dest, int duplicate);
ZEND_API int add_get_assoc_stringl_ex(zval *arg, const char *key, uint key_len, const char *str, uint length, void **dest, int duplicate);
ZEND_API int add_get_assoc_string_ex(zval *arg, const char *key, zend_size_t key_len, const char *str, void **dest, int duplicate);
ZEND_API int add_get_assoc_stringl_ex(zval *arg, const char *key, zend_size_t key_len, const char *str, zend_size_t length, void **dest, int duplicate);
#define add_get_assoc_string(__arg, __key, __str, __dest, __duplicate) add_get_assoc_string_ex(__arg, __key, strlen(__key)+1, __str, __dest, __duplicate)
#define add_get_assoc_stringl(__arg, __key, __str, __length, __dest, __duplicate) add_get_assoc_stringl_ex(__arg, __key, strlen(__key)+1, __str, __length, __dest, __duplicate)
ZEND_API int add_get_index_long(zval *arg, ulong idx, long l, void **dest);
ZEND_API int add_get_index_double(zval *arg, ulong idx, double d, void **dest);
ZEND_API int add_get_index_string(zval *arg, ulong idx, const char *str, void **dest, int duplicate);
ZEND_API int add_get_index_stringl(zval *arg, ulong idx, const char *str, uint length, void **dest, int duplicate);
ZEND_API int add_get_index_int(zval *arg, zend_uint_t idx, zend_int_t l, void **dest);
ZEND_API int add_get_index_double(zval *arg, zend_uint_t idx, double d, void **dest);
ZEND_API int add_get_index_string(zval *arg, zend_uint_t idx, const char *str, void **dest, int duplicate);
ZEND_API int add_get_index_stringl(zval *arg, zend_uint_t idx, const char *str, zend_size_t length, void **dest, int duplicate);
ZEND_API int array_set_zval_key(HashTable *ht, zval *key, zval *value);
ZEND_API int add_property_long_ex(zval *arg, const char *key, uint key_len, long l TSRMLS_DC);
ZEND_API int add_property_null_ex(zval *arg, const char *key, uint key_len TSRMLS_DC);
ZEND_API int add_property_bool_ex(zval *arg, const char *key, uint key_len, int b TSRMLS_DC);
ZEND_API int add_property_resource_ex(zval *arg, const char *key, uint key_len, long r TSRMLS_DC);
ZEND_API int add_property_double_ex(zval *arg, const char *key, uint key_len, double d TSRMLS_DC);
ZEND_API int add_property_string_ex(zval *arg, const char *key, uint key_len, const char *str, int duplicate TSRMLS_DC);
ZEND_API int add_property_stringl_ex(zval *arg, const char *key, uint key_len, const char *str, uint length, int duplicate TSRMLS_DC);
ZEND_API int add_property_zval_ex(zval *arg, const char *key, uint key_len, zval *value TSRMLS_DC);
ZEND_API int add_property_int_ex(zval *arg, const char *key, zend_size_t key_len, zend_int_t l TSRMLS_DC);
ZEND_API int add_property_null_ex(zval *arg, const char *key, zend_size_t key_len TSRMLS_DC);
ZEND_API int add_property_bool_ex(zval *arg, const char *key, zend_size_t key_len, int b TSRMLS_DC);
ZEND_API int add_property_resource_ex(zval *arg, const char *key, zend_size_t key_len, zend_int_t r TSRMLS_DC);
ZEND_API int add_property_double_ex(zval *arg, const char *key, zend_size_t key_len, double d TSRMLS_DC);
ZEND_API int add_property_string_ex(zval *arg, const char *key, zend_size_t key_len, const char *str, int duplicate TSRMLS_DC);
ZEND_API int add_property_stringl_ex(zval *arg, const char *key, zend_size_t key_len, const char *str, zend_size_t length, int duplicate TSRMLS_DC);
ZEND_API int add_property_zval_ex(zval *arg, const char *key, zend_size_t key_len, zval *value TSRMLS_DC);
#define add_property_long(__arg, __key, __n) add_property_long_ex(__arg, __key, strlen(__key)+1, __n TSRMLS_CC)
#define add_property_int(__arg, __key, __n) add_property_int_ex(__arg, __key, strlen(__key)+1, __n TSRMLS_CC)
#define add_property_null(__arg, __key) add_property_null_ex(__arg, __key, strlen(__key) + 1 TSRMLS_CC)
#define add_property_bool(__arg, __key, __b) add_property_bool_ex(__arg, __key, strlen(__key)+1, __b TSRMLS_CC)
#define add_property_resource(__arg, __key, __r) add_property_resource_ex(__arg, __key, strlen(__key)+1, __r TSRMLS_CC)
@@ -512,19 +512,19 @@ ZEND_API int zend_fcall_info_call(zend_fcall_info *fci, zend_fcall_info_cache *f
ZEND_API int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TSRMLS_DC);
ZEND_API int zend_set_hash_symbol(zval *symbol, const char *name, int name_length, zend_bool is_ref, int num_symbol_tables, ...);
ZEND_API int zend_set_hash_symbol(zval *symbol, const char *name, zend_size_t name_length, zend_bool is_ref, int num_symbol_tables, ...);
ZEND_API void zend_delete_variable(zend_execute_data *ex, HashTable *ht, const char *name, int name_len, ulong hash_value TSRMLS_DC);
ZEND_API void zend_delete_variable(zend_execute_data *ex, HashTable *ht, const char *name, zend_size_t name_len, zend_uint_t hash_value TSRMLS_DC);
ZEND_API int zend_delete_global_variable(const char *name, int name_len TSRMLS_DC);
ZEND_API int zend_delete_global_variable(const char *name, zend_size_t name_len TSRMLS_DC);
ZEND_API int zend_delete_global_variable_ex(const char *name, int name_len, ulong hash_value TSRMLS_DC);
ZEND_API int zend_delete_global_variable_ex(const char *name, zend_size_t name_len, zend_uint_t hash_value TSRMLS_DC);
ZEND_API void zend_reset_all_cv(HashTable *symbol_table TSRMLS_DC);
ZEND_API void zend_rebuild_symbol_table(TSRMLS_D);
ZEND_API const char* zend_find_alias_name(zend_class_entry *ce, const char *name, zend_uint len);
ZEND_API const char* zend_find_alias_name(zend_class_entry *ce, const char *name, zend_size_t len);
ZEND_API const char* zend_resolve_method_name(zend_class_entry *ce, zend_function *f);
#define add_method(arg, key, method) add_assoc_function((arg), (key), (method))
@@ -535,26 +535,26 @@ END_EXTERN_C()
#if ZEND_DEBUG
#define CHECK_ZVAL_STRING(z) \
if (Z_STRVAL_P(z)[ Z_STRLEN_P(z) ] != '\0') { zend_error(E_WARNING, "String is not zero-terminated (%s)", Z_STRVAL_P(z)); }
if (Z_STRVAL_P(z)[ Z_STRSIZE_P(z) ] != '\0') { zend_error(E_WARNING, "String is not zero-terminated (%s)", Z_STRVAL_P(z)); }
#define CHECK_ZVAL_STRING_REL(z) \
if (Z_STRVAL_P(z)[ Z_STRLEN_P(z) ] != '\0') { zend_error(E_WARNING, "String is not zero-terminated (%s) (source: %s:%d)", Z_STRVAL_P(z) ZEND_FILE_LINE_RELAY_CC); }
if (Z_STRVAL_P(z)[ Z_STRSIZE_P(z) ] != '\0') { zend_error(E_WARNING, "String is not zero-terminated (%s) (source: %s:%d)", Z_STRVAL_P(z) ZEND_FILE_LINE_RELAY_CC); }
#else
#define CHECK_ZVAL_STRING(z)
#define CHECK_ZVAL_STRING_REL(z)
#endif
#define CHECK_ZVAL_NULL_PATH(p) (Z_STRLEN_P(p) != strlen(Z_STRVAL_P(p)))
#define CHECK_ZVAL_NULL_PATH(p) (Z_STRSIZE_P(p) != strlen(Z_STRVAL_P(p)))
#define CHECK_NULL_PATH(p, l) (strlen(p) != l)
#define ZVAL_RESOURCE(z, l) do { \
zval *__z = (z); \
Z_LVAL_P(__z) = l; \
Z_IVAL_P(__z) = l; \
Z_TYPE_P(__z) = IS_RESOURCE;\
} while (0)
#define ZVAL_BOOL(z, b) do { \
zval *__z = (z); \
Z_LVAL_P(__z) = ((b) != 0); \
Z_IVAL_P(__z) = ((b) != 0); \
Z_TYPE_P(__z) = IS_BOOL; \
} while (0)
@@ -562,10 +562,10 @@ END_EXTERN_C()
Z_TYPE_P(z) = IS_NULL; \
}
#define ZVAL_LONG(z, l) { \
#define ZVAL_INT(z, l) { \
zval *__z = (z); \
Z_LVAL_P(__z) = l; \
Z_TYPE_P(__z) = IS_LONG; \
Z_IVAL_P(__z) = l; \
Z_TYPE_P(__z) = IS_INT; \
}
#define ZVAL_DOUBLE(z, d) { \
@@ -577,22 +577,22 @@ END_EXTERN_C()
#define ZVAL_STRING(z, s, duplicate) do { \
const char *__s=(s); \
zval *__z = (z); \
Z_STRLEN_P(__z) = strlen(__s); \
Z_STRVAL_P(__z) = (duplicate?estrndup(__s, Z_STRLEN_P(__z)):(char*)__s);\
Z_STRSIZE_P(__z) = (zend_size_t) strlen(__s); \
Z_STRVAL_P(__z) = (duplicate?estrndup(__s, Z_STRSIZE_P(__z)):(char*)__s);\
Z_TYPE_P(__z) = IS_STRING; \
} while (0)
#define ZVAL_STRINGL(z, s, l, duplicate) do { \
const char *__s=(s); int __l=l; \
const char *__s=(s); zend_size_t __l= (zend_size_t) (l); \
zval *__z = (z); \
Z_STRLEN_P(__z) = __l; \
Z_STRSIZE_P(__z) = __l; \
Z_STRVAL_P(__z) = (duplicate?estrndup(__s, __l):(char*)__s);\
Z_TYPE_P(__z) = IS_STRING; \
} while (0)
#define ZVAL_EMPTY_STRING(z) do { \
zval *__z = (z); \
Z_STRLEN_P(__z) = 0; \
Z_STRSIZE_P(__z) = 0; \
Z_STRVAL_P(__z) = STR_EMPTY_ALLOC();\
Z_TYPE_P(__z) = IS_STRING; \
} while (0)
@@ -618,7 +618,7 @@ END_EXTERN_C()
#define RETVAL_RESOURCE(l) ZVAL_RESOURCE(return_value, l)
#define RETVAL_BOOL(b) ZVAL_BOOL(return_value, b)
#define RETVAL_NULL() ZVAL_NULL(return_value)
#define RETVAL_LONG(l) ZVAL_LONG(return_value, l)
#define RETVAL_INT(l) ZVAL_INT(return_value, l)
#define RETVAL_DOUBLE(d) ZVAL_DOUBLE(return_value, d)
#define RETVAL_STRING(s, duplicate) ZVAL_STRING(return_value, s, duplicate)
#define RETVAL_STRINGL(s, l, duplicate) ZVAL_STRINGL(return_value, s, l, duplicate)
@@ -630,7 +630,7 @@ END_EXTERN_C()
#define RETURN_RESOURCE(l) { RETVAL_RESOURCE(l); return; }
#define RETURN_BOOL(b) { RETVAL_BOOL(b); return; }
#define RETURN_NULL() { RETVAL_NULL(); return;}
#define RETURN_LONG(l) { RETVAL_LONG(l); return; }
#define RETURN_INT(l) { RETVAL_INT(l); return; }
#define RETURN_DOUBLE(d) { RETVAL_DOUBLE(d); return; }
#define RETURN_STRING(s, duplicate) { RETVAL_STRING(s, duplicate); return; }
#define RETURN_STRINGL(s, l, duplicate) { RETVAL_STRINGL(s, l, duplicate); return; }
@@ -669,11 +669,11 @@ END_EXTERN_C()
} \
}
#define SET_VAR_LONG(n, v) { \
#define SET_VAR_INT(n, v) { \
{ \
zval *var; \
ALLOC_ZVAL(var); \
ZVAL_LONG(var, v); \
ZVAL_INT(var, v); \
ZEND_SET_GLOBAL_VAR(n, var); \
} \
}
@@ -729,7 +729,7 @@ END_EXTERN_C()
#define ZEND_DEFINE_PROPERTY(class_ptr, name, value, mask) \
{ \
char *_name = (name); \
int namelen = strlen(_name); \
zend_size_t namelen = strlen(_name); \
zend_declare_property(class_ptr, _name, namelen, value, mask TSRMLS_CC); \
}
+28 -28
View File
@@ -433,7 +433,7 @@ struct _zend_mm_heap {
int overflow;
int internal;
#if ZEND_MM_CACHE
unsigned int cached;
size_t cached;
zend_mm_free_block *cache[ZEND_MM_NUM_BUCKETS];
#endif
zend_mm_free_block *free_buckets[ZEND_MM_NUM_BUCKETS*2];
@@ -488,16 +488,16 @@ static unsigned int _zend_mm_cookie = 0;
#define ZEND_MM_RESERVE_SIZE (8*1024)
#ifdef _WIN64
# define ZEND_MM_LONG_CONST(x) (x##i64)
# define ZEND_MM_INT_CONST(x) (x##i64)
#else
# define ZEND_MM_LONG_CONST(x) (x##L)
# define ZEND_MM_INT_CONST(x) (x##L)
#endif
#define ZEND_MM_TYPE_MASK ZEND_MM_LONG_CONST(0x3)
#define ZEND_MM_TYPE_MASK ZEND_MM_INT_CONST(0x3)
#define ZEND_MM_FREE_BLOCK ZEND_MM_LONG_CONST(0x0)
#define ZEND_MM_USED_BLOCK ZEND_MM_LONG_CONST(0x1)
#define ZEND_MM_GUARD_BLOCK ZEND_MM_LONG_CONST(0x3)
#define ZEND_MM_FREE_BLOCK ZEND_MM_INT_CONST(0x0)
#define ZEND_MM_USED_BLOCK ZEND_MM_INT_CONST(0x1)
#define ZEND_MM_GUARD_BLOCK ZEND_MM_INT_CONST(0x3)
#define ZEND_MM_BLOCK(b, type, size) do { \
size_t _size = (size); \
@@ -615,11 +615,11 @@ static unsigned int _zend_mm_cookie = 0;
# define END_MAGIC_SIZE sizeof(unsigned int)
# define ZEND_MM_SET_BLOCK_SIZE(block, __size) do { \
char *p; \
char *__p; \
((zend_mm_block*)(block))->debug.size = (__size); \
p = ZEND_MM_END_MAGIC_PTR(block); \
__p = ZEND_MM_END_MAGIC_PTR(block); \
((zend_mm_block*)(block))->debug.start_magic = _mem_block_start_magic; \
memcpy(p, &_mem_block_end_magic, END_MAGIC_SIZE); \
memcpy(__p, &_mem_block_end_magic, END_MAGIC_SIZE); \
} while (0)
static unsigned int _mem_block_start_magic = 0;
@@ -742,7 +742,7 @@ static inline void zend_mm_add_to_free_list(zend_mm_heap *heap, zend_mm_free_blo
*p = mm_block;
mm_block->parent = p;
mm_block->prev_free_block = mm_block->next_free_block = mm_block;
heap->large_free_bitmap |= (ZEND_MM_LONG_CONST(1) << index);
heap->large_free_bitmap |= (ZEND_MM_INT_CONST(1) << index);
} else {
size_t m;
@@ -775,7 +775,7 @@ static inline void zend_mm_add_to_free_list(zend_mm_heap *heap, zend_mm_free_blo
prev = ZEND_MM_SMALL_FREE_BUCKET(heap, index);
if (prev->prev_free_block == prev) {
heap->free_bitmap |= (ZEND_MM_LONG_CONST(1) << index);
heap->free_bitmap |= (ZEND_MM_INT_CONST(1) << index);
}
next = prev->next_free_block;
@@ -809,7 +809,7 @@ static inline void zend_mm_remove_from_free_list(zend_mm_heap *heap, zend_mm_fre
ZEND_MM_CHECK_TREE(mm_block);
*mm_block->parent = NULL;
if (mm_block->parent == &heap->large_free_buckets[index]) {
heap->large_free_bitmap &= ~(ZEND_MM_LONG_CONST(1) << index);
heap->large_free_bitmap &= ~(ZEND_MM_INT_CONST(1) << index);
}
} else {
while (*(cp = &(prev->child[prev->child[1] != NULL])) != NULL) {
@@ -847,7 +847,7 @@ subst_block:
size_t index = ZEND_MM_BUCKET_INDEX(ZEND_MM_FREE_BLOCK_SIZE(mm_block));
if (EXPECTED(heap->free_buckets[index*2] == heap->free_buckets[index*2+1])) {
heap->free_bitmap &= ~(ZEND_MM_LONG_CONST(1) << index);
heap->free_bitmap &= ~(ZEND_MM_INT_CONST(1) << index);
}
}
} else if (UNEXPECTED(mm_block->parent == ZEND_MM_REST_BLOCK)) {
@@ -1116,7 +1116,7 @@ ZEND_API zend_mm_heap *zend_mm_startup_ex(const zend_mm_mem_handlers *handlers,
heap->real_size = 0;
heap->overflow = 0;
heap->real_peak = 0;
heap->limit = ZEND_MM_LONG_CONST(1)<<(ZEND_MM_NUM_BUCKETS-2);
heap->limit = ZEND_MM_INT_CONST(1)<<(ZEND_MM_NUM_BUCKETS-2);
heap->size = 0;
heap->peak = 0;
heap->internal = internal;
@@ -1231,9 +1231,9 @@ ZEND_API zend_mm_heap *zend_mm_startup(void)
}
#if ZEND_DEBUG
static long zend_mm_find_leaks(zend_mm_segment *segment, zend_mm_block *b)
static zend_int_t zend_mm_find_leaks(zend_mm_segment *segment, zend_mm_block *b)
{
long leaks = 0;
zend_int_t leaks = 0;
zend_mm_block *p, *q;
p = ZEND_MM_NEXT_BLOCK(b);
@@ -1291,7 +1291,7 @@ static void zend_mm_check_leaks(zend_mm_heap *heap TSRMLS_DC)
}
if (!ZEND_MM_IS_FREE_BLOCK(p)) {
if (p->magic == MEM_BLOCK_VALID) {
long repeated;
zend_int_t repeated;
zend_leak_info leak;
ZEND_MM_SET_MAGIC(p, MEM_BLOCK_LEAK);
@@ -1745,7 +1745,7 @@ static void zend_mm_safe_error(zend_mm_heap *heap,
size_t limit,
#if ZEND_DEBUG
const char *filename,
uint lineno,
zend_uint_t lineno,
#endif
size_t size)
{
@@ -1791,7 +1791,7 @@ static void zend_mm_safe_error(zend_mm_heap *heap,
lineno,
#endif
size);
fprintf(stderr, " in %s on line %d\n", error_filename, error_lineno);
fprintf(stderr, " in %s on line " ZEND_UINT_FMT "\n", error_filename, error_lineno);
}
/* See http://support.microsoft.com/kb/190351 */
#ifdef PHP_WIN32
@@ -1831,7 +1831,7 @@ static zend_mm_free_block *zend_mm_search_large_block(zend_mm_heap *heap, size_t
best_size = ZEND_MM_FREE_BLOCK_SIZE(p);
best_fit = p;
}
if ((m & (ZEND_MM_LONG_CONST(1) << (ZEND_MM_NUM_BUCKETS-1))) == 0) {
if ((m & (ZEND_MM_INT_CONST(1) << (ZEND_MM_NUM_BUCKETS-1))) == 0) {
if (p->child[1]) {
rst = p->child[1];
}
@@ -1973,9 +1973,9 @@ static void *_zend_mm_alloc_int(zend_mm_heap *heap, size_t size ZEND_FILE_LINE_D
#endif
HANDLE_UNBLOCK_INTERRUPTIONS();
#if ZEND_DEBUG
zend_mm_safe_error(heap, "Allowed memory size of %ld bytes exhausted at %s:%d (tried to allocate %lu bytes)", heap->limit, __zend_filename, __zend_lineno, size);
zend_mm_safe_error(heap, "Allowed memory size of " ZEND_INT_FMT " bytes exhausted at %s:%d (tried to allocate " ZEND_UINT_FMT " bytes)", heap->limit, __zend_filename, __zend_lineno, size);
#else
zend_mm_safe_error(heap, "Allowed memory size of %ld bytes exhausted (tried to allocate %lu bytes)", heap->limit, size);
zend_mm_safe_error(heap, "Allowed memory size of " ZEND_INT_FMT " bytes exhausted (tried to allocate " ZEND_UINT_FMT " bytes)", heap->limit, size);
#endif
}
@@ -2286,9 +2286,9 @@ realloc_segment:
#endif
HANDLE_UNBLOCK_INTERRUPTIONS();
#if ZEND_DEBUG
zend_mm_safe_error(heap, "Allowed memory size of %ld bytes exhausted at %s:%d (tried to allocate %ld bytes)", heap->limit, __zend_filename, __zend_lineno, size);
zend_mm_safe_error(heap, "Allowed memory size of " ZEND_INT_FMT " bytes exhausted at %s:%d (tried to allocate " ZEND_UINT_FMT " bytes)", heap->limit, __zend_filename, __zend_lineno, size);
#else
zend_mm_safe_error(heap, "Allowed memory size of %ld bytes exhausted (tried to allocate %ld bytes)", heap->limit, size);
zend_mm_safe_error(heap, "Allowed memory size of " ZEND_INT_FMT " bytes exhausted (tried to allocate " ZEND_UINT_FMT " bytes)", heap->limit, size);
#endif
return NULL;
}
@@ -2619,7 +2619,7 @@ ZEND_API void *_ecalloc(size_t nmemb, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LI
ZEND_API char *_estrdup(const char *s ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
{
int length;
zend_size_t length;
char *p;
#ifdef ZEND_SIGNALS
TSRMLS_FETCH();
@@ -2638,7 +2638,7 @@ ZEND_API char *_estrdup(const char *s ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
return p;
}
ZEND_API char *_estrndup(const char *s, uint length ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
ZEND_API char *_estrndup(const char *s, zend_size_t length ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
{
char *p;
#ifdef ZEND_SIGNALS
@@ -2659,7 +2659,7 @@ ZEND_API char *_estrndup(const char *s, uint length ZEND_FILE_LINE_DC ZEND_FILE_
}
ZEND_API char *zend_strndup(const char *s, uint length)
ZEND_API char *zend_strndup(const char *s, zend_size_t length)
{
char *p;
#ifdef ZEND_SIGNALS
+10 -9
View File
@@ -26,20 +26,21 @@
#include "../TSRM/TSRM.h"
#include "zend.h"
#include "zend_types.h"
#ifndef ZEND_MM_ALIGNMENT
# define ZEND_MM_ALIGNMENT 8
# define ZEND_MM_ALIGNMENT_LOG2 3
#elif ZEND_MM_ALIGNMENT < 4
# define ZEND_MM_ALIGNMENT Z_I(8)
# define ZEND_MM_ALIGNMENT_LOG2 Z_I(3)
#elif ZEND_MM_ALIGNMENT < Z_I(4)
# undef ZEND_MM_ALIGNMENT
# undef ZEND_MM_ALIGNMENT_LOG2
# define ZEND_MM_ALIGNMENT 4
# define ZEND_MM_ALIGNMENT_LOG2 2
# define ZEND_MM_ALIGNMENT Z_I(4)
# define ZEND_MM_ALIGNMENT_LOG2 Z_I(2)
#endif
#define ZEND_MM_ALIGNMENT_MASK ~(ZEND_MM_ALIGNMENT-1)
#define ZEND_MM_ALIGNMENT_MASK ~(ZEND_MM_ALIGNMENT-Z_I(1))
#define ZEND_MM_ALIGNED_SIZE(size) (((size) + ZEND_MM_ALIGNMENT - 1) & ZEND_MM_ALIGNMENT_MASK)
#define ZEND_MM_ALIGNED_SIZE(size) (((size) + ZEND_MM_ALIGNMENT - Z_I(1)) & ZEND_MM_ALIGNMENT_MASK)
typedef struct _zend_leak_info {
void *addr;
@@ -52,7 +53,7 @@ typedef struct _zend_leak_info {
BEGIN_EXTERN_C()
ZEND_API char *zend_strndup(const char *s, unsigned int length) ZEND_ATTRIBUTE_MALLOC;
ZEND_API char *zend_strndup(const char *s, zend_size_t length) ZEND_ATTRIBUTE_MALLOC;
ZEND_API void *_emalloc(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ZEND_ATTRIBUTE_MALLOC ZEND_ATTRIBUTE_ALLOC_SIZE(1);
ZEND_API void *_safe_emalloc(size_t nmemb, size_t size, size_t offset ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ZEND_ATTRIBUTE_MALLOC;
@@ -63,7 +64,7 @@ ZEND_API void *_erealloc(void *ptr, size_t size, int allow_failure ZEND_FILE_LIN
ZEND_API void *_safe_erealloc(void *ptr, size_t nmemb, size_t size, size_t offset ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
ZEND_API void *_safe_realloc(void *ptr, size_t nmemb, size_t size, size_t offset);
ZEND_API char *_estrdup(const char *s ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ZEND_ATTRIBUTE_MALLOC;
ZEND_API char *_estrndup(const char *s, unsigned int length ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ZEND_ATTRIBUTE_MALLOC;
ZEND_API char *_estrndup(const char *s, zend_size_t length ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ZEND_ATTRIBUTE_MALLOC;
ZEND_API size_t _zend_mem_block_size(void *ptr TSRMLS_DC ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
/* Standard wrapper macros */
+3 -3
View File
@@ -290,7 +290,7 @@ ZEND_API void zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *s
break;
case ZEND_SELECT:
zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC);
if (zend_is_true(&op1)) {
if (zend_is_true(&op1 TSRMLS_CC)) {
if (!(&ast->u.child)[1]) {
*result = op1;
} else {
@@ -303,13 +303,13 @@ ZEND_API void zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *s
}
break;
case ZEND_UNARY_PLUS:
ZVAL_LONG(&op1, 0);
ZVAL_INT(&op1, 0);
zend_ast_evaluate(&op2, (&ast->u.child)[0], scope TSRMLS_CC);
add_function(result, &op1, &op2 TSRMLS_CC);
zval_dtor(&op2);
break;
case ZEND_UNARY_MINUS:
ZVAL_LONG(&op1, 0);
ZVAL_INT(&op1, 0);
zend_ast_evaluate(&op2, (&ast->u.child)[0], scope TSRMLS_CC);
sub_function(result, &op1, &op2 TSRMLS_CC);
zval_dtor(&op2);
+103 -103
View File
@@ -358,7 +358,7 @@ ZEND_FUNCTION(zend_version)
Returns number of freed zvals */
ZEND_FUNCTION(gc_collect_cycles)
{
RETURN_LONG(gc_collect_cycles(TSRMLS_C));
RETURN_INT(gc_collect_cycles(TSRMLS_C));
}
/* }}} */
@@ -393,10 +393,10 @@ ZEND_FUNCTION(func_num_args)
zend_execute_data *ex = EG(current_execute_data)->prev_execute_data;
if (ex && ex->function_state.arguments) {
RETURN_LONG((long)(zend_uintptr_t)*(ex->function_state.arguments));
RETURN_INT((long)(zend_uintptr_t)*(ex->function_state.arguments));
} else {
zend_error(E_WARNING, "func_num_args(): Called from the global scope - no function context");
RETURN_LONG(-1);
RETURN_INT(-1);
}
}
/* }}} */
@@ -409,10 +409,10 @@ ZEND_FUNCTION(func_get_arg)
void **p;
int arg_count;
zval *arg;
long requested_offset;
zend_int_t requested_offset;
zend_execute_data *ex = EG(current_execute_data)->prev_execute_data;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &requested_offset) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "i", &requested_offset) == FAILURE) {
return;
}
@@ -430,7 +430,7 @@ ZEND_FUNCTION(func_get_arg)
arg_count = (int)(zend_uintptr_t) *p; /* this is the amount of arguments passed to func_get_arg(); */
if (requested_offset >= arg_count) {
zend_error(E_WARNING, "func_get_arg(): Argument %ld not passed to function", requested_offset);
zend_error(E_WARNING, "func_get_arg(): Argument " ZEND_INT_FMT " not passed to function", requested_offset);
RETURN_FALSE;
}
@@ -481,13 +481,13 @@ ZEND_FUNCTION(func_get_args)
ZEND_FUNCTION(strlen)
{
char *s1;
int s1_len;
zend_size_t s1_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &s1, &s1_len) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &s1, &s1_len) == FAILURE) {
return;
}
RETVAL_LONG(s1_len);
RETVAL_INT((zend_int_t) s1_len);
}
/* }}} */
@@ -497,13 +497,13 @@ ZEND_FUNCTION(strlen)
ZEND_FUNCTION(strcmp)
{
char *s1, *s2;
int s1_len, s2_len;
zend_size_t s1_len, s2_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &s1, &s1_len, &s2, &s2_len) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS", &s1, &s1_len, &s2, &s2_len) == FAILURE) {
return;
}
RETURN_LONG(zend_binary_strcmp(s1, s1_len, s2, s2_len));
RETURN_INT(zend_binary_strcmp(s1, s1_len, s2, s2_len));
}
/* }}} */
@@ -513,10 +513,10 @@ ZEND_FUNCTION(strcmp)
ZEND_FUNCTION(strncmp)
{
char *s1, *s2;
int s1_len, s2_len;
long len;
zend_size_t s1_len, s2_len;
zend_int_t len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssl", &s1, &s1_len, &s2, &s2_len, &len) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SSi", &s1, &s1_len, &s2, &s2_len, &len) == FAILURE) {
return;
}
@@ -525,7 +525,7 @@ ZEND_FUNCTION(strncmp)
RETURN_FALSE;
}
RETURN_LONG(zend_binary_strncmp(s1, s1_len, s2, s2_len, len));
RETURN_INT(zend_binary_strncmp(s1, s1_len, s2, s2_len, len));
}
/* }}} */
@@ -535,13 +535,13 @@ ZEND_FUNCTION(strncmp)
ZEND_FUNCTION(strcasecmp)
{
char *s1, *s2;
int s1_len, s2_len;
zend_size_t s1_len, s2_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &s1, &s1_len, &s2, &s2_len) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS", &s1, &s1_len, &s2, &s2_len) == FAILURE) {
return;
}
RETURN_LONG(zend_binary_strcasecmp(s1, s1_len, s2, s2_len));
RETURN_INT(zend_binary_strcasecmp(s1, s1_len, s2, s2_len));
}
/* }}} */
@@ -551,10 +551,10 @@ ZEND_FUNCTION(strcasecmp)
ZEND_FUNCTION(strncasecmp)
{
char *s1, *s2;
int s1_len, s2_len;
long len;
zend_size_t s1_len, s2_len;
zend_int_t len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssl", &s1, &s1_len, &s2, &s2_len, &len) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SSi", &s1, &s1_len, &s2, &s2_len, &len) == FAILURE) {
return;
}
@@ -563,7 +563,7 @@ ZEND_FUNCTION(strncasecmp)
RETURN_FALSE;
}
RETURN_LONG(zend_binary_strncasecmp(s1, s1_len, s2, s2_len, len));
RETURN_INT(zend_binary_strncasecmp(s1, s1_len, s2, s2_len, len));
}
/* }}} */
@@ -574,8 +574,8 @@ ZEND_FUNCTION(each)
{
zval *array, *entry, **entry_ptr, *tmp;
char *string_key;
uint string_key_len;
ulong num_key;
zend_size_t string_key_len;
zend_uint_t num_key;
zval **inserted_pointer;
HashTable *target_hash;
@@ -613,8 +613,8 @@ ZEND_FUNCTION(each)
case HASH_KEY_IS_STRING:
add_get_index_stringl(return_value, 0, string_key, string_key_len-1, (void **) &inserted_pointer, !IS_INTERNED(string_key));
break;
case HASH_KEY_IS_LONG:
add_get_index_long(return_value, 0, num_key, (void **) &inserted_pointer);
case HASH_KEY_IS_INT:
add_get_index_int(return_value, 0, num_key, (void **) &inserted_pointer);
break;
}
zend_hash_update(return_value->value.ht, "key", sizeof("key"), inserted_pointer, sizeof(zval *), NULL);
@@ -629,10 +629,10 @@ ZEND_FUNCTION(each)
ZEND_FUNCTION(error_reporting)
{
char *err;
int err_len;
zend_size_t err_len;
int old_error_reporting;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &err, &err_len) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|S", &err, &err_len) == FAILURE) {
return;
}
@@ -641,7 +641,7 @@ ZEND_FUNCTION(error_reporting)
zend_alter_ini_entry("error_reporting", sizeof("error_reporting"), err, err_len, ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME);
}
RETVAL_LONG(old_error_reporting);
RETVAL_INT(old_error_reporting);
}
/* }}} */
@@ -651,14 +651,14 @@ ZEND_FUNCTION(error_reporting)
ZEND_FUNCTION(define)
{
char *name;
int name_len;
zend_size_t name_len;
zval *val;
zval *val_free = NULL;
zend_bool non_cs = 0;
int case_sensitive = CONST_CS;
zend_constant c;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz|b", &name, &name_len, &val, &non_cs) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sz|b", &name, &name_len, &val, &non_cs) == FAILURE) {
return;
}
@@ -674,7 +674,7 @@ ZEND_FUNCTION(define)
repeat:
switch (Z_TYPE_P(val)) {
case IS_LONG:
case IS_INT:
case IS_DOUBLE:
case IS_STRING:
case IS_BOOL:
@@ -729,10 +729,10 @@ repeat:
ZEND_FUNCTION(defined)
{
char *name;
int name_len;
zend_size_t name_len;
zval c;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &name, &name_len) == FAILURE) {
return;
}
@@ -752,7 +752,7 @@ ZEND_FUNCTION(get_class)
{
zval *obj = NULL;
const char *name = "";
zend_uint name_len = 0;
zend_size_t name_len = 0;
int dup;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|o!", &obj) == FAILURE) {
@@ -800,7 +800,7 @@ ZEND_FUNCTION(get_parent_class)
zval *arg;
zend_class_entry *ce = NULL;
const char *name;
zend_uint name_length;
zend_size_t name_length;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|z", &arg) == FAILURE) {
return;
@@ -825,7 +825,7 @@ ZEND_FUNCTION(get_parent_class)
} else if (Z_TYPE_P(arg) == IS_STRING) {
zend_class_entry **pce;
if (zend_lookup_class(Z_STRVAL_P(arg), Z_STRLEN_P(arg), &pce TSRMLS_CC) == SUCCESS) {
if (zend_lookup_class(Z_STRVAL_P(arg), Z_STRSIZE_P(arg), &pce TSRMLS_CC) == SUCCESS) {
ce = *pce;
}
}
@@ -843,13 +843,13 @@ static void is_a_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool only_subclass)
{
zval *obj;
char *class_name;
int class_name_len;
zend_size_t class_name_len;
zend_class_entry *instance_ce;
zend_class_entry **ce;
zend_bool allow_string = only_subclass;
zend_bool retval;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zs|b", &obj, &class_name, &class_name_len, &allow_string) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zS|b", &obj, &class_name, &class_name_len, &allow_string) == FAILURE) {
return;
}
/*
@@ -861,7 +861,7 @@ static void is_a_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool only_subclass)
if (allow_string && Z_TYPE_P(obj) == IS_STRING) {
zend_class_entry **the_ce;
if (zend_lookup_class(Z_STRVAL_P(obj), Z_STRLEN_P(obj), &the_ce TSRMLS_CC) == FAILURE) {
if (zend_lookup_class(Z_STRVAL_P(obj), Z_STRSIZE_P(obj), &the_ce TSRMLS_CC) == FAILURE) {
RETURN_FALSE;
}
instance_ce = *the_ce;
@@ -910,8 +910,8 @@ static void add_class_vars(zend_class_entry *ce, int statics, zval *return_value
zend_property_info *prop_info;
zval *prop, *prop_copy;
char *key;
uint key_len;
ulong num_index;
zend_size_t key_len;
zend_uint_t num_index;
zend_hash_internal_pointer_reset_ex(&ce->properties_info, &pos);
while (zend_hash_get_current_data_ex(&ce->properties_info, (void **) &prop_info, &pos) == SUCCESS) {
@@ -961,10 +961,10 @@ static void add_class_vars(zend_class_entry *ce, int statics, zval *return_value
ZEND_FUNCTION(get_class_vars)
{
char *class_name;
int class_name_len;
zend_size_t class_name_len;
zend_class_entry **pce;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &class_name, &class_name_len) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &class_name, &class_name_len) == FAILURE) {
return;
}
@@ -990,8 +990,8 @@ ZEND_FUNCTION(get_object_vars)
HashPosition pos;
char *key;
const char *prop_name, *class_name;
uint key_len, prop_len;
ulong num_index;
zend_size_t key_len, prop_len;
zend_uint_t num_index;
zend_object *zobj;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &obj) == FAILURE) {
@@ -1017,7 +1017,7 @@ ZEND_FUNCTION(get_object_vars)
while (zend_hash_get_current_data_ex(properties, (void **) &value, &pos) == SUCCESS) {
if (zend_hash_get_current_key_ex(properties, &key, &key_len, &num_index, 0, &pos) == HASH_KEY_IS_STRING) {
if (zend_check_property_access(zobj, key, key_len-1 TSRMLS_CC) == SUCCESS) {
zend_unmangle_property_name_ex(key, key_len - 1, &class_name, &prop_name, (int*) &prop_len);
zend_unmangle_property_name_ex(key, key_len - 1, &class_name, &prop_name, &prop_len);
/* Not separating references */
Z_ADDREF_PP(value);
if (IS_INTERNED(key) && prop_name != key) {
@@ -1035,7 +1035,7 @@ ZEND_FUNCTION(get_object_vars)
}
/* }}} */
static int same_name(const char *key, const char *name, zend_uint name_len)
static int same_name(const char *key, const char *name, zend_size_t name_len)
{
char *lcname = zend_str_tolower_dup(name, name_len);
int ret = memcmp(lcname, key, name_len) == 0;
@@ -1064,7 +1064,7 @@ ZEND_FUNCTION(get_class_methods)
}
ce = Z_OBJCE_P(klass);
} else if (Z_TYPE_P(klass) == IS_STRING) {
if (zend_lookup_class(Z_STRVAL_P(klass), Z_STRLEN_P(klass), &pce TSRMLS_CC) == SUCCESS) {
if (zend_lookup_class(Z_STRVAL_P(klass), Z_STRSIZE_P(klass), &pce TSRMLS_CC) == SUCCESS) {
ce = *pce;
}
}
@@ -1084,9 +1084,9 @@ ZEND_FUNCTION(get_class_methods)
|| ((mptr->common.fn_flags & ZEND_ACC_PRIVATE) &&
EG(scope) == mptr->common.scope)))) {
char *key;
uint key_len;
ulong num_index;
uint len = strlen(mptr->common.function_name);
zend_size_t key_len;
zend_uint_t num_index;
zend_size_t len = strlen(mptr->common.function_name);
/* Do not display old-style inherited constructors */
if (zend_hash_get_current_key_ex(&ce->function_table, &key, &key_len, &num_index, 0, &pos) != HASH_KEY_IS_STRING) {
@@ -1123,17 +1123,17 @@ ZEND_FUNCTION(method_exists)
{
zval *klass;
char *method_name;
int method_len;
zend_size_t method_len;
char *lcname;
zend_class_entry * ce, **pce;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zs", &klass, &method_name, &method_len) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zS", &klass, &method_name, &method_len) == FAILURE) {
return;
}
if (Z_TYPE_P(klass) == IS_OBJECT) {
ce = Z_OBJCE_P(klass);
} else if (Z_TYPE_P(klass) == IS_STRING) {
if (zend_lookup_class(Z_STRVAL_P(klass), Z_STRLEN_P(klass), &pce TSRMLS_CC) == FAILURE) {
if (zend_lookup_class(Z_STRVAL_P(klass), Z_STRSIZE_P(klass), &pce TSRMLS_CC) == FAILURE) {
RETURN_FALSE;
}
ce = *pce;
@@ -1180,13 +1180,13 @@ ZEND_FUNCTION(property_exists)
{
zval *object;
char *property;
int property_len;
zend_size_t property_len;
zend_class_entry *ce, **pce;
zend_property_info *property_info;
zval property_z;
ulong h;
zend_uint_t h;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zs", &object, &property, &property_len) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zS", &object, &property, &property_len) == FAILURE) {
return;
}
@@ -1195,7 +1195,7 @@ ZEND_FUNCTION(property_exists)
}
if (Z_TYPE_P(object) == IS_STRING) {
if (zend_lookup_class(Z_STRVAL_P(object), Z_STRLEN_P(object), &pce TSRMLS_CC) == FAILURE) {
if (zend_lookup_class(Z_STRVAL_P(object), Z_STRSIZE_P(object), &pce TSRMLS_CC) == FAILURE) {
RETURN_FALSE;
}
ce = *pce;
@@ -1230,18 +1230,18 @@ ZEND_FUNCTION(class_exists)
{
char *class_name, *lc_name;
zend_class_entry **ce;
int class_name_len;
zend_size_t class_name_len;
int found;
zend_bool autoload = 1;
ALLOCA_FLAG(use_heap)
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &class_name, &class_name_len, &autoload) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|b", &class_name, &class_name_len, &autoload) == FAILURE) {
return;
}
if (!autoload) {
char *name;
int len;
zend_size_t len;
lc_name = do_alloca(class_name_len + 1, use_heap);
zend_str_tolower_copy(lc_name, class_name, class_name_len);
@@ -1273,18 +1273,18 @@ ZEND_FUNCTION(interface_exists)
{
char *iface_name, *lc_name;
zend_class_entry **ce;
int iface_name_len;
zend_size_t iface_name_len;
int found;
zend_bool autoload = 1;
ALLOCA_FLAG(use_heap)
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &iface_name, &iface_name_len, &autoload) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|b", &iface_name, &iface_name_len, &autoload) == FAILURE) {
return;
}
if (!autoload) {
char *name;
int len;
zend_size_t len;
lc_name = do_alloca(iface_name_len + 1, use_heap);
zend_str_tolower_copy(lc_name, iface_name, iface_name_len);
@@ -1316,18 +1316,18 @@ ZEND_FUNCTION(trait_exists)
{
char *trait_name, *lc_name;
zend_class_entry **ce;
int trait_name_len;
zend_size_t trait_name_len;
int found;
zend_bool autoload = 1;
ALLOCA_FLAG(use_heap)
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &trait_name, &trait_name_len, &autoload) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|b", &trait_name, &trait_name_len, &autoload) == FAILURE) {
return;
}
if (!autoload) {
char *name;
int len;
zend_size_t len;
lc_name = do_alloca(trait_name_len + 1, use_heap);
zend_str_tolower_copy(lc_name, trait_name, trait_name_len);
@@ -1359,12 +1359,12 @@ ZEND_FUNCTION(trait_exists)
ZEND_FUNCTION(function_exists)
{
char *name;
int name_len;
zend_size_t name_len;
zend_function *func;
char *lcname;
zend_bool retval;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &name, &name_len) == FAILURE) {
return;
}
@@ -1400,11 +1400,11 @@ ZEND_FUNCTION(class_alias)
{
char *class_name, *alias_name;
zend_class_entry **ce;
int class_name_len, alias_name_len;
zend_size_t class_name_len, alias_name_len;
int found;
zend_bool autoload = 1;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|b", &class_name, &class_name_len, &alias_name, &alias_name_len, &autoload) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS|b", &class_name, &class_name_len, &alias_name, &alias_name_len, &autoload) == FAILURE) {
return;
}
@@ -1434,9 +1434,9 @@ ZEND_FUNCTION(class_alias)
Cause an intentional memory leak, for testing/debugging purposes */
ZEND_FUNCTION(leak)
{
long leakbytes=3;
zend_int_t leakbytes=3;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &leakbytes) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|i", &leakbytes) == FAILURE) {
return;
}
@@ -1483,7 +1483,7 @@ ZEND_FUNCTION(crash)
ZEND_FUNCTION(get_included_files)
{
char *entry;
uint entry_len;
zend_size_t entry_len;
if (zend_parse_parameters_none() == FAILURE) {
return;
@@ -1503,11 +1503,11 @@ ZEND_FUNCTION(get_included_files)
Generates a user-level error/warning/notice message */
ZEND_FUNCTION(trigger_error)
{
long error_type = E_USER_NOTICE;
zend_int_t error_type = E_USER_NOTICE;
char *message;
int message_len;
zend_size_t message_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &message, &message_len, &error_type) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|i", &message, &message_len, &error_type) == FAILURE) {
return;
}
@@ -1535,9 +1535,9 @@ ZEND_FUNCTION(set_error_handler)
{
zval *error_handler;
char *error_handler_name = NULL;
long error_type = E_ALL;
zend_int_t error_type = E_ALL;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|l", &error_handler, &error_type) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|i", &error_handler, &error_type) == FAILURE) {
return;
}
@@ -1797,11 +1797,11 @@ ZEND_FUNCTION(get_defined_vars)
ZEND_FUNCTION(create_function)
{
char *eval_code, *function_name, *function_args, *function_code;
int eval_code_length, function_name_length, function_args_len, function_code_len;
zend_size_t eval_code_length, function_name_length, function_args_len, function_code_len;
int retval;
char *eval_name;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &function_args, &function_args_len, &function_code, &function_code_len) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS", &function_args, &function_args_len, &function_code, &function_code_len) == FAILURE) {
return;
}
@@ -1841,11 +1841,11 @@ ZEND_FUNCTION(create_function)
new_function = *func;
function_add_ref(&new_function);
function_name = (char *) emalloc(sizeof("0lambda_")+MAX_LENGTH_OF_LONG);
function_name = (char *) emalloc(sizeof("0lambda_")+MAX_LENGTH_OF_ZEND_INT);
function_name[0] = '\0';
do {
function_name_length = 1 + snprintf(function_name + 1, sizeof("lambda_")+MAX_LENGTH_OF_LONG, "lambda_%d", ++EG(lambda_count));
function_name_length = 1 + snprintf(function_name + 1, sizeof("lambda_")+MAX_LENGTH_OF_ZEND_INT, "lambda_%d", ++EG(lambda_count));
} while (zend_hash_add(EG(function_table), function_name, function_name_length+1, &new_function, sizeof(zend_function), NULL)==FAILURE);
zend_hash_del(EG(function_table), LAMBDA_TEMP_FUNCNAME, sizeof(LAMBDA_TEMP_FUNCNAME));
RETURN_STRINGL(function_name, function_name_length, 0);
@@ -1869,7 +1869,7 @@ ZEND_FUNCTION(zend_test_func)
#ifdef ZTS
ZEND_FUNCTION(zend_thread_id)
{
RETURN_LONG((long)tsrm_thread_id());
RETURN_INT((long)tsrm_thread_id());
}
#endif
#endif
@@ -1885,7 +1885,7 @@ ZEND_FUNCTION(get_resource_type)
return;
}
resource_type = zend_rsrc_list_get_rsrc_type(Z_LVAL_P(z_resource_type) TSRMLS_CC);
resource_type = zend_rsrc_list_get_rsrc_type(Z_IVAL_P(z_resource_type) TSRMLS_CC);
if (resource_type) {
RETURN_STRING(resource_type, 1);
} else {
@@ -2070,7 +2070,7 @@ void debug_print_backtrace_args(zval *arg_array TSRMLS_DC)
ZEND_FUNCTION(debug_print_backtrace)
{
zend_execute_data *ptr, *skip;
int lineno, frameno = 0;
zend_size_t lineno, frameno = 0;
const char *function_name;
const char *filename;
const char *class_name = NULL;
@@ -2078,10 +2078,10 @@ ZEND_FUNCTION(debug_print_backtrace)
const char *include_filename = NULL;
zval *arg_array = NULL;
int indent = 0;
long options = 0;
long limit = 0;
zend_int_t options = 0;
zend_int_t limit = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ll", &options, &limit) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ii", &options, &limit) == FAILURE) {
return;
}
@@ -2130,7 +2130,7 @@ ZEND_FUNCTION(debug_print_backtrace)
if (ptr->function_state.function->common.scope) {
class_name = ptr->function_state.function->common.scope->name;
} else {
zend_uint class_name_len;
zend_size_t class_name_len;
int dup;
dup = zend_get_object_classname(ptr->object, &class_name, &class_name_len TSRMLS_CC);
@@ -2238,7 +2238,7 @@ ZEND_FUNCTION(debug_print_backtrace)
ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int options, int limit TSRMLS_DC)
{
zend_execute_data *ptr, *skip;
int lineno, frameno = 0;
zend_size_t lineno, frameno = 0;
const char *function_name;
const char *filename;
const char *class_name;
@@ -2279,7 +2279,7 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
filename = skip->op_array->filename;
lineno = skip->opline->lineno;
add_assoc_string_ex(stack_frame, "file", sizeof("file"), (char*)filename, 1);
add_assoc_long_ex(stack_frame, "line", sizeof("line"), lineno);
add_assoc_int_ex(stack_frame, "line", sizeof("line"), lineno);
/* try to fetch args only if an FCALL was just made - elsewise we're in the middle of a function
* and debug_baktrace() might have been called by the error_handler. in this case we don't
@@ -2296,7 +2296,7 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
}
if (prev->op_array) {
add_assoc_string_ex(stack_frame, "file", sizeof("file"), (char*)prev->op_array->filename, 1);
add_assoc_long_ex(stack_frame, "line", sizeof("line"), prev->opline->lineno);
add_assoc_int_ex(stack_frame, "line", sizeof("line"), prev->opline->lineno);
break;
}
prev = prev->prev_execute_data;
@@ -2320,7 +2320,7 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
if (ptr->function_state.function->common.scope) {
add_assoc_string_ex(stack_frame, "class", sizeof("class"), (char*)ptr->function_state.function->common.scope->name, 1);
} else {
zend_uint class_name_len;
zend_size_t class_name_len;
int dup;
dup = zend_get_object_classname(ptr->object, &class_name, &class_name_len TSRMLS_CC);
@@ -2409,10 +2409,10 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
Return backtrace as array */
ZEND_FUNCTION(debug_backtrace)
{
long options = DEBUG_BACKTRACE_PROVIDE_OBJECT;
long limit = 0;
zend_int_t options = DEBUG_BACKTRACE_PROVIDE_OBJECT;
zend_int_t limit = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ll", &options, &limit) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ii", &options, &limit) == FAILURE) {
return;
}
@@ -2425,10 +2425,10 @@ ZEND_FUNCTION(debug_backtrace)
ZEND_FUNCTION(extension_loaded)
{
char *extension_name;
int extension_name_len;
zend_size_t extension_name_len;
char *lcname;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &extension_name, &extension_name_len) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &extension_name, &extension_name_len) == FAILURE) {
return;
}
@@ -2448,11 +2448,11 @@ ZEND_FUNCTION(extension_loaded)
ZEND_FUNCTION(get_extension_funcs)
{
char *extension_name, *lcname;
int extension_name_len, array;
zend_size_t extension_name_len, array;
zend_module_entry *module;
HashPosition iterator;
zend_function *zif;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &extension_name, &extension_name_len) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &extension_name, &extension_name_len) == FAILURE) {
return;
}
if (strncasecmp(extension_name, "zend", sizeof("zend"))) {
+6 -6
View File
@@ -95,19 +95,19 @@ ZEND_METHOD(Closure, bind)
ce = NULL;
} else {
char *class_name;
int class_name_len;
zend_size_t class_name_len;
zval tmp_zval;
INIT_ZVAL(tmp_zval);
if (Z_TYPE_P(scope_arg) == IS_STRING) {
class_name = Z_STRVAL_P(scope_arg);
class_name_len = Z_STRLEN_P(scope_arg);
class_name_len = Z_STRSIZE_P(scope_arg);
} else {
tmp_zval = *scope_arg;
zval_copy_ctor(&tmp_zval);
convert_to_string(&tmp_zval);
class_name = Z_STRVAL(tmp_zval);
class_name_len = Z_STRLEN(tmp_zval);
class_name_len = Z_STRSIZE(tmp_zval);
}
if ((class_name_len == sizeof("static") - 1) &&
@@ -174,7 +174,7 @@ ZEND_API zval* zend_get_closure_this_ptr(zval *obj TSRMLS_DC) /* {{{ */
}
/* }}} */
static zend_function *zend_closure_get_method(zval **object_ptr, char *method_name, int method_len, const zend_literal *key TSRMLS_DC) /* {{{ */
static zend_function *zend_closure_get_method(zval **object_ptr, char *method_name, zend_size_t method_len, const zend_literal *key TSRMLS_DC) /* {{{ */
{
char *lc_name;
ALLOCA_FLAG(use_heap)
@@ -338,14 +338,14 @@ static HashTable *zend_closure_get_debug_info(zval *object, int *is_temp TSRMLS_
}
if (arg_info) {
zend_uint i, required = closure->func.common.required_num_args;
zend_size_t i, required = closure->func.common.required_num_args;
MAKE_STD_ZVAL(val);
array_init(val);
for (i = 0; i < closure->func.common.num_args; i++) {
char *name, *info;
int name_len, info_len;
zend_size_t name_len, info_len;
if (arg_info->name) {
name_len = zend_spprintf(&name, 0, "%s$%s",
arg_info->pass_by_reference ? "&" : "",
+295 -295
View File
File diff suppressed because it is too large. Load diff
+40 -36
View File
@@ -40,7 +40,7 @@
#define INC_BPC(op_array) if (op_array->fn_flags & ZEND_ACC_INTERACTIVE) { (CG(context).backpatch_count++); }
#define DEC_BPC(op_array) if (op_array->fn_flags & ZEND_ACC_INTERACTIVE) { (CG(context).backpatch_count--); }
#define HANDLE_INTERACTIVE() if (CG(active_op_array)->fn_flags & ZEND_ACC_INTERACTIVE) { execute_new_code(TSRMLS_C); }
#define DO_TICKS() if (Z_LVAL(CG(declarables).ticks)) { zend_do_ticks(TSRMLS_C); }
#define DO_TICKS() if (Z_IVAL(CG(declarables).ticks)) { zend_do_ticks(TSRMLS_C); }
#define RESET_DOC_COMMENT() \
{ \
@@ -68,7 +68,7 @@ typedef struct _zend_compiler_context {
typedef struct _zend_literal {
zval constant;
zend_ulong hash_value;
zend_uint_t hash_value;
zend_uint cache_slot;
} zend_literal;
@@ -78,8 +78,8 @@ typedef struct _zend_literal {
typedef union _znode_op {
zend_uint constant;
zend_uint var;
zend_uint num;
zend_ulong hash;
zend_size_t num;
zend_uint_t hash;
zend_uint opline_num; /* Needs to be signed */
zend_op *jmp_addr;
zval *zv;
@@ -113,8 +113,8 @@ struct _zend_op {
znode_op op1;
znode_op op2;
znode_op result;
ulong extended_value;
uint lineno;
zend_uint_t extended_value;
zend_size_t lineno;
zend_uchar opcode;
zend_uchar op1_type;
zend_uchar op2_type;
@@ -141,8 +141,12 @@ typedef struct _zend_try_catch_element {
zend_uint finally_end;
} zend_try_catch_element;
#if SIZEOF_LONG == 8
#define THIS_HASHVAL 210728972157UL
#if SIZEOF_ZEND_INT == 8
# ifdef _WIN32
# define THIS_HASHVAL 210728972157Ui64
# else
# define THIS_HASHVAL 210728972157ULL
# endif
#else
#define THIS_HASHVAL 275574653UL
#endif
@@ -223,20 +227,20 @@ char *zend_visibility_string(zend_uint fn_flags);
typedef struct _zend_property_info {
zend_uint flags;
const char *name;
int name_length;
ulong h;
zend_size_t name_length;
zend_uint_t h;
int offset;
const char *doc_comment;
int doc_comment_len;
zend_size_t doc_comment_len;
zend_class_entry *ce;
} zend_property_info;
typedef struct _zend_arg_info {
const char *name;
zend_uint name_len;
zend_size_t name_len;
const char *class_name;
zend_uint class_name_len;
zend_size_t class_name_len;
zend_uchar type_hint;
zend_uchar pass_by_reference;
zend_bool allow_null;
@@ -249,9 +253,9 @@ typedef struct _zend_arg_info {
*/
typedef struct _zend_internal_function_info {
const char *_name;
zend_uint _name_len;
zend_size_t _name_len;
const char *_class_name;
zend_uint required_num_args;
zend_size_t required_num_args;
zend_uchar _type_hint;
zend_bool return_reference;
zend_bool _allow_null;
@@ -260,8 +264,8 @@ typedef struct _zend_internal_function_info {
typedef struct _zend_compiled_variable {
const char *name;
int name_len;
ulong hash_value;
zend_size_t name_len;
zend_uint_t hash_value;
} zend_compiled_variable;
struct _zend_op_array {
@@ -271,8 +275,8 @@ struct _zend_op_array {
zend_class_entry *scope;
zend_uint fn_flags;
union _zend_function *prototype;
zend_uint num_args;
zend_uint required_num_args;
zend_size_t num_args;
zend_size_t required_num_args;
zend_arg_info *arg_info;
/* END of common elements */
@@ -302,10 +306,10 @@ struct _zend_op_array {
zend_uint this_var;
const char *filename;
zend_uint line_start;
zend_uint line_end;
zend_size_t line_start;
zend_size_t line_end;
const char *doc_comment;
zend_uint doc_comment_len;
zend_size_t doc_comment_len;
zend_uint early_binding; /* the linked list of delayed declarations */
zend_literal *literals;
@@ -328,8 +332,8 @@ typedef struct _zend_internal_function {
zend_class_entry *scope;
zend_uint fn_flags;
union _zend_function *prototype;
zend_uint num_args;
zend_uint required_num_args;
zend_size_t num_args;
zend_size_t required_num_args;
zend_arg_info *arg_info;
/* END of common elements */
@@ -348,8 +352,8 @@ typedef union _zend_function {
zend_class_entry *scope;
zend_uint fn_flags;
union _zend_function *prototype;
zend_uint num_args;
zend_uint required_num_args;
zend_size_t num_args;
zend_size_t required_num_args;
zend_arg_info *arg_info;
} common;
@@ -447,14 +451,14 @@ void shutdown_scanner(TSRMLS_D);
ZEND_API char *zend_set_compiled_filename(const char *new_compiled_filename TSRMLS_DC);
ZEND_API void zend_restore_compiled_filename(char *original_compiled_filename TSRMLS_DC);
ZEND_API char *zend_get_compiled_filename(TSRMLS_D);
ZEND_API int zend_get_compiled_lineno(TSRMLS_D);
ZEND_API zend_uint_t zend_get_compiled_lineno(TSRMLS_D);
ZEND_API size_t zend_get_scanned_file_offset(TSRMLS_D);
void zend_resolve_non_class_name(znode *element_name, zend_bool *check_namespace, zend_bool case_sensitive, HashTable *current_import_sub TSRMLS_DC);
void zend_resolve_function_name(znode *element_name, zend_bool *check_namespace TSRMLS_DC);
void zend_resolve_const_name(znode *element_name, zend_bool *check_namespace TSRMLS_DC);
void zend_resolve_class_name(znode *class_name TSRMLS_DC);
ZEND_API const char* zend_get_compiled_variable_name(const zend_op_array *op_array, zend_uint var, int* name_len);
ZEND_API const char* zend_get_compiled_variable_name(const zend_op_array *op_array, zend_uint var, zend_size_t* name_len);
#ifdef ZTS
const char *zend_get_zendtext(TSRMLS_D);
@@ -692,10 +696,10 @@ ZEND_API void zend_function_dtor(zend_function *function);
ZEND_API void destroy_zend_class(zend_class_entry **pce);
void zend_class_add_ref(zend_class_entry **ce);
ZEND_API void zend_mangle_property_name(char **dest, int *dest_length, const char *src1, int src1_length, const char *src2, int src2_length, int internal);
ZEND_API void zend_mangle_property_name(char **dest, zend_size_t *dest_length, const char *src1, zend_size_t src1_length, const char *src2, zend_size_t src2_length, int internal);
#define zend_unmangle_property_name(mangled_property, mangled_property_len, class_name, prop_name) \
zend_unmangle_property_name_ex(mangled_property, mangled_property_len, class_name, prop_name, NULL)
ZEND_API int zend_unmangle_property_name_ex(const char *mangled_property, int mangled_property_len, const char **class_name, const char **prop_name, int *prop_len);
ZEND_API int zend_unmangle_property_name_ex(const char *mangled_property, zend_size_t mangled_property_len, const char **class_name, const char **prop_name, zend_size_t *prop_len);
#define ZEND_FUNCTION_DTOR (void (*)(void *)) zend_function_dtor
#define ZEND_CLASS_DTOR (void (*)(void *)) destroy_zend_class
@@ -713,21 +717,21 @@ void zend_do_mark_last_catch(const znode *first_catch, const znode *last_additio
ZEND_API zend_bool zend_is_compiling(TSRMLS_D);
ZEND_API char *zend_make_compiled_string_description(const char *name TSRMLS_DC);
ZEND_API void zend_initialize_class_data(zend_class_entry *ce, zend_bool nullify_handlers TSRMLS_DC);
int zend_get_class_fetch_type(const char *class_name, uint class_name_len);
int zend_get_class_fetch_type(const char *class_name, zend_size_t class_name_len);
typedef zend_bool (*zend_auto_global_callback)(const char *name, uint name_len TSRMLS_DC);
typedef zend_bool (*zend_auto_global_callback)(const char *name, zend_size_t name_len TSRMLS_DC);
typedef struct _zend_auto_global {
const char *name;
uint name_len;
zend_size_t name_len;
zend_auto_global_callback auto_global_callback;
zend_bool jit;
zend_bool armed;
} zend_auto_global;
ZEND_API int zend_register_auto_global(const char *name, uint name_len, zend_bool jit, zend_auto_global_callback auto_global_callback TSRMLS_DC);
ZEND_API int zend_register_auto_global(const char *name, zend_size_t name_len, zend_bool jit, zend_auto_global_callback auto_global_callback TSRMLS_DC);
ZEND_API void zend_activate_auto_globals(TSRMLS_D);
ZEND_API zend_bool zend_is_auto_global(const char *name, uint name_len TSRMLS_DC);
ZEND_API zend_bool zend_is_auto_global_quick(const char *name, uint name_len, ulong hashval TSRMLS_DC);
ZEND_API zend_bool zend_is_auto_global(const char *name, zend_size_t name_len TSRMLS_DC);
ZEND_API zend_bool zend_is_auto_global_quick(const char *name, zend_size_t name_len, zend_uint_t hashval TSRMLS_DC);
ZEND_API size_t zend_dirname(char *path, size_t len);
int zendlex(znode *zendlval TSRMLS_DC);
+44 -44
View File
@@ -95,26 +95,26 @@ int zend_startup_constants(TSRMLS_D)
void zend_register_standard_constants(TSRMLS_D)
{
REGISTER_MAIN_LONG_CONSTANT("E_ERROR", E_ERROR, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("E_RECOVERABLE_ERROR", E_RECOVERABLE_ERROR, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("E_WARNING", E_WARNING, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("E_PARSE", E_PARSE, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("E_NOTICE", E_NOTICE, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("E_STRICT", E_STRICT, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("E_DEPRECATED", E_DEPRECATED, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("E_CORE_ERROR", E_CORE_ERROR, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("E_CORE_WARNING", E_CORE_WARNING, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("E_COMPILE_ERROR", E_COMPILE_ERROR, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("E_COMPILE_WARNING", E_COMPILE_WARNING, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("E_USER_ERROR", E_USER_ERROR, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("E_USER_WARNING", E_USER_WARNING, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("E_USER_NOTICE", E_USER_NOTICE, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("E_USER_DEPRECATED", E_USER_DEPRECATED, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_INT_CONSTANT("E_ERROR", E_ERROR, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_INT_CONSTANT("E_RECOVERABLE_ERROR", E_RECOVERABLE_ERROR, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_INT_CONSTANT("E_WARNING", E_WARNING, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_INT_CONSTANT("E_PARSE", E_PARSE, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_INT_CONSTANT("E_NOTICE", E_NOTICE, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_INT_CONSTANT("E_STRICT", E_STRICT, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_INT_CONSTANT("E_DEPRECATED", E_DEPRECATED, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_INT_CONSTANT("E_CORE_ERROR", E_CORE_ERROR, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_INT_CONSTANT("E_CORE_WARNING", E_CORE_WARNING, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_INT_CONSTANT("E_COMPILE_ERROR", E_COMPILE_ERROR, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_INT_CONSTANT("E_COMPILE_WARNING", E_COMPILE_WARNING, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_INT_CONSTANT("E_USER_ERROR", E_USER_ERROR, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_INT_CONSTANT("E_USER_WARNING", E_USER_WARNING, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_INT_CONSTANT("E_USER_NOTICE", E_USER_NOTICE, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_INT_CONSTANT("E_USER_DEPRECATED", E_USER_DEPRECATED, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("E_ALL", E_ALL, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_INT_CONSTANT("E_ALL", E_ALL, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("DEBUG_BACKTRACE_PROVIDE_OBJECT", DEBUG_BACKTRACE_PROVIDE_OBJECT, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("DEBUG_BACKTRACE_IGNORE_ARGS", DEBUG_BACKTRACE_IGNORE_ARGS, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_INT_CONSTANT("DEBUG_BACKTRACE_PROVIDE_OBJECT", DEBUG_BACKTRACE_PROVIDE_OBJECT, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_INT_CONSTANT("DEBUG_BACKTRACE_IGNORE_ARGS", DEBUG_BACKTRACE_IGNORE_ARGS, CONST_PERSISTENT | CONST_CS);
/* true/false constants */
{
REGISTER_MAIN_BOOL_CONSTANT("TRUE", 1, CONST_PERSISTENT | CONST_CT_SUBST);
@@ -143,7 +143,7 @@ void clean_non_persistent_constants(TSRMLS_D)
}
}
ZEND_API void zend_register_null_constant(const char *name, uint name_len, int flags, int module_number TSRMLS_DC)
ZEND_API void zend_register_null_constant(const char *name, zend_size_t name_len, int flags, int module_number TSRMLS_DC)
{
zend_constant c;
@@ -155,7 +155,7 @@ ZEND_API void zend_register_null_constant(const char *name, uint name_len, int f
zend_register_constant(&c TSRMLS_CC);
}
ZEND_API void zend_register_bool_constant(const char *name, uint name_len, zend_bool bval, int flags, int module_number TSRMLS_DC)
ZEND_API void zend_register_bool_constant(const char *name, zend_size_t name_len, zend_bool bval, int flags, int module_number TSRMLS_DC)
{
zend_constant c;
@@ -167,11 +167,11 @@ ZEND_API void zend_register_bool_constant(const char *name, uint name_len, zend_
zend_register_constant(&c TSRMLS_CC);
}
ZEND_API void zend_register_long_constant(const char *name, uint name_len, long lval, int flags, int module_number TSRMLS_DC)
ZEND_API void zend_register_int_constant(const char *name, zend_size_t name_len, zend_int_t lval, int flags, int module_number TSRMLS_DC)
{
zend_constant c;
ZVAL_LONG(&c.value, lval);
ZVAL_INT(&c.value, lval);
c.flags = flags;
c.name = zend_strndup(name, name_len-1);
c.name_len = name_len;
@@ -180,7 +180,7 @@ ZEND_API void zend_register_long_constant(const char *name, uint name_len, long
}
ZEND_API void zend_register_double_constant(const char *name, uint name_len, double dval, int flags, int module_number TSRMLS_DC)
ZEND_API void zend_register_double_constant(const char *name, zend_size_t name_len, double dval, int flags, int module_number TSRMLS_DC)
{
zend_constant c;
@@ -193,7 +193,7 @@ ZEND_API void zend_register_double_constant(const char *name, uint name_len, dou
}
ZEND_API void zend_register_stringl_constant(const char *name, uint name_len, char *strval, uint strlen, int flags, int module_number TSRMLS_DC)
ZEND_API void zend_register_stringl_constant(const char *name, zend_size_t name_len, char *strval, zend_size_t strlen, int flags, int module_number TSRMLS_DC)
{
zend_constant c;
@@ -206,12 +206,12 @@ ZEND_API void zend_register_stringl_constant(const char *name, uint name_len, ch
}
ZEND_API void zend_register_string_constant(const char *name, uint name_len, char *strval, int flags, int module_number TSRMLS_DC)
ZEND_API void zend_register_string_constant(const char *name, zend_size_t name_len, char *strval, int flags, int module_number TSRMLS_DC)
{
zend_register_stringl_constant(name, name_len, strval, strlen(strval), flags, module_number TSRMLS_CC);
}
static int zend_get_special_constant(const char *name, uint name_len, zend_constant **c TSRMLS_DC)
static int zend_get_special_constant(const char *name, zend_size_t name_len, zend_constant **c TSRMLS_DC)
{
int ret;
static char haltoff[] = "__COMPILER_HALT_OFFSET__";
@@ -224,7 +224,7 @@ static int zend_get_special_constant(const char *name, uint name_len, zend_const
/* Returned constants may be cached, so they have to be stored */
if (EG(scope) && EG(scope)->name) {
int const_name_len;
zend_size_t const_name_len;
char *const_name;
ALLOCA_FLAG(use_heap)
@@ -236,7 +236,7 @@ static int zend_get_special_constant(const char *name, uint name_len, zend_const
zend_hash_add(EG(zend_constants), const_name, const_name_len, (void*)&tmp, sizeof(zend_constant), (void**)c);
memset(*c, 0, sizeof(zend_constant));
Z_STRVAL((**c).value) = estrndup(EG(scope)->name, EG(scope)->name_length);
Z_STRLEN((**c).value) = EG(scope)->name_length;
Z_STRSIZE((**c).value) = EG(scope)->name_length;
Z_TYPE((**c).value) = IS_STRING;
}
free_alloca(const_name, use_heap);
@@ -245,7 +245,7 @@ static int zend_get_special_constant(const char *name, uint name_len, zend_const
zend_hash_add(EG(zend_constants), "\0__CLASS__", sizeof("\0__CLASS__"), (void*)&tmp, sizeof(zend_constant), (void**)c);
memset(*c, 0, sizeof(zend_constant));
Z_STRVAL((**c).value) = estrndup("", 0);
Z_STRLEN((**c).value) = 0;
Z_STRSIZE((**c).value) = 0;
Z_TYPE((**c).value) = IS_STRING;
}
}
@@ -254,7 +254,7 @@ static int zend_get_special_constant(const char *name, uint name_len, zend_const
!memcmp(name, "__COMPILER_HALT_OFFSET__", sizeof("__COMPILER_HALT_OFFSET__")-1)) {
const char *cfilename;
char *haltname;
int len, clen;
zend_size_t len, clen;
cfilename = zend_get_executed_filename(TSRMLS_C);
clen = strlen(cfilename);
@@ -270,7 +270,7 @@ static int zend_get_special_constant(const char *name, uint name_len, zend_const
}
ZEND_API int zend_get_constant(const char *name, uint name_len, zval *result TSRMLS_DC)
ZEND_API int zend_get_constant(const char *name, zend_size_t name_len, zval *result TSRMLS_DC)
{
zend_constant *c;
int retval = 1;
@@ -299,7 +299,7 @@ ZEND_API int zend_get_constant(const char *name, uint name_len, zval *result TSR
return retval;
}
ZEND_API int zend_get_constant_ex(const char *name, uint name_len, zval *result, zend_class_entry *scope, ulong flags TSRMLS_DC)
ZEND_API int zend_get_constant_ex(const char *name, zend_size_t name_len, zval *result, zend_class_entry *scope, zend_uint_t flags TSRMLS_DC)
{
zend_constant *c;
int retval = 1;
@@ -317,8 +317,8 @@ ZEND_API int zend_get_constant_ex(const char *name, uint name_len, zval *result,
if ((colon = zend_memrchr(name, ':', name_len)) &&
colon > name && (*(colon - 1) == ':')) {
int class_name_len = colon - name - 1;
int const_name_len = name_len - class_name_len - 2;
zend_size_t class_name_len = colon - name - 1;
zend_size_t const_name_len = name_len - class_name_len - 2;
const char *constant_name = colon + 1;
char *lcname;
@@ -380,8 +380,8 @@ ZEND_API int zend_get_constant_ex(const char *name, uint name_len, zval *result,
/* non-class constant */
if ((colon = zend_memrchr(name, '\\', name_len)) != NULL) {
/* compound constant name */
int prefix_len = colon - name;
int const_name_len = name_len - prefix_len - 1;
zend_size_t prefix_len = colon - name;
zend_size_t const_name_len = name_len - prefix_len - 1;
const char *constant_name = colon + 1;
char *lcname;
int found_const = 0;
@@ -435,30 +435,30 @@ finish:
return zend_get_constant(name, name_len, result TSRMLS_CC);
}
zend_constant *zend_quick_get_constant(const zend_literal *key, ulong flags TSRMLS_DC)
zend_constant *zend_quick_get_constant(const zend_literal *key, zend_uint_t flags TSRMLS_DC)
{
zend_constant *c;
if (zend_hash_quick_find(EG(zend_constants), Z_STRVAL(key->constant), Z_STRLEN(key->constant) + 1, key->hash_value, (void **) &c) == FAILURE) {
if (zend_hash_quick_find(EG(zend_constants), Z_STRVAL(key->constant), Z_STRSIZE(key->constant) + 1, key->hash_value, (void **) &c) == FAILURE) {
key++;
if (zend_hash_quick_find(EG(zend_constants), Z_STRVAL(key->constant), Z_STRLEN(key->constant) + 1, key->hash_value, (void **) &c) == FAILURE ||
if (zend_hash_quick_find(EG(zend_constants), Z_STRVAL(key->constant), Z_STRSIZE(key->constant) + 1, key->hash_value, (void **) &c) == FAILURE ||
(c->flags & CONST_CS) != 0) {
if ((flags & (IS_CONSTANT_IN_NAMESPACE|IS_CONSTANT_UNQUALIFIED)) == (IS_CONSTANT_IN_NAMESPACE|IS_CONSTANT_UNQUALIFIED)) {
key++;
if (zend_hash_quick_find(EG(zend_constants), Z_STRVAL(key->constant), Z_STRLEN(key->constant) + 1, key->hash_value, (void **) &c) == FAILURE) {
if (zend_hash_quick_find(EG(zend_constants), Z_STRVAL(key->constant), Z_STRSIZE(key->constant) + 1, key->hash_value, (void **) &c) == FAILURE) {
key++;
if (zend_hash_quick_find(EG(zend_constants), Z_STRVAL(key->constant), Z_STRLEN(key->constant) + 1, key->hash_value, (void **) &c) == FAILURE ||
if (zend_hash_quick_find(EG(zend_constants), Z_STRVAL(key->constant), Z_STRSIZE(key->constant) + 1, key->hash_value, (void **) &c) == FAILURE ||
(c->flags & CONST_CS) != 0) {
key--;
if (!zend_get_special_constant(Z_STRVAL(key->constant), Z_STRLEN(key->constant), &c TSRMLS_CC)) {
if (!zend_get_special_constant(Z_STRVAL(key->constant), Z_STRSIZE(key->constant), &c TSRMLS_CC)) {
return NULL;
}
}
}
} else {
key--;
if (!zend_get_special_constant(Z_STRVAL(key->constant), Z_STRLEN(key->constant), &c TSRMLS_CC)) {
if (!zend_get_special_constant(Z_STRVAL(key->constant), Z_STRSIZE(key->constant), &c TSRMLS_CC)) {
return NULL;
}
}
@@ -472,7 +472,7 @@ ZEND_API int zend_register_constant(zend_constant *c TSRMLS_DC)
char *lowercase_name = NULL;
char *name;
int ret = SUCCESS;
ulong chash;
zend_uint_t chash;
#if 0
printf("Registering constant for module %d\n", c->module_number);
+13 -13
View File
@@ -34,27 +34,27 @@ typedef struct _zend_constant {
zval value;
int flags;
char *name;
uint name_len;
zend_size_t name_len;
int module_number;
} zend_constant;
#define REGISTER_NULL_CONSTANT(name, flags) zend_register_null_constant((name), sizeof(name), (flags), module_number TSRMLS_CC)
#define REGISTER_BOOL_CONSTANT(name, bval, flags) zend_register_bool_constant((name), sizeof(name), (bval), (flags), module_number TSRMLS_CC)
#define REGISTER_LONG_CONSTANT(name, lval, flags) zend_register_long_constant((name), sizeof(name), (lval), (flags), module_number TSRMLS_CC)
#define REGISTER_INT_CONSTANT(name, lval, flags) zend_register_int_constant((name), sizeof(name), (lval), (flags), module_number TSRMLS_CC)
#define REGISTER_DOUBLE_CONSTANT(name, dval, flags) zend_register_double_constant((name), sizeof(name), (dval), (flags), module_number TSRMLS_CC)
#define REGISTER_STRING_CONSTANT(name, str, flags) zend_register_string_constant((name), sizeof(name), (str), (flags), module_number TSRMLS_CC)
#define REGISTER_STRINGL_CONSTANT(name, str, len, flags) zend_register_stringl_constant((name), sizeof(name), (str), (len), (flags), module_number TSRMLS_CC)
#define REGISTER_NS_NULL_CONSTANT(ns, name, flags) zend_register_null_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name)), (flags), module_number TSRMLS_CC)
#define REGISTER_NS_BOOL_CONSTANT(ns, name, bval, flags) zend_register_bool_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name)), (bval), (flags), module_number TSRMLS_CC)
#define REGISTER_NS_LONG_CONSTANT(ns, name, lval, flags) zend_register_long_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name)), (lval), (flags), module_number TSRMLS_CC)
#define REGISTER_NS_INT_CONSTANT(ns, name, lval, flags) zend_register_int_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name)), (lval), (flags), module_number TSRMLS_CC)
#define REGISTER_NS_DOUBLE_CONSTANT(ns, name, dval, flags) zend_register_double_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name)), (dval), (flags), module_number TSRMLS_CC)
#define REGISTER_NS_STRING_CONSTANT(ns, name, str, flags) zend_register_string_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name)), (str), (flags), module_number TSRMLS_CC)
#define REGISTER_NS_STRINGL_CONSTANT(ns, name, str, len, flags) zend_register_stringl_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name)), (str), (len), (flags), module_number TSRMLS_CC)
#define REGISTER_MAIN_NULL_CONSTANT(name, flags) zend_register_null_constant((name), sizeof(name), (flags), 0 TSRMLS_CC)
#define REGISTER_MAIN_BOOL_CONSTANT(name, bval, flags) zend_register_bool_constant((name), sizeof(name), (bval), (flags), 0 TSRMLS_CC)
#define REGISTER_MAIN_LONG_CONSTANT(name, lval, flags) zend_register_long_constant((name), sizeof(name), (lval), (flags), 0 TSRMLS_CC)
#define REGISTER_MAIN_INT_CONSTANT(name, lval, flags) zend_register_int_constant((name), sizeof(name), (lval), (flags), 0 TSRMLS_CC)
#define REGISTER_MAIN_DOUBLE_CONSTANT(name, dval, flags) zend_register_double_constant((name), sizeof(name), (dval), (flags), 0 TSRMLS_CC)
#define REGISTER_MAIN_STRING_CONSTANT(name, str, flags) zend_register_string_constant((name), sizeof(name), (str), (flags), 0 TSRMLS_CC)
#define REGISTER_MAIN_STRINGL_CONSTANT(name, str, len, flags) zend_register_stringl_constant((name), sizeof(name), (str), (len), (flags), 0 TSRMLS_CC)
@@ -66,18 +66,18 @@ int zend_startup_constants(TSRMLS_D);
int zend_shutdown_constants(TSRMLS_D);
void zend_register_standard_constants(TSRMLS_D);
void clean_non_persistent_constants(TSRMLS_D);
ZEND_API int zend_get_constant(const char *name, uint name_len, zval *result TSRMLS_DC);
ZEND_API int zend_get_constant_ex(const char *name, uint name_len, zval *result, zend_class_entry *scope, ulong flags TSRMLS_DC);
ZEND_API void zend_register_bool_constant(const char *name, uint name_len, zend_bool bval, int flags, int module_number TSRMLS_DC);
ZEND_API void zend_register_null_constant(const char *name, uint name_len, int flags, int module_number TSRMLS_DC);
ZEND_API void zend_register_long_constant(const char *name, uint name_len, long lval, int flags, int module_number TSRMLS_DC);
ZEND_API void zend_register_double_constant(const char *name, uint name_len, double dval, int flags, int module_number TSRMLS_DC);
ZEND_API void zend_register_string_constant(const char *name, uint name_len, char *strval, int flags, int module_number TSRMLS_DC);
ZEND_API void zend_register_stringl_constant(const char *name, uint name_len, char *strval, uint strlen, int flags, int module_number TSRMLS_DC);
ZEND_API int zend_get_constant(const char *name, zend_size_t name_len, zval *result TSRMLS_DC);
ZEND_API int zend_get_constant_ex(const char *name, zend_size_t name_len, zval *result, zend_class_entry *scope, zend_uint_t flags TSRMLS_DC);
ZEND_API void zend_register_int_constant(const char *name, zend_size_t name_len, zend_int_t lval, int flags, int module_number TSRMLS_DC);
ZEND_API void zend_register_double_constant(const char *name, zend_size_t name_len, double dval, int flags, int module_number TSRMLS_DC);
ZEND_API void zend_register_string_constant(const char *name, zend_size_t name_len, char *strval, int flags, int module_number TSRMLS_DC);
ZEND_API void zend_register_stringl_constant(const char *name, zend_size_t name_len, char *strval, zend_size_t strlen, int flags, int module_number TSRMLS_DC);
ZEND_API void zend_register_bool_constant(const char *name, zend_size_t name_len, zend_bool bval, int flags, int module_number TSRMLS_DC);
ZEND_API void zend_register_null_constant(const char *name, zend_size_t name_len, int flags, int module_number TSRMLS_DC);
ZEND_API int zend_register_constant(zend_constant *c TSRMLS_DC);
void zend_copy_constants(HashTable *target, HashTable *sourc);
void copy_zend_constant(zend_constant *c);
zend_constant *zend_quick_get_constant(const zend_literal *key, ulong flags TSRMLS_DC);
zend_constant *zend_quick_get_constant(const zend_literal *key, zend_uint_t flags TSRMLS_DC);
END_EXTERN_C()
#define ZEND_CONSTANT_DTOR (void (*)(void *)) free_zend_constant
+67 -65
View File
@@ -86,7 +86,7 @@ void zend_throw_exception_internal(zval *exception TSRMLS_DC) /* {{{ */
#ifdef HAVE_DTRACE
if (DTRACE_EXCEPTION_THROWN_ENABLED()) {
const char *classname;
zend_uint name_len;
zend_size_t name_len;
if (exception != NULL) {
zend_get_object_classname(exception, &classname, &name_len TSRMLS_CC);
@@ -161,7 +161,7 @@ static zend_object_value zend_default_exception_new_ex(zend_class_entry *class_t
zend_fetch_debug_backtrace(trace, skip_top_traces, 0, 0 TSRMLS_CC);
zend_update_property_string(default_exception_ce, &obj, "file", sizeof("file")-1, zend_get_executed_filename(TSRMLS_C) TSRMLS_CC);
zend_update_property_long(default_exception_ce, &obj, "line", sizeof("line")-1, zend_get_executed_lineno(TSRMLS_C) TSRMLS_CC);
zend_update_property_int(default_exception_ce, &obj, "line", sizeof("line")-1, zend_get_executed_lineno(TSRMLS_C) TSRMLS_CC);
zend_update_property(default_exception_ce, &obj, "trace", sizeof("trace")-1, trace TSRMLS_CC);
return Z_OBJVAL(obj);
@@ -194,11 +194,12 @@ ZEND_METHOD(exception, __clone)
ZEND_METHOD(exception, __construct)
{
char *message = NULL;
long code = 0;
zend_int_t code = 0;
zval *object, *previous = NULL;
int argc = ZEND_NUM_ARGS(), message_len;
int argc = ZEND_NUM_ARGS();
zend_size_t message_len;
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC, "|slO!", &message, &message_len, &code, &previous, default_exception_ce) == FAILURE) {
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC, "|SiO!", &message, &message_len, &code, &previous, default_exception_ce) == FAILURE) {
zend_error(E_ERROR, "Wrong parameters for Exception([string $exception [, long $code [, Exception $previous = NULL]]])");
}
@@ -209,7 +210,7 @@ ZEND_METHOD(exception, __construct)
}
if (code) {
zend_update_property_long(default_exception_ce, object, "code", sizeof("code")-1, code TSRMLS_CC);
zend_update_property_int(default_exception_ce, object, "code", sizeof("code")-1, code TSRMLS_CC);
}
if (previous) {
@@ -223,11 +224,12 @@ ZEND_METHOD(exception, __construct)
ZEND_METHOD(error_exception, __construct)
{
char *message = NULL, *filename = NULL;
long code = 0, severity = E_ERROR, lineno;
zend_int_t code = 0, severity = E_ERROR, lineno;
zval *object, *previous = NULL;
int argc = ZEND_NUM_ARGS(), message_len, filename_len;
int argc = ZEND_NUM_ARGS();
zend_size_t message_len, filename_len;
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC, "|sllslO!", &message, &message_len, &code, &severity, &filename, &filename_len, &lineno, &previous, default_exception_ce) == FAILURE) {
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC, "|SiiSiO!", &message, &message_len, &code, &severity, &filename, &filename_len, &lineno, &previous, default_exception_ce) == FAILURE) {
zend_error(E_ERROR, "Wrong parameters for ErrorException([string $exception [, long $code, [ long $severity, [ string $filename, [ long $lineno [, Exception $previous = NULL]]]]]])");
}
@@ -238,21 +240,21 @@ ZEND_METHOD(error_exception, __construct)
}
if (code) {
zend_update_property_long(default_exception_ce, object, "code", sizeof("code")-1, code TSRMLS_CC);
zend_update_property_int(default_exception_ce, object, "code", sizeof("code")-1, code TSRMLS_CC);
}
if (previous) {
zend_update_property(default_exception_ce, object, "previous", sizeof("previous")-1, previous TSRMLS_CC);
}
zend_update_property_long(default_exception_ce, object, "severity", sizeof("severity")-1, severity TSRMLS_CC);
zend_update_property_int(default_exception_ce, object, "severity", sizeof("severity")-1, severity TSRMLS_CC);
if (argc >= 4) {
zend_update_property_string(default_exception_ce, object, "file", sizeof("file")-1, filename TSRMLS_CC);
if (argc < 5) {
lineno = 0; /* invalidate lineno */
}
zend_update_property_long(default_exception_ce, object, "line", sizeof("line")-1, lineno TSRMLS_CC);
zend_update_property_int(default_exception_ce, object, "line", sizeof("line")-1, lineno TSRMLS_CC);
}
}
/* }}} */
@@ -262,7 +264,7 @@ ZEND_METHOD(error_exception, __construct)
return; \
}
static void _default_exception_get_entry(zval *object, char *name, int name_len, zval *return_value TSRMLS_DC) /* {{{ */
static void _default_exception_get_entry(zval *object, char *name, zend_size_t name_len, zval *return_value TSRMLS_DC) /* {{{ */
{
zval *value;
@@ -341,7 +343,7 @@ ZEND_METHOD(error_exception, getSeverity)
#define TRACE_APPEND_STRL(val, vallen) \
{ \
int l = vallen; \
zend_size_t l = vallen; \
*str = (char*)erealloc(*str, *len + l + 1); \
memcpy((*str) + *len, val, l); \
*len += l; \
@@ -356,7 +358,7 @@ ZEND_METHOD(error_exception, getSeverity)
zend_error(E_WARNING, "Value for %s is no string", key); \
TRACE_APPEND_STR("[unknown]"); \
} else { \
TRACE_APPEND_STRL(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); \
TRACE_APPEND_STRL(Z_STRVAL_PP(tmp), Z_STRSIZE_PP(tmp)); \
} \
}
@@ -370,10 +372,10 @@ ZEND_METHOD(error_exception, getSeverity)
static int _build_trace_args(zval **arg TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
{
char **str;
int *len;
zend_size_t *len;
str = va_arg(args, char**);
len = va_arg(args, int*);
len = va_arg(args, zend_size_t*);
/* the trivial way would be to do:
* convert_to_string_ex(arg);
@@ -386,14 +388,14 @@ static int _build_trace_args(zval **arg TSRMLS_DC, int num_args, va_list args, z
TRACE_APPEND_STR("NULL, ");
break;
case IS_STRING: {
int l_added;
zend_size_t l_added;
TRACE_APPEND_CHR('\'');
if (Z_STRLEN_PP(arg) > 15) {
if (Z_STRSIZE_PP(arg) > 15) {
TRACE_APPEND_STRL(Z_STRVAL_PP(arg), 15);
TRACE_APPEND_STR("...', ");
l_added = 15 + 6 + 1; /* +1 because of while (--l_added) */
} else {
l_added = Z_STRLEN_PP(arg);
l_added = Z_STRSIZE_PP(arg);
TRACE_APPEND_STRL(Z_STRVAL_PP(arg), l_added);
TRACE_APPEND_STR("', ");
l_added += 3 + 1;
@@ -456,7 +458,7 @@ static int _build_trace_args(zval **arg TSRMLS_DC, int num_args, va_list args, z
break;
}
case IS_BOOL:
if (Z_LVAL_PP(arg)) {
if (Z_IVAL_PP(arg)) {
TRACE_APPEND_STR("true, ");
} else {
TRACE_APPEND_STR("false, ");
@@ -465,10 +467,10 @@ static int _build_trace_args(zval **arg TSRMLS_DC, int num_args, va_list args, z
case IS_RESOURCE:
TRACE_APPEND_STR("Resource id #");
/* break; */
case IS_LONG: {
long lval = Z_LVAL_PP(arg);
char s_tmp[MAX_LENGTH_OF_LONG + 1];
int l_tmp = zend_sprintf(s_tmp, "%ld", lval); /* SAFE */
case IS_INT: {
zend_int_t lval = Z_IVAL_PP(arg);
char s_tmp[MAX_LENGTH_OF_ZEND_INT + 1];
zend_size_t l_tmp = zend_sprintf(s_tmp, ZEND_INT_FMT, lval); /* SAFE */
TRACE_APPEND_STRL(s_tmp, l_tmp);
TRACE_APPEND_STR(", ");
break;
@@ -476,7 +478,7 @@ static int _build_trace_args(zval **arg TSRMLS_DC, int num_args, va_list args, z
case IS_DOUBLE: {
double dval = Z_DVAL_PP(arg);
char *s_tmp;
int l_tmp;
zend_size_t l_tmp;
s_tmp = emalloc(MAX_LENGTH_OF_DOUBLE + EG(precision) + 1);
l_tmp = zend_sprintf(s_tmp, "%.*G", (int) EG(precision), dval); /* SAFE */
@@ -491,7 +493,7 @@ static int _build_trace_args(zval **arg TSRMLS_DC, int num_args, va_list args, z
break;
case IS_OBJECT: {
const char *class_name;
zend_uint class_name_len;
zend_size_t class_name_len;
int dup;
TRACE_APPEND_STR("Object(");
@@ -516,8 +518,8 @@ static int _build_trace_args(zval **arg TSRMLS_DC, int num_args, va_list args, z
static int _build_trace_string(zval **frame TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
{
char *s_tmp, **str;
int *len, *num;
long line;
zend_size_t *len, *num;
zend_int_t line;
HashTable *ht = Z_ARRVAL_PP(frame);
zval **file, **tmp;
@@ -527,11 +529,11 @@ static int _build_trace_string(zval **frame TSRMLS_DC, int num_args, va_list arg
}
str = va_arg(args, char**);
len = va_arg(args, int*);
num = va_arg(args, int*);
len = va_arg(args, zend_size_t*);
num = va_arg(args, zend_size_t*);
s_tmp = emalloc(1 + MAX_LENGTH_OF_LONG + 1 + 1);
sprintf(s_tmp, "#%d ", (*num)++);
s_tmp = emalloc(1 + MAX_LENGTH_OF_ZEND_INT + 1 + 1);
sprintf(s_tmp, "#" ZEND_INT_FMT " ", (*num)++);
TRACE_APPEND_STRL(s_tmp, strlen(s_tmp));
efree(s_tmp);
if (zend_hash_find(ht, "file", sizeof("file"), (void**)&file) == SUCCESS) {
@@ -540,8 +542,8 @@ static int _build_trace_string(zval **frame TSRMLS_DC, int num_args, va_list arg
TRACE_APPEND_STR("[unknown function]");
} else{
if (zend_hash_find(ht, "line", sizeof("line"), (void**)&tmp) == SUCCESS) {
if (Z_TYPE_PP(tmp) == IS_LONG) {
line = Z_LVAL_PP(tmp);
if (Z_TYPE_PP(tmp) == IS_INT) {
line = Z_IVAL_PP(tmp);
} else {
zend_error(E_WARNING, "Line is no long");
line = 0;
@@ -549,8 +551,8 @@ static int _build_trace_string(zval **frame TSRMLS_DC, int num_args, va_list arg
} else {
line = 0;
}
s_tmp = emalloc(Z_STRLEN_PP(file) + MAX_LENGTH_OF_LONG + 4 + 1);
sprintf(s_tmp, "%s(%ld): ", Z_STRVAL_PP(file), line);
s_tmp = emalloc(Z_STRSIZE_PP(file) + MAX_LENGTH_OF_ZEND_INT + 4 + 1);
sprintf(s_tmp, "%s(" ZEND_INT_FMT "): ", Z_STRVAL_PP(file), line);
TRACE_APPEND_STRL(s_tmp, strlen(s_tmp));
efree(s_tmp);
}
@@ -563,7 +565,7 @@ static int _build_trace_string(zval **frame TSRMLS_DC, int num_args, va_list arg
TRACE_APPEND_CHR('(');
if (zend_hash_find(ht, "args", sizeof("args"), (void**)&tmp) == SUCCESS) {
if (Z_TYPE_PP(tmp) == IS_ARRAY) {
int last_len = *len;
zend_size_t last_len = *len;
zend_hash_apply_with_arguments(Z_ARRVAL_PP(tmp) TSRMLS_CC, (apply_func_args_t)_build_trace_args, 2, str, len);
if (last_len != *len) {
*len -= 2; /* remove last ', ' */
@@ -583,7 +585,7 @@ ZEND_METHOD(exception, getTraceAsString)
{
zval *trace;
char *res, **str, *s_tmp;
int res_len = 0, *len = &res_len, num = 0;
zend_size_t res_len = 0, *len = &res_len, num = 0;
DEFAULT_0_PARAMS;
@@ -593,8 +595,8 @@ ZEND_METHOD(exception, getTraceAsString)
trace = zend_read_property(default_exception_ce, getThis(), "trace", sizeof("trace")-1, 1 TSRMLS_CC);
zend_hash_apply_with_arguments(Z_ARRVAL_P(trace) TSRMLS_CC, (apply_func_args_t)_build_trace_string, 3, str, len, &num);
s_tmp = emalloc(1 + MAX_LENGTH_OF_LONG + 7 + 1);
sprintf(s_tmp, "#%d {main}", num);
s_tmp = emalloc(1 + MAX_LENGTH_OF_ZEND_INT + 7 + 1);
sprintf(s_tmp, "#" ZEND_INT_FMT " {main}", num);
TRACE_APPEND_STRL(s_tmp, strlen(s_tmp));
efree(s_tmp);
@@ -615,10 +617,10 @@ ZEND_METHOD(exception, getPrevious)
RETURN_ZVAL(previous, 1, 0);
}
int zend_spprintf(char **message, int max_len, const char *format, ...) /* {{{ */
zend_size_t zend_spprintf(char **message, zend_size_t max_len, const char *format, ...) /* {{{ */
{
va_list arg;
int len;
zend_size_t len;
va_start(arg, format);
len = zend_vspprintf(message, max_len, format, arg);
@@ -633,7 +635,7 @@ ZEND_METHOD(exception, __toString)
{
zval message, file, line, *trace, *exception;
char *str, *prev_str;
int len = 0;
zend_size_t len = 0;
zend_fcall_info fci;
zval fname;
@@ -652,7 +654,7 @@ ZEND_METHOD(exception, __toString)
convert_to_string(&message);
convert_to_string(&file);
convert_to_long(&line);
convert_to_int(&line);
fci.size = sizeof(fci);
fci.function_table = &Z_OBJCE_P(exception)->function_table;
@@ -671,15 +673,15 @@ ZEND_METHOD(exception, __toString)
trace = NULL;
}
if (Z_STRLEN(message) > 0) {
len = zend_spprintf(&str, 0, "exception '%s' with message '%s' in %s:%ld\nStack trace:\n%s%s%s",
Z_OBJCE_P(exception)->name, Z_STRVAL(message), Z_STRVAL(file), Z_LVAL(line),
(trace && Z_STRLEN_P(trace)) ? Z_STRVAL_P(trace) : "#0 {main}\n",
if (Z_STRSIZE(message) > 0) {
len = zend_spprintf(&str, 0, "exception '%s' with message '%s' in %s:" ZEND_INT_FMT "\nStack trace:\n%s%s%s",
Z_OBJCE_P(exception)->name, Z_STRVAL(message), Z_STRVAL(file), Z_IVAL(line),
(trace && Z_STRSIZE_P(trace)) ? Z_STRVAL_P(trace) : "#0 {main}\n",
len ? "\n\nNext " : "", prev_str);
} else {
len = zend_spprintf(&str, 0, "exception '%s' in %s:%ld\nStack trace:\n%s%s%s",
Z_OBJCE_P(exception)->name, Z_STRVAL(file), Z_LVAL(line),
(trace && Z_STRLEN_P(trace)) ? Z_STRVAL_P(trace) : "#0 {main}\n",
len = zend_spprintf(&str, 0, "exception '%s' in %s:" ZEND_INT_FMT "\nStack trace:\n%s%s%s",
Z_OBJCE_P(exception)->name, Z_STRVAL(file), Z_IVAL(line),
(trace && Z_STRSIZE_P(trace)) ? Z_STRVAL_P(trace) : "#0 {main}\n",
len ? "\n\nNext " : "", prev_str);
}
efree(prev_str);
@@ -762,7 +764,7 @@ void zend_register_default_exception(TSRMLS_D) /* {{{ */
zend_declare_property_string(default_exception_ce, "message", sizeof("message")-1, "", ZEND_ACC_PROTECTED TSRMLS_CC);
zend_declare_property_string(default_exception_ce, "string", sizeof("string")-1, "", ZEND_ACC_PRIVATE TSRMLS_CC);
zend_declare_property_long(default_exception_ce, "code", sizeof("code")-1, 0, ZEND_ACC_PROTECTED TSRMLS_CC);
zend_declare_property_int(default_exception_ce, "code", sizeof("code")-1, 0, ZEND_ACC_PROTECTED TSRMLS_CC);
zend_declare_property_null(default_exception_ce, "file", sizeof("file")-1, ZEND_ACC_PROTECTED TSRMLS_CC);
zend_declare_property_null(default_exception_ce, "line", sizeof("line")-1, ZEND_ACC_PROTECTED TSRMLS_CC);
zend_declare_property_null(default_exception_ce, "trace", sizeof("trace")-1, ZEND_ACC_PRIVATE TSRMLS_CC);
@@ -771,7 +773,7 @@ void zend_register_default_exception(TSRMLS_D) /* {{{ */
INIT_CLASS_ENTRY(ce, "ErrorException", error_exception_functions);
error_exception_ce = zend_register_internal_class_ex(&ce, default_exception_ce, NULL TSRMLS_CC);
error_exception_ce->create_object = zend_error_exception_new;
zend_declare_property_long(error_exception_ce, "severity", sizeof("severity")-1, E_ERROR, ZEND_ACC_PROTECTED TSRMLS_CC);
zend_declare_property_int(error_exception_ce, "severity", sizeof("severity")-1, E_ERROR, ZEND_ACC_PROTECTED TSRMLS_CC);
}
/* }}} */
@@ -787,7 +789,7 @@ ZEND_API zend_class_entry *zend_get_error_exception(TSRMLS_D) /* {{{ */
}
/* }}} */
ZEND_API zval * zend_throw_exception(zend_class_entry *exception_ce, const char *message, long code TSRMLS_DC) /* {{{ */
ZEND_API zval * zend_throw_exception(zend_class_entry *exception_ce, const char *message, zend_int_t code TSRMLS_DC) /* {{{ */
{
zval *ex;
@@ -807,7 +809,7 @@ ZEND_API zval * zend_throw_exception(zend_class_entry *exception_ce, const char
zend_update_property_string(default_exception_ce, ex, "message", sizeof("message")-1, message TSRMLS_CC);
}
if (code) {
zend_update_property_long(default_exception_ce, ex, "code", sizeof("code")-1, code TSRMLS_CC);
zend_update_property_int(default_exception_ce, ex, "code", sizeof("code")-1, code TSRMLS_CC);
}
zend_throw_exception_internal(ex TSRMLS_CC);
@@ -815,7 +817,7 @@ ZEND_API zval * zend_throw_exception(zend_class_entry *exception_ce, const char
}
/* }}} */
ZEND_API zval * zend_throw_exception_ex(zend_class_entry *exception_ce, long code TSRMLS_DC, const char *format, ...) /* {{{ */
ZEND_API zval * zend_throw_exception_ex(zend_class_entry *exception_ce, zend_int_t code TSRMLS_DC, const char *format, ...) /* {{{ */
{
va_list arg;
char *message;
@@ -830,15 +832,15 @@ ZEND_API zval * zend_throw_exception_ex(zend_class_entry *exception_ce, long cod
}
/* }}} */
ZEND_API zval * zend_throw_error_exception(zend_class_entry *exception_ce, const char *message, long code, int severity TSRMLS_DC) /* {{{ */
ZEND_API zval * zend_throw_error_exception(zend_class_entry *exception_ce, const char *message, zend_int_t code, int severity TSRMLS_DC) /* {{{ */
{
zval *ex = zend_throw_exception(exception_ce, message, code TSRMLS_CC);
zend_update_property_long(default_exception_ce, ex, "severity", sizeof("severity")-1, severity TSRMLS_CC);
zend_update_property_int(default_exception_ce, ex, "severity", sizeof("severity")-1, severity TSRMLS_CC);
return ex;
}
/* }}} */
static void zend_error_va(int type, const char *file, uint lineno, const char *format, ...) /* {{{ */
static void zend_error_va(int type, const char *file, zend_size_t lineno, const char *format, ...) /* {{{ */
{
va_list args;
@@ -874,13 +876,13 @@ ZEND_API void zend_exception_error(zval *exception, int severity TSRMLS_DC) /* {
line = zend_read_property(default_exception_ce, EG(exception), "line", sizeof("line")-1, 1 TSRMLS_CC);
convert_to_string(file);
file = (Z_STRLEN_P(file) > 0) ? file : NULL;
line = (Z_TYPE_P(line) == IS_LONG) ? line : NULL;
file = (Z_STRSIZE_P(file) > 0) ? file : NULL;
line = (Z_TYPE_P(line) == IS_INT) ? line : NULL;
} else {
file = NULL;
line = NULL;
}
zend_error_va(E_WARNING, file ? Z_STRVAL_P(file) : NULL, line ? Z_LVAL_P(line) : 0, "Uncaught %s in exception handling during call to %s::__tostring()", Z_OBJCE_P(EG(exception))->name, ce_exception->name);
zend_error_va(E_WARNING, file ? Z_STRVAL_P(file) : NULL, line ? Z_IVAL_P(line) : 0, "Uncaught %s in exception handling during call to %s::__tostring()", Z_OBJCE_P(EG(exception))->name, ce_exception->name);
}
str = zend_read_property(default_exception_ce, exception, "string", sizeof("string")-1, 1 TSRMLS_CC);
@@ -889,9 +891,9 @@ ZEND_API void zend_exception_error(zval *exception, int severity TSRMLS_DC) /* {
convert_to_string(str);
convert_to_string(file);
convert_to_long(line);
convert_to_int(line);
zend_error_va(severity, (Z_STRLEN_P(file) > 0) ? Z_STRVAL_P(file) : NULL, Z_LVAL_P(line), "Uncaught %s\n thrown", Z_STRVAL_P(str));
zend_error_va(severity, (Z_STRSIZE_P(file) > 0) ? Z_STRVAL_P(file) : NULL, Z_IVAL_P(line), "Uncaught %s\n thrown", Z_STRVAL_P(str));
} else {
zend_error(severity, "Uncaught exception '%s'", ce_exception->name);
}
+4 -4
View File
@@ -40,12 +40,12 @@ ZEND_API void zend_register_default_classes(TSRMLS_D);
/* exception_ce NULL or zend_exception_get_default() or a derived class
* message NULL or the message of the exception */
ZEND_API zval * zend_throw_exception(zend_class_entry *exception_ce, const char *message, long code TSRMLS_DC);
ZEND_API zval * zend_throw_exception_ex(zend_class_entry *exception_ce, long code TSRMLS_DC, const char *format, ...);
ZEND_API zval * zend_throw_exception(zend_class_entry *exception_ce, const char *message, zend_int_t code TSRMLS_DC);
ZEND_API zval * zend_throw_exception_ex(zend_class_entry *exception_ce, zend_int_t code TSRMLS_DC, const char *format, ...);
ZEND_API void zend_throw_exception_object(zval *exception TSRMLS_DC);
ZEND_API void zend_clear_exception(TSRMLS_D);
ZEND_API zval * zend_throw_error_exception(zend_class_entry *exception_ce, const char *message, long code, int severity TSRMLS_DC);
ZEND_API zval * zend_throw_error_exception(zend_class_entry *exception_ce, const char *message, zend_int_t code, int severity TSRMLS_DC);
extern ZEND_API void (*zend_throw_exception_hook)(zval *ex TSRMLS_DC);
@@ -53,7 +53,7 @@ extern ZEND_API void (*zend_throw_exception_hook)(zval *ex TSRMLS_DC);
ZEND_API void zend_exception_error(zval *exception, int severity TSRMLS_DC);
/* do not export, in php it's available thru spprintf directly */
int zend_spprintf(char **message, int max_len, const char *format, ...);
zend_size_t zend_spprintf(char **message, zend_size_t max_len, const char *format, ...);
END_EXTERN_C()
+42 -42
View File
@@ -563,8 +563,8 @@ static void zend_assign_to_variable_reference(zval **variable_ptr_ptr, zval **va
static inline void make_real_object(zval **object_ptr TSRMLS_DC)
{
if (Z_TYPE_PP(object_ptr) == IS_NULL
|| (Z_TYPE_PP(object_ptr) == IS_BOOL && Z_LVAL_PP(object_ptr) == 0)
|| (Z_TYPE_PP(object_ptr) == IS_STRING && Z_STRLEN_PP(object_ptr) == 0)
|| (Z_TYPE_PP(object_ptr) == IS_BOOL && Z_IVAL_PP(object_ptr) == 0)
|| (Z_TYPE_PP(object_ptr) == IS_STRING && Z_STRSIZE_PP(object_ptr) == 0)
) {
SEPARATE_ZVAL_IF_NOT_REF(object_ptr);
zval_dtor(*object_ptr);
@@ -573,7 +573,7 @@ static inline void make_real_object(zval **object_ptr TSRMLS_DC)
}
}
ZEND_API char * zend_verify_arg_class_kind(const zend_arg_info *cur_arg_info, ulong fetch_type, const char **class_name, zend_class_entry **pce TSRMLS_DC)
ZEND_API char * zend_verify_arg_class_kind(const zend_arg_info *cur_arg_info, zend_uint_t fetch_type, const char **class_name, zend_class_entry **pce TSRMLS_DC)
{
*pce = zend_fetch_class(cur_arg_info->class_name, cur_arg_info->class_name_len, (fetch_type | ZEND_FETCH_CLASS_AUTO | ZEND_FETCH_CLASS_NO_AUTOLOAD) TSRMLS_CC);
@@ -585,7 +585,7 @@ ZEND_API char * zend_verify_arg_class_kind(const zend_arg_info *cur_arg_info, ul
}
}
ZEND_API int zend_verify_arg_error(int error_type, const zend_function *zf, zend_uint arg_num, const char *need_msg, const char *need_kind, const char *given_msg, const char *given_kind TSRMLS_DC)
ZEND_API int zend_verify_arg_error(int error_type, const zend_function *zf, zend_size_t arg_num, const char *need_msg, const char *need_kind, const char *given_msg, const char *given_kind TSRMLS_DC)
{
zend_execute_data *ptr = EG(current_execute_data)->prev_execute_data;
const char *fname = zf->common.function_name;
@@ -601,14 +601,14 @@ ZEND_API int zend_verify_arg_error(int error_type, const zend_function *zf, zend
}
if (ptr && ptr->op_array) {
zend_error(error_type, "Argument %d passed to %s%s%s() must %s%s, %s%s given, called in %s on line %d and defined", arg_num, fclass, fsep, fname, need_msg, need_kind, given_msg, given_kind, ptr->op_array->filename, ptr->opline->lineno);
zend_error(error_type, "Argument %pu passed to %s%s%s() must %s%s, %s%s given, called in %s on line %pu and defined", arg_num, fclass, fsep, fname, need_msg, need_kind, given_msg, given_kind, ptr->op_array->filename, ptr->opline->lineno);
} else {
zend_error(error_type, "Argument %d passed to %s%s%s() must %s%s, %s%s given", arg_num, fclass, fsep, fname, need_msg, need_kind, given_msg, given_kind);
zend_error(error_type, "Argument %pu passed to %s%s%s() must %s%s, %s%s given", arg_num, fclass, fsep, fname, need_msg, need_kind, given_msg, given_kind);
}
return 0;
}
static inline int zend_verify_arg_type(zend_function *zf, zend_uint arg_num, zval *arg, ulong fetch_type TSRMLS_DC)
static inline int zend_verify_arg_type(zend_function *zf, zend_size_t arg_num, zval *arg, zend_uint_t fetch_type TSRMLS_DC)
{
zend_arg_info *cur_arg_info;
char *need_msg;
@@ -686,8 +686,8 @@ static inline void zend_assign_to_object(zval **retval, zval **object_ptr, zval
return;
}
if (Z_TYPE_P(object) == IS_NULL ||
(Z_TYPE_P(object) == IS_BOOL && Z_LVAL_P(object) == 0) ||
(Z_TYPE_P(object) == IS_STRING && Z_STRLEN_P(object) == 0)) {
(Z_TYPE_P(object) == IS_BOOL && Z_IVAL_P(object) == 0) ||
(Z_TYPE_P(object) == IS_STRING && Z_STRSIZE_P(object) == 0)) {
SEPARATE_ZVAL_IF_NOT_REF(object_ptr);
object = *object_ptr;
Z_ADDREF_P(object);
@@ -771,20 +771,20 @@ static inline void zend_assign_to_object(zval **retval, zval **object_ptr, zval
static inline int zend_assign_to_string_offset(const temp_variable *T, const zval *value, int value_type TSRMLS_DC)
{
zval *str = T->str_offset.str;
zend_uint offset = T->str_offset.offset;
zend_uint_t offset = T->str_offset.offset;
if (Z_TYPE_P(str) == IS_STRING) {
if ((int)offset < 0) {
if ((zend_int_t)offset < 0) {
zend_error(E_WARNING, "Illegal string offset: %d", offset);
return 0;
}
if (offset >= Z_STRLEN_P(str)) {
if (offset >= Z_STRSIZE_P(str)) {
Z_STRVAL_P(str) = str_erealloc(Z_STRVAL_P(str), offset+1+1);
memset(Z_STRVAL_P(str) + Z_STRLEN_P(str), ' ', offset - Z_STRLEN_P(str));
memset(Z_STRVAL_P(str) + Z_STRSIZE_P(str), ' ', offset - Z_STRSIZE_P(str));
Z_STRVAL_P(str)[offset+1] = 0;
Z_STRLEN_P(str) = offset+1;
Z_STRSIZE_P(str) = offset+1;
} else if (IS_INTERNED(Z_STRVAL_P(str))) {
Z_STRVAL_P(str) = estrndup(Z_STRVAL_P(str), Z_STRLEN_P(str));
Z_STRVAL_P(str) = estrndup(Z_STRVAL_P(str), Z_STRSIZE_P(str));
}
if (Z_TYPE_P(value) != IS_STRING) {
@@ -1017,8 +1017,8 @@ static inline zval **zend_fetch_dimension_address_inner(HashTable *ht, const zva
{
zval **retval;
char *offset_key;
int offset_key_length;
ulong hval;
zend_size_t offset_key_length;
zend_uint_t hval;
switch (dim->type) {
case IS_NULL:
@@ -1062,26 +1062,26 @@ fetch_string_dim:
}
break;
case IS_DOUBLE:
hval = zend_dval_to_lval(Z_DVAL_P(dim));
hval = zend_dval_to_ival(Z_DVAL_P(dim));
goto num_index;
case IS_RESOURCE:
zend_error(E_STRICT, "Resource ID#%ld used as offset, casting to integer (%ld)", Z_LVAL_P(dim), Z_LVAL_P(dim));
zend_error(E_STRICT, "Resource ID#" ZEND_INT_FMT " used as offset, casting to integer (" ZEND_INT_FMT ")", Z_IVAL_P(dim), Z_IVAL_P(dim));
/* Fall Through */
case IS_BOOL:
case IS_LONG:
hval = Z_LVAL_P(dim);
case IS_INT:
hval = Z_IVAL_P(dim);
num_index:
if (zend_hash_index_find(ht, hval, (void **) &retval) == FAILURE) {
switch (type) {
case BP_VAR_R:
zend_error(E_NOTICE,"Undefined offset: %ld", hval);
zend_error(E_NOTICE,"Undefined offset: " ZEND_INT_FMT, hval);
/* break missing intentionally */
case BP_VAR_UNSET:
case BP_VAR_IS:
retval = &EG(uninitialized_zval_ptr);
break;
case BP_VAR_RW:
zend_error(E_NOTICE,"Undefined offset: %ld", hval);
zend_error(E_NOTICE,"Undefined offset: " ZEND_INT_FMT, hval);
/* break missing intentionally */
case BP_VAR_W: {
zval *new_zval = &EG(uninitialized_zval);
@@ -1156,7 +1156,7 @@ convert_to_array:
case IS_STRING: {
zval tmp;
if (type != BP_VAR_UNSET && Z_STRLEN_P(container)==0) {
if (type != BP_VAR_UNSET && Z_STRSIZE_P(container)==0) {
goto convert_to_array;
}
if (dim == NULL) {
@@ -1167,12 +1167,12 @@ convert_to_array:
SEPARATE_ZVAL_IF_NOT_REF(container_ptr);
}
if (Z_TYPE_P(dim) != IS_LONG) {
if (Z_TYPE_P(dim) != IS_INT) {
switch(Z_TYPE_P(dim)) {
/* case IS_LONG: */
/* case IS_INT: */
case IS_STRING:
if (IS_LONG == is_numeric_string(Z_STRVAL_P(dim), Z_STRLEN_P(dim), NULL, NULL, -1)) {
if (IS_INT == is_numeric_string(Z_STRVAL_P(dim), Z_STRSIZE_P(dim), NULL, NULL, -1)) {
break;
}
if (type != BP_VAR_UNSET) {
@@ -1192,13 +1192,13 @@ convert_to_array:
tmp = *dim;
zval_copy_ctor(&tmp);
convert_to_long(&tmp);
convert_to_int(&tmp);
dim = &tmp;
}
container = *container_ptr;
result->str_offset.str = container;
PZVAL_LOCK(container);
result->str_offset.offset = Z_LVAL_P(dim);
result->str_offset.offset = Z_IVAL_P(dim);
result->str_offset.ptr_ptr = NULL;
return;
}
@@ -1247,7 +1247,7 @@ convert_to_array:
break;
case IS_BOOL:
if (type != BP_VAR_UNSET && Z_LVAL_P(container)==0) {
if (type != BP_VAR_UNSET && Z_IVAL_P(container)==0) {
goto convert_to_array;
}
/* break missing intentionally */
@@ -1287,11 +1287,11 @@ static void zend_fetch_dimension_address_read(temp_variable *result, zval *conta
zval tmp;
zval *ptr;
if (Z_TYPE_P(dim) != IS_LONG) {
if (Z_TYPE_P(dim) != IS_INT) {
switch(Z_TYPE_P(dim)) {
/* case IS_LONG: */
/* case IS_INT: */
case IS_STRING:
if (IS_LONG == is_numeric_string(Z_STRVAL_P(dim), Z_STRLEN_P(dim), NULL, NULL, -1)) {
if (IS_INT == is_numeric_string(Z_STRVAL_P(dim), Z_STRSIZE_P(dim), NULL, NULL, -1)) {
break;
}
if (type != BP_VAR_IS) {
@@ -1312,7 +1312,7 @@ static void zend_fetch_dimension_address_read(temp_variable *result, zval *conta
ZVAL_COPY_VALUE(&tmp, dim);
zval_copy_ctor(&tmp);
convert_to_long(&tmp);
convert_to_int(&tmp);
dim = &tmp;
}
@@ -1320,17 +1320,17 @@ static void zend_fetch_dimension_address_read(temp_variable *result, zval *conta
INIT_PZVAL(ptr);
Z_TYPE_P(ptr) = IS_STRING;
if (Z_LVAL_P(dim) < 0 || Z_STRLEN_P(container) <= Z_LVAL_P(dim)) {
if (Z_IVAL_P(dim) < 0 || Z_STRSIZE_P(container) <= Z_IVAL_P(dim)) {
if (type != BP_VAR_IS) {
zend_error(E_NOTICE, "Uninitialized string offset: %ld", Z_LVAL_P(dim));
zend_error(E_NOTICE, "Uninitialized string offset: " ZEND_INT_FMT, Z_IVAL_P(dim));
}
Z_STRVAL_P(ptr) = STR_EMPTY_ALLOC();
Z_STRLEN_P(ptr) = 0;
Z_STRSIZE_P(ptr) = 0;
} else {
Z_STRVAL_P(ptr) = (char*)emalloc(2);
Z_STRVAL_P(ptr)[0] = Z_STRVAL_P(container)[Z_LVAL_P(dim)];
Z_STRVAL_P(ptr)[0] = Z_STRVAL_P(container)[Z_IVAL_P(dim)];
Z_STRVAL_P(ptr)[1] = 0;
Z_STRLEN_P(ptr) = 1;
Z_STRSIZE_P(ptr) = 1;
}
result->var.ptr = ptr;
return;
@@ -1392,8 +1392,8 @@ static void zend_fetch_property_address(temp_variable *result, zval **container_
/* this should modify object only if it's empty */
if (type != BP_VAR_UNSET &&
((Z_TYPE_P(container) == IS_NULL ||
(Z_TYPE_P(container) == IS_BOOL && Z_LVAL_P(container)==0) ||
(Z_TYPE_P(container) == IS_STRING && Z_STRLEN_P(container)==0)))) {
(Z_TYPE_P(container) == IS_BOOL && Z_IVAL_P(container)==0) ||
(Z_TYPE_P(container) == IS_STRING && Z_STRSIZE_P(container)==0)))) {
if (!PZVAL_IS_REF(container)) {
SEPARATE_ZVAL(container_ptr);
container = *container_ptr;
@@ -1628,7 +1628,7 @@ static zend_always_inline zend_execute_data *i_create_execute_data_from_op_array
/* Prepend the regular stack frame with a copy of prev_execute_data
* and the passed arguments
*/
int args_count = zend_vm_stack_get_args_count_ex(EG(current_execute_data));
zend_size_t args_count = zend_vm_stack_get_args_count_ex(EG(current_execute_data));
size_t args_size = ZEND_MM_ALIGNED_SIZE(sizeof(zval*)) * (args_count + 1);
total_size += args_size + execute_data_size;
+27 -27
View File
@@ -37,7 +37,7 @@ typedef union _temp_variable {
struct {
zval **ptr_ptr; /* shared with var.ptr_ptr */
zval *str;
zend_uint offset;
zend_size_t offset;
} str_offset;
struct {
zval **ptr_ptr; /* shared with var.ptr_ptr */
@@ -61,15 +61,15 @@ ZEND_API void zend_execute(zend_op_array *op_array TSRMLS_DC);
ZEND_API void execute_ex(zend_execute_data *execute_data TSRMLS_DC);
ZEND_API void execute_internal(zend_execute_data *execute_data_ptr, struct _zend_fcall_info *fci, int return_value_used TSRMLS_DC);
ZEND_API int zend_is_true(zval *op);
ZEND_API int zend_lookup_class(const char *name, int name_length, zend_class_entry ***ce TSRMLS_DC);
ZEND_API int zend_lookup_class_ex(const char *name, int name_length, const zend_literal *key, int use_autoload, zend_class_entry ***ce TSRMLS_DC);
ZEND_API int zend_lookup_class(const char *name, zend_size_t name_length, zend_class_entry ***ce TSRMLS_DC);
ZEND_API int zend_lookup_class_ex(const char *name, zend_size_t name_length, const zend_literal *key, int use_autoload, zend_class_entry ***ce TSRMLS_DC);
ZEND_API int zend_eval_string(char *str, zval *retval_ptr, char *string_name TSRMLS_DC);
ZEND_API int zend_eval_stringl(char *str, int str_len, zval *retval_ptr, char *string_name TSRMLS_DC);
ZEND_API int zend_eval_stringl(char *str, zend_size_t str_len, zval *retval_ptr, char *string_name TSRMLS_DC);
ZEND_API int zend_eval_string_ex(char *str, zval *retval_ptr, char *string_name, int handle_exceptions TSRMLS_DC);
ZEND_API int zend_eval_stringl_ex(char *str, int str_len, zval *retval_ptr, char *string_name, int handle_exceptions TSRMLS_DC);
ZEND_API int zend_eval_stringl_ex(char *str, zend_size_t str_len, zval *retval_ptr, char *string_name, int handle_exceptions TSRMLS_DC);
ZEND_API char * zend_verify_arg_class_kind(const zend_arg_info *cur_arg_info, ulong fetch_type, const char **class_name, zend_class_entry **pce TSRMLS_DC);
ZEND_API int zend_verify_arg_error(int error_type, const zend_function *zf, zend_uint arg_num, const char *need_msg, const char *need_kind, const char *given_msg, const char *given_kind TSRMLS_DC);
ZEND_API char * zend_verify_arg_class_kind(const zend_arg_info *cur_arg_info, zend_uint_t fetch_type, const char **class_name, zend_class_entry **pce TSRMLS_DC);
ZEND_API int zend_verify_arg_error(int error_type, const zend_function *zf, zend_size_t arg_num, const char *need_msg, const char *need_kind, const char *given_msg, const char *given_kind TSRMLS_DC);
static zend_always_inline void i_zval_ptr_dtor(zval *zval_ptr ZEND_FILE_LINE_DC TSRMLS_DC)
{
@@ -109,17 +109,17 @@ static zend_always_inline int i_zend_is_true(zval *op)
case IS_NULL:
result = 0;
break;
case IS_LONG:
case IS_INT:
case IS_BOOL:
case IS_RESOURCE:
result = (Z_LVAL_P(op)?1:0);
result = (Z_IVAL_P(op)?1:0);
break;
case IS_DOUBLE:
result = (Z_DVAL_P(op) ? 1 : 0);
break;
case IS_STRING:
if (Z_STRLEN_P(op) == 0
|| (Z_STRLEN_P(op)==1 && Z_STRVAL_P(op)[0]=='0')) {
if (Z_STRSIZE_P(op) == 0
|| (Z_STRSIZE_P(op)==1 && Z_STRVAL_P(op)[0]=='0')) {
result = 0;
} else {
result = 1;
@@ -135,7 +135,7 @@ static zend_always_inline int i_zend_is_true(zval *op)
if (Z_OBJ_HT_P(op)->cast_object) {
zval tmp;
if (Z_OBJ_HT_P(op)->cast_object(op, &tmp, IS_BOOL TSRMLS_CC) == SUCCESS) {
result = Z_LVAL(tmp);
result = (int)Z_IVAL(tmp);
break;
}
} else if (Z_OBJ_HT_P(op)->get) {
@@ -143,7 +143,7 @@ static zend_always_inline int i_zend_is_true(zval *op)
if(Z_TYPE_P(tmp) != IS_OBJECT) {
/* for safety - avoid loop */
convert_to_boolean(tmp);
result = Z_LVAL_P(tmp);
result = (int)Z_IVAL_P(tmp);
zval_ptr_dtor(&tmp);
break;
}
@@ -183,7 +183,7 @@ struct _zend_vm_stack {
} \
} while (0)
static zend_always_inline zend_vm_stack zend_vm_stack_new_page(int count) {
static zend_always_inline zend_vm_stack zend_vm_stack_new_page(size_t count) {
zend_vm_stack page = (zend_vm_stack)emalloc(ZEND_MM_ALIGNED_SIZE(sizeof(*page)) + sizeof(void*) * count);
page->top = ZEND_VM_STACK_ELEMETS(page);
@@ -208,7 +208,7 @@ static zend_always_inline void zend_vm_stack_destroy(TSRMLS_D)
}
}
static zend_always_inline void zend_vm_stack_extend(int count TSRMLS_DC)
static zend_always_inline void zend_vm_stack_extend(size_t count TSRMLS_DC)
{
zend_vm_stack p = zend_vm_stack_new_page(count >= ZEND_VM_STACK_PAGE_SIZE ? count : ZEND_VM_STACK_PAGE_SIZE);
p->prev = EG(argument_stack);
@@ -254,7 +254,7 @@ static zend_always_inline void *zend_vm_stack_alloc(size_t size TSRMLS_DC)
EG(argument_stack)->top += ZEND_MM_ALIGNED_SIZE(sizeof(void*)) / sizeof(void*);
}
} else {
ZEND_VM_STACK_GROW_IF_NEEDED((int)size);
ZEND_VM_STACK_GROW_IF_NEEDED(size);
}
ret = (void*)EG(argument_stack)->top;
EG(argument_stack)->top += size;
@@ -300,7 +300,7 @@ static zend_always_inline void zend_vm_stack_free(void *ptr TSRMLS_DC)
static zend_always_inline void zend_vm_stack_clear_multiple(int nested TSRMLS_DC)
{
void **p = EG(argument_stack)->top - 1;
void **end = p - (int)(zend_uintptr_t)*p;
void **end = p - (ptrdiff_t)(zend_uintptr_t)*p;
while (p != end) {
zval *q = (zval *) *(--p);
@@ -314,20 +314,20 @@ static zend_always_inline void zend_vm_stack_clear_multiple(int nested TSRMLS_DC
}
}
static zend_always_inline int zend_vm_stack_get_args_count_ex(zend_execute_data *ex)
static zend_always_inline zend_size_t zend_vm_stack_get_args_count_ex(zend_execute_data *ex)
{
if (ex) {
void **p = ex->function_state.arguments;
return (int)(zend_uintptr_t) *p;
return (zend_size_t)(zend_uintptr_t) *p;
} else {
return 0;
}
}
static zend_always_inline zval** zend_vm_stack_get_arg_ex(zend_execute_data *ex, int requested_arg)
static zend_always_inline zval** zend_vm_stack_get_arg_ex(zend_execute_data *ex, zend_size_t requested_arg)
{
void **p = ex->function_state.arguments;
int arg_count = (int)(zend_uintptr_t) *p;
zend_int_t arg_count = (zend_int_t)(zend_uintptr_t) *p;
if (UNEXPECTED(requested_arg > arg_count)) {
return NULL;
@@ -335,12 +335,12 @@ static zend_always_inline zval** zend_vm_stack_get_arg_ex(zend_execute_data *ex,
return (zval**)p - arg_count + requested_arg - 1;
}
static zend_always_inline int zend_vm_stack_get_args_count(TSRMLS_D)
static zend_always_inline zend_size_t zend_vm_stack_get_args_count(TSRMLS_D)
{
return zend_vm_stack_get_args_count_ex(EG(current_execute_data)->prev_execute_data);
}
static zend_always_inline zval** zend_vm_stack_get_arg(int requested_arg TSRMLS_DC)
static zend_always_inline zval** zend_vm_stack_get_arg(zend_size_t requested_arg TSRMLS_DC)
{
return zend_vm_stack_get_arg_ex(EG(current_execute_data)->prev_execute_data, requested_arg);
}
@@ -352,14 +352,14 @@ void execute_new_code(TSRMLS_D);
ZEND_API const char *get_active_class_name(const char **space TSRMLS_DC);
ZEND_API const char *get_active_function_name(TSRMLS_D);
ZEND_API const char *zend_get_executed_filename(TSRMLS_D);
ZEND_API uint zend_get_executed_lineno(TSRMLS_D);
ZEND_API zend_size_t zend_get_executed_lineno(TSRMLS_D);
ZEND_API zend_bool zend_is_executing(TSRMLS_D);
ZEND_API void zend_set_timeout(long seconds, int reset_signals);
ZEND_API void zend_set_timeout(zend_int_t seconds, int reset_signals);
ZEND_API void zend_unset_timeout(TSRMLS_D);
ZEND_API void zend_timeout(int dummy);
ZEND_API zend_class_entry *zend_fetch_class(const char *class_name, uint class_name_len, int fetch_type TSRMLS_DC);
ZEND_API zend_class_entry *zend_fetch_class_by_name(const char *class_name, uint class_name_len, const zend_literal *key, int fetch_type TSRMLS_DC);
ZEND_API zend_class_entry *zend_fetch_class(const char *class_name, zend_size_t class_name_len, int fetch_type TSRMLS_DC);
ZEND_API zend_class_entry *zend_fetch_class_by_name(const char *class_name, zend_size_t class_name_len, const zend_literal *key, int fetch_type TSRMLS_DC);
void zend_verify_abstract_class(zend_class_entry *ce TSRMLS_DC);
ZEND_API void zend_fetch_dimension_by_zval(zval **result, zval *container, zval *dim TSRMLS_DC);
+29 -28
View File
@@ -401,7 +401,7 @@ ZEND_API const char *zend_get_executed_filename(TSRMLS_D) /* {{{ */
}
/* }}} */
ZEND_API uint zend_get_executed_lineno(TSRMLS_D) /* {{{ */
ZEND_API zend_size_t zend_get_executed_lineno(TSRMLS_D) /* {{{ */
{
if(EG(exception) && EG(opline_ptr) && active_opline->opcode == ZEND_HANDLE_EXCEPTION &&
active_opline->lineno == 0 && EG(opline_before_exception)) {
@@ -477,11 +477,11 @@ ZEND_API int zval_update_constant_ex(zval **pp, zend_bool inline_change, zend_cl
if (!zend_get_constant_ex(p->value.str.val, p->value.str.len, &const_value, scope, Z_REAL_TYPE_P(p) TSRMLS_CC)) {
char *actual = Z_STRVAL_P(p);
if ((colon = (char*)zend_memrchr(Z_STRVAL_P(p), ':', Z_STRLEN_P(p)))) {
if ((colon = (char*)zend_memrchr(Z_STRVAL_P(p), ':', Z_STRSIZE_P(p)))) {
zend_error(E_ERROR, "Undefined class constant '%s'", Z_STRVAL_P(p));
Z_STRLEN_P(p) -= ((colon - Z_STRVAL_P(p)) + 1);
Z_STRSIZE_P(p) -= ((colon - Z_STRVAL_P(p)) + 1);
if (inline_change) {
colon = estrndup(colon, Z_STRLEN_P(p));
colon = estrndup(colon, Z_STRSIZE_P(p));
str_efree(Z_STRVAL_P(p));
Z_STRVAL_P(p) = colon;
} else {
@@ -489,20 +489,20 @@ ZEND_API int zval_update_constant_ex(zval **pp, zend_bool inline_change, zend_cl
}
} else {
char *save = actual, *slash;
int actual_len = Z_STRLEN_P(p);
zend_size_t actual_len = Z_STRSIZE_P(p);
if ((Z_TYPE_P(p) & IS_CONSTANT_UNQUALIFIED) && (slash = (char *)zend_memrchr(actual, '\\', actual_len))) {
actual = slash + 1;
actual_len -= (actual - Z_STRVAL_P(p));
if (inline_change) {
actual = estrndup(actual, actual_len);
Z_STRVAL_P(p) = actual;
Z_STRLEN_P(p) = actual_len;
Z_STRSIZE_P(p) = actual_len;
}
}
if (actual[0] == '\\') {
if (inline_change) {
memmove(Z_STRVAL_P(p), Z_STRVAL_P(p)+1, Z_STRLEN_P(p));
--Z_STRLEN_P(p);
memmove(Z_STRVAL_P(p), Z_STRVAL_P(p)+1, Z_STRSIZE_P(p));
--Z_STRSIZE_P(p);
} else {
++actual;
}
@@ -530,7 +530,7 @@ ZEND_API int zval_update_constant_ex(zval **pp, zend_bool inline_change, zend_cl
p->type = IS_STRING;
if (!inline_change) {
Z_STRVAL_P(p) = actual;
Z_STRLEN_P(p) = actual_len;
Z_STRSIZE_P(p) = actual_len;
zval_copy_ctor(p);
}
}
@@ -903,24 +903,25 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
}
/* }}} */
ZEND_API int zend_lookup_class_ex(const char *name, int name_length, const zend_literal *key, int use_autoload, zend_class_entry ***ce TSRMLS_DC) /* {{{ */
ZEND_API int zend_lookup_class_ex(const char *name, zend_size_t name_length, const zend_literal *key, int use_autoload, zend_class_entry ***ce TSRMLS_DC) /* {{{ */
{
zval **args[1];
zval autoload_function;
zval *class_name_ptr;
zval *retval_ptr = NULL;
int retval, lc_length;
int retval;
zend_size_t lc_length;
char *lc_name;
char *lc_free;
zend_fcall_info fcall_info;
zend_fcall_info_cache fcall_cache;
char dummy = 1;
ulong hash;
zend_uint_t hash;
ALLOCA_FLAG(use_heap)
if (key) {
lc_name = Z_STRVAL(key->constant);
lc_length = Z_STRLEN(key->constant) + 1;
lc_length = Z_STRSIZE(key->constant) + 1;
hash = key->hash_value;
} else {
if (name == NULL || !name_length) {
@@ -1028,13 +1029,13 @@ ZEND_API int zend_lookup_class_ex(const char *name, int name_length, const zend_
}
/* }}} */
ZEND_API int zend_lookup_class(const char *name, int name_length, zend_class_entry ***ce TSRMLS_DC) /* {{{ */
ZEND_API int zend_lookup_class(const char *name, zend_size_t name_length, zend_class_entry ***ce TSRMLS_DC) /* {{{ */
{
return zend_lookup_class_ex(name, name_length, NULL, 1, ce TSRMLS_CC);
}
/* }}} */
ZEND_API int zend_eval_stringl(char *str, int str_len, zval *retval_ptr, char *string_name TSRMLS_DC) /* {{{ */
ZEND_API int zend_eval_stringl(char *str, zend_size_t str_len, zval *retval_ptr, char *string_name TSRMLS_DC) /* {{{ */
{
zval pv;
zend_op_array *new_op_array;
@@ -1043,14 +1044,14 @@ ZEND_API int zend_eval_stringl(char *str, int str_len, zval *retval_ptr, char *s
int retval;
if (retval_ptr) {
Z_STRLEN(pv) = str_len + sizeof("return ;") - 1;
Z_STRVAL(pv) = emalloc(Z_STRLEN(pv) + 1);
Z_STRSIZE(pv) = str_len + sizeof("return ;") - 1;
Z_STRVAL(pv) = emalloc(Z_STRSIZE(pv) + 1);
memcpy(Z_STRVAL(pv), "return ", sizeof("return ") - 1);
memcpy(Z_STRVAL(pv) + sizeof("return ") - 1, str, str_len);
Z_STRVAL(pv)[Z_STRLEN(pv) - 1] = ';';
Z_STRVAL(pv)[Z_STRLEN(pv)] = '\0';
Z_STRVAL(pv)[Z_STRSIZE(pv) - 1] = ';';
Z_STRVAL(pv)[Z_STRSIZE(pv)] = '\0';
} else {
Z_STRLEN(pv) = str_len;
Z_STRSIZE(pv) = str_len;
Z_STRVAL(pv) = str;
}
Z_TYPE(pv) = IS_STRING;
@@ -1120,7 +1121,7 @@ ZEND_API int zend_eval_string(char *str, zval *retval_ptr, char *string_name TSR
}
/* }}} */
ZEND_API int zend_eval_stringl_ex(char *str, int str_len, zval *retval_ptr, char *string_name, int handle_exceptions TSRMLS_DC) /* {{{ */
ZEND_API int zend_eval_stringl_ex(char *str, zend_size_t str_len, zval *retval_ptr, char *string_name, int handle_exceptions TSRMLS_DC) /* {{{ */
{
int result;
@@ -1174,7 +1175,7 @@ void execute_new_code(TSRMLS_D) /* {{{ */
}
switch (opline->opcode) {
case ZEND_GOTO:
if (Z_TYPE_P(opline->op2.zv) != IS_LONG) {
if (Z_TYPE_P(opline->op2.zv) != IS_INT) {
zend_resolve_goto_label(CG(active_op_array), opline, 1 TSRMLS_CC);
}
/* break omitted intentionally */
@@ -1346,7 +1347,7 @@ void zend_shutdown_timeout_thread(void) /* {{{ */
#define SIGPROF 27
#endif
void zend_set_timeout(long seconds, int reset_signals) /* {{{ */
void zend_set_timeout(zend_int_t seconds, int reset_signals) /* {{{ */
{
TSRMLS_FETCH();
@@ -1425,7 +1426,7 @@ void zend_unset_timeout(TSRMLS_D) /* {{{ */
}
/* }}} */
zend_class_entry *zend_fetch_class(const char *class_name, uint class_name_len, int fetch_type TSRMLS_DC) /* {{{ */
zend_class_entry *zend_fetch_class(const char *class_name, zend_size_t class_name_len, int fetch_type TSRMLS_DC) /* {{{ */
{
zend_class_entry **pce;
int use_autoload = (fetch_type & ZEND_FETCH_CLASS_NO_AUTOLOAD) == 0;
@@ -1480,7 +1481,7 @@ check_fetch_type:
}
/* }}} */
zend_class_entry *zend_fetch_class_by_name(const char *class_name, uint class_name_len, const zend_literal *key, int fetch_type TSRMLS_DC) /* {{{ */
zend_class_entry *zend_fetch_class_by_name(const char *class_name, zend_size_t class_name_len, const zend_literal *key, int fetch_type TSRMLS_DC) /* {{{ */
{
zend_class_entry **pce;
int use_autoload = (fetch_type & ZEND_FETCH_CLASS_NO_AUTOLOAD) == 0;
@@ -1575,7 +1576,7 @@ ZEND_API void zend_reset_all_cv(HashTable *symbol_table TSRMLS_DC) /* {{{ */
}
/* }}} */
ZEND_API void zend_delete_variable(zend_execute_data *ex, HashTable *ht, const char *name, int name_len, ulong hash_value TSRMLS_DC) /* {{{ */
ZEND_API void zend_delete_variable(zend_execute_data *ex, HashTable *ht, const char *name, zend_size_t name_len, zend_uint_t hash_value TSRMLS_DC) /* {{{ */
{
if (zend_hash_quick_del(ht, name, name_len, hash_value) == SUCCESS) {
name_len--;
@@ -1598,7 +1599,7 @@ ZEND_API void zend_delete_variable(zend_execute_data *ex, HashTable *ht, const c
}
/* }}} */
ZEND_API int zend_delete_global_variable_ex(const char *name, int name_len, ulong hash_value TSRMLS_DC) /* {{{ */
ZEND_API int zend_delete_global_variable_ex(const char *name, zend_size_t name_len, zend_uint_t hash_value TSRMLS_DC) /* {{{ */
{
zend_execute_data *ex;
@@ -1623,7 +1624,7 @@ ZEND_API int zend_delete_global_variable_ex(const char *name, int name_len, ulon
}
/* }}} */
ZEND_API int zend_delete_global_variable(const char *name, int name_len TSRMLS_DC) /* {{{ */
ZEND_API int zend_delete_global_variable(const char *name, zend_size_t name_len TSRMLS_DC) /* {{{ */
{
return zend_delete_global_variable_ex(name, name_len, zend_inline_hash_func(name, name_len + 1) TSRMLS_CC);
}
+1 -1
View File
@@ -51,7 +51,7 @@ typedef struct _zend_generator {
/* Variable to put sent value into */
zval **send_target;
/* Largest used integer key for auto-incrementing keys */
long largest_used_integer_key;
zend_int_t largest_used_integer_key;
/* ZEND_GENERATOR_* flags */
zend_uchar flags;
+6 -6
View File
@@ -87,7 +87,7 @@ struct _zend_compiler_globals {
char *compiled_filename;
int zend_lineno;
zend_uint_t zend_lineno;
zend_op_array *active_op_array;
@@ -111,7 +111,7 @@ struct _zend_compiler_globals {
zend_llist open_files;
long catch_begin;
zend_int_t catch_begin;
struct _zend_ini_parser_param *ini_parser_param;
@@ -188,8 +188,8 @@ struct _zend_executor_globals {
JMP_BUF *bailout;
int error_reporting;
int orig_error_reporting;
zend_int_t error_reporting;
zend_int_t orig_error_reporting;
int exit_status;
zend_op_array *active_op_array;
@@ -203,7 +203,7 @@ struct _zend_executor_globals {
zval *This;
long precision;
zend_int_t precision;
int ticks_count;
@@ -236,7 +236,7 @@ struct _zend_executor_globals {
zend_class_entry *exception_class;
/* timeout support */
int timeout_seconds;
zend_int_t timeout_seconds;
int lambda_count;
+58 -58
View File
@@ -55,7 +55,7 @@
#define HT_DESTROYED 2
#define HT_CLEANING 3
static void _zend_is_inconsistent(const HashTable *ht, const char *file, int line)
static void _zend_is_inconsistent(const HashTable *ht, const char *file, zend_size_t line)
{
if (ht->inconsistent==HT_OK) {
return;
@@ -104,7 +104,7 @@ static void _zend_is_inconsistent(const HashTable *ht, const char *file, int lin
static void zend_hash_do_resize(HashTable *ht);
ZEND_API ulong zend_hash_func(const char *arKey, uint nKeyLength)
ZEND_API zend_uint_t zend_hash_func(const char *arKey, zend_size_t nKeyLength)
{
return zend_inline_hash_func(arKey, nKeyLength);
}
@@ -192,20 +192,20 @@ static void zend_hash_bucket_delete(HashTable *ht, Bucket *p) {
i_zend_hash_bucket_delete(ht, p);
}
ZEND_API int _zend_hash_init(HashTable *ht, uint nSize, dtor_func_t pDestructor, zend_bool persistent ZEND_FILE_LINE_DC)
ZEND_API int _zend_hash_init(HashTable *ht, zend_uint_t nSize, dtor_func_t pDestructor, zend_bool persistent ZEND_FILE_LINE_DC)
{
uint i = 3;
zend_uint_t i = 3;
SET_INCONSISTENT(HT_OK);
if (nSize >= 0x80000000) {
if (nSize >= ZEND_INT_MAX) {
/* prevent overflow */
ht->nTableSize = 0x80000000;
ht->nTableSize = ZEND_INT_MAX;
} else {
while ((1U << i) < nSize) {
while ((Z_UI(1) << i) < nSize) {
i++;
}
ht->nTableSize = 1 << i;
ht->nTableSize = Z_UI(1) << i;
}
ht->nTableMask = 0; /* 0 means that ht->arBuckets is uninitialized */
@@ -223,7 +223,7 @@ ZEND_API int _zend_hash_init(HashTable *ht, uint nSize, dtor_func_t pDestructor,
}
ZEND_API int _zend_hash_init_ex(HashTable *ht, uint nSize, dtor_func_t pDestructor, zend_bool persistent, zend_bool bApplyProtection ZEND_FILE_LINE_DC)
ZEND_API int _zend_hash_init_ex(HashTable *ht, zend_uint_t nSize, dtor_func_t pDestructor, zend_bool persistent, zend_bool bApplyProtection ZEND_FILE_LINE_DC)
{
int retval = _zend_hash_init(ht, nSize, pDestructor, persistent ZEND_FILE_LINE_CC);
@@ -239,10 +239,10 @@ ZEND_API void zend_hash_set_apply_protection(HashTable *ht, zend_bool bApplyProt
ZEND_API int _zend_hash_add_or_update(HashTable *ht, const char *arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC)
ZEND_API int _zend_hash_add_or_update(HashTable *ht, const char *arKey, zend_size_t nKeyLength, void *pData, zend_uint_t nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC)
{
ulong h;
uint nIndex;
zend_uint_t h;
zend_uint_t nIndex;
Bucket *p;
#ifdef ZEND_SIGNALS
TSRMLS_FETCH();
@@ -305,9 +305,9 @@ ZEND_API int _zend_hash_add_or_update(HashTable *ht, const char *arKey, uint nKe
return SUCCESS;
}
ZEND_API int _zend_hash_quick_add_or_update(HashTable *ht, const char *arKey, uint nKeyLength, ulong h, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC)
ZEND_API int _zend_hash_quick_add_or_update(HashTable *ht, const char *arKey, zend_size_t nKeyLength, zend_uint_t h, void *pData, zend_uint_t nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC)
{
uint nIndex;
zend_uint_t nIndex;
Bucket *p;
#ifdef ZEND_SIGNALS
TSRMLS_FETCH();
@@ -372,7 +372,7 @@ ZEND_API int _zend_hash_quick_add_or_update(HashTable *ht, const char *arKey, ui
}
ZEND_API int zend_hash_add_empty_element(HashTable *ht, const char *arKey, uint nKeyLength)
ZEND_API int zend_hash_add_empty_element(HashTable *ht, const char *arKey, zend_size_t nKeyLength)
{
void *dummy = (void *) 1;
@@ -380,9 +380,9 @@ ZEND_API int zend_hash_add_empty_element(HashTable *ht, const char *arKey, uint
}
ZEND_API int _zend_hash_index_update_or_next_insert(HashTable *ht, ulong h, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC)
ZEND_API int _zend_hash_index_update_or_next_insert(HashTable *ht, zend_uint_t h, void *pData, zend_uint_t nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC)
{
uint nIndex;
zend_uint_t nIndex;
Bucket *p;
#ifdef ZEND_SIGNALS
TSRMLS_FETCH();
@@ -432,8 +432,8 @@ ZEND_API int _zend_hash_index_update_or_next_insert(HashTable *ht, ulong h, void
CONNECT_TO_GLOBAL_DLLIST(p, ht);
HANDLE_UNBLOCK_INTERRUPTIONS();
if ((long)h >= (long)ht->nNextFreeElement) {
ht->nNextFreeElement = h < LONG_MAX ? h + 1 : LONG_MAX;
if ((zend_int_t)h >= (zend_int_t)ht->nNextFreeElement) {
ht->nNextFreeElement = h < ZEND_INT_MAX ? h + 1 : ZEND_INT_MAX;
}
ht->nNumOfElements++;
ZEND_HASH_IF_FULL_DO_RESIZE(ht);
@@ -464,7 +464,7 @@ static void zend_hash_do_resize(HashTable *ht)
ZEND_API int zend_hash_rehash(HashTable *ht)
{
Bucket *p;
uint nIndex;
zend_uint_t nIndex;
IS_CONSISTENT(ht);
if (UNEXPECTED(ht->nNumOfElements == 0)) {
@@ -482,8 +482,8 @@ ZEND_API int zend_hash_rehash(HashTable *ht)
ZEND_API void zend_hash_reindex(HashTable *ht, zend_bool only_integer_keys) {
Bucket *p;
uint nIndex;
ulong offset = 0;
zend_uint_t nIndex;
zend_uint_t offset = 0;
IS_CONSISTENT(ht);
if (UNEXPECTED(ht->nNumOfElements == 0)) {
@@ -505,9 +505,9 @@ ZEND_API void zend_hash_reindex(HashTable *ht, zend_bool only_integer_keys) {
ht->nNextFreeElement = offset;
}
ZEND_API int zend_hash_del_key_or_index(HashTable *ht, const char *arKey, uint nKeyLength, ulong h, int flag)
ZEND_API int zend_hash_del_key_or_index(HashTable *ht, const char *arKey, zend_size_t nKeyLength, zend_uint_t h, int flag)
{
uint nIndex;
zend_uint_t nIndex;
Bucket *p;
IS_CONSISTENT(ht);
@@ -742,7 +742,7 @@ ZEND_API void zend_hash_reverse_apply(HashTable *ht, apply_func_t apply_func TSR
}
ZEND_API void zend_hash_copy(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, void *tmp, uint size)
ZEND_API void zend_hash_copy(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, void *tmp, zend_uint_t size)
{
Bucket *p;
void *new_entry;
@@ -773,7 +773,7 @@ ZEND_API void zend_hash_copy(HashTable *target, HashTable *source, copy_ctor_fun
}
ZEND_API void _zend_hash_merge(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, void *tmp, uint size, int overwrite ZEND_FILE_LINE_DC)
ZEND_API void _zend_hash_merge(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, void *tmp, zend_uint_t size, int overwrite ZEND_FILE_LINE_DC)
{
Bucket *p;
void *t;
@@ -810,7 +810,7 @@ static zend_bool zend_hash_replace_checker_wrapper(HashTable *target, void *sour
}
ZEND_API void zend_hash_merge_ex(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, uint size, merge_checker_func_t pMergeSource, void *pParam)
ZEND_API void zend_hash_merge_ex(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, zend_uint_t size, merge_checker_func_t pMergeSource, void *pParam)
{
Bucket *p;
void *t;
@@ -835,10 +835,10 @@ ZEND_API void zend_hash_merge_ex(HashTable *target, HashTable *source, copy_ctor
* data is returned in pData. The reason is that there's no reason
* someone using the hash table might not want to have NULL data
*/
ZEND_API int zend_hash_find(const HashTable *ht, const char *arKey, uint nKeyLength, void **pData)
ZEND_API int zend_hash_find(const HashTable *ht, const char *arKey, zend_size_t nKeyLength, void **pData)
{
ulong h;
uint nIndex;
zend_uint_t h;
zend_uint_t nIndex;
Bucket *p;
IS_CONSISTENT(ht);
@@ -859,9 +859,9 @@ ZEND_API int zend_hash_find(const HashTable *ht, const char *arKey, uint nKeyLen
}
ZEND_API int zend_hash_quick_find(const HashTable *ht, const char *arKey, uint nKeyLength, ulong h, void **pData)
ZEND_API int zend_hash_quick_find(const HashTable *ht, const char *arKey, zend_size_t nKeyLength, zend_uint_t h, void **pData)
{
uint nIndex;
zend_uint_t nIndex;
Bucket *p;
ZEND_ASSERT(nKeyLength != 0);
@@ -883,10 +883,10 @@ ZEND_API int zend_hash_quick_find(const HashTable *ht, const char *arKey, uint n
}
ZEND_API int zend_hash_exists(const HashTable *ht, const char *arKey, uint nKeyLength)
ZEND_API int zend_hash_exists(const HashTable *ht, const char *arKey, zend_size_t nKeyLength)
{
ulong h;
uint nIndex;
zend_uint_t h;
zend_uint_t nIndex;
Bucket *p;
IS_CONSISTENT(ht);
@@ -906,9 +906,9 @@ ZEND_API int zend_hash_exists(const HashTable *ht, const char *arKey, uint nKeyL
}
ZEND_API int zend_hash_quick_exists(const HashTable *ht, const char *arKey, uint nKeyLength, ulong h)
ZEND_API int zend_hash_quick_exists(const HashTable *ht, const char *arKey, zend_size_t nKeyLength, zend_uint_t h)
{
uint nIndex;
zend_uint_t nIndex;
Bucket *p;
ZEND_ASSERT(nKeyLength != 0);
@@ -930,9 +930,9 @@ ZEND_API int zend_hash_quick_exists(const HashTable *ht, const char *arKey, uint
}
ZEND_API int zend_hash_index_find(const HashTable *ht, ulong h, void **pData)
ZEND_API int zend_hash_index_find(const HashTable *ht, zend_uint_t h, void **pData)
{
uint nIndex;
zend_uint_t nIndex;
Bucket *p;
IS_CONSISTENT(ht);
@@ -951,9 +951,9 @@ ZEND_API int zend_hash_index_find(const HashTable *ht, ulong h, void **pData)
}
ZEND_API int zend_hash_index_exists(const HashTable *ht, ulong h)
ZEND_API int zend_hash_index_exists(const HashTable *ht, zend_uint_t h)
{
uint nIndex;
zend_uint_t nIndex;
Bucket *p;
IS_CONSISTENT(ht);
@@ -971,7 +971,7 @@ ZEND_API int zend_hash_index_exists(const HashTable *ht, ulong h)
}
ZEND_API int zend_hash_num_elements(const HashTable *ht)
ZEND_API zend_uint_t zend_hash_num_elements(const HashTable *ht)
{
IS_CONSISTENT(ht);
@@ -1065,7 +1065,7 @@ ZEND_API int zend_hash_move_backwards_ex(HashTable *ht, HashPosition *pos)
/* This function should be made binary safe */
ZEND_API int zend_hash_get_current_key_ex(const HashTable *ht, char **str_index, uint *str_length, ulong *num_index, zend_bool duplicate, HashPosition *pos)
ZEND_API int zend_hash_get_current_key_ex(const HashTable *ht, char **str_index, zend_size_t *str_length, zend_uint_t *num_index, zend_bool duplicate, HashPosition *pos)
{
Bucket *p;
@@ -1086,7 +1086,7 @@ ZEND_API int zend_hash_get_current_key_ex(const HashTable *ht, char **str_index,
return HASH_KEY_IS_STRING;
} else {
*num_index = p->h;
return HASH_KEY_IS_LONG;
return HASH_KEY_IS_INT;
}
}
return HASH_KEY_NON_EXISTENT;
@@ -1104,10 +1104,10 @@ ZEND_API void zend_hash_get_current_key_zval_ex(const HashTable *ht, zval *key,
} else if (p->nKeyLength) {
Z_TYPE_P(key) = IS_STRING;
Z_STRVAL_P(key) = IS_INTERNED(p->arKey) ? (char*)p->arKey : estrndup(p->arKey, p->nKeyLength - 1);
Z_STRLEN_P(key) = p->nKeyLength - 1;
Z_STRSIZE_P(key) = p->nKeyLength - 1;
} else {
Z_TYPE_P(key) = IS_LONG;
Z_LVAL_P(key) = p->h;
Z_TYPE_P(key) = IS_INT;
Z_IVAL_P(key) = p->h;
}
}
@@ -1123,7 +1123,7 @@ ZEND_API int zend_hash_get_current_key_type_ex(HashTable *ht, HashPosition *pos)
if (p->nKeyLength) {
return HASH_KEY_IS_STRING;
} else {
return HASH_KEY_IS_LONG;
return HASH_KEY_IS_INT;
}
}
return HASH_KEY_NON_EXISTENT;
@@ -1149,10 +1149,10 @@ ZEND_API int zend_hash_get_current_data_ex(HashTable *ht, void **pData, HashPosi
/* This function changes key of current element without changing elements'
* order. If element with target key already exists, it will be deleted first.
*/
ZEND_API int zend_hash_update_current_key_ex(HashTable *ht, int key_type, const char *str_index, uint str_length, ulong num_index, int mode, HashPosition *pos)
ZEND_API int zend_hash_update_current_key_ex(HashTable *ht, int key_type, const char *str_index, zend_size_t str_length, zend_uint_t num_index, int mode, HashPosition *pos)
{
Bucket *p, *q;
ulong h;
zend_uint_t h;
#ifdef ZEND_SIGNALS
TSRMLS_FETCH();
#endif
@@ -1162,7 +1162,7 @@ ZEND_API int zend_hash_update_current_key_ex(HashTable *ht, int key_type, const
IS_CONSISTENT(ht);
if (p) {
if (key_type == HASH_KEY_IS_LONG) {
if (key_type == HASH_KEY_IS_INT) {
str_length = 0;
if (!p->nKeyLength && p->h == num_index) {
return SUCCESS;
@@ -1267,7 +1267,7 @@ ZEND_API int zend_hash_update_current_key_ex(HashTable *ht, int key_type, const
p = q;
}
if (key_type == HASH_KEY_IS_LONG) {
if (key_type == HASH_KEY_IS_INT) {
p->h = num_index;
} else {
p->h = h;
@@ -1295,9 +1295,9 @@ ZEND_API int zend_hash_update_current_key_ex(HashTable *ht, int key_type, const
* are inserted in their place. The removed elements can be optionally collected into a hashtable.
* This operation reindexes the hashtable, i.e. integer keys will be zero-based and sequential,
* while string keys stay intact. The same applies to the elements inserted into the removed HT. */
ZEND_API void _zend_hash_splice(HashTable *ht, uint nDataSize, copy_ctor_func_t pCopyConstructor, uint offset, uint length, void **list, uint list_count, HashTable *removed ZEND_FILE_LINE_DC) /* {{{ */
ZEND_API void _zend_hash_splice(HashTable *ht, zend_uint_t nDataSize, copy_ctor_func_t pCopyConstructor, zend_uint_t offset, zend_size_t length, void **list, zend_size_t list_count, HashTable *removed ZEND_FILE_LINE_DC) /* {{{ */
{
int pos;
zend_size_t pos;
Bucket *p;
IS_CONSISTENT(ht);
@@ -1333,7 +1333,7 @@ ZEND_API void _zend_hash_splice(HashTable *ht, uint nDataSize, copy_ctor_func_t
}
if (list != NULL) {
int i;
zend_size_t i;
for (i = 0; i < list_count; i++) {
/* Add new element only to the global linked list, not the bucket list.
* Also use key 0 for everything, as we'll reindex the hashtable anyways. */
@@ -1414,7 +1414,7 @@ ZEND_API int zend_hash_sort(HashTable *ht, sort_func_t sort_func,
ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t compar, zend_bool ordered TSRMLS_DC)
{
Bucket *p1, *p2 = NULL;
int result;
ptrdiff_t result;
void *pData2;
IS_CONSISTENT(ht1);
@@ -1524,7 +1524,7 @@ ZEND_API int zend_hash_minmax(const HashTable *ht, compare_func_t compar, int fl
return SUCCESS;
}
ZEND_API ulong zend_hash_next_free_element(const HashTable *ht)
ZEND_API zend_uint_t zend_hash_next_free_element(const HashTable *ht)
{
IS_CONSISTENT(ht);
@@ -1548,7 +1548,7 @@ void zend_hash_display_pListTail(const HashTable *ht)
void zend_hash_display(const HashTable *ht)
{
Bucket *p;
uint i;
zend_uint_t i;
if (UNEXPECTED(ht->nNumOfElements == 0)) {
zend_output_debug_string(0, "The hash is empty");
+47 -47
View File
@@ -26,7 +26,7 @@
#include "zend.h"
#define HASH_KEY_IS_STRING 1
#define HASH_KEY_IS_LONG 2
#define HASH_KEY_IS_INT 2
#define HASH_KEY_NON_EXISTENT 3
#define HASH_KEY_NON_EXISTANT HASH_KEY_NON_EXISTENT /* Keeping old define (with typo) for backward compatibility */
@@ -43,7 +43,7 @@
#define HASH_UPDATE_KEY_IF_AFTER 2
#define HASH_UPDATE_KEY_ANYWAY 3
typedef ulong (*hash_func_t)(const char *arKey, uint nKeyLength);
typedef zend_uint_t (*hash_func_t)(const char *arKey, zend_size_t nKeyLength);
typedef int (*compare_func_t)(const void *, const void * TSRMLS_DC);
typedef void (*sort_func_t)(void *, size_t, register size_t, compare_func_t TSRMLS_DC);
typedef void (*dtor_func_t)(void *pDest);
@@ -53,8 +53,8 @@ typedef void (*copy_ctor_param_func_t)(void *pElement, void *pParam);
struct _hashtable;
typedef struct bucket {
ulong h; /* Used for numeric indexing */
uint nKeyLength;
zend_uint_t h; /* Used for numeric indexing */
zend_size_t nKeyLength;
void *pData;
void *pDataPtr;
struct bucket *pListNext;
@@ -65,10 +65,10 @@ typedef struct bucket {
} Bucket;
typedef struct _hashtable {
uint nTableSize;
uint nTableMask;
uint nNumOfElements;
ulong nNextFreeElement;
zend_uint_t nTableSize;
zend_uint_t nTableMask;
zend_uint_t nNumOfElements;
zend_uint_t nNextFreeElement;
Bucket *pInternalPointer; /* Used for element traversal */
Bucket *pListHead;
Bucket *pListTail;
@@ -85,8 +85,8 @@ typedef struct _hashtable {
typedef struct _zend_hash_key {
const char *arKey;
uint nKeyLength;
ulong h;
zend_size_t nKeyLength;
zend_uint_t h;
} zend_hash_key;
@@ -97,33 +97,33 @@ typedef Bucket* HashPosition;
BEGIN_EXTERN_C()
/* startup/shutdown */
ZEND_API int _zend_hash_init(HashTable *ht, uint nSize, dtor_func_t pDestructor, zend_bool persistent ZEND_FILE_LINE_DC);
ZEND_API int _zend_hash_init_ex(HashTable *ht, uint nSize, dtor_func_t pDestructor, zend_bool persistent, zend_bool bApplyProtection ZEND_FILE_LINE_DC);
ZEND_API int _zend_hash_init(HashTable *ht, zend_uint_t nSize, dtor_func_t pDestructor, zend_bool persistent ZEND_FILE_LINE_DC);
ZEND_API int _zend_hash_init_ex(HashTable *ht, zend_uint_t nSize, dtor_func_t pDestructor, zend_bool persistent, zend_bool bApplyProtection ZEND_FILE_LINE_DC);
ZEND_API void zend_hash_destroy(HashTable *ht);
ZEND_API void zend_hash_clean(HashTable *ht);
#define zend_hash_init(ht, nSize, pHashFunction, pDestructor, persistent) _zend_hash_init((ht), (nSize), (pDestructor), (persistent) ZEND_FILE_LINE_CC)
#define zend_hash_init_ex(ht, nSize, pHashFunction, pDestructor, persistent, bApplyProtection) _zend_hash_init_ex((ht), (nSize), (pDestructor), (persistent), (bApplyProtection) ZEND_FILE_LINE_CC)
/* additions/updates/changes */
ZEND_API int _zend_hash_add_or_update(HashTable *ht, const char *arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC);
ZEND_API int _zend_hash_add_or_update(HashTable *ht, const char *arKey, zend_size_t nKeyLength, void *pData, zend_uint_t nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC);
#define zend_hash_update(ht, arKey, nKeyLength, pData, nDataSize, pDest) \
_zend_hash_add_or_update(ht, arKey, nKeyLength, pData, nDataSize, pDest, HASH_UPDATE ZEND_FILE_LINE_CC)
#define zend_hash_add(ht, arKey, nKeyLength, pData, nDataSize, pDest) \
_zend_hash_add_or_update(ht, arKey, nKeyLength, pData, nDataSize, pDest, HASH_ADD ZEND_FILE_LINE_CC)
ZEND_API int _zend_hash_quick_add_or_update(HashTable *ht, const char *arKey, uint nKeyLength, ulong h, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC);
ZEND_API int _zend_hash_quick_add_or_update(HashTable *ht, const char *arKey, zend_size_t nKeyLength, zend_uint_t h, void *pData, zend_uint_t nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC);
#define zend_hash_quick_update(ht, arKey, nKeyLength, h, pData, nDataSize, pDest) \
_zend_hash_quick_add_or_update(ht, arKey, nKeyLength, h, pData, nDataSize, pDest, HASH_UPDATE ZEND_FILE_LINE_CC)
#define zend_hash_quick_add(ht, arKey, nKeyLength, h, pData, nDataSize, pDest) \
_zend_hash_quick_add_or_update(ht, arKey, nKeyLength, h, pData, nDataSize, pDest, HASH_ADD ZEND_FILE_LINE_CC)
ZEND_API int _zend_hash_index_update_or_next_insert(HashTable *ht, ulong h, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC);
ZEND_API int _zend_hash_index_update_or_next_insert(HashTable *ht, zend_uint_t h, void *pData, zend_uint_t nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC);
#define zend_hash_index_update(ht, h, pData, nDataSize, pDest) \
_zend_hash_index_update_or_next_insert(ht, h, pData, nDataSize, pDest, HASH_UPDATE ZEND_FILE_LINE_CC)
#define zend_hash_next_index_insert(ht, pData, nDataSize, pDest) \
_zend_hash_index_update_or_next_insert(ht, 0, pData, nDataSize, pDest, HASH_NEXT_INSERT ZEND_FILE_LINE_CC)
ZEND_API int zend_hash_add_empty_element(HashTable *ht, const char *arKey, uint nKeyLength);
ZEND_API int zend_hash_add_empty_element(HashTable *ht, const char *arKey, zend_size_t nKeyLength);
#define ZEND_HASH_APPLY_KEEP 0
@@ -150,7 +150,7 @@ ZEND_API void zend_hash_reverse_apply(HashTable *ht, apply_func_t apply_func TSR
/* Deletes */
ZEND_API int zend_hash_del_key_or_index(HashTable *ht, const char *arKey, uint nKeyLength, ulong h, int flag);
ZEND_API int zend_hash_del_key_or_index(HashTable *ht, const char *arKey, zend_size_t nKeyLength, zend_uint_t h, int flag);
#define zend_hash_del(ht, arKey, nKeyLength) \
zend_hash_del_key_or_index(ht, arKey, nKeyLength, 0, HASH_DEL_KEY)
#define zend_hash_quick_del(ht, arKey, nKeyLength, h) \
@@ -161,32 +161,32 @@ ZEND_API int zend_hash_del_key_or_index(HashTable *ht, const char *arKey, uint n
zend_hash_func
/* Data retreival */
ZEND_API int zend_hash_find(const HashTable *ht, const char *arKey, uint nKeyLength, void **pData);
ZEND_API int zend_hash_quick_find(const HashTable *ht, const char *arKey, uint nKeyLength, ulong h, void **pData);
ZEND_API int zend_hash_index_find(const HashTable *ht, ulong h, void **pData);
ZEND_API int zend_hash_find(const HashTable *ht, const char *arKey, zend_size_t nKeyLength, void **pData);
ZEND_API int zend_hash_quick_find(const HashTable *ht, const char *arKey, zend_size_t nKeyLength, zend_uint_t h, void **pData);
ZEND_API int zend_hash_index_find(const HashTable *ht, zend_uint_t h, void **pData);
/* Misc */
ZEND_API int zend_hash_exists(const HashTable *ht, const char *arKey, uint nKeyLength);
ZEND_API int zend_hash_quick_exists(const HashTable *ht, const char *arKey, uint nKeyLength, ulong h);
ZEND_API int zend_hash_index_exists(const HashTable *ht, ulong h);
ZEND_API ulong zend_hash_next_free_element(const HashTable *ht);
ZEND_API int zend_hash_exists(const HashTable *ht, const char *arKey, zend_size_t nKeyLength);
ZEND_API int zend_hash_quick_exists(const HashTable *ht, const char *arKey, zend_size_t nKeyLength, zend_uint_t h);
ZEND_API int zend_hash_index_exists(const HashTable *ht, zend_uint_t h);
ZEND_API zend_uint_t zend_hash_next_free_element(const HashTable *ht);
/* traversing */
#define zend_hash_has_more_elements_ex(ht, pos) \
(zend_hash_get_current_key_type_ex(ht, pos) == HASH_KEY_NON_EXISTENT ? FAILURE : SUCCESS)
ZEND_API int zend_hash_move_forward_ex(HashTable *ht, HashPosition *pos);
ZEND_API int zend_hash_move_backwards_ex(HashTable *ht, HashPosition *pos);
ZEND_API int zend_hash_get_current_key_ex(const HashTable *ht, char **str_index, uint *str_length, ulong *num_index, zend_bool duplicate, HashPosition *pos);
ZEND_API int zend_hash_get_current_key_ex(const HashTable *ht, char **str_index, zend_size_t *str_length, zend_uint_t *num_index, zend_bool duplicate, HashPosition *pos);
ZEND_API void zend_hash_get_current_key_zval_ex(const HashTable *ht, zval *key, HashPosition *pos);
ZEND_API int zend_hash_get_current_key_type_ex(HashTable *ht, HashPosition *pos);
ZEND_API int zend_hash_get_current_data_ex(HashTable *ht, void **pData, HashPosition *pos);
ZEND_API void zend_hash_internal_pointer_reset_ex(HashTable *ht, HashPosition *pos);
ZEND_API void zend_hash_internal_pointer_end_ex(HashTable *ht, HashPosition *pos);
ZEND_API int zend_hash_update_current_key_ex(HashTable *ht, int key_type, const char *str_index, uint str_length, ulong num_index, int mode, HashPosition *pos);
ZEND_API int zend_hash_update_current_key_ex(HashTable *ht, int key_type, const char *str_index, zend_size_t str_length, zend_uint_t num_index, int mode, HashPosition *pos);
typedef struct _HashPointer {
HashPosition pos;
ulong h;
zend_uint_t h;
} HashPointer;
ZEND_API int zend_hash_get_pointer(const HashTable *ht, HashPointer *ptr);
@@ -214,9 +214,9 @@ ZEND_API int zend_hash_set_pointer(HashTable *ht, const HashPointer *ptr);
zend_hash_update_current_key_ex(ht, key_type, str_index, str_length, num_index, HASH_UPDATE_KEY_ANYWAY, NULL)
/* Copying, merging and sorting */
ZEND_API void zend_hash_copy(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, void *tmp, uint size);
ZEND_API void _zend_hash_merge(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, void *tmp, uint size, int overwrite ZEND_FILE_LINE_DC);
ZEND_API void zend_hash_merge_ex(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, uint size, merge_checker_func_t pMergeSource, void *pParam);
ZEND_API void zend_hash_copy(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, void *tmp, zend_uint_t size);
ZEND_API void _zend_hash_merge(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, void *tmp, zend_uint_t size, int overwrite ZEND_FILE_LINE_DC);
ZEND_API void zend_hash_merge_ex(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, zend_uint_t size, merge_checker_func_t pMergeSource, void *pParam);
ZEND_API int zend_hash_sort(HashTable *ht, sort_func_t sort_func, compare_func_t compare_func, int renumber TSRMLS_DC);
ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t compar, zend_bool ordered TSRMLS_DC);
ZEND_API int zend_hash_minmax(const HashTable *ht, compare_func_t compar, int flag, void **pData TSRMLS_DC);
@@ -224,12 +224,12 @@ ZEND_API int zend_hash_minmax(const HashTable *ht, compare_func_t compar, int fl
#define zend_hash_merge(target, source, pCopyConstructor, tmp, size, overwrite) \
_zend_hash_merge(target, source, pCopyConstructor, tmp, size, overwrite ZEND_FILE_LINE_CC)
ZEND_API int zend_hash_num_elements(const HashTable *ht);
ZEND_API zend_uint_t zend_hash_num_elements(const HashTable *ht);
ZEND_API int zend_hash_rehash(HashTable *ht);
ZEND_API void zend_hash_reindex(HashTable *ht, zend_bool only_integer_keys);
ZEND_API void _zend_hash_splice(HashTable *ht, uint nDataSize, copy_ctor_func_t pCopyConstructor, uint offset, uint length, void **list, uint list_count, HashTable *removed ZEND_FILE_LINE_DC);
ZEND_API void _zend_hash_splice(HashTable *ht, zend_uint_t nDataSize, copy_ctor_func_t pCopyConstructor, zend_uint_t offset, zend_size_t length, void **list, zend_size_t list_count, HashTable *removed ZEND_FILE_LINE_DC);
#define zend_hash_splice(ht, nDataSize, pCopyConstructor, offset, length, list, list_count, removed) \
_zend_hash_splice(ht, nDataSize, pCopyConstructor, offset, length, list, list_count, removed ZEND_FILE_LINE_CC)
@@ -266,9 +266,9 @@ ZEND_API void _zend_hash_splice(HashTable *ht, uint nDataSize, copy_ctor_func_t
* -- Ralf S. Engelschall <rse@engelschall.com>
*/
static inline ulong zend_inline_hash_func(const char *arKey, uint nKeyLength)
static inline zend_uint_t zend_inline_hash_func(const char *arKey, zend_size_t nKeyLength)
{
register ulong hash = 5381;
register zend_uint_t hash = Z_UI(5381);
/* variant with the hash unrolled eight times */
for (; nKeyLength >= 8; nKeyLength -= 8) {
@@ -296,7 +296,7 @@ EMPTY_SWITCH_DEFAULT_CASE()
}
ZEND_API ulong zend_hash_func(const char *arKey, uint nKeyLength);
ZEND_API zend_uint_t zend_hash_func(const char *arKey, zend_size_t nKeyLength);
#if ZEND_DEBUG
/* debug */
@@ -323,9 +323,9 @@ END_EXTERN_C()
\
if ((*end != '\0') /* not a null terminated string */ \
|| (*tmp == '0' && length > 2) /* numbers with leading zeros */ \
|| (end - tmp > MAX_LENGTH_OF_LONG - 1) /* number too long */ \
|| (SIZEOF_LONG == 4 && \
end - tmp == MAX_LENGTH_OF_LONG - 1 && \
|| (end - tmp > MAX_LENGTH_OF_ZEND_INT - 1) /* number too long */ \
|| (SIZEOF_ZEND_INT == 4 && \
end - tmp == MAX_LENGTH_OF_ZEND_INT - 1 && \
*tmp > '2')) { /* overflow */ \
break; \
} \
@@ -335,11 +335,11 @@ END_EXTERN_C()
} \
if (tmp == end) { \
if (*key == '-') { \
if (idx-1 > LONG_MAX) { /* overflow */ \
if (idx-1 > ZEND_INT_MAX) { /* overflow */ \
break; \
} \
idx = 0 - idx; \
} else if (idx > LONG_MAX) { /* overflow */ \
} else if (idx > ZEND_INT_MAX) { /* overflow */ \
break; \
} \
func; \
@@ -348,41 +348,41 @@ END_EXTERN_C()
} while (0)
#define ZEND_HANDLE_NUMERIC(key, length, func) do { \
ulong idx; \
zend_uint_t idx; \
\
ZEND_HANDLE_NUMERIC_EX(key, length, idx, return func); \
} while (0)
static inline int zend_symtable_update(HashTable *ht, const char *arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest) \
static inline int zend_symtable_update(HashTable *ht, const char *arKey, zend_size_t nKeyLength, void *pData, zend_uint_t nDataSize, void **pDest) \
{
ZEND_HANDLE_NUMERIC(arKey, nKeyLength, zend_hash_index_update(ht, idx, pData, nDataSize, pDest));
return zend_hash_update(ht, arKey, nKeyLength, pData, nDataSize, pDest);
}
static inline int zend_symtable_del(HashTable *ht, const char *arKey, uint nKeyLength)
static inline int zend_symtable_del(HashTable *ht, const char *arKey, zend_size_t nKeyLength)
{
ZEND_HANDLE_NUMERIC(arKey, nKeyLength, zend_hash_index_del(ht, idx));
return zend_hash_del(ht, arKey, nKeyLength);
}
static inline int zend_symtable_find(HashTable *ht, const char *arKey, uint nKeyLength, void **pData)
static inline int zend_symtable_find(HashTable *ht, const char *arKey, zend_size_t nKeyLength, void **pData)
{
ZEND_HANDLE_NUMERIC(arKey, nKeyLength, zend_hash_index_find(ht, idx, pData));
return zend_hash_find(ht, arKey, nKeyLength, pData);
}
static inline int zend_symtable_exists(HashTable *ht, const char *arKey, uint nKeyLength)
static inline int zend_symtable_exists(HashTable *ht, const char *arKey, zend_size_t nKeyLength)
{
ZEND_HANDLE_NUMERIC(arKey, nKeyLength, zend_hash_index_exists(ht, idx));
return zend_hash_exists(ht, arKey, nKeyLength);
}
static inline int zend_symtable_update_current_key_ex(HashTable *ht, const char *arKey, uint nKeyLength, int mode, HashPosition *pos)
static inline int zend_symtable_update_current_key_ex(HashTable *ht, const char *arKey, zend_size_t nKeyLength, int mode, HashPosition *pos)
{
ZEND_HANDLE_NUMERIC(arKey, nKeyLength, zend_hash_update_current_key_ex(ht, HASH_KEY_IS_LONG, NULL, 0, idx, mode, pos));
ZEND_HANDLE_NUMERIC(arKey, nKeyLength, zend_hash_update_current_key_ex(ht, HASH_KEY_IS_INT, NULL, 0, idx, mode, pos));
return zend_hash_update_current_key_ex(ht, HASH_KEY_IS_STRING, arKey, nKeyLength, 0, mode, pos);
}
#define zend_symtable_update_current_key(ht,arKey,nKeyLength,mode) \
+1 -1
View File
@@ -54,7 +54,7 @@ ZEND_API void zend_html_putc(char c)
}
ZEND_API void zend_html_puts(const char *s, uint len TSRMLS_DC)
ZEND_API void zend_html_puts(const char *s, zend_size_t len TSRMLS_DC)
{
const unsigned char *ptr = (const unsigned char*)s, *end = ptr + len;
unsigned char *filtered = NULL;
+1 -1
View File
@@ -44,7 +44,7 @@ ZEND_API void zend_strip(TSRMLS_D);
ZEND_API int highlight_file(char *filename, zend_syntax_highlighter_ini *syntax_highlighter_ini TSRMLS_DC);
ZEND_API int highlight_string(zval *str, zend_syntax_highlighter_ini *syntax_highlighter_ini, char *str_name TSRMLS_DC);
ZEND_API void zend_html_putc(char c);
ZEND_API void zend_html_puts(const char *s, uint len TSRMLS_DC);
ZEND_API void zend_html_puts(const char *s, zend_size_t len TSRMLS_DC);
END_EXTERN_C()
extern zend_syntax_highlighter_ini syntax_highlighter_ini;
+19 -18
View File
@@ -205,9 +205,9 @@ ZEND_API int zend_register_ini_entries(const zend_ini_entry *ini_entry, int modu
hashed_ini_entry->module_number = module_number;
if ((zend_get_configuration_directive(p->name, p->name_length, &default_value)) == SUCCESS) {
if (!hashed_ini_entry->on_modify
|| hashed_ini_entry->on_modify(hashed_ini_entry, Z_STRVAL(default_value), Z_STRLEN(default_value), hashed_ini_entry->mh_arg1, hashed_ini_entry->mh_arg2, hashed_ini_entry->mh_arg3, ZEND_INI_STAGE_STARTUP TSRMLS_CC) == SUCCESS) {
|| hashed_ini_entry->on_modify(hashed_ini_entry, Z_STRVAL(default_value), Z_STRSIZE(default_value), hashed_ini_entry->mh_arg1, hashed_ini_entry->mh_arg2, hashed_ini_entry->mh_arg3, ZEND_INI_STAGE_STARTUP TSRMLS_CC) == SUCCESS) {
hashed_ini_entry->value = Z_STRVAL(default_value);
hashed_ini_entry->value_length = Z_STRLEN(default_value);
hashed_ini_entry->value_length = Z_STRSIZE(default_value);
config_directive_success = 1;
}
}
@@ -244,7 +244,7 @@ ZEND_API void zend_ini_refresh_caches(int stage TSRMLS_DC) /* {{{ */
/* }}} */
#endif
ZEND_API int zend_alter_ini_entry(char *name, uint name_length, char *new_value, uint new_value_length, int modify_type, int stage) /* {{{ */
ZEND_API int zend_alter_ini_entry(char *name, zend_size_t name_length, char *new_value, zend_size_t new_value_length, int modify_type, int stage) /* {{{ */
{
TSRMLS_FETCH();
@@ -252,7 +252,7 @@ ZEND_API int zend_alter_ini_entry(char *name, uint name_length, char *new_value,
}
/* }}} */
ZEND_API int zend_alter_ini_entry_ex(char *name, uint name_length, char *new_value, uint new_value_length, int modify_type, int stage, int force_change TSRMLS_DC) /* {{{ */
ZEND_API int zend_alter_ini_entry_ex(char *name, zend_size_t name_length, char *new_value, zend_size_t new_value_length, int modify_type, int stage, int force_change TSRMLS_DC) /* {{{ */
{
zend_ini_entry *ini_entry;
char *duplicate;
@@ -306,7 +306,7 @@ ZEND_API int zend_alter_ini_entry_ex(char *name, uint name_length, char *new_val
}
/* }}} */
ZEND_API int zend_restore_ini_entry(char *name, uint name_length, int stage) /* {{{ */
ZEND_API int zend_restore_ini_entry(char *name, zend_size_t name_length, int stage) /* {{{ */
{
zend_ini_entry *ini_entry;
TSRMLS_FETCH();
@@ -328,7 +328,7 @@ ZEND_API int zend_restore_ini_entry(char *name, uint name_length, int stage) /*
}
/* }}} */
ZEND_API int zend_ini_register_displayer(char *name, uint name_length, void (*displayer)(zend_ini_entry *ini_entry, int type)) /* {{{ */
ZEND_API int zend_ini_register_displayer(char *name, zend_size_t name_length, void (*displayer)(zend_ini_entry *ini_entry, int type)) /* {{{ */
{
zend_ini_entry *ini_entry;
@@ -345,16 +345,16 @@ ZEND_API int zend_ini_register_displayer(char *name, uint name_length, void (*di
* Data retrieval
*/
ZEND_API long zend_ini_long(char *name, uint name_length, int orig) /* {{{ */
ZEND_API zend_int_t zend_ini_int(char *name, zend_size_t name_length, int orig) /* {{{ */
{
zend_ini_entry *ini_entry;
TSRMLS_FETCH();
if (zend_hash_find(EG(ini_directives), name, name_length, (void **) &ini_entry) == SUCCESS) {
if (orig && ini_entry->modified) {
return (ini_entry->orig_value ? strtol(ini_entry->orig_value, NULL, 0) : 0);
return (ini_entry->orig_value ? ZEND_STRTOI(ini_entry->orig_value, NULL, 0) : 0);
} else {
return (ini_entry->value ? strtol(ini_entry->value, NULL, 0) : 0);
return (ini_entry->value ? ZEND_STRTOI(ini_entry->value, NULL, 0) : 0);
}
}
@@ -362,7 +362,7 @@ ZEND_API long zend_ini_long(char *name, uint name_length, int orig) /* {{{ */
}
/* }}} */
ZEND_API double zend_ini_double(char *name, uint name_length, int orig) /* {{{ */
ZEND_API double zend_ini_double(char *name, zend_size_t name_length, int orig) /* {{{ */
{
zend_ini_entry *ini_entry;
TSRMLS_FETCH();
@@ -379,7 +379,7 @@ ZEND_API double zend_ini_double(char *name, uint name_length, int orig) /* {{{ *
}
/* }}} */
ZEND_API char *zend_ini_string_ex(char *name, uint name_length, int orig, zend_bool *exists) /* {{{ */
ZEND_API char *zend_ini_string_ex(char *name, zend_size_t name_length, int orig, zend_bool *exists) /* {{{ */
{
zend_ini_entry *ini_entry;
TSRMLS_FETCH();
@@ -403,7 +403,7 @@ ZEND_API char *zend_ini_string_ex(char *name, uint name_length, int orig, zend_b
}
/* }}} */
ZEND_API char *zend_ini_string(char *name, uint name_length, int orig) /* {{{ */
ZEND_API char *zend_ini_string(char *name, zend_size_t name_length, int orig) /* {{{ */
{
zend_bool exists = 1;
char *return_value;
@@ -425,7 +425,7 @@ static void zend_ini_displayer_cb(zend_ini_entry *ini_entry, int type) /* {{{ */
ini_entry->displayer(ini_entry, type);
} else {
char *display_string;
uint display_string_length;
zend_size_t display_string_length;
if (type == ZEND_INI_DISPLAY_ORIG && ini_entry->modified) {
if (ini_entry->orig_value) {
@@ -460,7 +460,8 @@ static void zend_ini_displayer_cb(zend_ini_entry *ini_entry, int type) /* {{{ */
ZEND_INI_DISP(zend_ini_boolean_displayer_cb) /* {{{ */
{
int value, tmp_value_len;
int value;
zend_size_t tmp_value_len;
char *tmp_value;
if (type == ZEND_INI_DISPLAY_ORIG && ini_entry->modified) {
@@ -577,7 +578,7 @@ ZEND_API ZEND_INI_MH(OnUpdateBool) /* {{{ */
ZEND_API ZEND_INI_MH(OnUpdateLong) /* {{{ */
{
long *p;
zend_int_t *p;
#ifndef ZTS
char *base = (char *) mh_arg2;
#else
@@ -586,7 +587,7 @@ ZEND_API ZEND_INI_MH(OnUpdateLong) /* {{{ */
base = (char *) ts_resource(*((int *) mh_arg2));
#endif
p = (long *) (base+(size_t) mh_arg1);
p = (zend_int_t *) (base+(size_t) mh_arg1);
*p = zend_atol(new_value, new_value_length);
return SUCCESS;
@@ -595,7 +596,7 @@ ZEND_API ZEND_INI_MH(OnUpdateLong) /* {{{ */
ZEND_API ZEND_INI_MH(OnUpdateLongGEZero) /* {{{ */
{
long *p, tmp;
zend_int_t *p, tmp;
#ifndef ZTS
char *base = (char *) mh_arg2;
#else
@@ -609,7 +610,7 @@ ZEND_API ZEND_INI_MH(OnUpdateLongGEZero) /* {{{ */
return FAILURE;
}
p = (long *) (base+(size_t) mh_arg1);
p = (zend_int_t *) (base+(size_t) mh_arg1);
*p = tmp;
return SUCCESS;
+15 -15
View File
@@ -45,7 +45,7 @@
# else /* ! (CRAY || __arm) */
# define XtOffset(p_type, field) \
((long) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL)))
((zend_int_t) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL)))
# endif /* !CRAY */
@@ -57,24 +57,24 @@
#endif
#define ZEND_INI_MH(name) int name(zend_ini_entry *entry, char *new_value, uint new_value_length, void *mh_arg1, void *mh_arg2, void *mh_arg3, int stage TSRMLS_DC)
#define ZEND_INI_MH(name) int name(zend_ini_entry *entry, char *new_value, zend_size_t new_value_length, void *mh_arg1, void *mh_arg2, void *mh_arg3, int stage TSRMLS_DC)
#define ZEND_INI_DISP(name) void name(zend_ini_entry *ini_entry, int type)
struct _zend_ini_entry {
int module_number;
int modifiable;
char *name;
uint name_length;
zend_size_t name_length;
ZEND_INI_MH((*on_modify));
void *mh_arg1;
void *mh_arg2;
void *mh_arg3;
char *value;
uint value_length;
zend_size_t value_length;
char *orig_value;
uint orig_value_length;
zend_size_t orig_value_length;
int orig_modifiable;
int modified;
@@ -94,17 +94,17 @@ ZEND_API void zend_ini_sort_entries(TSRMLS_D);
ZEND_API int zend_register_ini_entries(const zend_ini_entry *ini_entry, int module_number TSRMLS_DC);
ZEND_API void zend_unregister_ini_entries(int module_number TSRMLS_DC);
ZEND_API void zend_ini_refresh_caches(int stage TSRMLS_DC);
ZEND_API int zend_alter_ini_entry(char *name, uint name_length, char *new_value, uint new_value_length, int modify_type, int stage);
ZEND_API int zend_alter_ini_entry_ex(char *name, uint name_length, char *new_value, uint new_value_length, int modify_type, int stage, int force_change TSRMLS_DC);
ZEND_API int zend_restore_ini_entry(char *name, uint name_length, int stage);
ZEND_API int zend_alter_ini_entry(char *name, zend_size_t name_length, char *new_value, zend_size_t new_value_length, int modify_type, int stage);
ZEND_API int zend_alter_ini_entry_ex(char *name, zend_size_t name_length, char *new_value, zend_size_t new_value_length, int modify_type, int stage, int force_change TSRMLS_DC);
ZEND_API int zend_restore_ini_entry(char *name, zend_size_t name_length, int stage);
ZEND_API void display_ini_entries(zend_module_entry *module);
ZEND_API long zend_ini_long(char *name, uint name_length, int orig);
ZEND_API double zend_ini_double(char *name, uint name_length, int orig);
ZEND_API char *zend_ini_string(char *name, uint name_length, int orig);
ZEND_API char *zend_ini_string_ex(char *name, uint name_length, int orig, zend_bool *exists);
ZEND_API zend_int_t zend_ini_int(char *name, zend_size_t name_length, int orig);
ZEND_API double zend_ini_double(char *name, zend_size_t name_length, int orig);
ZEND_API char *zend_ini_string(char *name, zend_size_t name_length, int orig);
ZEND_API char *zend_ini_string_ex(char *name, zend_size_t name_length, int orig, zend_bool *exists);
ZEND_API int zend_ini_register_displayer(char *name, uint name_length, void (*displayer)(zend_ini_entry *ini_entry, int type));
ZEND_API int zend_ini_register_displayer(char *name, zend_size_t name_length, void (*displayer)(zend_ini_entry *ini_entry, int type));
ZEND_API ZEND_INI_DISP(zend_ini_boolean_displayer_cb);
ZEND_API ZEND_INI_DISP(zend_ini_color_displayer_cb);
@@ -154,12 +154,12 @@ END_EXTERN_C()
ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr, NULL, zend_ini_boolean_displayer_cb)
#endif
#define INI_INT(name) zend_ini_long((name), sizeof(name), 0)
#define INI_INT(name) zend_ini_int((name), sizeof(name), 0)
#define INI_FLT(name) zend_ini_double((name), sizeof(name), 0)
#define INI_STR(name) zend_ini_string_ex((name), sizeof(name), 0, NULL)
#define INI_BOOL(name) ((zend_bool) INI_INT(name))
#define INI_ORIG_INT(name) zend_ini_long((name), sizeof(name), 1)
#define INI_ORIG_INT(name) zend_ini_int((name), sizeof(name), 1)
#define INI_ORIG_FLT(name) zend_ini_double((name), sizeof(name), 1)
#define INI_ORIG_STR(name) zend_ini_string((name), sizeof(name), 1)
#define INI_ORIG_BOOL(name) ((zend_bool) INI_ORIG_INT(name))
+19 -19
View File
@@ -49,7 +49,7 @@ static void zend_ini_do_op(char type, zval *result, zval *op1, zval *op2)
{
int i_result;
int i_op1, i_op2;
char str_result[MAX_LENGTH_OF_LONG];
char str_result[MAX_LENGTH_OF_ZEND_INT];
i_op1 = atoi(Z_STRVAL_P(op1));
free(Z_STRVAL_P(op1));
@@ -81,10 +81,10 @@ static void zend_ini_do_op(char type, zval *result, zval *op1, zval *op2)
break;
}
Z_STRLEN_P(result) = zend_sprintf(str_result, "%d", i_result);
Z_STRVAL_P(result) = (char *) malloc(Z_STRLEN_P(result)+1);
memcpy(Z_STRVAL_P(result), str_result, Z_STRLEN_P(result));
Z_STRVAL_P(result)[Z_STRLEN_P(result)] = 0;
Z_STRSIZE_P(result) = zend_sprintf(str_result, "%d", i_result);
Z_STRVAL_P(result) = (char *) malloc(Z_STRSIZE_P(result)+1);
memcpy(Z_STRVAL_P(result), str_result, Z_STRSIZE_P(result));
Z_STRVAL_P(result)[Z_STRSIZE_P(result)] = 0;
Z_TYPE_P(result) = IS_STRING;
}
/* }}} */
@@ -95,7 +95,7 @@ static void zend_ini_init_string(zval *result)
{
Z_STRVAL_P(result) = malloc(1);
Z_STRVAL_P(result)[0] = 0;
Z_STRLEN_P(result) = 0;
Z_STRSIZE_P(result) = 0;
Z_TYPE_P(result) = IS_STRING;
}
/* }}} */
@@ -104,12 +104,12 @@ static void zend_ini_init_string(zval *result)
*/
static void zend_ini_add_string(zval *result, zval *op1, zval *op2)
{
int length = Z_STRLEN_P(op1) + Z_STRLEN_P(op2);
zend_size_t length = Z_STRSIZE_P(op1) + Z_STRSIZE_P(op2);
Z_STRVAL_P(result) = (char *) realloc(Z_STRVAL_P(op1), length+1);
memcpy(Z_STRVAL_P(result)+Z_STRLEN_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op2));
memcpy(Z_STRVAL_P(result)+Z_STRSIZE_P(op1), Z_STRVAL_P(op2), Z_STRSIZE_P(op2));
Z_STRVAL_P(result)[length] = 0;
Z_STRLEN_P(result) = length;
Z_STRSIZE_P(result) = length;
Z_TYPE_P(result) = IS_STRING;
}
/* }}} */
@@ -121,12 +121,12 @@ static void zend_ini_get_constant(zval *result, zval *name TSRMLS_DC)
zval z_constant;
/* If name contains ':' it is not a constant. Bug #26893. */
if (!memchr(Z_STRVAL_P(name), ':', Z_STRLEN_P(name))
&& zend_get_constant(Z_STRVAL_P(name), Z_STRLEN_P(name), &z_constant TSRMLS_CC)) {
if (!memchr(Z_STRVAL_P(name), ':', Z_STRSIZE_P(name))
&& zend_get_constant(Z_STRVAL_P(name), Z_STRSIZE_P(name), &z_constant TSRMLS_CC)) {
/* z_constant is emalloc()'d */
convert_to_string(&z_constant);
Z_STRVAL_P(result) = zend_strndup(Z_STRVAL(z_constant), Z_STRLEN(z_constant));
Z_STRLEN_P(result) = Z_STRLEN(z_constant);
Z_STRVAL_P(result) = zend_strndup(Z_STRVAL(z_constant), Z_STRSIZE(z_constant));
Z_STRSIZE_P(result) = Z_STRSIZE(z_constant);
Z_TYPE_P(result) = Z_TYPE(z_constant);
zval_dtor(&z_constant);
free(Z_STRVAL_P(name));
@@ -144,14 +144,14 @@ static void zend_ini_get_var(zval *result, zval *name TSRMLS_DC)
char *envvar;
/* Fetch configuration option value */
if (zend_get_configuration_directive(Z_STRVAL_P(name), Z_STRLEN_P(name)+1, &curval) == SUCCESS) {
Z_STRVAL_P(result) = zend_strndup(Z_STRVAL(curval), Z_STRLEN(curval));
Z_STRLEN_P(result) = Z_STRLEN(curval);
if (zend_get_configuration_directive(Z_STRVAL_P(name), Z_STRSIZE_P(name)+1, &curval) == SUCCESS) {
Z_STRVAL_P(result) = zend_strndup(Z_STRVAL(curval), Z_STRSIZE(curval));
Z_STRSIZE_P(result) = Z_STRSIZE(curval);
/* ..or if not found, try ENV */
} else if ((envvar = zend_getenv(Z_STRVAL_P(name), Z_STRLEN_P(name) TSRMLS_CC)) != NULL ||
} else if ((envvar = zend_getenv(Z_STRVAL_P(name), Z_STRSIZE_P(name) TSRMLS_CC)) != NULL ||
(envvar = getenv(Z_STRVAL_P(name))) != NULL) {
Z_STRVAL_P(result) = strdup(envvar);
Z_STRLEN_P(result) = strlen(envvar);
Z_STRSIZE_P(result) = strlen(envvar);
} else {
zend_ini_init_string(result);
}
@@ -163,7 +163,7 @@ static void zend_ini_get_var(zval *result, zval *name TSRMLS_DC)
static void ini_error(char *msg)
{
char *error_buf;
int error_buf_len;
zend_size_t error_buf_len;
char *currently_parsed_filename;
TSRMLS_FETCH();
+4663 -4663
View File
File diff suppressed because it is too large. Load diff
+5 -5
View File
@@ -55,7 +55,7 @@
#define yytext ((char*)SCNG(yy_text))
#define yyleng SCNG(yy_leng)
#define yyless(x) do { YYCURSOR = (unsigned char*)yytext + x; \
yyleng = (unsigned int)x; } while(0)
yyleng = (zend_size_t)x; } while(0)
/* #define yymore() goto yymore_restart */
@@ -133,7 +133,7 @@ ZEND_API zend_ini_scanner_globals ini_scanner_globals;
#define zend_ini_copy_value(retval, str, len) { \
Z_STRVAL_P(retval) = zend_strndup(str, len); \
Z_STRLEN_P(retval) = len; \
Z_STRSIZE_P(retval) = len; \
Z_TYPE_P(retval) = IS_STRING; \
}
@@ -261,7 +261,7 @@ int zend_ini_prepare_string_for_scanning(char *str, int scanner_mode TSRMLS_DC)
/* {{{ zend_ini_escape_string()
*/
static void zend_ini_escape_string(zval *lval, char *str, int len, char quote_type TSRMLS_DC)
static void zend_ini_escape_string(zval *lval, char *str, zend_size_t len, char quote_type TSRMLS_DC)
{
register char *s, *t;
char *end;
@@ -270,7 +270,7 @@ static void zend_ini_escape_string(zval *lval, char *str, int len, char quote_ty
/* convert escape sequences */
s = t = Z_STRVAL_P(lval);
end = s + Z_STRLEN_P(lval);
end = s + Z_STRSIZE_P(lval);
while (s < end) {
if (*s == '\\') {
@@ -289,7 +289,7 @@ static void zend_ini_escape_string(zval *lval, char *str, int len, char quote_ty
case '\\':
case '$':
*t++ = *s;
Z_STRLEN_P(lval)--;
Z_STRSIZE_P(lval)--;
break;
default:
*t++ = '\\';
+145
View File
@@ -0,0 +1,145 @@
/*
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Anatol Belski <ab@php.net> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#ifndef ZEND_INT_H
#define ZEND_INT_H
#ifndef ZEND_WIN32
/* this probably needs more on non windows, like for C++ and C99*/
# include <stdint.h>
# include <inttypes.h>
#endif
/* This is the heart of the whole int64 enablement in zval. Based on this
macros the zend_size_t datatype is handled, see zend_types.h */
#if defined(__X86_64__) || defined(__LP64__) || defined(_LP64) || defined(_WIN64)
# define ZEND_ENABLE_INT64 1
#endif
/* Integer types or the old bad long. */
#ifdef ZEND_ENABLE_INT64
# ifdef ZEND_WIN32
# ifdef _WIN64
typedef __int64 zend_int_t;
typedef unsigned __int64 zend_uint_t;
typedef __int64 zend_off_t;
# define ZEND_INT_MAX _I64_MAX
# define ZEND_INT_MIN _I64_MIN
# define ZEND_UINT_MAX _UI64_MAX
# define Z_I(i) i##i64
# define Z_UI(i) i##Ui64
# else
# error Cant enable 64 bit integers on non 64 bit platform
# endif
# else
# if defined(__X86_64__) || defined(__LP64__) || defined(_LP64)
typedef int64_t zend_int_t;
typedef uint64_t zend_uint_t;
typedef off_t zend_off_t;
# define ZEND_INT_MAX INT64_MAX
# define ZEND_INT_MIN INT64_MIN
# define ZEND_UINT_MAX UINT64_MAX
# define Z_I(i) i##LL
# define Z_UI(i) i##ULL
# else
# error Cant enable 64 bit integers on non 64 bit platform
# endif
# endif
# define SIZEOF_ZEND_INT 8
#else
typedef long zend_int_t;
typedef unsigned long zend_uint_t;
typedef long zend_off_t;
# define ZEND_INT_MAX LONG_MAX
# define ZEND_INT_MIN LONG_MIN
# define ZEND_UINT_MAX ULONG_MAX
# define Z_I(i) i##L
# define Z_UI(i) i##UL
# define SIZEOF_ZEND_INT SIZEOF_LONG
#endif
/* conversion macros */
#define ZEND_ITOA_BUF_LEN 65
#ifdef ZEND_ENABLE_INT64
# ifdef PHP_WIN32
# define ZEND_ITOA(i, s, len) _i64toa_s((i), (s), (len), 10)
# define ZEND_ATOI(i, s) i = _atoi64((s))
# define ZEND_STRTOI(s0, s1, base) _strtoi64((s0), (s1), (base))
# define ZEND_STRTOUI(s0, s1, base) _strtoui64((s0), (s1), (base))
# define ZEND_INT_FMT "%I64d"
# define ZEND_UINT_FMT "%I64u"
# define ZEND_INT_FMT_SPEC "I64d"
# define ZEND_UINT_FMT_SPEC "I64u"
# define ZEND_STRTOI_PTR _strtoi64
# define ZEND_STRTOUI_PTR _strtoui64
# define ZEND_ABS _abs64
# else
# define ZEND_ITOA(i, s, len) \
do { \
int st = snprintf((s), (len), "%lld", (i)); \
(s)[st] = '\0'; \
} while (0)
# define ZEND_ATOI(i, s) (i) = atoll((s))
# define ZEND_STRTOI(s0, s1, base) strtoll((s0), (s1), (base))
# define ZEND_STRTOUI(s0, s1, base) strtoull((s0), (s1), (base))
# define ZEND_INT_FMT "%" PRId64
# define ZEND_UINT_FMT "%" PRIu64
# define ZEND_INT_FMT_SPEC PRId64
# define ZEND_UINT_FMT_SPEC PRIu64
# define ZEND_STRTOI_PTR strtoll
# define ZEND_STRTOUI_PTR strtoull
# define ZEND_ABS llabs
# endif
#else
# define ZEND_STRTOI(s0, s1, base) strtol((s0), (s1), (base))
# define ZEND_STRTOUI(s0, s1, base) strtoul((s0), (s1), (base))
# ifdef PHP_WIN32
# define ZEND_ITOA(i, s, len) _ltoa_s((i), (s), (len), 10)
# define ZEND_ATOI(i, s) i = atol((s))
# else
# define ZEND_ITOA(i, s, len) \
do { \
int st = snprintf((s), (len), "%ld", (i)); \
(s)[st] = '\0'; \
} while (0)
# define ZEND_ATOI(i, s) (i) = atol((s))
# endif
# define ZEND_INT_FMT "%ld"
# define ZEND_UINT_FMT "%lu"
# define ZEND_INT_FMT_SPEC "ld"
# define ZEND_UINT_FMT_SPEC "lu"
# define ZEND_STRTOI_PTR strtol
# define ZEND_STRTOUI_PTR strtoul
# define ZEND_ABS abs
#endif
#endif /* ZEND_INT_H */
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* indent-tabs-mode: t
* End:
*/
+9 -9
View File
@@ -31,7 +31,7 @@ ZEND_API zend_class_entry *zend_ce_serializable;
/* {{{ zend_call_method
Only returns the returned zval if retval_ptr != NULL */
ZEND_API zval* zend_call_method(zval **object_pp, zend_class_entry *obj_ce, zend_function **fn_proxy, const char *function_name, int function_name_len, zval **retval_ptr_ptr, int param_count, zval* arg1, zval* arg2 TSRMLS_DC)
ZEND_API zval* zend_call_method(zval **object_pp, zend_class_entry *obj_ce, zend_function **fn_proxy, const char *function_name, zend_size_t function_name_len, zval **retval_ptr_ptr, int param_count, zval* arg1, zval* arg2 TSRMLS_DC)
{
int result;
zend_fcall_info fci;
@@ -189,7 +189,7 @@ ZEND_API void zend_user_it_get_current_data(zend_object_iterator *_iter, zval **
static int zend_user_it_get_current_key_default(zend_object_iterator *_iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC)
{
*int_key = _iter->index;
return HASH_KEY_IS_LONG;
return HASH_KEY_IS_INT;
}
#endif
/* }}} */
@@ -210,7 +210,7 @@ ZEND_API void zend_user_it_get_current_key(zend_object_iterator *_iter, zval *ke
zend_error(E_WARNING, "Nothing returned from %s::key()", iter->ce->name);
}
ZVAL_LONG(key, 0);
ZVAL_INT(key, 0);
}
}
@@ -397,7 +397,7 @@ static int zend_implement_arrayaccess(zend_class_entry *interface, zend_class_en
/* }}}*/
/* {{{ zend_user_serialize */
ZEND_API int zend_user_serialize(zval *object, unsigned char **buffer, zend_uint *buf_len, zend_serialize_data *data TSRMLS_DC)
ZEND_API int zend_user_serialize(zval *object, unsigned char **buffer, zend_size_t *buf_len, zend_serialize_data *data TSRMLS_DC)
{
zend_class_entry * ce = Z_OBJCE_P(object);
zval *retval;
@@ -415,8 +415,8 @@ ZEND_API int zend_user_serialize(zval *object, unsigned char **buffer, zend_uint
zval_ptr_dtor(&retval);
return FAILURE;
case IS_STRING:
*buffer = (unsigned char*)estrndup(Z_STRVAL_P(retval), Z_STRLEN_P(retval));
*buf_len = Z_STRLEN_P(retval);
*buffer = (unsigned char*)estrndup(Z_STRVAL_P(retval), Z_STRSIZE_P(retval));
*buf_len = Z_STRSIZE_P(retval);
result = SUCCESS;
break;
default: /* failure */
@@ -434,7 +434,7 @@ ZEND_API int zend_user_serialize(zval *object, unsigned char **buffer, zend_uint
/* }}} */
/* {{{ zend_user_unserialize */
ZEND_API int zend_user_unserialize(zval **object, zend_class_entry *ce, const unsigned char *buf, zend_uint buf_len, zend_unserialize_data *data TSRMLS_DC)
ZEND_API int zend_user_unserialize(zval **object, zend_class_entry *ce, const unsigned char *buf, zend_size_t buf_len, zend_unserialize_data *data TSRMLS_DC)
{
zval * zdata;
@@ -455,7 +455,7 @@ ZEND_API int zend_user_unserialize(zval **object, zend_class_entry *ce, const un
}
/* }}} */
ZEND_API int zend_class_serialize_deny(zval *object, unsigned char **buffer, zend_uint *buf_len, zend_serialize_data *data TSRMLS_DC) /* {{{ */
ZEND_API int zend_class_serialize_deny(zval *object, unsigned char **buffer, zend_size_t *buf_len, zend_serialize_data *data TSRMLS_DC) /* {{{ */
{
zend_class_entry *ce = Z_OBJCE_P(object);
zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Serialization of '%s' is not allowed", ce->name);
@@ -463,7 +463,7 @@ ZEND_API int zend_class_serialize_deny(zval *object, unsigned char **buffer, zen
}
/* }}} */
ZEND_API int zend_class_unserialize_deny(zval **object, zend_class_entry *ce, const unsigned char *buf, zend_uint buf_len, zend_unserialize_data *data TSRMLS_DC) /* {{{ */
ZEND_API int zend_class_unserialize_deny(zval **object, zend_class_entry *ce, const unsigned char *buf, zend_size_t buf_len, zend_unserialize_data *data TSRMLS_DC) /* {{{ */
{
zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Unserialization of '%s' is not allowed", ce->name);
return FAILURE;
+5 -5
View File
@@ -38,7 +38,7 @@ typedef struct _zend_user_iterator {
zval *value;
} zend_user_iterator;
ZEND_API zval* zend_call_method(zval **object_pp, zend_class_entry *obj_ce, zend_function **fn_proxy, const char *function_name, int function_name_len, zval **retval_ptr_ptr, int param_count, zval* arg1, zval* arg2 TSRMLS_DC);
ZEND_API zval* zend_call_method(zval **object_pp, zend_class_entry *obj_ce, zend_function **fn_proxy, const char *function_name, zend_size_t function_name_len, zval **retval_ptr_ptr, int param_count, zval* arg1, zval* arg2 TSRMLS_DC);
#define zend_call_method_with_0_params(obj, obj_ce, fn_proxy, function_name, retval) \
zend_call_method(obj, obj_ce, fn_proxy, function_name, sizeof(function_name)-1, retval, 0, NULL, NULL TSRMLS_CC)
@@ -61,11 +61,11 @@ ZEND_API zend_object_iterator *zend_user_it_get_new_iterator(zend_class_entry *c
ZEND_API void zend_register_interfaces(TSRMLS_D);
ZEND_API int zend_user_serialize(zval *object, unsigned char **buffer, zend_uint *buf_len, zend_serialize_data *data TSRMLS_DC);
ZEND_API int zend_user_unserialize(zval **object, zend_class_entry *ce, const unsigned char *buf, zend_uint buf_len, zend_unserialize_data *data TSRMLS_DC);
ZEND_API int zend_user_serialize(zval *object, unsigned char **buffer, zend_size_t *buf_len, zend_serialize_data *data TSRMLS_DC);
ZEND_API int zend_user_unserialize(zval **object, zend_class_entry *ce, const unsigned char *buf, zend_size_t buf_len, zend_unserialize_data *data TSRMLS_DC);
ZEND_API int zend_class_serialize_deny(zval *object, unsigned char **buffer, zend_uint *buf_len, zend_serialize_data *data TSRMLS_DC);
ZEND_API int zend_class_unserialize_deny(zval **object, zend_class_entry *ce, const unsigned char *buf, zend_uint buf_len, zend_unserialize_data *data TSRMLS_DC);
ZEND_API int zend_class_serialize_deny(zval *object, unsigned char **buffer, zend_size_t *buf_len, zend_serialize_data *data TSRMLS_DC);
ZEND_API int zend_class_unserialize_deny(zval **object, zend_class_entry *ce, const unsigned char *buf, zend_size_t buf_len, zend_unserialize_data *data TSRMLS_DC);
END_EXTERN_C()
+1 -1
View File
@@ -57,7 +57,7 @@ typedef struct _zend_object_iterator_funcs {
struct _zend_object_iterator {
void *data;
zend_object_iterator_funcs *funcs;
ulong index; /* private to fe_reset/fe_fetch opcodes */
zend_uint_t index; /* private to fe_reset/fe_fetch opcodes */
};
typedef struct _zend_class_iterator_funcs {
+27 -27
View File
@@ -578,7 +578,7 @@ optional_class_type:
function_call_parameter_list:
'(' ')' { Z_LVAL($$.u.constant) = 0; }
'(' ')' { Z_IVAL($$.u.constant) = 0; }
| '(' non_empty_function_call_parameter_list ')' { $$ = $2; }
| '(' yield_expr ')' { zend_do_pass_param(&$2, ZEND_SEND_VAL TSRMLS_CC); }
;
@@ -625,7 +625,7 @@ class_statement_list:
class_statement:
variable_modifiers { CG(access_type) = Z_LVAL($1.u.constant); } class_variable_declaration ';'
variable_modifiers { CG(access_type) = Z_IVAL($1.u.constant); } class_variable_declaration ';'
| class_constant_declaration ';'
| trait_use_statement
| method_modifiers function is_reference T_STRING { zend_do_begin_function_declaration(&$2, &$4, 1, $3.op_type, &$1 TSRMLS_CC); }
@@ -686,37 +686,37 @@ trait_alias:
;
trait_modifiers:
/* empty */ { Z_LVAL($$.u.constant) = 0x0; } /* No change of methods visibility */
/* empty */ { Z_IVAL($$.u.constant) = 0x0; } /* No change of methods visibility */
| member_modifier { $$ = $1; } /* REM: Keep in mind, there are not only visibility modifiers */
;
method_body:
';' /* abstract method */ { Z_LVAL($$.u.constant) = ZEND_ACC_ABSTRACT; }
| '{' inner_statement_list '}' { Z_LVAL($$.u.constant) = 0; }
';' /* abstract method */ { Z_IVAL($$.u.constant) = ZEND_ACC_ABSTRACT; }
| '{' inner_statement_list '}' { Z_IVAL($$.u.constant) = 0; }
;
variable_modifiers:
non_empty_member_modifiers { $$ = $1; }
| T_VAR { Z_LVAL($$.u.constant) = ZEND_ACC_PUBLIC; }
| T_VAR { Z_IVAL($$.u.constant) = ZEND_ACC_PUBLIC; }
;
method_modifiers:
/* empty */ { Z_LVAL($$.u.constant) = ZEND_ACC_PUBLIC; }
| non_empty_member_modifiers { $$ = $1; if (!(Z_LVAL($$.u.constant) & ZEND_ACC_PPP_MASK)) { Z_LVAL($$.u.constant) |= ZEND_ACC_PUBLIC; } }
/* empty */ { Z_IVAL($$.u.constant) = ZEND_ACC_PUBLIC; }
| non_empty_member_modifiers { $$ = $1; if (!(Z_IVAL($$.u.constant) & ZEND_ACC_PPP_MASK)) { Z_IVAL($$.u.constant) |= ZEND_ACC_PUBLIC; } }
;
non_empty_member_modifiers:
member_modifier { $$ = $1; }
| non_empty_member_modifiers member_modifier { Z_LVAL($$.u.constant) = zend_do_verify_access_types(&$1, &$2); }
| non_empty_member_modifiers member_modifier { Z_IVAL($$.u.constant) = zend_do_verify_access_types(&$1, &$2); }
;
member_modifier:
T_PUBLIC { Z_LVAL($$.u.constant) = ZEND_ACC_PUBLIC; }
| T_PROTECTED { Z_LVAL($$.u.constant) = ZEND_ACC_PROTECTED; }
| T_PRIVATE { Z_LVAL($$.u.constant) = ZEND_ACC_PRIVATE; }
| T_STATIC { Z_LVAL($$.u.constant) = ZEND_ACC_STATIC; }
| T_ABSTRACT { Z_LVAL($$.u.constant) = ZEND_ACC_ABSTRACT; }
| T_FINAL { Z_LVAL($$.u.constant) = ZEND_ACC_FINAL; }
T_PUBLIC { Z_IVAL($$.u.constant) = ZEND_ACC_PUBLIC; }
| T_PROTECTED { Z_IVAL($$.u.constant) = ZEND_ACC_PROTECTED; }
| T_PRIVATE { Z_IVAL($$.u.constant) = ZEND_ACC_PRIVATE; }
| T_STATIC { Z_IVAL($$.u.constant) = ZEND_ACC_STATIC; }
| T_ABSTRACT { Z_IVAL($$.u.constant) = ZEND_ACC_ABSTRACT; }
| T_FINAL { Z_IVAL($$.u.constant) = ZEND_ACC_FINAL; }
;
class_variable_declaration:
@@ -738,7 +738,7 @@ echo_expr_list:
for_expr:
/* empty */ { $$.op_type = IS_CONST; Z_TYPE($$.u.constant) = IS_BOOL; Z_LVAL($$.u.constant) = 1; }
/* empty */ { $$.op_type = IS_CONST; Z_TYPE($$.u.constant) = IS_BOOL; Z_IVAL($$.u.constant) = 1; }
| non_empty_for_expr { $$ = $1; }
;
@@ -812,8 +812,8 @@ expr_without_variable:
| expr '%' expr { zend_do_binary_op(ZEND_MOD, &$$, &$1, &$3 TSRMLS_CC); }
| expr T_SL expr { zend_do_binary_op(ZEND_SL, &$$, &$1, &$3 TSRMLS_CC); }
| expr T_SR expr { zend_do_binary_op(ZEND_SR, &$$, &$1, &$3 TSRMLS_CC); }
| '+' expr %prec T_INC { ZVAL_LONG(&$1.u.constant, 0); if ($2.op_type == IS_CONST) { add_function(&$2.u.constant, &$1.u.constant, &$2.u.constant TSRMLS_CC); $$ = $2; } else { $1.op_type = IS_CONST; INIT_PZVAL(&$1.u.constant); zend_do_binary_op(ZEND_ADD, &$$, &$1, &$2 TSRMLS_CC); } }
| '-' expr %prec T_INC { ZVAL_LONG(&$1.u.constant, 0); if ($2.op_type == IS_CONST) { sub_function(&$2.u.constant, &$1.u.constant, &$2.u.constant TSRMLS_CC); $$ = $2; } else { $1.op_type = IS_CONST; INIT_PZVAL(&$1.u.constant); zend_do_binary_op(ZEND_SUB, &$$, &$1, &$2 TSRMLS_CC); } }
| '+' expr %prec T_INC { ZVAL_INT(&$1.u.constant, 0); if ($2.op_type == IS_CONST) { add_function(&$2.u.constant, &$1.u.constant, &$2.u.constant TSRMLS_CC); $$ = $2; } else { $1.op_type = IS_CONST; INIT_PZVAL(&$1.u.constant); zend_do_binary_op(ZEND_ADD, &$$, &$1, &$2 TSRMLS_CC); } }
| '-' expr %prec T_INC { ZVAL_INT(&$1.u.constant, 0); if ($2.op_type == IS_CONST) { sub_function(&$2.u.constant, &$1.u.constant, &$2.u.constant TSRMLS_CC); $$ = $2; } else { $1.op_type = IS_CONST; INIT_PZVAL(&$1.u.constant); zend_do_binary_op(ZEND_SUB, &$$, &$1, &$2 TSRMLS_CC); } }
| '!' expr { zend_do_unary_op(ZEND_BOOL_NOT, &$$, &$2 TSRMLS_CC); }
| '~' expr { zend_do_unary_op(ZEND_BW_NOT, &$$, &$2 TSRMLS_CC); }
| expr T_IS_IDENTICAL expr { zend_do_binary_op(ZEND_IS_IDENTICAL, &$$, &$1, &$3 TSRMLS_CC); }
@@ -834,7 +834,7 @@ expr_without_variable:
| expr '?' ':' { zend_do_jmp_set(&$1, &$2, &$3 TSRMLS_CC); }
expr { zend_do_jmp_set_else(&$$, &$5, &$2, &$3 TSRMLS_CC); }
| internal_functions_in_yacc { $$ = $1; }
| T_INT_CAST expr { zend_do_cast(&$$, &$2, IS_LONG TSRMLS_CC); }
| T_INT_CAST expr { zend_do_cast(&$$, &$2, IS_INT TSRMLS_CC); }
| T_DOUBLE_CAST expr { zend_do_cast(&$$, &$2, IS_DOUBLE TSRMLS_CC); }
| T_STRING_CAST expr { zend_do_cast(&$$, &$2, IS_STRING TSRMLS_CC); }
| T_ARRAY_CAST expr { zend_do_cast(&$$, &$2, IS_ARRAY TSRMLS_CC); }
@@ -915,13 +915,13 @@ class_name:
T_STATIC { $$.op_type = IS_CONST; ZVAL_STRINGL(&$$.u.constant, "static", sizeof("static")-1, 1);}
| namespace_name { $$ = $1; }
| T_NAMESPACE T_NS_SEPARATOR namespace_name { $$.op_type = IS_CONST; ZVAL_EMPTY_STRING(&$$.u.constant); zend_do_build_namespace_name(&$$, &$$, &$3 TSRMLS_CC); }
| T_NS_SEPARATOR namespace_name { char *tmp = estrndup(Z_STRVAL($2.u.constant), Z_STRLEN($2.u.constant)+1); memcpy(&(tmp[1]), Z_STRVAL($2.u.constant), Z_STRLEN($2.u.constant)+1); tmp[0] = '\\'; efree(Z_STRVAL($2.u.constant)); Z_STRVAL($2.u.constant) = tmp; ++Z_STRLEN($2.u.constant); $$ = $2; }
| T_NS_SEPARATOR namespace_name { char *tmp = estrndup(Z_STRVAL($2.u.constant), Z_STRSIZE($2.u.constant)+1); memcpy(&(tmp[1]), Z_STRVAL($2.u.constant), Z_STRSIZE($2.u.constant)+1); tmp[0] = '\\'; efree(Z_STRVAL($2.u.constant)); Z_STRVAL($2.u.constant) = tmp; ++Z_STRSIZE($2.u.constant); $$ = $2; }
;
fully_qualified_class_name:
namespace_name { $$ = $1; }
| T_NAMESPACE T_NS_SEPARATOR namespace_name { $$.op_type = IS_CONST; ZVAL_EMPTY_STRING(&$$.u.constant); zend_do_build_namespace_name(&$$, &$$, &$3 TSRMLS_CC); }
| T_NS_SEPARATOR namespace_name { char *tmp = estrndup(Z_STRVAL($2.u.constant), Z_STRLEN($2.u.constant)+1); memcpy(&(tmp[1]), Z_STRVAL($2.u.constant), Z_STRLEN($2.u.constant)+1); tmp[0] = '\\'; efree(Z_STRVAL($2.u.constant)); Z_STRVAL($2.u.constant) = tmp; ++Z_STRLEN($2.u.constant); $$ = $2; }
| T_NS_SEPARATOR namespace_name { char *tmp = estrndup(Z_STRVAL($2.u.constant), Z_STRSIZE($2.u.constant)+1); memcpy(&(tmp[1]), Z_STRVAL($2.u.constant), Z_STRSIZE($2.u.constant)+1); tmp[0] = '\\'; efree(Z_STRVAL($2.u.constant)); Z_STRVAL($2.u.constant) = tmp; ++Z_STRSIZE($2.u.constant); $$ = $2; }
;
@@ -964,7 +964,7 @@ backticks_expr:
ctor_arguments:
/* empty */ { Z_LVAL($$.u.constant) = 0; }
/* empty */ { Z_IVAL($$.u.constant) = 0; }
| function_call_parameter_list { $$ = $1; }
;
@@ -997,7 +997,7 @@ static_scalar_value:
| static_class_name_scalar { $$.u.ast = zend_ast_create_constant(&$1.u.constant); }
| namespace_name { zend_do_fetch_constant(&$$, NULL, &$1, ZEND_CT, 1 TSRMLS_CC); $$.u.ast = zend_ast_create_constant(&$$.u.constant); }
| T_NAMESPACE T_NS_SEPARATOR namespace_name { $$.op_type = IS_CONST; ZVAL_EMPTY_STRING(&$$.u.constant); zend_do_build_namespace_name(&$$, &$$, &$3 TSRMLS_CC); $3 = $$; zend_do_fetch_constant(&$$, NULL, &$3, ZEND_CT, 0 TSRMLS_CC); $$.u.ast = zend_ast_create_constant(&$$.u.constant); }
| T_NS_SEPARATOR namespace_name { char *tmp = estrndup(Z_STRVAL($2.u.constant), Z_STRLEN($2.u.constant)+1); memcpy(&(tmp[1]), Z_STRVAL($2.u.constant), Z_STRLEN($2.u.constant)+1); tmp[0] = '\\'; efree(Z_STRVAL($2.u.constant)); Z_STRVAL($2.u.constant) = tmp; ++Z_STRLEN($2.u.constant); zend_do_fetch_constant(&$$, NULL, &$2, ZEND_CT, 0 TSRMLS_CC); $$.u.ast = zend_ast_create_constant(&$$.u.constant); }
| T_NS_SEPARATOR namespace_name { char *tmp = estrndup(Z_STRVAL($2.u.constant), Z_STRSIZE($2.u.constant)+1); memcpy(&(tmp[1]), Z_STRVAL($2.u.constant), Z_STRSIZE($2.u.constant)+1); tmp[0] = '\\'; efree(Z_STRVAL($2.u.constant)); Z_STRVAL($2.u.constant) = tmp; ++Z_STRSIZE($2.u.constant); zend_do_fetch_constant(&$$, NULL, &$2, ZEND_CT, 0 TSRMLS_CC); $$.u.ast = zend_ast_create_constant(&$$.u.constant); }
| T_ARRAY '(' static_array_pair_list ')' { $$ = $3; }
| '[' static_array_pair_list ']' { $$ = $2; }
| static_class_constant { $$.u.ast = zend_ast_create_constant(&$1.u.constant); }
@@ -1045,7 +1045,7 @@ general_constant:
class_constant { $$ = $1; }
| namespace_name { zend_do_fetch_constant(&$$, NULL, &$1, ZEND_RT, 1 TSRMLS_CC); }
| T_NAMESPACE T_NS_SEPARATOR namespace_name { $$.op_type = IS_CONST; ZVAL_EMPTY_STRING(&$$.u.constant); zend_do_build_namespace_name(&$$, &$$, &$3 TSRMLS_CC); $3 = $$; zend_do_fetch_constant(&$$, NULL, &$3, ZEND_RT, 0 TSRMLS_CC); }
| T_NS_SEPARATOR namespace_name { char *tmp = estrndup(Z_STRVAL($2.u.constant), Z_STRLEN($2.u.constant)+1); memcpy(&(tmp[1]), Z_STRVAL($2.u.constant), Z_STRLEN($2.u.constant)+1); tmp[0] = '\\'; efree(Z_STRVAL($2.u.constant)); Z_STRVAL($2.u.constant) = tmp; ++Z_STRLEN($2.u.constant); zend_do_fetch_constant(&$$, NULL, &$2, ZEND_RT, 0 TSRMLS_CC); }
| T_NS_SEPARATOR namespace_name { char *tmp = estrndup(Z_STRVAL($2.u.constant), Z_STRSIZE($2.u.constant)+1); memcpy(&(tmp[1]), Z_STRVAL($2.u.constant), Z_STRSIZE($2.u.constant)+1); tmp[0] = '\\'; efree(Z_STRVAL($2.u.constant)); Z_STRVAL($2.u.constant) = tmp; ++Z_STRSIZE($2.u.constant); zend_do_fetch_constant(&$$, NULL, &$2, ZEND_RT, 0 TSRMLS_CC); }
;
scalar:
@@ -1203,8 +1203,8 @@ variable_name:
;
simple_indirect_reference:
'$' { Z_LVAL($$.u.constant) = 1; }
| simple_indirect_reference '$' { Z_LVAL($$.u.constant)++; }
'$' { Z_IVAL($$.u.constant) = 1; }
| simple_indirect_reference '$' { Z_IVAL($$.u.constant)++; }
;
assignment_list:
@@ -1315,7 +1315,7 @@ static YYSIZE_T zend_yytnamerr(char *yyres, const char *yystr)
if (CG(parse_error) == 0) {
char buffer[120];
const unsigned char *end, *str, *tok1 = NULL, *tok2 = NULL;
unsigned int len = 0, toklen = 0, yystr_len;
zend_size_t len = 0, toklen = 0, yystr_len;
CG(parse_error) = 1;
+7857 -7857
View File
File diff suppressed because it is too large. Load diff
+51 -51
View File
@@ -563,7 +563,7 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSR
retval_znode.op_type = IS_CONST;
INIT_PZVAL(&retval_znode.u.constant);
ZVAL_LONG(&retval_znode.u.constant, 1);
ZVAL_INT(&retval_znode.u.constant, 1);
zend_save_lexical_state(&original_lex_state TSRMLS_CC);
@@ -631,7 +631,7 @@ zend_op_array *compile_filename(int type, zval *filename TSRMLS_DC)
int dummy = 1;
if (!file_handle.opened_path) {
file_handle.opened_path = opened_path = estrndup(Z_STRVAL_P(filename), Z_STRLEN_P(filename));
file_handle.opened_path = opened_path = estrndup(Z_STRVAL_P(filename), Z_STRSIZE_P(filename));
}
zend_hash_add(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1, (void *)&dummy, sizeof(int), NULL);
@@ -654,14 +654,14 @@ ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_D
size_t size;
/* enforce ZEND_MMAP_AHEAD trailing NULLs for flex... */
Z_STRVAL_P(str) = str_erealloc(Z_STRVAL_P(str), Z_STRLEN_P(str) + ZEND_MMAP_AHEAD);
memset(Z_STRVAL_P(str) + Z_STRLEN_P(str), 0, ZEND_MMAP_AHEAD);
Z_STRVAL_P(str) = str_erealloc(Z_STRVAL_P(str), Z_STRSIZE_P(str) + ZEND_MMAP_AHEAD);
memset(Z_STRVAL_P(str) + Z_STRSIZE_P(str), 0, ZEND_MMAP_AHEAD);
SCNG(yy_in) = NULL;
SCNG(yy_start) = NULL;
buf = Z_STRVAL_P(str);
size = Z_STRLEN_P(str);
size = Z_STRSIZE_P(str);
if (CG(multibyte)) {
SCNG(script_org) = (unsigned char*)buf;
@@ -722,7 +722,7 @@ zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC)
int compiler_result;
zend_bool original_in_compilation = CG(in_compilation);
if (Z_STRLEN_P(source_string)==0) {
if (Z_STRSIZE_P(source_string)==0) {
efree(op_array);
return NULL;
}
@@ -861,10 +861,10 @@ ZEND_API void zend_multibyte_yyinput_again(zend_encoding_filter old_input_filter
if (SCNG(output_filter)) { \
size_t sz = 0; \
SCNG(output_filter)((unsigned char **)&Z_STRVAL_P(zendlval), &sz, (unsigned char *)yytext, (size_t)yyleng TSRMLS_CC); \
Z_STRLEN_P(zendlval) = sz; \
Z_STRSIZE_P(zendlval) = sz; \
} else { \
Z_STRVAL_P(zendlval) = (char *) estrndup(yytext, yyleng); \
Z_STRLEN_P(zendlval) = yyleng; \
Z_STRSIZE_P(zendlval) = yyleng; \
}
static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quote_type TSRMLS_DC)
@@ -876,7 +876,7 @@ static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quo
/* convert escape sequences */
s = t = Z_STRVAL_P(zendlval);
end = s+Z_STRLEN_P(zendlval);
end = s+Z_STRSIZE_P(zendlval);
while (s<end) {
if (*s=='\\') {
s++;
@@ -888,23 +888,23 @@ static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quo
switch(*s) {
case 'n':
*t++ = '\n';
Z_STRLEN_P(zendlval)--;
Z_STRSIZE_P(zendlval)--;
break;
case 'r':
*t++ = '\r';
Z_STRLEN_P(zendlval)--;
Z_STRSIZE_P(zendlval)--;
break;
case 't':
*t++ = '\t';
Z_STRLEN_P(zendlval)--;
Z_STRSIZE_P(zendlval)--;
break;
case 'f':
*t++ = '\f';
Z_STRLEN_P(zendlval)--;
Z_STRSIZE_P(zendlval)--;
break;
case 'v':
*t++ = '\v';
Z_STRLEN_P(zendlval)--;
Z_STRSIZE_P(zendlval)--;
break;
case 'e':
#ifdef PHP_WIN32
@@ -912,7 +912,7 @@ static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quo
#else
*t++ = '\e';
#endif
Z_STRLEN_P(zendlval)--;
Z_STRSIZE_P(zendlval)--;
break;
case '"':
case '`':
@@ -924,22 +924,22 @@ static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quo
case '\\':
case '$':
*t++ = *s;
Z_STRLEN_P(zendlval)--;
Z_STRSIZE_P(zendlval)--;
break;
case 'x':
case 'X':
if (ZEND_IS_HEX(*(s+1))) {
char hex_buf[3] = { 0, 0, 0 };
Z_STRLEN_P(zendlval)--; /* for the 'x' */
Z_STRSIZE_P(zendlval)--; /* for the 'x' */
hex_buf[0] = *(++s);
Z_STRLEN_P(zendlval)--;
Z_STRSIZE_P(zendlval)--;
if (ZEND_IS_HEX(*(s+1))) {
hex_buf[1] = *(++s);
Z_STRLEN_P(zendlval)--;
Z_STRSIZE_P(zendlval)--;
}
*t++ = (char) strtol(hex_buf, NULL, 16);
*t++ = (char) ZEND_STRTOI(hex_buf, NULL, 16);
} else {
*t++ = '\\';
*t++ = *s;
@@ -951,16 +951,16 @@ static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quo
char octal_buf[4] = { 0, 0, 0, 0 };
octal_buf[0] = *s;
Z_STRLEN_P(zendlval)--;
Z_STRSIZE_P(zendlval)--;
if (ZEND_IS_OCT(*(s+1))) {
octal_buf[1] = *(++s);
Z_STRLEN_P(zendlval)--;
Z_STRSIZE_P(zendlval)--;
if (ZEND_IS_OCT(*(s+1))) {
octal_buf[2] = *(++s);
Z_STRLEN_P(zendlval)--;
Z_STRSIZE_P(zendlval)--;
}
}
*t++ = (char) strtol(octal_buf, NULL, 8);
*t++ = (char) ZEND_STRTOI(octal_buf, NULL, 8);
} else {
*t++ = '\\';
*t++ = *s;
@@ -980,8 +980,8 @@ static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quo
if (SCNG(output_filter)) {
size_t sz = 0;
s = Z_STRVAL_P(zendlval);
SCNG(output_filter)((unsigned char **)&Z_STRVAL_P(zendlval), &sz, (unsigned char *)s, (size_t)Z_STRLEN_P(zendlval) TSRMLS_CC);
Z_STRLEN_P(zendlval) = sz;
SCNG(output_filter)((unsigned char **)&Z_STRVAL_P(zendlval), &sz, (unsigned char *)s, (size_t)Z_STRSIZE_P(zendlval) TSRMLS_CC);
Z_STRSIZE_P(zendlval) = sz;
efree(s);
}
}
@@ -1504,13 +1504,13 @@ NEWLINE ("\r"|"\n"|"\r\n")
--len;
}
if (len < SIZEOF_LONG * 8) {
if (len < SIZEOF_ZEND_INT * 8) {
if (len == 0) {
Z_LVAL_P(zendlval) = 0;
Z_IVAL_P(zendlval) = 0;
} else {
Z_LVAL_P(zendlval) = strtol(bin, NULL, 2);
Z_IVAL_P(zendlval) = ZEND_STRTOI(bin, NULL, 2);
}
zendlval->type = IS_LONG;
zendlval->type = IS_INT;
return T_LNUMBER;
} else {
ZVAL_DOUBLE(zendlval, zend_bin_strtod(bin, NULL));
@@ -1519,11 +1519,11 @@ NEWLINE ("\r"|"\n"|"\r\n")
}
<ST_IN_SCRIPTING>{LNUM} {
if (yyleng < MAX_LENGTH_OF_LONG - 1) { /* Won't overflow */
Z_LVAL_P(zendlval) = strtol(yytext, NULL, 0);
if (yyleng < MAX_LENGTH_OF_ZEND_INT - 1) { /* Won't overflow */
Z_IVAL_P(zendlval) = ZEND_STRTOI(yytext, NULL, 0);
} else {
errno = 0;
Z_LVAL_P(zendlval) = strtol(yytext, NULL, 0);
Z_IVAL_P(zendlval) = ZEND_STRTOI(yytext, NULL, 0);
if (errno == ERANGE) { /* Overflow */
if (yytext[0] == '0') { /* octal overflow */
Z_DVAL_P(zendlval) = zend_oct_strtod(yytext, NULL);
@@ -1535,7 +1535,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
}
}
zendlval->type = IS_LONG;
zendlval->type = IS_INT;
return T_LNUMBER;
}
@@ -1549,13 +1549,13 @@ NEWLINE ("\r"|"\n"|"\r\n")
len--;
}
if (len < SIZEOF_LONG * 2 || (len == SIZEOF_LONG * 2 && *hex <= '7')) {
if (len < SIZEOF_ZEND_INT * 2 || (len == SIZEOF_ZEND_INT * 2 && *hex <= '7')) {
if (len == 0) {
Z_LVAL_P(zendlval) = 0;
Z_IVAL_P(zendlval) = 0;
} else {
Z_LVAL_P(zendlval) = strtol(hex, NULL, 16);
Z_IVAL_P(zendlval) = ZEND_STRTOI(hex, NULL, 16);
}
zendlval->type = IS_LONG;
zendlval->type = IS_INT;
return T_LNUMBER;
} else {
ZVAL_DOUBLE(zendlval, zend_hex_strtod(hex, NULL));
@@ -1564,8 +1564,8 @@ NEWLINE ("\r"|"\n"|"\r\n")
}
<ST_VAR_OFFSET>[0]|([1-9][0-9]*) { /* Offset could be treated as a long */
if (yyleng < MAX_LENGTH_OF_LONG - 1 || (yyleng == MAX_LENGTH_OF_LONG - 1 && strcmp(yytext, long_min_digits) < 0)) {
ZVAL_LONG(zendlval, strtol(yytext, NULL, 10));
if (yyleng < MAX_LENGTH_OF_ZEND_INT - 1 || (yyleng == MAX_LENGTH_OF_ZEND_INT - 1 && strcmp(yytext, int_min_digits) < 0)) {
ZVAL_INT(zendlval, ZEND_STRTOI(yytext, NULL, 10));
} else {
ZVAL_STRINGL(zendlval, yytext, yyleng, 1);
}
@@ -1587,8 +1587,8 @@ NEWLINE ("\r"|"\n"|"\r\n")
if (ce && ZEND_ACC_TRAIT == (ce->ce_flags & ZEND_ACC_TRAIT)) {
/* We create a special __CLASS__ constant that is going to be resolved
at run-time */
Z_STRLEN_P(zendlval) = sizeof("__CLASS__")-1;
Z_STRVAL_P(zendlval) = estrndup("__CLASS__", Z_STRLEN_P(zendlval));
Z_STRSIZE_P(zendlval) = sizeof("__CLASS__")-1;
Z_STRVAL_P(zendlval) = estrndup("__CLASS__", Z_STRSIZE_P(zendlval));
zendlval->type = IS_CONSTANT;
} else {
if (ce && ce->name) {
@@ -1624,7 +1624,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
const char *class_name = CG(active_class_entry) ? CG(active_class_entry)->name : NULL;
const char *func_name = CG(active_op_array)? CG(active_op_array)->function_name : NULL;
Z_STRLEN_P(zendlval) = zend_spprintf(&Z_STRVAL_P(zendlval), 0, "%s%s%s",
Z_STRSIZE_P(zendlval) = zend_spprintf(&Z_STRVAL_P(zendlval), 0, "%s%s%s",
class_name ? class_name : "",
class_name && func_name ? "::" : "",
func_name ? func_name : ""
@@ -1634,7 +1634,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
}
<ST_IN_SCRIPTING>"__LINE__" {
ZVAL_LONG(zendlval, CG(zend_lineno));
ZVAL_INT(zendlval, CG(zend_lineno));
return T_LINE;
}
@@ -1793,13 +1793,13 @@ inline_html:
int readsize;
size_t sz = 0;
readsize = SCNG(output_filter)((unsigned char **)&Z_STRVAL_P(zendlval), &sz, (unsigned char *)yytext, (size_t)yyleng TSRMLS_CC);
Z_STRLEN_P(zendlval) = sz;
Z_STRSIZE_P(zendlval) = sz;
if (readsize < yyleng) {
yyless(readsize);
}
} else {
Z_STRVAL_P(zendlval) = (char *) estrndup(yytext, yyleng);
Z_STRLEN_P(zendlval) = yyleng;
Z_STRSIZE_P(zendlval) = yyleng;
}
zendlval->type = IS_STRING;
HANDLE_NEWLINES(yytext, yyleng);
@@ -1974,7 +1974,7 @@ inline_html:
/* convert escape sequences */
s = t = Z_STRVAL_P(zendlval);
end = s+Z_STRLEN_P(zendlval);
end = s+Z_STRSIZE_P(zendlval);
while (s<end) {
if (*s=='\\') {
s++;
@@ -1983,7 +1983,7 @@ inline_html:
case '\\':
case '\'':
*t++ = *s;
Z_STRLEN_P(zendlval)--;
Z_STRSIZE_P(zendlval)--;
break;
default:
*t++ = '\\';
@@ -2004,8 +2004,8 @@ inline_html:
if (SCNG(output_filter)) {
size_t sz = 0;
s = Z_STRVAL_P(zendlval);
SCNG(output_filter)((unsigned char **)&Z_STRVAL_P(zendlval), &sz, (unsigned char *)s, (size_t)Z_STRLEN_P(zendlval) TSRMLS_CC);
Z_STRLEN_P(zendlval) = sz;
SCNG(output_filter)((unsigned char **)&Z_STRVAL_P(zendlval), &sz, (unsigned char *)s, (size_t)Z_STRSIZE_P(zendlval) TSRMLS_CC);
Z_STRSIZE_P(zendlval) = sz;
efree(s);
}
return T_CONSTANT_ENCAPSED_STRING;
@@ -2123,7 +2123,7 @@ inline_html:
<ST_DOUBLE_QUOTES,ST_BACKQUOTE,ST_HEREDOC>"{$" {
Z_LVAL_P(zendlval) = (long) '{';
Z_IVAL_P(zendlval) = (long) '{';
yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
yyless(1);
return T_CURLY_OPEN;
+10 -10
View File
@@ -32,9 +32,9 @@ ZEND_API int le_index_ptr;
static HashTable list_destructors;
ZEND_API int zend_list_insert(void *ptr, int type TSRMLS_DC)
ZEND_API zend_int_t zend_list_insert(void *ptr, int type TSRMLS_DC)
{
int index;
zend_int_t index;
zend_rsrc_list_entry le;
le.ptr=ptr;
@@ -47,7 +47,7 @@ ZEND_API int zend_list_insert(void *ptr, int type TSRMLS_DC)
return index;
}
ZEND_API int _zend_list_delete(int id TSRMLS_DC)
ZEND_API int _zend_list_delete(zend_int_t id TSRMLS_DC)
{
zend_rsrc_list_entry *le;
@@ -64,7 +64,7 @@ ZEND_API int _zend_list_delete(int id TSRMLS_DC)
}
ZEND_API void *_zend_list_find(int id, int *type TSRMLS_DC)
ZEND_API void *_zend_list_find(zend_int_t id, int *type TSRMLS_DC)
{
zend_rsrc_list_entry *le;
@@ -77,7 +77,7 @@ ZEND_API void *_zend_list_find(int id, int *type TSRMLS_DC)
}
}
ZEND_API int _zend_list_addref(int id TSRMLS_DC)
ZEND_API int _zend_list_addref(zend_int_t id TSRMLS_DC)
{
zend_rsrc_list_entry *le;
@@ -91,9 +91,9 @@ ZEND_API int _zend_list_addref(int id TSRMLS_DC)
}
ZEND_API int zend_register_resource(zval *rsrc_result, void *rsrc_pointer, int rsrc_type TSRMLS_DC)
ZEND_API zend_int_t zend_register_resource(zval *rsrc_result, void *rsrc_pointer, int rsrc_type TSRMLS_DC)
{
int rsrc_id;
zend_int_t rsrc_id;
rsrc_id = zend_list_insert(rsrc_pointer, rsrc_type TSRMLS_CC);
@@ -106,9 +106,9 @@ ZEND_API int zend_register_resource(zval *rsrc_result, void *rsrc_pointer, int r
}
ZEND_API void *zend_fetch_resource(zval **passed_id TSRMLS_DC, int default_id, const char *resource_type_name, int *found_resource_type, int num_resource_types, ...)
ZEND_API void *zend_fetch_resource(zval **passed_id TSRMLS_DC, zend_int_t default_id, const char *resource_type_name, int *found_resource_type, int num_resource_types, ...)
{
int id;
zend_int_t id;
int actual_resource_type;
void *resource;
va_list resource_types;
@@ -139,7 +139,7 @@ ZEND_API void *zend_fetch_resource(zval **passed_id TSRMLS_DC, int default_id, c
if (!resource) {
if (resource_type_name) {
class_name = get_active_class_name(&space TSRMLS_CC);
zend_error(E_WARNING, "%s%s%s(): %d is not a valid %s resource", class_name, space, get_active_function_name(TSRMLS_C), id, resource_type_name);
zend_error(E_WARNING, "%s%s%s(): " ZEND_INT_FMT " is not a valid %s resource", class_name, space, get_active_function_name(TSRMLS_C), id, resource_type_name);
}
return NULL;
}
+7 -7
View File
@@ -33,7 +33,7 @@ BEGIN_EXTERN_C()
typedef struct _zend_rsrc_list_entry {
void *ptr;
int type;
int refcount;
zend_int_t refcount;
} zend_rsrc_list_entry;
typedef void (*rsrc_dtor_func_t)(zend_rsrc_list_entry *rsrc TSRMLS_DC);
@@ -70,17 +70,17 @@ void zend_destroy_rsrc_list(HashTable *ht TSRMLS_DC);
int zend_init_rsrc_list_dtors(void);
void zend_destroy_rsrc_list_dtors(void);
ZEND_API int zend_list_insert(void *ptr, int type TSRMLS_DC);
ZEND_API int _zend_list_addref(int id TSRMLS_DC);
ZEND_API int _zend_list_delete(int id TSRMLS_DC);
ZEND_API void *_zend_list_find(int id, int *type TSRMLS_DC);
ZEND_API zend_int_t zend_list_insert(void *ptr, int type TSRMLS_DC);
ZEND_API int _zend_list_addref(zend_int_t id TSRMLS_DC);
ZEND_API int _zend_list_delete(zend_int_t id TSRMLS_DC);
ZEND_API void *_zend_list_find(zend_int_t id, int *type TSRMLS_DC);
#define zend_list_addref(id) _zend_list_addref(id TSRMLS_CC)
#define zend_list_delete(id) _zend_list_delete(id TSRMLS_CC)
#define zend_list_find(id, type) _zend_list_find(id, type TSRMLS_CC)
ZEND_API int zend_register_resource(zval *rsrc_result, void *rsrc_pointer, int rsrc_type TSRMLS_DC);
ZEND_API void *zend_fetch_resource(zval **passed_id TSRMLS_DC, int default_id, const char *resource_type_name, int *found_resource_type, int num_resource_types, ...);
ZEND_API zend_int_t zend_register_resource(zval *rsrc_result, void *rsrc_pointer, int rsrc_type TSRMLS_DC);
ZEND_API void *zend_fetch_resource(zval **passed_id TSRMLS_DC, zend_int_t default_id, const char *resource_type_name, int *found_resource_type, int num_resource_types, ...);
ZEND_API const char *zend_rsrc_list_get_rsrc_type(int resource TSRMLS_DC);
ZEND_API int zend_fetch_list_dtor_id(char *type_name);
+1 -1
View File
@@ -249,7 +249,7 @@ ZEND_API void zend_llist_apply_with_arguments(zend_llist *l, llist_apply_with_ar
}
ZEND_API int zend_llist_count(zend_llist *l)
ZEND_API size_t zend_llist_count(zend_llist *l)
{
return l->count;
}
+1 -1
View File
@@ -59,7 +59,7 @@ ZEND_API void zend_llist_apply(zend_llist *l, llist_apply_func_t func TSRMLS_DC)
ZEND_API void zend_llist_apply_with_del(zend_llist *l, int (*func)(void *data));
ZEND_API void zend_llist_apply_with_argument(zend_llist *l, llist_apply_with_arg_func_t func, void *arg TSRMLS_DC);
ZEND_API void zend_llist_apply_with_arguments(zend_llist *l, llist_apply_with_args_func_t func TSRMLS_DC, int num_args, ...);
ZEND_API int zend_llist_count(zend_llist *l);
ZEND_API size_t zend_llist_count(zend_llist *l);
ZEND_API void zend_llist_sort(zend_llist *l, llist_compare_func_t comp_func TSRMLS_DC);
/* traversal */
+24 -11
View File
@@ -21,8 +21,8 @@
#if defined(__i386__) && defined(__GNUC__)
#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
long __tmpvar; \
#define ZEND_SIGNED_MULTIPLY_INT(a, b, lval, dval, usedval) do { \
zend_int_t __tmpvar; \
__asm__ ("imul %3,%0\n" \
"adc $0,%1" \
: "=r"(__tmpvar),"=r"(usedval) \
@@ -33,8 +33,8 @@
#elif defined(__x86_64__) && defined(__GNUC__)
#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
long __tmpvar; \
#define ZEND_SIGNED_MULTIPLY_INT(a, b, lval, dval, usedval) do { \
zend_int_t __tmpvar; \
__asm__ ("imul %3,%0\n" \
"adc $0,%1" \
: "=r"(__tmpvar),"=r"(usedval) \
@@ -45,8 +45,8 @@
#elif defined(__arm__) && defined(__GNUC__)
#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
long __tmpvar; \
#define ZEND_SIGNED_MULTIPLY_INT(a, b, lval, dval, usedval) do { \
zend_int_t __tmpvar; \
__asm__("smull %0, %1, %2, %3\n" \
"sub %1, %1, %0, asr #31" \
: "=r"(__tmpvar), "=r"(usedval) \
@@ -57,8 +57,8 @@
#elif defined(__aarch64__) && defined(__GNUC__)
#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
long __tmpvar; \
#define ZEND_SIGNED_MULTIPLY_INT(a, b, lval, dval, usedval) do { \
zend_int_t __tmpvar; \
__asm__("mul %0, %2, %3\n" \
"smulh %1, %2, %3\n" \
"sub %1, %1, %0, asr #63\n" \
@@ -68,11 +68,24 @@
else (lval) = __tmpvar; \
} while (0)
#elif defined(ZEND_WIN32)
#define ZEND_SIGNED_MULTIPLY_INT(a, b, lval, dval, usedval) do { \
zend_int_t __lres = (a) * (b); \
long double __dres = (long double)(a) * (long double)(b); \
long double __delta = (long double) __lres - __dres; \
if ( ((usedval) = (( __dres + __delta ) != __dres))) { \
(dval) = __dres; \
} else { \
(lval) = __lres; \
} \
} while (0)
#elif SIZEOF_LONG == 4 && defined(HAVE_ZEND_LONG64)
#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
#define ZEND_SIGNED_MULTIPLY_INT(a, b, lval, dval, usedval) do { \
zend_long64 __result = (zend_long64) (a) * (zend_long64) (b); \
if (__result > LONG_MAX || __result < LONG_MIN) { \
if (__result > ZEND_INT_MAX || __result < ZEND_INT_MIN) { \
(dval) = (double) __result; \
(usedval) = 1; \
} else { \
@@ -83,7 +96,7 @@
#else
#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
#define ZEND_SIGNED_MULTIPLY_INT(a, b, lval, dval, usedval) do { \
long __lres = (a) * (b); \
long double __dres = (long double)(a) * (long double)(b); \
long double __delta = (long double) __lres - __dres; \
+30 -29
View File
@@ -29,6 +29,7 @@
#include "zend_interfaces.h"
#include "zend_closures.h"
#include "zend_compile.h"
#include "zend_hash.h"
#define DEBUG_OBJECT_HANDLERS 0
@@ -304,7 +305,7 @@ static zend_always_inline struct _zend_property_info *zend_get_property_info_qui
zend_property_info *property_info;
zend_property_info *scope_property_info;
zend_bool denied_access = 0;
ulong h;
zend_uint_t h;
if (key && (property_info = CACHED_POLYMORPHIC_PTR(key->cache_slot, ce)) != NULL) {
return property_info;
@@ -312,7 +313,7 @@ static zend_always_inline struct _zend_property_info *zend_get_property_info_qui
if (UNEXPECTED(Z_STRVAL_P(member)[0] == '\0')) {
if (!silent) {
if (Z_STRLEN_P(member) == 0) {
if (Z_STRSIZE_P(member) == 0) {
zend_error_noreturn(E_ERROR, "Cannot access empty property");
} else {
zend_error_noreturn(E_ERROR, "Cannot access property started with '\\0'");
@@ -321,8 +322,8 @@ static zend_always_inline struct _zend_property_info *zend_get_property_info_qui
return NULL;
}
property_info = NULL;
h = key ? key->hash_value : zend_get_hash_value(Z_STRVAL_P(member), Z_STRLEN_P(member) + 1);
if (zend_hash_quick_find(&ce->properties_info, Z_STRVAL_P(member), Z_STRLEN_P(member)+1, h, (void **) &property_info)==SUCCESS) {
h = key ? key->hash_value : zend_get_hash_value(Z_STRVAL_P(member), Z_STRSIZE_P(member) + 1);
if (zend_hash_quick_find(&ce->properties_info, Z_STRVAL_P(member), Z_STRSIZE_P(member)+1, h, (void **) &property_info)==SUCCESS) {
if (UNEXPECTED((property_info->flags & ZEND_ACC_SHADOW) != 0)) {
/* if it's a shadow - go to access it's private */
property_info = NULL;
@@ -352,7 +353,7 @@ static zend_always_inline struct _zend_property_info *zend_get_property_info_qui
if (EG(scope) != ce
&& EG(scope)
&& is_derived_class(ce, EG(scope))
&& zend_hash_quick_find(&EG(scope)->properties_info, Z_STRVAL_P(member), Z_STRLEN_P(member)+1, h, (void **) &scope_property_info)==SUCCESS
&& zend_hash_quick_find(&EG(scope)->properties_info, Z_STRVAL_P(member), Z_STRSIZE_P(member)+1, h, (void **) &scope_property_info)==SUCCESS
&& scope_property_info->flags & ZEND_ACC_PRIVATE) {
if (key) {
CACHE_POLYMORPHIC_PTR(key->cache_slot, ce, scope_property_info);
@@ -374,7 +375,7 @@ static zend_always_inline struct _zend_property_info *zend_get_property_info_qui
} else {
EG(std_property_info).flags = ZEND_ACC_PUBLIC;
EG(std_property_info).name = Z_STRVAL_P(member);
EG(std_property_info).name_length = Z_STRLEN_P(member);
EG(std_property_info).name_length = Z_STRSIZE_P(member);
EG(std_property_info).h = h;
EG(std_property_info).ce = ce;
EG(std_property_info).offset = -1;
@@ -390,12 +391,12 @@ ZEND_API struct _zend_property_info *zend_get_property_info(zend_class_entry *ce
}
/* }}} */
ZEND_API int zend_check_property_access(zend_object *zobj, const char *prop_info_name, int prop_info_name_len TSRMLS_DC) /* {{{ */
ZEND_API int zend_check_property_access(zend_object *zobj, const char *prop_info_name, zend_size_t prop_info_name_len TSRMLS_DC) /* {{{ */
{
zend_property_info *property_info;
const char *class_name, *prop_name;
zval member;
int prop_name_len;
zend_size_t prop_name_len;
zend_unmangle_property_name_ex(prop_info_name, prop_info_name_len, &class_name, &prop_name, &prop_name_len);
ZVAL_STRINGL(&member, prop_name, prop_name_len, 0);
@@ -424,8 +425,8 @@ static int zend_get_property_guard(zend_object *zobj, zend_property_info *proper
if (!property_info) {
property_info = &info;
info.name = Z_STRVAL_P(member);
info.name_length = Z_STRLEN_P(member);
info.h = zend_get_hash_value(Z_STRVAL_P(member), Z_STRLEN_P(member) + 1);
info.name_length = Z_STRSIZE_P(member);
info.h = zend_get_hash_value(Z_STRVAL_P(member), Z_STRSIZE_P(member) + 1);
} else if(property_info->name[0] == '\0'){
const char *class_name = NULL, *prop_name = NULL;
zend_unmangle_property_name(property_info->name, property_info->name_length, &class_name, &prop_name);
@@ -530,7 +531,7 @@ zval *zend_std_read_property(zval *object, zval *member, int type, const zend_li
} else {
if (zobj->ce->__get && guard && guard->in_get == 1) {
if (Z_STRVAL_P(member)[0] == '\0') {
if (Z_STRLEN_P(member) == 0) {
if (Z_STRSIZE_P(member) == 0) {
zend_error(E_ERROR, "Cannot access empty property");
} else {
zend_error(E_ERROR, "Cannot access property started with '\\0'");
@@ -648,7 +649,7 @@ ZEND_API void zend_std_write_property(zval *object, zval *member, zval *value, c
}
} else if (zobj->ce->__set && guard && guard->in_set == 1) {
if (Z_STRVAL_P(member)[0] == '\0') {
if (Z_STRLEN_P(member) == 0) {
if (Z_STRSIZE_P(member) == 0) {
zend_error(E_ERROR, "Cannot access empty property");
} else {
zend_error(E_ERROR, "Cannot access property started with '\\0'");
@@ -866,7 +867,7 @@ static void zend_std_unset_property(zval *object, zval *member, const zend_liter
zval_ptr_dtor(&object);
} else if (zobj->ce->__unset && guard && guard->in_unset == 1) {
if (Z_STRVAL_P(member)[0] == '\0') {
if (Z_STRLEN_P(member) == 0) {
if (Z_STRSIZE_P(member) == 0) {
zend_error(E_ERROR, "Cannot access empty property");
} else {
zend_error(E_ERROR, "Cannot access property started with '\\0'");
@@ -945,7 +946,7 @@ ZEND_API void zend_std_call_user_call(INTERNAL_FUNCTION_PARAMETERS) /* {{{ */
* Returns the function address that should be called, or NULL
* if no such function exists.
*/
static inline zend_function *zend_check_private_int(zend_function *fbc, zend_class_entry *ce, char *function_name_strval, int function_name_strlen, ulong hash_value TSRMLS_DC) /* {{{ */
static inline zend_function *zend_check_private_int(zend_function *fbc, zend_class_entry *ce, char *function_name_strval, zend_size_t function_name_strlen, zend_uint_t hash_value TSRMLS_DC) /* {{{ */
{
if (!ce) {
return 0;
@@ -980,7 +981,7 @@ static inline zend_function *zend_check_private_int(zend_function *fbc, zend_cla
}
/* }}} */
ZEND_API int zend_check_private(zend_function *fbc, zend_class_entry *ce, char *function_name_strval, int function_name_strlen TSRMLS_DC) /* {{{ */
ZEND_API int zend_check_private(zend_function *fbc, zend_class_entry *ce, char *function_name_strval, zend_size_t function_name_strlen TSRMLS_DC) /* {{{ */
{
return zend_check_private_int(fbc, ce, function_name_strval, function_name_strlen, zend_hash_func(function_name_strval, function_name_strlen+1) TSRMLS_CC) != NULL;
}
@@ -1015,7 +1016,7 @@ ZEND_API int zend_check_protected(zend_class_entry *ce, zend_class_entry *scope)
}
/* }}} */
static inline union _zend_function *zend_get_user_call_function(zend_class_entry *ce, const char *method_name, int method_len) /* {{{ */
static inline union _zend_function *zend_get_user_call_function(zend_class_entry *ce, const char *method_name, zend_size_t method_len) /* {{{ */
{
zend_internal_function *call_user_call = emalloc(sizeof(zend_internal_function));
call_user_call->type = ZEND_INTERNAL_FUNCTION;
@@ -1031,12 +1032,12 @@ static inline union _zend_function *zend_get_user_call_function(zend_class_entry
}
/* }}} */
static union _zend_function *zend_std_get_method(zval **object_ptr, char *method_name, int method_len, const zend_literal *key TSRMLS_DC) /* {{{ */
static union _zend_function *zend_std_get_method(zval **object_ptr, char *method_name, zend_size_t method_len, const zend_literal *key TSRMLS_DC) /* {{{ */
{
zend_function *fbc;
zval *object = *object_ptr;
zend_object *zobj = Z_OBJ_P(object);
ulong hash_value;
zend_uint_t hash_value;
char *lc_method_name;
ALLOCA_FLAG(use_heap)
@@ -1155,7 +1156,7 @@ ZEND_API void zend_std_callstatic_user_call(INTERNAL_FUNCTION_PARAMETERS) /* {{{
}
/* }}} */
static inline union _zend_function *zend_get_user_callstatic_function(zend_class_entry *ce, const char *method_name, int method_len) /* {{{ */
static inline union _zend_function *zend_get_user_callstatic_function(zend_class_entry *ce, const char *method_name, zend_size_t method_len) /* {{{ */
{
zend_internal_function *callstatic_user_call = emalloc(sizeof(zend_internal_function));
callstatic_user_call->type = ZEND_INTERNAL_FUNCTION;
@@ -1173,11 +1174,11 @@ static inline union _zend_function *zend_get_user_callstatic_function(zend_class
/* This is not (yet?) in the API, but it belongs in the built-in objects callbacks */
ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, const char *function_name_strval, int function_name_strlen, const zend_literal *key TSRMLS_DC) /* {{{ */
ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, const char *function_name_strval, zend_size_t function_name_strlen, const zend_literal *key TSRMLS_DC) /* {{{ */
{
zend_function *fbc = NULL;
char *lc_class_name, *lc_function_name = NULL;
ulong hash_value;
zend_uint_t hash_value;
ALLOCA_FLAG(use_heap)
if (EXPECTED(key != NULL)) {
@@ -1262,10 +1263,10 @@ ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, const c
}
/* }}} */
ZEND_API zval **zend_std_get_static_property(zend_class_entry *ce, const char *property_name, int property_name_len, zend_bool silent, const zend_literal *key TSRMLS_DC) /* {{{ */
ZEND_API zval **zend_std_get_static_property(zend_class_entry *ce, const char *property_name, zend_size_t property_name_len, zend_bool silent, const zend_literal *key TSRMLS_DC) /* {{{ */
{
zend_property_info *property_info;
ulong hash_value;
zend_uint_t hash_value;
if (UNEXPECTED(!key) ||
(property_info = CACHED_POLYMORPHIC_PTR(key->cache_slot, ce)) == NULL) {
@@ -1319,7 +1320,7 @@ ZEND_API zval **zend_std_get_static_property(zend_class_entry *ce, const char *p
}
/* }}} */
ZEND_API zend_bool zend_std_unset_static_property(zend_class_entry *ce, const char *property_name, int property_name_len, const zend_literal *key TSRMLS_DC) /* {{{ */
ZEND_API zend_bool zend_std_unset_static_property(zend_class_entry *ce, const char *property_name, zend_size_t property_name_len, const zend_literal *key TSRMLS_DC) /* {{{ */
{
zend_error_noreturn(E_ERROR, "Attempt to unset static property %s::$%s", ce->name, property_name);
return 0;
@@ -1390,10 +1391,10 @@ static int zend_std_compare_objects(zval *o1, zval *o2 TSRMLS_DC) /* {{{ */
Z_OBJ_UNPROTECT_RECURSION(o2);
return 1;
}
if (Z_LVAL(result) != 0) {
if (Z_IVAL(result) != 0) {
Z_OBJ_UNPROTECT_RECURSION(o1);
Z_OBJ_UNPROTECT_RECURSION(o2);
return Z_LVAL(result);
return Z_IVAL(result);
}
} else {
Z_OBJ_UNPROTECT_RECURSION(o1);
@@ -1526,7 +1527,7 @@ zend_class_entry *zend_std_object_get_class(const zval *object TSRMLS_DC) /* {{{
}
/* }}} */
int zend_std_object_get_class_name(const zval *object, const char **class_name, zend_uint *class_name_len, int parent TSRMLS_DC) /* {{{ */
int zend_std_object_get_class_name(const zval *object, const char **class_name, zend_size_t *class_name_len, int parent TSRMLS_DC) /* {{{ */
{
zend_object *zobj;
zend_class_entry *ce;
@@ -1591,14 +1592,14 @@ ZEND_API int zend_std_cast_object_tostring(zval *readobj, zval *writeobj, int ty
INIT_PZVAL(writeobj);
ZVAL_BOOL(writeobj, 1);
return SUCCESS;
case IS_LONG:
case IS_INT:
ce = Z_OBJCE_P(readobj);
zend_error(E_NOTICE, "Object of class %s could not be converted to int", ce->name);
INIT_PZVAL(writeobj);
if (readobj == writeobj) {
zval_dtor(readobj);
}
ZVAL_LONG(writeobj, 1);
ZVAL_INT(writeobj, 1);
return SUCCESS;
case IS_DOUBLE:
ce = Z_OBJCE_P(readobj);
+8 -8
View File
@@ -88,7 +88,7 @@ typedef HashTable *(*zend_object_get_debug_info_t)(zval *object, int *is_temp TS
/* Andi - EX(fbc) (function being called) needs to be initialized already in the INIT fcall opcode so that the parameters can be parsed the right way. We need to add another callback for this.
*/
typedef int (*zend_object_call_method_t)(const char *method, INTERNAL_FUNCTION_PARAMETERS);
typedef union _zend_function *(*zend_object_get_method_t)(zval **object_ptr, char *method, int method_len, const struct _zend_literal *key TSRMLS_DC);
typedef union _zend_function *(*zend_object_get_method_t)(zval **object_ptr, char *method, zend_size_t method_len, const struct _zend_literal *key TSRMLS_DC);
typedef union _zend_function *(*zend_object_get_constructor_t)(zval *object TSRMLS_DC);
/* Object maintenance/destruction */
@@ -98,7 +98,7 @@ typedef void (*zend_object_delete_obj_t)(zval *object TSRMLS_DC);
typedef zend_object_value (*zend_object_clone_obj_t)(zval *object TSRMLS_DC);
typedef zend_class_entry *(*zend_object_get_class_entry_t)(const zval *object TSRMLS_DC);
typedef int (*zend_object_get_class_name_t)(const zval *object, const char **class_name, zend_uint *class_name_len, int parent TSRMLS_DC);
typedef int (*zend_object_get_class_name_t)(const zval *object, const char **class_name, zend_size_t *class_name_len, int parent TSRMLS_DC);
typedef int (*zend_object_compare_t)(zval *object1, zval *object2 TSRMLS_DC);
typedef int (*zend_object_compare_zvals_t)(zval *resul, zval *op1, zval *op2 TSRMLS_DC);
@@ -108,7 +108,7 @@ typedef int (*zend_object_cast_t)(zval *readobj, zval *retval, int type TSRMLS_D
/* updates *count to hold the number of elements present and returns SUCCESS.
* Returns FAILURE if the object does not have any sense of overloaded dimensions */
typedef int (*zend_object_count_elements_t)(zval *object, long *count TSRMLS_DC);
typedef int (*zend_object_count_elements_t)(zval *object, zend_int_t *count TSRMLS_DC);
typedef int (*zend_object_get_closure_t)(zval *obj, zend_class_entry **ce_ptr, union _zend_function **fptr_ptr, zval **zobj_ptr TSRMLS_DC);
@@ -155,9 +155,9 @@ extern ZEND_API zend_object_handlers std_object_handlers;
((fbc)->common.prototype ? (fbc)->common.prototype->common.scope : (fbc)->common.scope)
BEGIN_EXTERN_C()
ZEND_API union _zend_function *zend_std_get_static_method(zend_class_entry *ce, const char *function_name_strval, int function_name_strlen, const struct _zend_literal *key TSRMLS_DC);
ZEND_API zval **zend_std_get_static_property(zend_class_entry *ce, const char *property_name, int property_name_len, zend_bool silent, const struct _zend_literal *key TSRMLS_DC);
ZEND_API zend_bool zend_std_unset_static_property(zend_class_entry *ce, const char *property_name, int property_name_len, const struct _zend_literal *key TSRMLS_DC);
ZEND_API union _zend_function *zend_std_get_static_method(zend_class_entry *ce, const char *function_name_strval, zend_size_t function_name_strlen, const struct _zend_literal *key TSRMLS_DC);
ZEND_API zval **zend_std_get_static_property(zend_class_entry *ce, const char *property_name, zend_size_t property_name_len, zend_bool silent, const struct _zend_literal *key TSRMLS_DC);
ZEND_API zend_bool zend_std_unset_static_property(zend_class_entry *ce, const char *property_name, zend_size_t property_name_len, const struct _zend_literal *key TSRMLS_DC);
ZEND_API union _zend_function *zend_std_get_constructor(zval *object TSRMLS_DC);
ZEND_API struct _zend_property_info *zend_get_property_info(zend_class_entry *ce, zval *member, int silent TSRMLS_DC);
ZEND_API HashTable *zend_std_get_properties(zval *object TSRMLS_DC);
@@ -170,11 +170,11 @@ ZEND_API void rebuild_object_properties(zend_object *zobj);
#define IS_ZEND_STD_OBJECT(z) (Z_TYPE(z) == IS_OBJECT && (Z_OBJ_HT((z))->get_class_entry != NULL))
#define HAS_CLASS_ENTRY(z) (Z_OBJ_HT(z)->get_class_entry != NULL)
ZEND_API int zend_check_private(union _zend_function *fbc, zend_class_entry *ce, char *function_name_strval, int function_name_strlen TSRMLS_DC);
ZEND_API int zend_check_private(union _zend_function *fbc, zend_class_entry *ce, char *function_name_strval, zend_size_t function_name_strlen TSRMLS_DC);
ZEND_API int zend_check_protected(zend_class_entry *ce, zend_class_entry *scope);
ZEND_API int zend_check_property_access(zend_object *zobj, const char *prop_info_name, int prop_info_name_len TSRMLS_DC);
ZEND_API int zend_check_property_access(zend_object *zobj, const char *prop_info_name, zend_size_t prop_info_name_len TSRMLS_DC);
ZEND_API void zend_std_call_user_call(INTERNAL_FUNCTION_PARAMETERS);
END_EXTERN_C()
+3 -3
View File
@@ -677,7 +677,7 @@ static void zend_resolve_finally_calls(zend_op_array *op_array TSRMLS_DC)
int nest_levels, array_offset;
zend_brk_cont_element *jmp_to;
nest_levels = Z_LVAL(op_array->literals[opline->op2.constant].constant);
nest_levels = Z_IVAL(op_array->literals[opline->op2.constant].constant);
if ((array_offset = opline->op1.opline_num) != -1) {
do {
jmp_to = &op_array->brk_cont_array[array_offset];
@@ -690,7 +690,7 @@ static void zend_resolve_finally_calls(zend_op_array *op_array TSRMLS_DC)
}
}
case ZEND_GOTO:
if (Z_TYPE(op_array->literals[opline->op2.constant].constant) != IS_LONG) {
if (Z_TYPE(op_array->literals[opline->op2.constant].constant) != IS_INT) {
zend_uint num = opline->op2.constant;
opline->op2.zv = &op_array->literals[opline->op2.constant].constant;
zend_resolve_goto_label(op_array, opline, 1 TSRMLS_CC);
@@ -753,7 +753,7 @@ ZEND_API int pass_two(zend_op_array *op_array TSRMLS_DC)
}
switch (opline->opcode) {
case ZEND_GOTO:
if (Z_TYPE_P(opline->op2.zv) != IS_LONG) {
if (Z_TYPE_P(opline->op2.zv) != IS_INT) {
zend_resolve_goto_label(op_array, opline, 1 TSRMLS_CC);
}
/* break omitted intentionally */
+364 -365
View File
File diff suppressed because it is too large. Load diff
+150 -145
View File
@@ -41,7 +41,7 @@
#include "ext/bcmath/libbcmath/src/bcmath.h"
#endif
#define LONG_SIGN_MASK (1L << (8*sizeof(long)-1))
#define LONG_SIGN_MASK (((zend_int_t)1) << (8*sizeof(zend_int_t)-1))
BEGIN_EXTERN_C()
ZEND_API int add_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
@@ -71,12 +71,12 @@ ZEND_API zend_bool instanceof_function_ex(const zend_class_entry *instance_ce, c
ZEND_API zend_bool instanceof_function(const zend_class_entry *instance_ce, const zend_class_entry *ce TSRMLS_DC);
END_EXTERN_C()
#if ZEND_DVAL_TO_LVAL_CAST_OK
# define zend_dval_to_lval(d) ((long) (d))
#elif SIZEOF_LONG == 4
static zend_always_inline long zend_dval_to_lval(double d)
#if ZEND_DVAL_TO_IVAL_CAST_OK
# define zend_dval_to_ival(d) ((zend_int_t) (d))
#elif SIZEOF_ZEND_INT == 4
static zend_always_inline zend_int_t zend_dval_to_ival(double d)
{
if (d > LONG_MAX || d < LONG_MIN) {
if (d > ZEND_INT_MAX || d < ZEND_INT_MIN) {
double two_pow_32 = pow(2., 32.),
dmod;
@@ -86,15 +86,15 @@ static zend_always_inline long zend_dval_to_lval(double d)
* to simulate rounding towards 0 of the negative number */
dmod = ceil(dmod) + two_pow_32;
}
return (long)(unsigned long)dmod;
return (zend_int_t)(zend_uint_t)dmod;
}
return (long)d;
return (zend_int_t)d;
}
#else
static zend_always_inline long zend_dval_to_lval(double d)
static zend_always_inline zend_int_t zend_dval_to_ival(double d)
{
/* >= as (double)LONG_MAX is outside signed range */
if (d >= LONG_MAX || d < LONG_MIN) {
if (d >= ZEND_INT_MAX || d < ZEND_INT_MIN) {
double two_pow_64 = pow(2., 64.),
dmod;
@@ -104,9 +104,9 @@ static zend_always_inline long zend_dval_to_lval(double d)
* fractional part, hence dmod does not have one either */
dmod += two_pow_64;
}
return (long)(unsigned long)dmod;
return (zend_int_t)(zend_uint_t)dmod;
}
return (long)d;
return (zend_int_t)d;
}
#endif
/* }}} */
@@ -119,7 +119,7 @@ static zend_always_inline long zend_dval_to_lval(double d)
* of allow_errors determines whether it's required to be entirely numeric, or
* just its prefix. Leading whitespace is allowed.
*
* The function returns 0 if the string did not contain a valid number; IS_LONG
* The function returns 0 if the string did not contain a valid number; IS_INT
* if it contained a number that fits within the range of a long; or IS_DOUBLE
* if the number was out of long range or contained a decimal point/exponent.
* The number's value is returned into the respective pointer, *lval or *dval,
@@ -129,10 +129,11 @@ static zend_always_inline long zend_dval_to_lval(double d)
* could not be represented as such due to overflow. It writes 1 to oflow_info
* if the integer is larger than LONG_MAX and -1 if it's smaller than LONG_MIN.
*/
static inline zend_uchar is_numeric_string_ex(const char *str, int length, long *lval, double *dval, int allow_errors, int *oflow_info)
static inline zend_uchar is_numeric_string_ex(const char *str, zend_size_t length, zend_int_t *lval, double *dval, int allow_errors, int *oflow_info)
{
const char *ptr;
int base = 10, digits = 0, dp_or_e = 0;
int base = 10, dp_or_e = 0;
ptrdiff_t digits = 0;
double local_dval = 0.0;
zend_uchar type;
@@ -172,7 +173,7 @@ static inline zend_uchar is_numeric_string_ex(const char *str, int length, long
/* Count the number of digits. If a decimal point/exponent is found,
* it's a double. Otherwise, if there's a dval or no need to check for
* a full match, stop when there are too many digits for a long */
for (type = IS_LONG; !(digits >= MAX_LENGTH_OF_LONG && (dval || allow_errors == 1)); digits++, ptr++) {
for (type = IS_INT; !(digits >= MAX_LENGTH_OF_ZEND_INT && (dval || allow_errors == 1)); digits++, ptr++) {
check_digits:
if (ZEND_IS_DIGIT(*ptr) || (base == 16 && ZEND_IS_XDIGIT(*ptr))) {
continue;
@@ -195,14 +196,14 @@ check_digits:
}
if (base == 10) {
if (digits >= MAX_LENGTH_OF_LONG) {
if (digits >= MAX_LENGTH_OF_ZEND_INT) {
if (oflow_info != NULL) {
*oflow_info = *str == '-' ? -1 : 1;
}
dp_or_e = -1;
goto process_double;
}
} else if (!(digits < SIZEOF_LONG * 2 || (digits == SIZEOF_LONG * 2 && ptr[-digits] <= '7'))) {
} else if (!(digits < SIZEOF_ZEND_INT * 2 || (digits == SIZEOF_ZEND_INT * 2 && ptr[-digits] <= '7'))) {
if (dval) {
local_dval = zend_hex_strtod(str, &ptr);
}
@@ -236,9 +237,9 @@ process_double:
}
}
if (type == IS_LONG) {
if (digits == MAX_LENGTH_OF_LONG - 1) {
int cmp = strcmp(&ptr[-digits], long_min_digits);
if (type == IS_INT) {
if (digits == MAX_LENGTH_OF_ZEND_INT - 1) {
int cmp = strcmp(&ptr[-digits], int_min_digits);
if (!(cmp < 0 || (cmp == 0 && *str == '-'))) {
if (dval) {
@@ -253,10 +254,10 @@ process_double:
}
if (lval) {
*lval = strtol(str, NULL, base);
*lval = ZEND_STRTOI(str, NULL, base);
}
return IS_LONG;
return IS_INT;
} else {
if (dval) {
*dval = local_dval;
@@ -266,21 +267,25 @@ process_double:
}
}
static inline zend_uchar is_numeric_string(const char *str, int length, long *lval, double *dval, int allow_errors) {
static inline zend_uchar is_numeric_string(const char *str, zend_size_t length, zend_int_t *lval, double *dval, int allow_errors) {
return is_numeric_string_ex(str, length, lval, dval, allow_errors, NULL);
}
static inline const char *
zend_memnstr(const char *haystack, const char *needle, int needle_len, char *end)
zend_memnstr(const char *haystack, const char *needle, zend_size_t needle_len, char *end)
{
const char *p = haystack;
const char ne = needle[needle_len-1];
ptrdiff_t off_p;
zend_size_t off_s;
if (needle_len == 1) {
return (char *)memchr(p, *needle, (end-p));
}
if (needle_len > end-haystack) {
off_p = end - haystack;
off_s = (off_p > 0) ? (zend_size_t)off_p : 0;
if (needle_len > off_s) {
return NULL;
}
@@ -303,7 +308,7 @@ zend_memnstr(const char *haystack, const char *needle, int needle_len, char *end
return NULL;
}
static inline const void *zend_memrchr(const void *s, int c, size_t n)
static inline const void *zend_memrchr(const void *s, int c, zend_size_t n)
{
register const unsigned char *e;
@@ -327,14 +332,14 @@ ZEND_API int decrement_function(zval *op2);
ZEND_API void convert_scalar_to_number(zval *op TSRMLS_DC);
ZEND_API void _convert_to_cstring(zval *op ZEND_FILE_LINE_DC);
ZEND_API void _convert_to_string(zval *op ZEND_FILE_LINE_DC);
ZEND_API void convert_to_long(zval *op);
ZEND_API void convert_to_int(zval *op);
ZEND_API void convert_to_double(zval *op);
ZEND_API void convert_to_long_base(zval *op, int base);
ZEND_API void convert_to_int_base(zval *op, int base);
ZEND_API void convert_to_null(zval *op);
ZEND_API void convert_to_boolean(zval *op);
ZEND_API void convert_to_array(zval *op);
ZEND_API void convert_to_object(zval *op);
ZEND_API void multi_convert_to_long_ex(int argc, ...);
ZEND_API void multi_convert_to_int_ex(int argc, ...);
ZEND_API void multi_convert_to_double_ex(int argc, ...);
ZEND_API void multi_convert_to_string_ex(int argc, ...);
ZEND_API int add_char_to_string(zval *result, const zval *op1, const zval *op2);
@@ -342,7 +347,7 @@ ZEND_API int add_string_to_string(zval *result, const zval *op1, const zval *op2
#define convert_to_cstring(op) if ((op)->type != IS_STRING) { _convert_to_cstring((op) ZEND_FILE_LINE_CC); }
#define convert_to_string(op) if ((op)->type != IS_STRING) { _convert_to_string((op) ZEND_FILE_LINE_CC); }
ZEND_API double zend_string_to_double(const char *number, zend_uint length);
ZEND_API double zend_string_to_double(const char *number, zend_size_t length);
ZEND_API int zval_is_true(zval *op);
ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
@@ -354,27 +359,27 @@ ZEND_API int string_case_compare_function(zval *result, zval *op1, zval *op2 TSR
ZEND_API int string_locale_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
#endif
ZEND_API void zend_str_tolower(char *str, unsigned int length);
ZEND_API char *zend_str_tolower_copy(char *dest, const char *source, unsigned int length);
ZEND_API char *zend_str_tolower_dup(const char *source, unsigned int length);
ZEND_API void zend_str_tolower(char *str, zend_size_t length);
ZEND_API char *zend_str_tolower_copy(char *dest, const char *source, zend_size_t length);
ZEND_API char *zend_str_tolower_dup(const char *source, zend_size_t length);
ZEND_API int zend_binary_zval_strcmp(zval *s1, zval *s2);
ZEND_API int zend_binary_zval_strncmp(zval *s1, zval *s2, zval *s3);
ZEND_API int zend_binary_zval_strcasecmp(zval *s1, zval *s2);
ZEND_API int zend_binary_zval_strncasecmp(zval *s1, zval *s2, zval *s3);
ZEND_API int zend_binary_strcmp(const char *s1, uint len1, const char *s2, uint len2);
ZEND_API int zend_binary_strncmp(const char *s1, uint len1, const char *s2, uint len2, uint length);
ZEND_API int zend_binary_strcasecmp(const char *s1, uint len1, const char *s2, uint len2);
ZEND_API int zend_binary_strncasecmp(const char *s1, uint len1, const char *s2, uint len2, uint length);
ZEND_API int zend_binary_strncasecmp_l(const char *s1, uint len1, const char *s2, uint len2, uint length);
ZEND_API int zend_binary_strcmp(const char *s1, zend_size_t len1, const char *s2, zend_size_t len2);
ZEND_API int zend_binary_strncmp(const char *s1, zend_size_t len1, const char *s2, zend_size_t len2, zend_size_t length);
ZEND_API int zend_binary_strcasecmp(const char *s1, zend_size_t len1, const char *s2, zend_size_t len2);
ZEND_API int zend_binary_strncasecmp(const char *s1, zend_size_t len1, const char *s2, zend_size_t len2, zend_size_t length);
ZEND_API int zend_binary_strncasecmp_l(const char *s1, zend_size_t len1, const char *s2, zend_size_t len2, zend_size_t length);
ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2);
ZEND_API void zend_compare_symbol_tables(zval *result, HashTable *ht1, HashTable *ht2 TSRMLS_DC);
ZEND_API void zend_compare_arrays(zval *result, zval *a1, zval *a2 TSRMLS_DC);
ZEND_API void zend_compare_objects(zval *result, zval *o1, zval *o2 TSRMLS_DC);
ZEND_API int zend_atoi(const char *str, int str_len);
ZEND_API long zend_atol(const char *str, int str_len);
ZEND_API int zend_atoi(const char *str, zend_size_t str_len);
ZEND_API zend_int_t zend_atol(const char *str, zend_size_t str_len);
ZEND_API void zend_locale_sprintf_double(zval *op ZEND_FILE_LINE_DC);
END_EXTERN_C()
@@ -391,8 +396,8 @@ END_EXTERN_C()
case IS_NULL: \
convert_to_null(pzv); \
break; \
case IS_LONG: \
convert_to_long(pzv); \
case IS_INT: \
convert_to_int(pzv); \
break; \
case IS_DOUBLE: \
convert_to_double(pzv); \
@@ -422,7 +427,7 @@ END_EXTERN_C()
}
#define convert_to_boolean_ex(ppzv) convert_to_ex_master(ppzv, boolean, BOOL)
#define convert_to_long_ex(ppzv) convert_to_ex_master(ppzv, long, LONG)
#define convert_to_int_ex(ppzv) convert_to_ex_master(ppzv, int, INT)
#define convert_to_double_ex(ppzv) convert_to_ex_master(ppzv, double, DOUBLE)
#define convert_to_string_ex(ppzv) convert_to_ex_master(ppzv, string, STRING)
#define convert_to_array_ex(ppzv) convert_to_ex_master(ppzv, array, ARRAY)
@@ -430,7 +435,7 @@ END_EXTERN_C()
#define convert_to_null_ex(ppzv) convert_to_ex_master(ppzv, null, NULL)
#define convert_scalar_to_number_ex(ppzv) \
if (Z_TYPE_PP(ppzv)!=IS_LONG && Z_TYPE_PP(ppzv)!=IS_DOUBLE) { \
if (Z_TYPE_PP(ppzv)!=IS_INT && Z_TYPE_PP(ppzv)!=IS_DOUBLE) { \
if (!Z_ISREF_PP(ppzv)) { \
SEPARATE_ZVAL(ppzv); \
} \
@@ -438,11 +443,11 @@ END_EXTERN_C()
}
#define Z_LVAL(zval) (zval).value.lval
#define Z_IVAL(zval) (zval).value.lval
#define Z_BVAL(zval) ((zend_bool)(zval).value.lval)
#define Z_DVAL(zval) (zval).value.dval
#define Z_STRVAL(zval) (zval).value.str.val
#define Z_STRLEN(zval) (zval).value.str.len
#define Z_STRSIZE(zval) (zval).value.str.len
#define Z_ARRVAL(zval) (zval).value.ht
#define Z_AST(zval) (zval).value.ast
#define Z_OBJVAL(zval) (zval).value.obj
@@ -454,11 +459,11 @@ END_EXTERN_C()
#define Z_RESVAL(zval) (zval).value.lval
#define Z_OBJDEBUG(zval,is_tmp) (Z_OBJ_HANDLER((zval),get_debug_info)?Z_OBJ_HANDLER((zval),get_debug_info)(&(zval),&is_tmp TSRMLS_CC):(is_tmp=0,Z_OBJ_HANDLER((zval),get_properties)?Z_OBJPROP(zval):NULL))
#define Z_LVAL_P(zval_p) Z_LVAL(*zval_p)
#define Z_IVAL_P(zval_p) Z_IVAL(*zval_p)
#define Z_BVAL_P(zval_p) Z_BVAL(*zval_p)
#define Z_DVAL_P(zval_p) Z_DVAL(*zval_p)
#define Z_STRVAL_P(zval_p) Z_STRVAL(*zval_p)
#define Z_STRLEN_P(zval_p) Z_STRLEN(*zval_p)
#define Z_STRSIZE_P(zval_p) Z_STRSIZE(*zval_p)
#define Z_ARRVAL_P(zval_p) Z_ARRVAL(*zval_p)
#define Z_AST_P(zval_p) Z_AST(*zval_p)
#define Z_OBJPROP_P(zval_p) Z_OBJPROP(*zval_p)
@@ -470,11 +475,11 @@ END_EXTERN_C()
#define Z_OBJ_HANDLER_P(zval_p, h) Z_OBJ_HANDLER(*zval_p, h)
#define Z_OBJDEBUG_P(zval_p,is_tmp) Z_OBJDEBUG(*zval_p,is_tmp)
#define Z_LVAL_PP(zval_pp) Z_LVAL(**zval_pp)
#define Z_IVAL_PP(zval_pp) Z_IVAL(**zval_pp)
#define Z_BVAL_PP(zval_pp) Z_BVAL(**zval_pp)
#define Z_DVAL_PP(zval_pp) Z_DVAL(**zval_pp)
#define Z_STRVAL_PP(zval_pp) Z_STRVAL(**zval_pp)
#define Z_STRLEN_PP(zval_pp) Z_STRLEN(**zval_pp)
#define Z_STRSIZE_PP(zval_pp) Z_STRSIZE(**zval_pp)
#define Z_ARRVAL_PP(zval_pp) Z_ARRVAL(**zval_pp)
#define Z_AST_PP(zval_p) Z_AST(**zval_p)
#define Z_OBJPROP_PP(zval_pp) Z_OBJPROP(**zval_pp)
@@ -509,7 +514,7 @@ ZEND_API void zend_update_current_locale(void);
static zend_always_inline int fast_increment_function(zval *op1)
{
if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_P(op1) == IS_INT)) {
#if defined(__GNUC__) && defined(__i386__)
__asm__(
"incl (%0)\n\t"
@@ -537,12 +542,12 @@ static zend_always_inline int fast_increment_function(zval *op1)
"n"(ZVAL_OFFSETOF_TYPE)
: "cc");
#else
if (UNEXPECTED(Z_LVAL_P(op1) == LONG_MAX)) {
if (UNEXPECTED(Z_IVAL_P(op1) == ZEND_INT_MAX)) {
/* switch to double */
Z_DVAL_P(op1) = (double)LONG_MAX + 1.0;
Z_DVAL_P(op1) = (double)ZEND_INT_MAX + 1.0;
Z_TYPE_P(op1) = IS_DOUBLE;
} else {
Z_LVAL_P(op1)++;
Z_IVAL_P(op1)++;
}
#endif
return SUCCESS;
@@ -552,7 +557,7 @@ static zend_always_inline int fast_increment_function(zval *op1)
static zend_always_inline int fast_decrement_function(zval *op1)
{
if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_P(op1) == IS_INT)) {
#if defined(__GNUC__) && defined(__i386__)
__asm__(
"decl (%0)\n\t"
@@ -580,12 +585,12 @@ static zend_always_inline int fast_decrement_function(zval *op1)
"n"(ZVAL_OFFSETOF_TYPE)
: "cc");
#else
if (UNEXPECTED(Z_LVAL_P(op1) == LONG_MIN)) {
if (UNEXPECTED(Z_IVAL_P(op1) == ZEND_INT_MIN)) {
/* switch to double */
Z_DVAL_P(op1) = (double)LONG_MIN - 1.0;
Z_DVAL_P(op1) = (double)ZEND_INT_MIN - 1.0;
Z_TYPE_P(op1) = IS_DOUBLE;
} else {
Z_LVAL_P(op1)--;
Z_IVAL_P(op1)--;
}
#endif
return SUCCESS;
@@ -595,8 +600,8 @@ static zend_always_inline int fast_decrement_function(zval *op1)
static zend_always_inline int fast_add_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
if (EXPECTED(Z_TYPE_P(op1) == IS_INT)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_INT)) {
#if defined(__GNUC__) && defined(__i386__)
__asm__(
"movl (%1), %%eax\n\t"
@@ -616,7 +621,7 @@ static zend_always_inline int fast_add_function(zval *result, zval *op1, zval *o
: "r"(&result->value),
"r"(&op1->value),
"r"(&op2->value),
"n"(IS_LONG),
"n"(IS_INT),
"n"(IS_DOUBLE),
"n"(ZVAL_OFFSETOF_TYPE)
: "eax","cc");
@@ -639,7 +644,7 @@ static zend_always_inline int fast_add_function(zval *result, zval *op1, zval *o
: "r"(&result->value),
"r"(&op1->value),
"r"(&op2->value),
"n"(IS_LONG),
"n"(IS_INT),
"n"(IS_DOUBLE),
"n"(ZVAL_OFFSETOF_TYPE)
: "rax","cc");
@@ -650,18 +655,18 @@ static zend_always_inline int fast_add_function(zval *result, zval *op1, zval *o
* have read the values of op1 and op2.
*/
if (UNEXPECTED((Z_LVAL_P(op1) & LONG_SIGN_MASK) == (Z_LVAL_P(op2) & LONG_SIGN_MASK)
&& (Z_LVAL_P(op1) & LONG_SIGN_MASK) != ((Z_LVAL_P(op1) + Z_LVAL_P(op2)) & LONG_SIGN_MASK))) {
Z_DVAL_P(result) = (double) Z_LVAL_P(op1) + (double) Z_LVAL_P(op2);
if (UNEXPECTED((Z_IVAL_P(op1) & LONG_SIGN_MASK) == (Z_IVAL_P(op2) & LONG_SIGN_MASK)
&& (Z_IVAL_P(op1) & LONG_SIGN_MASK) != ((Z_IVAL_P(op1) + Z_IVAL_P(op2)) & LONG_SIGN_MASK))) {
Z_DVAL_P(result) = (double) Z_IVAL_P(op1) + (double) Z_IVAL_P(op2);
Z_TYPE_P(result) = IS_DOUBLE;
} else {
Z_LVAL_P(result) = Z_LVAL_P(op1) + Z_LVAL_P(op2);
Z_TYPE_P(result) = IS_LONG;
Z_IVAL_P(result) = Z_IVAL_P(op1) + Z_IVAL_P(op2);
Z_TYPE_P(result) = IS_INT;
}
#endif
return SUCCESS;
} else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
Z_DVAL_P(result) = ((double)Z_LVAL_P(op1)) + Z_DVAL_P(op2);
Z_DVAL_P(result) = ((double)Z_IVAL_P(op1)) + Z_DVAL_P(op2);
Z_TYPE_P(result) = IS_DOUBLE;
return SUCCESS;
}
@@ -670,8 +675,8 @@ static zend_always_inline int fast_add_function(zval *result, zval *op1, zval *o
Z_DVAL_P(result) = Z_DVAL_P(op1) + Z_DVAL_P(op2);
Z_TYPE_P(result) = IS_DOUBLE;
return SUCCESS;
} else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
Z_DVAL_P(result) = Z_DVAL_P(op1) + ((double)Z_LVAL_P(op2));
} else if (EXPECTED(Z_TYPE_P(op2) == IS_INT)) {
Z_DVAL_P(result) = Z_DVAL_P(op1) + ((double)Z_IVAL_P(op2));
Z_TYPE_P(result) = IS_DOUBLE;
return SUCCESS;
}
@@ -681,8 +686,8 @@ static zend_always_inline int fast_add_function(zval *result, zval *op1, zval *o
static zend_always_inline int fast_sub_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
if (EXPECTED(Z_TYPE_P(op1) == IS_INT)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_INT)) {
#if defined(__GNUC__) && defined(__i386__)
__asm__(
"movl (%1), %%eax\n\t"
@@ -706,7 +711,7 @@ static zend_always_inline int fast_sub_function(zval *result, zval *op1, zval *o
: "r"(&result->value),
"r"(&op1->value),
"r"(&op2->value),
"n"(IS_LONG),
"n"(IS_INT),
"n"(IS_DOUBLE),
"n"(ZVAL_OFFSETOF_TYPE)
: "eax","cc");
@@ -733,24 +738,24 @@ static zend_always_inline int fast_sub_function(zval *result, zval *op1, zval *o
: "r"(&result->value),
"r"(&op1->value),
"r"(&op2->value),
"n"(IS_LONG),
"n"(IS_INT),
"n"(IS_DOUBLE),
"n"(ZVAL_OFFSETOF_TYPE)
: "rax","cc");
#else
Z_LVAL_P(result) = Z_LVAL_P(op1) - Z_LVAL_P(op2);
Z_IVAL_P(result) = Z_IVAL_P(op1) - Z_IVAL_P(op2);
if (UNEXPECTED((Z_LVAL_P(op1) & LONG_SIGN_MASK) != (Z_LVAL_P(op2) & LONG_SIGN_MASK)
&& (Z_LVAL_P(op1) & LONG_SIGN_MASK) != (Z_LVAL_P(result) & LONG_SIGN_MASK))) {
Z_DVAL_P(result) = (double) Z_LVAL_P(op1) - (double) Z_LVAL_P(op2);
if (UNEXPECTED((Z_IVAL_P(op1) & LONG_SIGN_MASK) != (Z_IVAL_P(op2) & LONG_SIGN_MASK)
&& (Z_IVAL_P(op1) & LONG_SIGN_MASK) != (Z_IVAL_P(result) & LONG_SIGN_MASK))) {
Z_DVAL_P(result) = (double) Z_IVAL_P(op1) - (double) Z_IVAL_P(op2);
Z_TYPE_P(result) = IS_DOUBLE;
} else {
Z_TYPE_P(result) = IS_LONG;
Z_TYPE_P(result) = IS_INT;
}
#endif
return SUCCESS;
} else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
Z_DVAL_P(result) = ((double)Z_LVAL_P(op1)) - Z_DVAL_P(op2);
Z_DVAL_P(result) = ((double)Z_IVAL_P(op1)) - Z_DVAL_P(op2);
Z_TYPE_P(result) = IS_DOUBLE;
return SUCCESS;
}
@@ -759,8 +764,8 @@ static zend_always_inline int fast_sub_function(zval *result, zval *op1, zval *o
Z_DVAL_P(result) = Z_DVAL_P(op1) - Z_DVAL_P(op2);
Z_TYPE_P(result) = IS_DOUBLE;
return SUCCESS;
} else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
Z_DVAL_P(result) = Z_DVAL_P(op1) - ((double)Z_LVAL_P(op2));
} else if (EXPECTED(Z_TYPE_P(op2) == IS_INT)) {
Z_DVAL_P(result) = Z_DVAL_P(op1) - ((double)Z_IVAL_P(op2));
Z_TYPE_P(result) = IS_DOUBLE;
return SUCCESS;
}
@@ -770,15 +775,15 @@ static zend_always_inline int fast_sub_function(zval *result, zval *op1, zval *o
static zend_always_inline int fast_mul_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
long overflow;
if (EXPECTED(Z_TYPE_P(op1) == IS_INT)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_INT)) {
zend_int_t overflow;
ZEND_SIGNED_MULTIPLY_LONG(Z_LVAL_P(op1), Z_LVAL_P(op2), Z_LVAL_P(result), Z_DVAL_P(result), overflow);
Z_TYPE_P(result) = overflow ? IS_DOUBLE : IS_LONG;
ZEND_SIGNED_MULTIPLY_INT(Z_IVAL_P(op1), Z_IVAL_P(op2), Z_IVAL_P(result), Z_DVAL_P(result), overflow);
Z_TYPE_P(result) = overflow ? IS_DOUBLE : IS_INT;
return SUCCESS;
} else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
Z_DVAL_P(result) = ((double)Z_LVAL_P(op1)) * Z_DVAL_P(op2);
Z_DVAL_P(result) = ((double)Z_IVAL_P(op1)) * Z_DVAL_P(op2);
Z_TYPE_P(result) = IS_DOUBLE;
return SUCCESS;
}
@@ -787,8 +792,8 @@ static zend_always_inline int fast_mul_function(zval *result, zval *op1, zval *o
Z_DVAL_P(result) = Z_DVAL_P(op1) * Z_DVAL_P(op2);
Z_TYPE_P(result) = IS_DOUBLE;
return SUCCESS;
} else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
Z_DVAL_P(result) = Z_DVAL_P(op1) * ((double)Z_LVAL_P(op2));
} else if (EXPECTED(Z_TYPE_P(op2) == IS_INT)) {
Z_DVAL_P(result) = Z_DVAL_P(op1) * ((double)Z_IVAL_P(op2));
Z_TYPE_P(result) = IS_DOUBLE;
return SUCCESS;
}
@@ -799,34 +804,34 @@ static zend_always_inline int fast_mul_function(zval *result, zval *op1, zval *o
static zend_always_inline int fast_div_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
#if 0
if (EXPECTED(Z_TYPE_P(op1) == IS_LONG) && 0) {
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
if (UNEXPECTED(Z_LVAL_P(op2) == 0)) {
if (EXPECTED(Z_TYPE_P(op1) == IS_INT) && 0) {
if (EXPECTED(Z_TYPE_P(op2) == IS_INT)) {
if (UNEXPECTED(Z_IVAL_P(op2) == 0)) {
zend_error(E_WARNING, "Division by zero");
Z_LVAL_P(result) = 0;
Z_IVAL_P(result) = 0;
Z_TYPE_P(result) = IS_BOOL;
return FAILURE;
} else if (UNEXPECTED(Z_LVAL_P(op2) == -1 && Z_LVAL_P(op1) == LONG_MIN)) {
} else if (UNEXPECTED(Z_IVAL_P(op2) == -1 && Z_IVAL_P(op1) == ZEND_INT_MIN)) {
/* Prevent overflow error/crash */
Z_DVAL_P(result) = (double) LONG_MIN / -1;
Z_DVAL_P(result) = (double) ZEND_INT_MIN / -1;
Z_TYPE_P(result) = IS_DOUBLE;
} else if (EXPECTED(Z_LVAL_P(op1) % Z_LVAL_P(op2) == 0)) {
} else if (EXPECTED(Z_IVAL_P(op1) % Z_IVAL_P(op2) == 0)) {
/* integer */
Z_LVAL_P(result) = Z_LVAL_P(op1) / Z_LVAL_P(op2);
Z_TYPE_P(result) = IS_LONG;
Z_IVAL_P(result) = Z_IVAL_P(op1) / Z_IVAL_P(op2);
Z_TYPE_P(result) = IS_INT;
} else {
Z_DVAL_P(result) = ((double) Z_LVAL_P(op1)) / ((double)Z_LVAL_P(op2));
Z_DVAL_P(result) = ((double) Z_IVAL_P(op1)) / ((double)Z_IVAL_P(op2));
Z_TYPE_P(result) = IS_DOUBLE;
}
return SUCCESS;
} else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
if (UNEXPECTED(Z_DVAL_P(op2) == 0)) {
zend_error(E_WARNING, "Division by zero");
Z_LVAL_P(result) = 0;
Z_IVAL_P(result) = 0;
Z_TYPE_P(result) = IS_BOOL;
return FAILURE;
}
Z_DVAL_P(result) = ((double)Z_LVAL_P(op1)) / Z_DVAL_P(op2);
Z_DVAL_P(result) = ((double)Z_IVAL_P(op1)) / Z_DVAL_P(op2);
Z_TYPE_P(result) = IS_DOUBLE;
return SUCCESS;
}
@@ -834,21 +839,21 @@ static zend_always_inline int fast_div_function(zval *result, zval *op1, zval *o
if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
if (UNEXPECTED(Z_DVAL_P(op2) == 0)) {
zend_error(E_WARNING, "Division by zero");
Z_LVAL_P(result) = 0;
Z_IVAL_P(result) = 0;
Z_TYPE_P(result) = IS_BOOL;
return FAILURE;
}
Z_DVAL_P(result) = Z_DVAL_P(op1) / Z_DVAL_P(op2);
Z_TYPE_P(result) = IS_DOUBLE;
return SUCCESS;
} else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
if (UNEXPECTED(Z_LVAL_P(op2) == 0)) {
} else if (EXPECTED(Z_TYPE_P(op2) == IS_INT)) {
if (UNEXPECTED(Z_IVAL_P(op2) == 0)) {
zend_error(E_WARNING, "Division by zero");
Z_LVAL_P(result) = 0;
Z_IVAL_P(result) = 0;
Z_TYPE_P(result) = IS_BOOL;
return FAILURE;
}
Z_DVAL_P(result) = Z_DVAL_P(op1) / ((double)Z_LVAL_P(op2));
Z_DVAL_P(result) = Z_DVAL_P(op1) / ((double)Z_IVAL_P(op2));
Z_TYPE_P(result) = IS_DOUBLE;
return SUCCESS;
}
@@ -859,21 +864,21 @@ static zend_always_inline int fast_div_function(zval *result, zval *op1, zval *o
static zend_always_inline int fast_mod_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
if (UNEXPECTED(Z_LVAL_P(op2) == 0)) {
if (EXPECTED(Z_TYPE_P(op1) == IS_INT)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_INT)) {
if (UNEXPECTED(Z_IVAL_P(op2) == 0)) {
zend_error(E_WARNING, "Division by zero");
Z_LVAL_P(result) = 0;
Z_IVAL_P(result) = 0;
Z_TYPE_P(result) = IS_BOOL;
return FAILURE;
} else if (UNEXPECTED(Z_LVAL_P(op2) == -1)) {
} else if (UNEXPECTED(Z_IVAL_P(op2) == -1)) {
/* Prevent overflow error/crash if op1==LONG_MIN */
Z_LVAL_P(result) = 0;
Z_TYPE_P(result) = IS_LONG;
Z_IVAL_P(result) = 0;
Z_TYPE_P(result) = IS_INT;
return SUCCESS;
}
Z_LVAL_P(result) = Z_LVAL_P(op1) % Z_LVAL_P(op2);
Z_TYPE_P(result) = IS_LONG;
Z_IVAL_P(result) = Z_IVAL_P(op1) % Z_IVAL_P(op2);
Z_TYPE_P(result) = IS_INT;
return SUCCESS;
}
}
@@ -882,78 +887,78 @@ static zend_always_inline int fast_mod_function(zval *result, zval *op1, zval *o
static zend_always_inline int fast_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
return Z_LVAL_P(op1) == Z_LVAL_P(op2);
if (EXPECTED(Z_TYPE_P(op1) == IS_INT)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_INT)) {
return Z_IVAL_P(op1) == Z_IVAL_P(op2);
} else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
return ((double)Z_LVAL_P(op1)) == Z_DVAL_P(op2);
return ((double)Z_IVAL_P(op1)) == Z_DVAL_P(op2);
}
} else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
return Z_DVAL_P(op1) == Z_DVAL_P(op2);
} else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
return Z_DVAL_P(op1) == ((double)Z_LVAL_P(op2));
} else if (EXPECTED(Z_TYPE_P(op2) == IS_INT)) {
return Z_DVAL_P(op1) == ((double)Z_IVAL_P(op2));
}
}
compare_function(result, op1, op2 TSRMLS_CC);
return Z_LVAL_P(result) == 0;
return Z_IVAL_P(result) == 0;
}
static zend_always_inline int fast_not_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
return Z_LVAL_P(op1) != Z_LVAL_P(op2);
if (EXPECTED(Z_TYPE_P(op1) == IS_INT)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_INT)) {
return Z_IVAL_P(op1) != Z_IVAL_P(op2);
} else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
return ((double)Z_LVAL_P(op1)) != Z_DVAL_P(op2);
return ((double)Z_IVAL_P(op1)) != Z_DVAL_P(op2);
}
} else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
return Z_DVAL_P(op1) != Z_DVAL_P(op2);
} else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
return Z_DVAL_P(op1) != ((double)Z_LVAL_P(op2));
} else if (EXPECTED(Z_TYPE_P(op2) == IS_INT)) {
return Z_DVAL_P(op1) != ((double)Z_IVAL_P(op2));
}
}
compare_function(result, op1, op2 TSRMLS_CC);
return Z_LVAL_P(result) != 0;
return Z_IVAL_P(result) != 0;
}
static zend_always_inline int fast_is_smaller_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
return Z_LVAL_P(op1) < Z_LVAL_P(op2);
if (EXPECTED(Z_TYPE_P(op1) == IS_INT)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_INT)) {
return Z_IVAL_P(op1) < Z_IVAL_P(op2);
} else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
return ((double)Z_LVAL_P(op1)) < Z_DVAL_P(op2);
return ((double)Z_IVAL_P(op1)) < Z_DVAL_P(op2);
}
} else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
return Z_DVAL_P(op1) < Z_DVAL_P(op2);
} else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
return Z_DVAL_P(op1) < ((double)Z_LVAL_P(op2));
} else if (EXPECTED(Z_TYPE_P(op2) == IS_INT)) {
return Z_DVAL_P(op1) < ((double)Z_IVAL_P(op2));
}
}
compare_function(result, op1, op2 TSRMLS_CC);
return Z_LVAL_P(result) < 0;
return Z_IVAL_P(result) < 0;
}
static zend_always_inline int fast_is_smaller_or_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
return Z_LVAL_P(op1) <= Z_LVAL_P(op2);
if (EXPECTED(Z_TYPE_P(op1) == IS_INT)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_INT)) {
return Z_IVAL_P(op1) <= Z_IVAL_P(op2);
} else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
return ((double)Z_LVAL_P(op1)) <= Z_DVAL_P(op2);
return ((double)Z_IVAL_P(op1)) <= Z_DVAL_P(op2);
}
} else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
return Z_DVAL_P(op1) <= Z_DVAL_P(op2);
} else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
return Z_DVAL_P(op1) <= ((double)Z_LVAL_P(op2));
} else if (EXPECTED(Z_TYPE_P(op2) == IS_INT)) {
return Z_DVAL_P(op1) <= ((double)Z_IVAL_P(op2));
}
}
compare_function(result, op1, op2 TSRMLS_CC);
return Z_LVAL_P(result) <= 0;
return Z_IVAL_P(result) <= 0;
}
#define ZEND_TRY_BINARY_OBJECT_OPERATION(opcode) \
+1 -1
View File
@@ -23,7 +23,7 @@
#define ZEND_PTR_STACK_H
typedef struct _zend_ptr_stack {
int top, max;
ptrdiff_t top, max;
void **elements;
void **top_element;
zend_bool persistent;
+1 -1
View File
@@ -74,7 +74,7 @@ ZEND_API void zend_qsort_r(void *base, size_t nmemb, size_t siz, compare_r_func_
end = end_stack[loop];
while (begin < end) {
offset = (end - begin) >> 1;
offset = (end - begin) >> Z_I(1);
_zend_qsort_swap(begin, begin + (offset - (offset % siz)), siz);
seg1 = begin + siz;
+7 -7
View File
@@ -30,7 +30,7 @@ ZEND_API int zend_stack_init(zend_stack *stack)
return SUCCESS;
}
ZEND_API int zend_stack_push(zend_stack *stack, const void *element, int size)
ZEND_API zend_size_t zend_stack_push(zend_stack *stack, const void *element, zend_size_t size)
{
if (stack->top >= stack->max) { /* we need to allocate more memory */
stack->elements = (void **) erealloc(stack->elements,
@@ -90,7 +90,7 @@ ZEND_API int zend_stack_is_empty(const zend_stack *stack)
ZEND_API int zend_stack_destroy(zend_stack *stack)
{
int i;
zend_size_t i;
if (stack->elements) {
for (i = 0; i < stack->top; i++) {
@@ -110,7 +110,7 @@ ZEND_API void **zend_stack_base(const zend_stack *stack)
}
ZEND_API int zend_stack_count(const zend_stack *stack)
ZEND_API zend_size_t zend_stack_count(const zend_stack *stack)
{
return stack->top;
}
@@ -118,11 +118,11 @@ ZEND_API int zend_stack_count(const zend_stack *stack)
ZEND_API void zend_stack_apply(zend_stack *stack, int type, int (*apply_function)(void *element))
{
int i;
zend_size_t i;
switch (type) {
case ZEND_STACK_APPLY_TOPDOWN:
for (i=stack->top-1; i>=0; i--) {
for (i=stack->top-1; i < ZEND_SIZE_MAX; i--) {
if (apply_function(stack->elements[i])) {
break;
}
@@ -141,11 +141,11 @@ ZEND_API void zend_stack_apply(zend_stack *stack, int type, int (*apply_function
ZEND_API void zend_stack_apply_with_argument(zend_stack *stack, int type, int (*apply_function)(void *element, void *arg), void *arg)
{
int i;
zend_size_t i;
switch (type) {
case ZEND_STACK_APPLY_TOPDOWN:
for (i=stack->top-1; i>=0; i--) {
for (i = stack->top - 1; i < ZEND_SIZE_MAX; i--) {
if (apply_function(stack->elements[i], arg)) {
break;
}
+3 -3
View File
@@ -23,7 +23,7 @@
#define ZEND_STACK_H
typedef struct _zend_stack {
int top, max;
zend_size_t top, max;
void **elements;
} zend_stack;
@@ -32,14 +32,14 @@ typedef struct _zend_stack {
BEGIN_EXTERN_C()
ZEND_API int zend_stack_init(zend_stack *stack);
ZEND_API int zend_stack_push(zend_stack *stack, const void *element, int size);
ZEND_API zend_size_t zend_stack_push(zend_stack *stack, const void *element, zend_size_t size);
ZEND_API int zend_stack_top(const zend_stack *stack, void **element);
ZEND_API int zend_stack_del_top(zend_stack *stack);
ZEND_API int zend_stack_int_top(const zend_stack *stack);
ZEND_API int zend_stack_is_empty(const zend_stack *stack);
ZEND_API int zend_stack_destroy(zend_stack *stack);
ZEND_API void **zend_stack_base(const zend_stack *stack);
ZEND_API int zend_stack_count(const zend_stack *stack);
ZEND_API zend_size_t zend_stack_count(const zend_stack *stack);
ZEND_API void zend_stack_apply(zend_stack *stack, int type, int (*apply_function)(void *element));
ZEND_API void zend_stack_apply_with_argument(zend_stack *stack, int type, int (*apply_function)(void *element, void *arg), void *arg);
END_EXTERN_C()
+4 -5
View File
@@ -24,9 +24,8 @@
#include "zend.h"
#include "zend_compile.h"
#include "zend_stream.h"
#include <sys/types.h>
#include <sys/stat.h>
#if HAVE_MMAP
# if HAVE_UNISTD_H
# include <unistd.h>
@@ -64,8 +63,8 @@ static void zend_stream_stdio_closer(void *handle TSRMLS_DC) /* {{{ */
static size_t zend_stream_stdio_fsizer(void *handle TSRMLS_DC) /* {{{ */
{
struct stat buf;
if (handle && fstat(fileno((FILE*)handle), &buf) == 0) {
zend_stat_t buf;
if (handle && zend_fstat(fileno((FILE*)handle), &buf) == 0) {
#ifdef S_ISREG
if (!S_ISREG(buf.st_mode)) {
return 0;
@@ -237,7 +236,7 @@ ZEND_API int zend_stream_fixup(zend_file_handle *file_handle, char **buf, size_t
/* *buf[size] is zeroed automatically by the kernel */
*buf = mmap(0, size + ZEND_MMAP_AHEAD, PROT_READ, MAP_PRIVATE, fileno(file_handle->handle.fp), 0);
if (*buf != MAP_FAILED) {
long offset = ftell(file_handle->handle.fp);
zend_int_t offset = zend_ftell(file_handle->handle.fp);
file_handle->handle.stream.mmap.map = *buf;
if (offset != -1) {
+22 -3
View File
@@ -24,6 +24,9 @@
#ifndef ZEND_STREAM_H
#define ZEND_STREAM_H
#include <sys/types.h>
#include <sys/stat.h>
/* Lightweight stream implementation for the ZE scanners.
* These functions are private to the engine.
* */
@@ -60,14 +63,14 @@ typedef struct _zend_stream {
} zend_stream;
typedef struct _zend_file_handle {
zend_stream_type type;
const char *filename;
char *opened_path;
union {
int fd;
FILE *fp;
zend_stream stream;
} handle;
const char *filename;
char *opened_path;
zend_stream_type type;
zend_bool free_filename;
} zend_file_handle;
@@ -78,4 +81,20 @@ ZEND_API void zend_file_handle_dtor(zend_file_handle *fh TSRMLS_DC);
ZEND_API int zend_compare_file_handles(zend_file_handle *fh1, zend_file_handle *fh2);
END_EXTERN_C()
#ifdef _WIN64
# define zend_fseek _fseeki64
# define zend_ftell _ftelli64
# define zend_lseek _lseeki64
# define zend_fstat _fstat64
# define zend_stat _stat64
typedef struct __stat64 zend_stat_t;
#else
# define zend_fseek fseek
# define zend_ftell ftell
# define zend_lseek lseek
# define zend_fstat fstat
# define zend_stat stat
typedef struct stat zend_stat_t;
#endif
#endif
+4 -4
View File
@@ -29,11 +29,11 @@
# include <sys/mman.h>
#endif
ZEND_API const char *(*zend_new_interned_string)(const char *str, int len, int free_src TSRMLS_DC);
ZEND_API const char *(*zend_new_interned_string)(const char *str, zend_size_t len, int free_src TSRMLS_DC);
ZEND_API void (*zend_interned_strings_snapshot)(TSRMLS_D);
ZEND_API void (*zend_interned_strings_restore)(TSRMLS_D);
static const char *zend_new_interned_string_int(const char *str, int len, int free_src TSRMLS_DC);
static const char *zend_new_interned_string_int(const char *str, zend_size_t len, int free_src TSRMLS_DC);
static void zend_interned_strings_snapshot_int(TSRMLS_D);
static void zend_interned_strings_restore_int(TSRMLS_D);
@@ -81,10 +81,10 @@ void zend_interned_strings_dtor(TSRMLS_D)
#endif
}
static const char *zend_new_interned_string_int(const char *arKey, int nKeyLength, int free_src TSRMLS_DC)
static const char *zend_new_interned_string_int(const char *arKey, zend_size_t nKeyLength, int free_src TSRMLS_DC)
{
#ifndef ZTS
ulong h;
zend_uint_t h;
uint nIndex;
Bucket *p;
+1 -1
View File
@@ -24,7 +24,7 @@
#include "zend.h"
BEGIN_EXTERN_C()
ZEND_API extern const char *(*zend_new_interned_string)(const char *str, int len, int free_src TSRMLS_DC);
ZEND_API extern const char *(*zend_new_interned_string)(const char *str, zend_size_t len, int free_src TSRMLS_DC);
ZEND_API extern void (*zend_interned_strings_snapshot)(TSRMLS_D);
ZEND_API extern void (*zend_interned_strings_restore)(TSRMLS_D);
+12 -12
View File
@@ -99,7 +99,7 @@ ZEND_API void zend_ts_hash_clean(TsHashTable *ht)
end_write(ht);
}
ZEND_API int _zend_ts_hash_add_or_update(TsHashTable *ht, char *arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC)
ZEND_API int _zend_ts_hash_add_or_update(TsHashTable *ht, char *arKey, zend_size_t nKeyLength, void *pData, zend_size_t nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC)
{
int retval;
@@ -110,7 +110,7 @@ ZEND_API int _zend_ts_hash_add_or_update(TsHashTable *ht, char *arKey, uint nKey
return retval;
}
ZEND_API int _zend_ts_hash_quick_add_or_update(TsHashTable *ht, char *arKey, uint nKeyLength, ulong h, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC)
ZEND_API int _zend_ts_hash_quick_add_or_update(TsHashTable *ht, char *arKey, zend_size_t nKeyLength, zend_uint_t h, void *pData, zend_size_t nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC)
{
int retval;
@@ -121,7 +121,7 @@ ZEND_API int _zend_ts_hash_quick_add_or_update(TsHashTable *ht, char *arKey, uin
return retval;
}
ZEND_API int _zend_ts_hash_index_update_or_next_insert(TsHashTable *ht, ulong h, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC)
ZEND_API int _zend_ts_hash_index_update_or_next_insert(TsHashTable *ht, zend_uint_t h, void *pData, zend_size_t nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC)
{
int retval;
@@ -132,7 +132,7 @@ ZEND_API int _zend_ts_hash_index_update_or_next_insert(TsHashTable *ht, ulong h,
return retval;
}
ZEND_API int zend_ts_hash_add_empty_element(TsHashTable *ht, char *arKey, uint nKeyLength)
ZEND_API int zend_ts_hash_add_empty_element(TsHashTable *ht, char *arKey, zend_size_t nKeyLength)
{
int retval;
@@ -187,7 +187,7 @@ ZEND_API void zend_ts_hash_reverse_apply(TsHashTable *ht, apply_func_t apply_fun
end_write(ht);
}
ZEND_API int zend_ts_hash_del_key_or_index(TsHashTable *ht, char *arKey, uint nKeyLength, ulong h, int flag)
ZEND_API int zend_ts_hash_del_key_or_index(TsHashTable *ht, char *arKey, zend_size_t nKeyLength, zend_uint_t h, int flag)
{
int retval;
@@ -198,9 +198,9 @@ ZEND_API int zend_ts_hash_del_key_or_index(TsHashTable *ht, char *arKey, uint nK
return retval;
}
ZEND_API ulong zend_ts_get_hash_value(TsHashTable *ht, char *arKey, uint nKeyLength)
ZEND_API zend_uint_t zend_ts_get_hash_value(TsHashTable *ht, char *arKey, zend_size_t nKeyLength)
{
ulong retval;
zend_uint_t retval;
begin_read(ht);
retval = zend_get_hash_value(arKey, nKeyLength);
@@ -209,7 +209,7 @@ ZEND_API ulong zend_ts_get_hash_value(TsHashTable *ht, char *arKey, uint nKeyLen
return retval;
}
ZEND_API int zend_ts_hash_find(TsHashTable *ht, char *arKey, uint nKeyLength, void **pData)
ZEND_API int zend_ts_hash_find(TsHashTable *ht, char *arKey, zend_size_t nKeyLength, void **pData)
{
int retval;
@@ -220,7 +220,7 @@ ZEND_API int zend_ts_hash_find(TsHashTable *ht, char *arKey, uint nKeyLength, vo
return retval;
}
ZEND_API int zend_ts_hash_quick_find(TsHashTable *ht, char *arKey, uint nKeyLength, ulong h, void **pData)
ZEND_API int zend_ts_hash_quick_find(TsHashTable *ht, char *arKey, zend_size_t nKeyLength, zend_uint_t h, void **pData)
{
int retval;
@@ -231,7 +231,7 @@ ZEND_API int zend_ts_hash_quick_find(TsHashTable *ht, char *arKey, uint nKeyLeng
return retval;
}
ZEND_API int zend_ts_hash_index_find(TsHashTable *ht, ulong h, void **pData)
ZEND_API int zend_ts_hash_index_find(TsHashTable *ht, zend_uint_t h, void **pData)
{
int retval;
@@ -242,7 +242,7 @@ ZEND_API int zend_ts_hash_index_find(TsHashTable *ht, ulong h, void **pData)
return retval;
}
ZEND_API int zend_ts_hash_exists(TsHashTable *ht, char *arKey, uint nKeyLength)
ZEND_API int zend_ts_hash_exists(TsHashTable *ht, char *arKey, zend_size_t nKeyLength)
{
int retval;
@@ -253,7 +253,7 @@ ZEND_API int zend_ts_hash_exists(TsHashTable *ht, char *arKey, uint nKeyLength)
return retval;
}
ZEND_API int zend_ts_hash_index_exists(TsHashTable *ht, ulong h)
ZEND_API int zend_ts_hash_index_exists(TsHashTable *ht, zend_uint_t h)
{
int retval;
+12 -12
View File
@@ -49,25 +49,25 @@ ZEND_API void zend_ts_hash_clean(TsHashTable *ht);
/* additions/updates/changes */
ZEND_API int _zend_ts_hash_add_or_update(TsHashTable *ht, char *arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC);
ZEND_API int _zend_ts_hash_add_or_update(TsHashTable *ht, char *arKey, zend_size_t nKeyLength, void *pData, zend_size_t nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC);
#define zend_ts_hash_update(ht, arKey, nKeyLength, pData, nDataSize, pDest) \
_zend_ts_hash_add_or_update(ht, arKey, nKeyLength, pData, nDataSize, pDest, HASH_UPDATE ZEND_FILE_LINE_CC)
#define zend_ts_hash_add(ht, arKey, nKeyLength, pData, nDataSize, pDest) \
_zend_ts_hash_add_or_update(ht, arKey, nKeyLength, pData, nDataSize, pDest, HASH_ADD ZEND_FILE_LINE_CC)
ZEND_API int _zend_ts_hash_quick_add_or_update(TsHashTable *ht, char *arKey, uint nKeyLength, ulong h, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC);
ZEND_API int _zend_ts_hash_quick_add_or_update(TsHashTable *ht, char *arKey, zend_size_t nKeyLength, zend_uint_t h, void *pData, zend_size_t nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC);
#define zend_ts_hash_quick_update(ht, arKey, nKeyLength, h, pData, nDataSize, pDest) \
_zend_ts_hash_quick_add_or_update(ht, arKey, nKeyLength, h, pData, nDataSize, pDest, HASH_UPDATE ZEND_FILE_LINE_CC)
#define zend_ts_hash_quick_add(ht, arKey, nKeyLength, h, pData, nDataSize, pDest) \
_zend_ts_hash_quick_add_or_update(ht, arKey, nKeyLength, h, pData, nDataSize, pDest, HASH_ADD ZEND_FILE_LINE_CC)
ZEND_API int _zend_ts_hash_index_update_or_next_insert(TsHashTable *ht, ulong h, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC);
ZEND_API int _zend_ts_hash_index_update_or_next_insert(TsHashTable *ht, zend_uint_t h, void *pData, zend_size_t nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC);
#define zend_ts_hash_index_update(ht, h, pData, nDataSize, pDest) \
_zend_ts_hash_index_update_or_next_insert(ht, h, pData, nDataSize, pDest, HASH_UPDATE ZEND_FILE_LINE_CC)
#define zend_ts_hash_next_index_insert(ht, pData, nDataSize, pDest) \
_zend_ts_hash_index_update_or_next_insert(ht, 0, pData, nDataSize, pDest, HASH_NEXT_INSERT ZEND_FILE_LINE_CC)
ZEND_API int zend_ts_hash_add_empty_element(TsHashTable *ht, char *arKey, uint nKeyLength);
ZEND_API int zend_ts_hash_add_empty_element(TsHashTable *ht, char *arKey, zend_size_t nKeyLength);
ZEND_API void zend_ts_hash_graceful_destroy(TsHashTable *ht);
ZEND_API void zend_ts_hash_apply(TsHashTable *ht, apply_func_t apply_func TSRMLS_DC);
@@ -78,22 +78,22 @@ ZEND_API void zend_ts_hash_reverse_apply(TsHashTable *ht, apply_func_t apply_fun
/* Deletes */
ZEND_API int zend_ts_hash_del_key_or_index(TsHashTable *ht, char *arKey, uint nKeyLength, ulong h, int flag);
ZEND_API int zend_ts_hash_del_key_or_index(TsHashTable *ht, char *arKey, zend_size_t nKeyLength, zend_uint_t h, int flag);
#define zend_ts_hash_del(ht, arKey, nKeyLength) \
zend_ts_hash_del_key_or_index(ht, arKey, nKeyLength, 0, HASH_DEL_KEY)
#define zend_ts_hash_index_del(ht, h) \
zend_ts_hash_del_key_or_index(ht, NULL, 0, h, HASH_DEL_INDEX)
ZEND_API ulong zend_ts_get_hash_value(TsHashTable *ht, char *arKey, uint nKeyLength);
ZEND_API zend_uint_t zend_ts_get_hash_value(TsHashTable *ht, char *arKey, zend_size_t nKeyLength);
/* Data retreival */
ZEND_API int zend_ts_hash_find(TsHashTable *ht, char *arKey, uint nKeyLength, void **pData);
ZEND_API int zend_ts_hash_quick_find(TsHashTable *ht, char *arKey, uint nKeyLength, ulong h, void **pData);
ZEND_API int zend_ts_hash_index_find(TsHashTable *ht, ulong h, void **pData);
ZEND_API int zend_ts_hash_find(TsHashTable *ht, char *arKey, zend_size_t nKeyLength, void **pData);
ZEND_API int zend_ts_hash_quick_find(TsHashTable *ht, char *arKey, zend_size_t nKeyLength, zend_uint_t h, void **pData);
ZEND_API int zend_ts_hash_index_find(TsHashTable *ht, zend_uint_t h, void **pData);
/* Misc */
ZEND_API int zend_ts_hash_exists(TsHashTable *ht, char *arKey, uint nKeyLength);
ZEND_API int zend_ts_hash_index_exists(TsHashTable *ht, ulong h);
ZEND_API int zend_ts_hash_exists(TsHashTable *ht, char *arKey, zend_size_t nKeyLength);
ZEND_API int zend_ts_hash_index_exists(TsHashTable *ht, zend_uint_t h);
/* Copying, merging and sorting */
ZEND_API void zend_ts_hash_copy(TsHashTable *target, TsHashTable *source, copy_ctor_func_t pCopyConstructor, void *tmp, uint size);
@@ -108,7 +108,7 @@ ZEND_API int zend_ts_hash_num_elements(TsHashTable *ht);
ZEND_API int zend_ts_hash_rehash(TsHashTable *ht);
ZEND_API ulong zend_ts_hash_func(char *arKey, uint nKeyLength);
ZEND_API zend_uint_t zend_ts_hash_func(char *arKey, uint nKeyLength);
#if ZEND_DEBUG
/* debug */
+17
View File
@@ -22,12 +22,29 @@
#ifndef ZEND_TYPES_H
#define ZEND_TYPES_H
#include "zend_int.h"
typedef unsigned char zend_bool;
typedef unsigned char zend_uchar;
typedef unsigned int zend_uint;
typedef unsigned long zend_ulong;
typedef unsigned short zend_ushort;
#ifdef ZEND_ENABLE_INT64
# ifdef ZEND_WIN32
# define ZEND_SIZE_MAX _UI64_MAX
# else
# define ZEND_SIZE_MAX SIZE_MAX
# endif
#else
# if defined(ZEND_WIN32)
# define ZEND_SIZE_MAX _UI32_MAX
# else
# define ZEND_SIZE_MAX SIZE_MAX
# endif
#endif
typedef size_t zend_size_t;
#define HAVE_ZEND_LONG64
#ifdef ZEND_WIN32
typedef __int64 zend_long64;
+4 -4
View File
@@ -65,7 +65,7 @@ ZEND_API void _zval_dtor_func(zval *zvalue ZEND_FILE_LINE_DC)
zend_list_delete(zvalue->value.lval);
}
break;
case IS_LONG:
case IS_INT:
case IS_DOUBLE:
case IS_BOOL:
case IS_NULL:
@@ -90,7 +90,7 @@ ZEND_API void _zval_internal_dtor(zval *zvalue ZEND_FILE_LINE_DC)
case IS_RESOURCE:
zend_error(E_CORE_ERROR, "Internal zval's can't be arrays, objects or resources");
break;
case IS_LONG:
case IS_INT:
case IS_DOUBLE:
case IS_BOOL:
case IS_NULL:
@@ -116,7 +116,7 @@ ZEND_API void _zval_copy_ctor_func(zval *zvalue ZEND_FILE_LINE_DC)
}
break;
case IS_BOOL:
case IS_LONG:
case IS_INT:
case IS_NULL:
break;
case IS_CONSTANT:
@@ -154,7 +154,7 @@ ZEND_API void _zval_copy_ctor_func(zval *zvalue ZEND_FILE_LINE_DC)
}
ZEND_API int zend_print_variable(zval *var)
ZEND_API zend_size_t zend_print_variable(zval *var)
{
return zend_print_zval(var, 0);
}
+1 -1
View File
@@ -47,7 +47,7 @@ static zend_always_inline void _zval_copy_ctor(zval *zvalue ZEND_FILE_LINE_DC)
ZEND_API int zval_copy_static_var(zval **p TSRMLS_DC, int num_args, va_list args, zend_hash_key *key);
ZEND_API int zend_print_variable(zval *var);
ZEND_API zend_size_t zend_print_variable(zval *var);
ZEND_API void _zval_ptr_dtor(zval **zval_ptr ZEND_FILE_LINE_DC);
ZEND_API void _zval_internal_dtor(zval *zvalue ZEND_FILE_LINE_DC);
ZEND_API void _zval_internal_ptr_dtor(zval **zvalue ZEND_FILE_LINE_DC);
+25 -25
View File
@@ -291,7 +291,7 @@ CWD_API int php_sys_readlink(const char *link, char *target, size_t target_len){
}
/* }}} */
CWD_API int php_sys_stat_ex(const char *path, struct stat *buf, int lstat) /* {{{ */
CWD_API int php_sys_stat_ex(const char *path, zend_stat_t *buf, int lstat) /* {{{ */
{
WIN32_FILE_ATTRIBUTE_DATA data;
__int64 t;
@@ -299,7 +299,7 @@ CWD_API int php_sys_stat_ex(const char *path, struct stat *buf, int lstat) /* {{
ALLOCA_FLAG(use_heap_large);
if (!GetFileAttributesEx(path, GetFileExInfoStandard, &data)) {
return stat(path, buf);
return zend_stat(path, buf);
}
if (path_len >= 1 && path[1] == ':') {
@@ -407,7 +407,7 @@ CWD_API int php_sys_stat_ex(const char *path, struct stat *buf, int lstat) /* {{
static int php_is_dir_ok(const cwd_state *state) /* {{{ */
{
struct stat buf;
zend_stat_t buf;
if (php_sys_stat(state->cwd, &buf) == 0 && S_ISDIR(buf.st_mode))
return (0);
@@ -418,7 +418,7 @@ static int php_is_dir_ok(const cwd_state *state) /* {{{ */
static int php_is_file_ok(const cwd_state *state) /* {{{ */
{
struct stat buf;
zend_stat_t buf;
if (php_sys_stat(state->cwd, &buf) == 0 && S_ISREG(buf.st_mode))
return (0);
@@ -582,9 +582,9 @@ CWD_API char *virtual_getcwd(char *buf, size_t size TSRMLS_DC) /* {{{ */
/* }}} */
#ifdef PHP_WIN32
static inline unsigned long realpath_cache_key(const char *path, int path_len TSRMLS_DC) /* {{{ */
static inline zend_uint_t realpath_cache_key(const char *path, zend_size_t path_len TSRMLS_DC) /* {{{ */
{
register unsigned long h;
register zend_uint_t h;
char *bucket_key_start = tsrm_win32_get_path_sid_key(path TSRMLS_CC);
char *bucket_key = (char *)bucket_key_start;
const char *e = bucket_key + strlen(bucket_key);
@@ -602,9 +602,9 @@ static inline unsigned long realpath_cache_key(const char *path, int path_len TS
}
/* }}} */
#else
static inline unsigned long realpath_cache_key(const char *path, int path_len) /* {{{ */
static inline zend_uint_t realpath_cache_key(const char *path, zend_size_t path_len) /* {{{ */
{
register unsigned long h;
register zend_uint_t h;
const char *e = path + path_len;
for (h = 2166136261U; path < e;) {
@@ -634,14 +634,14 @@ CWD_API void realpath_cache_clean(TSRMLS_D) /* {{{ */
}
/* }}} */
CWD_API void realpath_cache_del(const char *path, int path_len TSRMLS_DC) /* {{{ */
CWD_API void realpath_cache_del(const char *path, zend_size_t path_len TSRMLS_DC) /* {{{ */
{
#ifdef PHP_WIN32
unsigned long key = realpath_cache_key(path, path_len TSRMLS_CC);
zend_uint_t key = realpath_cache_key(path, path_len TSRMLS_CC);
#else
unsigned long key = realpath_cache_key(path, path_len);
zend_uint_t key = realpath_cache_key(path, path_len);
#endif
unsigned long n = key % (sizeof(CWDG(realpath_cache)) / sizeof(CWDG(realpath_cache)[0]));
zend_uint_t n = key % (sizeof(CWDG(realpath_cache)) / sizeof(CWDG(realpath_cache)[0]));
realpath_cache_bucket **bucket = &CWDG(realpath_cache)[n];
while (*bucket != NULL) {
@@ -666,9 +666,9 @@ CWD_API void realpath_cache_del(const char *path, int path_len TSRMLS_DC) /* {{{
}
/* }}} */
static inline void realpath_cache_add(const char *path, int path_len, const char *realpath, int realpath_len, int is_dir, time_t t TSRMLS_DC) /* {{{ */
static inline void realpath_cache_add(const char *path, zend_size_t path_len, const char *realpath, zend_size_t realpath_len, int is_dir, time_t t TSRMLS_DC) /* {{{ */
{
long size = sizeof(realpath_cache_bucket) + path_len + 1;
zend_int_t size = sizeof(realpath_cache_bucket) + path_len + 1;
int same = 1;
if (realpath_len != path_len ||
@@ -679,7 +679,7 @@ static inline void realpath_cache_add(const char *path, int path_len, const char
if (CWDG(realpath_cache_size) + size <= CWDG(realpath_cache_size_limit)) {
realpath_cache_bucket *bucket = malloc(size);
unsigned long n;
zend_uint_t n;
if (bucket == NULL) {
return;
@@ -716,15 +716,15 @@ static inline void realpath_cache_add(const char *path, int path_len, const char
}
/* }}} */
static inline realpath_cache_bucket* realpath_cache_find(const char *path, int path_len, time_t t TSRMLS_DC) /* {{{ */
static inline realpath_cache_bucket* realpath_cache_find(const char *path, zend_size_t path_len, time_t t TSRMLS_DC) /* {{{ */
{
#ifdef PHP_WIN32
unsigned long key = realpath_cache_key(path, path_len TSRMLS_CC);
zend_uint_t key = realpath_cache_key(path, path_len TSRMLS_CC);
#else
unsigned long key = realpath_cache_key(path, path_len);
zend_uint_t key = realpath_cache_key(path, path_len);
#endif
unsigned long n = key % (sizeof(CWDG(realpath_cache)) / sizeof(CWDG(realpath_cache)[0]));
zend_uint_t n = key % (sizeof(CWDG(realpath_cache)) / sizeof(CWDG(realpath_cache)[0]));
realpath_cache_bucket **bucket = &CWDG(realpath_cache)[n];
while (*bucket != NULL) {
@@ -750,18 +750,18 @@ static inline realpath_cache_bucket* realpath_cache_find(const char *path, int p
}
/* }}} */
CWD_API realpath_cache_bucket* realpath_cache_lookup(const char *path, int path_len, time_t t TSRMLS_DC) /* {{{ */
CWD_API realpath_cache_bucket* realpath_cache_lookup(const char *path, zend_size_t path_len, time_t t TSRMLS_DC) /* {{{ */
{
return realpath_cache_find(path, path_len, t TSRMLS_CC);
}
/* }}} */
CWD_API int realpath_cache_size(TSRMLS_D)
CWD_API zend_int_t realpath_cache_size(TSRMLS_D)
{
return CWDG(realpath_cache_size);
}
CWD_API int realpath_cache_max_buckets(TSRMLS_D)
CWD_API zend_int_t realpath_cache_max_buckets(TSRMLS_D)
{
return (sizeof(CWDG(realpath_cache)) / sizeof(CWDG(realpath_cache)[0]));
}
@@ -784,7 +784,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
HANDLE hFind;
ALLOCA_FLAG(use_heap_large)
#else
struct stat st;
zend_stat_t st;
#endif
realpath_cache_bucket *bucket;
char *tmp;
@@ -1739,7 +1739,7 @@ CWD_API int virtual_rename(const char *oldname, const char *newname TSRMLS_DC) /
}
/* }}} */
CWD_API int virtual_stat(const char *path, struct stat *buf TSRMLS_DC) /* {{{ */
CWD_API int virtual_stat(const char *path, zend_stat_t *buf TSRMLS_DC) /* {{{ */
{
cwd_state new_state;
int retval;
@@ -1757,7 +1757,7 @@ CWD_API int virtual_stat(const char *path, struct stat *buf TSRMLS_DC) /* {{{ */
}
/* }}} */
CWD_API int virtual_lstat(const char *path, struct stat *buf TSRMLS_DC) /* {{{ */
CWD_API int virtual_lstat(const char *path, zend_stat_t *buf TSRMLS_DC) /* {{{ */
{
cwd_state new_state;
int retval;
+11 -11
View File
@@ -130,7 +130,7 @@ typedef unsigned short mode_t;
#endif
#ifdef TSRM_WIN32
CWD_API int php_sys_stat_ex(const char *path, struct stat *buf, int lstat);
CWD_API int php_sys_stat_ex(const char *path, zend_stat_t *buf, int lstat);
# define php_sys_stat(path, buf) php_sys_stat_ex(path, buf, 0)
# define php_sys_lstat(path, buf) php_sys_stat_ex(path, buf, 1)
CWD_API int php_sys_readlink(const char *link, char *target, size_t target_len);
@@ -164,8 +164,8 @@ CWD_API FILE *virtual_fopen(const char *path, const char *mode TSRMLS_DC);
CWD_API int virtual_open(const char *path TSRMLS_DC, int flags, ...);
CWD_API int virtual_creat(const char *path, mode_t mode TSRMLS_DC);
CWD_API int virtual_rename(const char *oldname, const char *newname TSRMLS_DC);
CWD_API int virtual_stat(const char *path, struct stat *buf TSRMLS_DC);
CWD_API int virtual_lstat(const char *path, struct stat *buf TSRMLS_DC);
CWD_API int virtual_stat(const char *path, zend_stat_t *buf TSRMLS_DC);
CWD_API int virtual_lstat(const char *path, zend_stat_t *buf TSRMLS_DC);
CWD_API int virtual_unlink(const char *path TSRMLS_DC);
CWD_API int virtual_mkdir(const char *pathname, mode_t mode TSRMLS_DC);
CWD_API int virtual_rmdir(const char *pathname TSRMLS_DC);
@@ -211,7 +211,7 @@ CWD_API char *tsrm_realpath(const char *path, char *real_path TSRMLS_DC);
#define REALPATH_CACHE_SIZE 0 /* disabled while php.ini isn't loaded */
typedef struct _realpath_cache_bucket {
unsigned long key;
zend_uint_t key;
char *path;
int path_len;
char *realpath;
@@ -229,9 +229,9 @@ typedef struct _realpath_cache_bucket {
typedef struct _virtual_cwd_globals {
cwd_state cwd;
long realpath_cache_size;
long realpath_cache_size_limit;
long realpath_cache_ttl;
zend_int_t realpath_cache_size;
zend_int_t realpath_cache_size_limit;
zend_int_t realpath_cache_ttl;
realpath_cache_bucket *realpath_cache[1024];
} virtual_cwd_globals;
@@ -244,10 +244,10 @@ extern virtual_cwd_globals cwd_globals;
#endif
CWD_API void realpath_cache_clean(TSRMLS_D);
CWD_API void realpath_cache_del(const char *path, int path_len TSRMLS_DC);
CWD_API realpath_cache_bucket* realpath_cache_lookup(const char *path, int path_len, time_t t TSRMLS_DC);
CWD_API int realpath_cache_size(TSRMLS_D);
CWD_API int realpath_cache_max_buckets(TSRMLS_D);
CWD_API void realpath_cache_del(const char *path, zend_size_t path_len TSRMLS_DC);
CWD_API realpath_cache_bucket* realpath_cache_lookup(const char *path, zend_size_t path_len, time_t t TSRMLS_DC);
CWD_API zend_int_t realpath_cache_size(TSRMLS_D);
CWD_API zend_int_t realpath_cache_max_buckets(TSRMLS_D);
CWD_API realpath_cache_bucket** realpath_cache_get_buckets(TSRMLS_D);
/* The actual macros to be used in programs using TSRM
+126 -126
View File
@@ -170,7 +170,7 @@ ZEND_VM_HANDLER(16, ZEND_IS_NOT_IDENTICAL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
is_identical_function(result,
GET_OP1_ZVAL_PTR(BP_VAR_R),
GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
Z_LVAL_P(result) = !Z_LVAL_P(result);
Z_IVAL_P(result) = !Z_IVAL_P(result);
FREE_OP1();
FREE_OP2();
CHECK_EXCEPTION();
@@ -989,7 +989,7 @@ ZEND_VM_HANDLER(41, ZEND_PRINT, CONST|TMP|VAR|CV, ANY)
{
USE_OPLINE
ZVAL_LONG(&EX_T(opline->result.var).tmp_var, 1);
ZVAL_INT(&EX_T(opline->result.var).tmp_var, 1);
ZEND_VM_DISPATCH_TO_HANDLER(ZEND_ECHO);
}
@@ -1001,7 +1001,7 @@ ZEND_VM_HELPER_EX(zend_fetch_var_address_helper, CONST|TMP|VAR|CV, UNUSED|CONST|
zval **retval;
zval tmp_varname;
HashTable *target_symbol_table;
ulong hash_value;
zend_uint_t hash_value;
SAVE_OPLINE();
varname = GET_OP1_ZVAL_PTR(BP_VAR_R);
@@ -1022,7 +1022,7 @@ ZEND_VM_HELPER_EX(zend_fetch_var_address_helper, CONST|TMP|VAR|CV, UNUSED|CONST|
if (CACHED_PTR(opline->op2.literal->cache_slot)) {
ce = CACHED_PTR(opline->op2.literal->cache_slot);
} else {
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRSIZE_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
if (UNEXPECTED(ce == NULL)) {
if (OP1_TYPE != IS_CONST && varname == &tmp_varname) {
zval_dtor(&tmp_varname);
@@ -1036,7 +1036,7 @@ ZEND_VM_HELPER_EX(zend_fetch_var_address_helper, CONST|TMP|VAR|CV, UNUSED|CONST|
} else {
ce = EX_T(opline->op2.var).class_entry;
}
retval = zend_std_get_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 0, ((OP1_TYPE == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
retval = zend_std_get_static_property(ce, Z_STRVAL_P(varname), Z_STRSIZE_P(varname), 0, ((OP1_TYPE == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
FREE_OP1();
} else {
target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
@@ -1049,10 +1049,10 @@ ZEND_VM_HELPER_EX(zend_fetch_var_address_helper, CONST|TMP|VAR|CV, UNUSED|CONST|
if (OP1_TYPE == IS_CONST) {
hash_value = Z_HASH_P(varname);
} else {
hash_value = str_hash(Z_STRVAL_P(varname), Z_STRLEN_P(varname));
hash_value = str_hash(Z_STRVAL_P(varname), Z_STRSIZE_P(varname));
}
if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) {
if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRSIZE_P(varname)+1, hash_value, (void **) &retval) == FAILURE) {
switch (type) {
case BP_VAR_R:
case BP_VAR_UNSET:
@@ -1066,7 +1066,7 @@ ZEND_VM_HELPER_EX(zend_fetch_var_address_helper, CONST|TMP|VAR|CV, UNUSED|CONST|
/* break missing intentionally */
case BP_VAR_W:
Z_ADDREF_P(&EG(uninitialized_zval));
zend_hash_quick_update(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, &EG(uninitialized_zval_ptr), sizeof(zval *), (void **) &retval);
zend_hash_quick_update(target_symbol_table, Z_STRVAL_P(varname), Z_STRSIZE_P(varname)+1, hash_value, &EG(uninitialized_zval_ptr), sizeof(zval *), (void **) &retval);
break;
EMPTY_SWITCH_DEFAULT_CASE()
}
@@ -2102,7 +2102,7 @@ ZEND_VM_HANDLER(43, ZEND_JMPZ, CONST|TMP|VAR|CV, ANY)
val = GET_OP1_ZVAL_PTR(BP_VAR_R);
if (OP1_TYPE == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) {
ret = Z_LVAL_P(val);
ret = Z_IVAL_P(val);
} else {
ret = i_zend_is_true(val);
FREE_OP1();
@@ -2132,7 +2132,7 @@ ZEND_VM_HANDLER(44, ZEND_JMPNZ, CONST|TMP|VAR|CV, ANY)
val = GET_OP1_ZVAL_PTR(BP_VAR_R);
if (OP1_TYPE == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) {
ret = Z_LVAL_P(val);
ret = Z_IVAL_P(val);
} else {
ret = i_zend_is_true(val);
FREE_OP1();
@@ -2162,7 +2162,7 @@ ZEND_VM_HANDLER(45, ZEND_JMPZNZ, CONST|TMP|VAR|CV, ANY)
val = GET_OP1_ZVAL_PTR(BP_VAR_R);
if (OP1_TYPE == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) {
retval = Z_LVAL_P(val);
retval = Z_IVAL_P(val);
} else {
retval = i_zend_is_true(val);
FREE_OP1();
@@ -2196,7 +2196,7 @@ ZEND_VM_HANDLER(46, ZEND_JMPZ_EX, CONST|TMP|VAR|CV, ANY)
val = GET_OP1_ZVAL_PTR(BP_VAR_R);
if (OP1_TYPE == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) {
retval = Z_LVAL_P(val);
retval = Z_IVAL_P(val);
} else {
retval = i_zend_is_true(val);
FREE_OP1();
@@ -2204,7 +2204,7 @@ ZEND_VM_HANDLER(46, ZEND_JMPZ_EX, CONST|TMP|VAR|CV, ANY)
HANDLE_EXCEPTION();
}
}
Z_LVAL(EX_T(opline->result.var).tmp_var) = retval;
Z_IVAL(EX_T(opline->result.var).tmp_var) = retval;
Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
if (!retval) {
#if DEBUG_ZEND>=2
@@ -2227,7 +2227,7 @@ ZEND_VM_HANDLER(47, ZEND_JMPNZ_EX, CONST|TMP|VAR|CV, ANY)
val = GET_OP1_ZVAL_PTR(BP_VAR_R);
if (OP1_TYPE == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) {
retval = Z_LVAL_P(val);
retval = Z_IVAL_P(val);
} else {
retval = i_zend_is_true(val);
FREE_OP1();
@@ -2235,7 +2235,7 @@ ZEND_VM_HANDLER(47, ZEND_JMPNZ_EX, CONST|TMP|VAR|CV, ANY)
HANDLE_EXCEPTION();
}
}
Z_LVAL(EX_T(opline->result.var).tmp_var) = retval;
Z_IVAL(EX_T(opline->result.var).tmp_var) = retval;
Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
if (retval) {
#if DEBUG_ZEND>=2
@@ -2287,7 +2287,7 @@ ZEND_VM_HANDLER(54, ZEND_ADD_CHAR, TMP|UNUSED, CONST)
if (OP1_TYPE == IS_UNUSED) {
/* Initialize for erealloc in add_char_to_string */
Z_STRVAL_P(str) = NULL;
Z_STRLEN_P(str) = 0;
Z_STRSIZE_P(str) = 0;
Z_TYPE_P(str) = IS_STRING;
INIT_PZVAL(str);
@@ -2310,7 +2310,7 @@ ZEND_VM_HANDLER(55, ZEND_ADD_STRING, TMP|UNUSED, CONST)
if (OP1_TYPE == IS_UNUSED) {
/* Initialize for erealloc in add_string_to_string */
Z_STRVAL_P(str) = NULL;
Z_STRLEN_P(str) = 0;
Z_STRSIZE_P(str) = 0;
Z_TYPE_P(str) = IS_STRING;
INIT_PZVAL(str);
@@ -2338,7 +2338,7 @@ ZEND_VM_HANDLER(56, ZEND_ADD_VAR, TMP|UNUSED, TMP|VAR|CV)
if (OP1_TYPE == IS_UNUSED) {
/* Initialize for erealloc in add_string_to_string */
Z_STRVAL_P(str) = NULL;
Z_STRLEN_P(str) = 0;
Z_STRSIZE_P(str) = 0;
Z_TYPE_P(str) = IS_STRING;
INIT_PZVAL(str);
@@ -2388,13 +2388,13 @@ ZEND_VM_HANDLER(109, ZEND_FETCH_CLASS, ANY, CONST|TMP|VAR|UNUSED|CV)
if (CACHED_PTR(opline->op2.literal->cache_slot)) {
EX_T(opline->result.var).class_entry = CACHED_PTR(opline->op2.literal->cache_slot);
} else {
EX_T(opline->result.var).class_entry = zend_fetch_class_by_name(Z_STRVAL_P(class_name), Z_STRLEN_P(class_name), opline->op2.literal + 1, opline->extended_value TSRMLS_CC);
EX_T(opline->result.var).class_entry = zend_fetch_class_by_name(Z_STRVAL_P(class_name), Z_STRSIZE_P(class_name), opline->op2.literal + 1, opline->extended_value TSRMLS_CC);
CACHE_PTR(opline->op2.literal->cache_slot, EX_T(opline->result.var).class_entry);
}
} else if (Z_TYPE_P(class_name) == IS_OBJECT) {
EX_T(opline->result.var).class_entry = Z_OBJCE_P(class_name);
} else if (Z_TYPE_P(class_name) == IS_STRING) {
EX_T(opline->result.var).class_entry = zend_fetch_class(Z_STRVAL_P(class_name), Z_STRLEN_P(class_name), opline->extended_value TSRMLS_CC);
EX_T(opline->result.var).class_entry = zend_fetch_class(Z_STRVAL_P(class_name), Z_STRSIZE_P(class_name), opline->extended_value TSRMLS_CC);
} else {
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
@@ -2413,7 +2413,7 @@ ZEND_VM_HANDLER(112, ZEND_INIT_METHOD_CALL, TMP|VAR|UNUSED|CV, CONST|TMP|VAR|CV)
USE_OPLINE
zval *function_name;
char *function_name_strval;
int function_name_strlen;
zend_size_t function_name_strlen;
zend_free_op free_op1, free_op2;
call_slot *call = EX(call_slots) + opline->result.num;
@@ -2430,7 +2430,7 @@ ZEND_VM_HANDLER(112, ZEND_INIT_METHOD_CALL, TMP|VAR|UNUSED|CV, CONST|TMP|VAR|CV)
}
function_name_strval = Z_STRVAL_P(function_name);
function_name_strlen = Z_STRLEN_P(function_name);
function_name_strlen = Z_STRSIZE_P(function_name);
call->object = GET_OP1_OBJ_ZVAL_PTR(BP_VAR_R);
@@ -2505,7 +2505,7 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMP|VAR|UNUS
if (CACHED_PTR(opline->op1.literal->cache_slot)) {
ce = CACHED_PTR(opline->op1.literal->cache_slot);
} else {
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRSIZE_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
@@ -2535,12 +2535,12 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMP|VAR|UNUS
/* do nothing */
} else if (OP2_TYPE != IS_UNUSED) {
char *function_name_strval = NULL;
int function_name_strlen = 0;
zend_size_t function_name_strlen = 0;
zend_free_op free_op2;
if (OP2_TYPE == IS_CONST) {
function_name_strval = Z_STRVAL_P(opline->op2.zv);
function_name_strlen = Z_STRLEN_P(opline->op2.zv);
function_name_strlen = Z_STRSIZE_P(opline->op2.zv);
} else {
function_name = GET_OP2_ZVAL_PTR(BP_VAR_R);
@@ -2551,7 +2551,7 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMP|VAR|UNUS
zend_error_noreturn(E_ERROR, "Function name must be a string");
} else {
function_name_strval = Z_STRVAL_P(function_name);
function_name_strlen = Z_STRLEN_P(function_name);
function_name_strlen = Z_STRSIZE_P(function_name);
}
}
@@ -2626,7 +2626,7 @@ ZEND_VM_HANDLER(59, ZEND_INIT_FCALL_BY_NAME, ANY, CONST|TMP|VAR|CV)
function_name = (zval*)(opline->op2.literal+1);
if (CACHED_PTR(opline->op2.literal->cache_slot)) {
call->fbc = CACHED_PTR(opline->op2.literal->cache_slot);
} else if (UNEXPECTED(zend_hash_quick_find(EG(function_table), Z_STRVAL_P(function_name), Z_STRLEN_P(function_name)+1, Z_HASH_P(function_name), (void **) &call->fbc) == FAILURE)) {
} else if (UNEXPECTED(zend_hash_quick_find(EG(function_table), Z_STRVAL_P(function_name), Z_STRSIZE_P(function_name)+1, Z_HASH_P(function_name), (void **) &call->fbc) == FAILURE)) {
SAVE_OPLINE();
zend_error_noreturn(E_ERROR, "Call to undefined function %s()", Z_STRVAL_P(opline->op2.zv));
} else {
@@ -2643,7 +2643,7 @@ ZEND_VM_HANDLER(59, ZEND_INIT_FCALL_BY_NAME, ANY, CONST|TMP|VAR|CV)
ZEND_VM_NEXT_OPCODE();
} else {
char *function_name_strval, *lcname;
int function_name_strlen;
zend_size_t function_name_strlen;
zend_free_op free_op2;
SAVE_OPLINE();
@@ -2651,7 +2651,7 @@ ZEND_VM_HANDLER(59, ZEND_INIT_FCALL_BY_NAME, ANY, CONST|TMP|VAR|CV)
if (EXPECTED(Z_TYPE_P(function_name) == IS_STRING)) {
function_name_strval = Z_STRVAL_P(function_name);
function_name_strlen = Z_STRLEN_P(function_name);
function_name_strlen = Z_STRSIZE_P(function_name);
if (function_name_strval[0] == '\\') {
function_name_strlen -= 1;
lcname = zend_str_tolower_dup(function_name_strval + 1, function_name_strlen);
@@ -2716,7 +2716,7 @@ ZEND_VM_HANDLER(59, ZEND_INIT_FCALL_BY_NAME, ANY, CONST|TMP|VAR|CV)
}
if (Z_TYPE_PP(obj) == IS_STRING) {
ce = zend_fetch_class_by_name(Z_STRVAL_PP(obj), Z_STRLEN_PP(obj), NULL, 0 TSRMLS_CC);
ce = zend_fetch_class_by_name(Z_STRVAL_PP(obj), Z_STRSIZE_PP(obj), NULL, 0 TSRMLS_CC);
if (UNEXPECTED(ce == NULL)) {
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -2725,15 +2725,15 @@ ZEND_VM_HANDLER(59, ZEND_INIT_FCALL_BY_NAME, ANY, CONST|TMP|VAR|CV)
call->object = NULL;
if (ce->get_static_method) {
call->fbc = ce->get_static_method(ce, Z_STRVAL_PP(method), Z_STRLEN_PP(method) TSRMLS_CC);
call->fbc = ce->get_static_method(ce, Z_STRVAL_PP(method), Z_STRSIZE_PP(method) TSRMLS_CC);
} else {
call->fbc = zend_std_get_static_method(ce, Z_STRVAL_PP(method), Z_STRLEN_PP(method), NULL TSRMLS_CC);
call->fbc = zend_std_get_static_method(ce, Z_STRVAL_PP(method), Z_STRSIZE_PP(method), NULL TSRMLS_CC);
}
} else {
call->object = *obj;
ce = call->called_scope = Z_OBJCE_PP(obj);
call->fbc = Z_OBJ_HT_P(call->object)->get_method(&call->object, Z_STRVAL_PP(method), Z_STRLEN_PP(method), NULL TSRMLS_CC);
call->fbc = Z_OBJ_HT_P(call->object)->get_method(&call->object, Z_STRVAL_PP(method), Z_STRSIZE_PP(method), NULL TSRMLS_CC);
if (UNEXPECTED(call->fbc == NULL)) {
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(call->object), Z_STRVAL_PP(method));
}
@@ -2784,9 +2784,9 @@ ZEND_VM_HANDLER(69, ZEND_INIT_NS_FCALL_BY_NAME, ANY, CONST)
func_name = opline->op2.literal + 1;
if (CACHED_PTR(opline->op2.literal->cache_slot)) {
call->fbc = CACHED_PTR(opline->op2.literal->cache_slot);
} else if (zend_hash_quick_find(EG(function_table), Z_STRVAL(func_name->constant), Z_STRLEN(func_name->constant)+1, func_name->hash_value, (void **) &call->fbc)==FAILURE) {
} else if (zend_hash_quick_find(EG(function_table), Z_STRVAL(func_name->constant), Z_STRSIZE(func_name->constant)+1, func_name->hash_value, (void **) &call->fbc)==FAILURE) {
func_name++;
if (UNEXPECTED(zend_hash_quick_find(EG(function_table), Z_STRVAL(func_name->constant), Z_STRLEN(func_name->constant)+1, func_name->hash_value, (void **) &call->fbc)==FAILURE)) {
if (UNEXPECTED(zend_hash_quick_find(EG(function_table), Z_STRVAL(func_name->constant), Z_STRSIZE(func_name->constant)+1, func_name->hash_value, (void **) &call->fbc)==FAILURE)) {
SAVE_OPLINE();
zend_error_noreturn(E_ERROR, "Call to undefined function %s()", Z_STRVAL_P(opline->op2.zv));
} else {
@@ -2820,7 +2820,7 @@ ZEND_VM_HANDLER(60, ZEND_DO_FCALL, CONST, ANY)
if (CACHED_PTR(opline->op1.literal->cache_slot)) {
EX(function_state).function = CACHED_PTR(opline->op1.literal->cache_slot);
} else if (UNEXPECTED(zend_hash_quick_find(EG(function_table), Z_STRVAL_P(fname), Z_STRLEN_P(fname)+1, Z_HASH_P(fname), (void **) &EX(function_state).function)==FAILURE)) {
} else if (UNEXPECTED(zend_hash_quick_find(EG(function_table), Z_STRVAL_P(fname), Z_STRSIZE_P(fname)+1, Z_HASH_P(fname), (void **) &EX(function_state).function)==FAILURE)) {
SAVE_OPLINE();
zend_error_noreturn(E_ERROR, "Call to undefined function %s()", fname->value.str.val);
} else {
@@ -3013,7 +3013,7 @@ ZEND_VM_HANDLER(107, ZEND_CATCH, CONST, CV)
if (CACHED_PTR(opline->op1.literal->cache_slot)) {
catch_ce = CACHED_PTR(opline->op1.literal->cache_slot);
} else {
catch_ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, ZEND_FETCH_CLASS_NO_AUTOLOAD TSRMLS_CC);
catch_ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRSIZE_P(opline->op1.zv), opline->op1.literal + 1, ZEND_FETCH_CLASS_NO_AUTOLOAD TSRMLS_CC);
CACHE_PTR(opline->op1.literal->cache_slot, catch_ce);
}
@@ -3223,7 +3223,7 @@ ZEND_VM_HANDLER(165, ZEND_SEND_UNPACK, ANY, ANY)
USE_OPLINE
zend_free_op free_op1;
zval *args;
int arg_num;
zend_size_t arg_num;
SAVE_OPLINE();
args = GET_OP1_ZVAL_PTR(BP_VAR_R);
@@ -3242,8 +3242,8 @@ ZEND_VM_HANDLER(165, ZEND_SEND_UNPACK, ANY, ANY)
zend_hash_move_forward_ex(ht, &pos), ++arg_num
) {
char *name;
zend_uint name_len;
zend_ulong index;
zend_size_t name_len;
zend_uint_t index;
if (zend_hash_get_current_key_ex(ht, &name, &name_len, &index, 0, &pos) == HASH_KEY_IS_STRING) {
zend_error(E_RECOVERABLE_ERROR, "Cannot unpack array with string keys");
@@ -3327,7 +3327,7 @@ ZEND_VM_HANDLER(165, ZEND_SEND_UNPACK, ANY, ANY)
if (ARG_MUST_BE_SENT_BY_REF(EX(call)->fbc, arg_num)) {
zend_error(
E_WARNING, "Cannot pass by-reference argument %d of %s%s%s()"
E_WARNING, "Cannot pass by-reference argument %pu of %s%s%s()"
" by unpacking a Traversable, passing by-value instead", arg_num,
EX(call)->fbc->common.scope ? EX(call)->fbc->common.scope->name : "",
EX(call)->fbc->common.scope ? "::" : "",
@@ -3369,7 +3369,7 @@ ZEND_VM_C_LABEL(unpack_iter_dtor):
ZEND_VM_HANDLER(63, ZEND_RECV, ANY, ANY)
{
USE_OPLINE
zend_uint arg_num = opline->op1.num;
zend_size_t arg_num = opline->op1.num;
zval **param = zend_vm_stack_get_arg(arg_num TSRMLS_CC);
SAVE_OPLINE();
@@ -3388,7 +3388,7 @@ ZEND_VM_HANDLER(63, ZEND_RECV, ANY, ANY)
ptr = EX(prev_execute_data);
if(ptr && ptr->op_array) {
zend_error(E_WARNING, "Missing argument %u for %s%s%s(), called in %s on line %d and defined", opline->op1.num, class_name, space, get_active_function_name(TSRMLS_C), ptr->op_array->filename, ptr->opline->lineno);
zend_error(E_WARNING, "Missing argument %u for %s%s%s(), called in %s on line %pu and defined", opline->op1.num, class_name, space, get_active_function_name(TSRMLS_C), ptr->op_array->filename, ptr->opline->lineno);
} else {
zend_error(E_WARNING, "Missing argument %u for %s%s%s()", opline->op1.num, class_name, space, get_active_function_name(TSRMLS_C));
}
@@ -3411,7 +3411,7 @@ ZEND_VM_HANDLER(64, ZEND_RECV_INIT, ANY, CONST)
{
USE_OPLINE
zval *assignment_value;
zend_uint arg_num = opline->op1.num;
zend_size_t arg_num = opline->op1.num;
zval **param = zend_vm_stack_get_arg(arg_num TSRMLS_CC);
zval **var_ptr;
@@ -3450,8 +3450,8 @@ ZEND_VM_HANDLER(64, ZEND_RECV_INIT, ANY, CONST)
ZEND_VM_HANDLER(164, ZEND_RECV_VARIADIC, ANY, ANY)
{
USE_OPLINE
zend_uint arg_num = opline->op1.num;
zend_uint arg_count = zend_vm_stack_get_args_count(TSRMLS_C);
zend_size_t arg_num = opline->op1.num;
zend_size_t arg_count = zend_vm_stack_get_args_count(TSRMLS_C);
zval **var_ptr, *params;
SAVE_OPLINE();
@@ -3499,7 +3499,7 @@ ZEND_VM_HANDLER(50, ZEND_BRK, ANY, CONST)
zend_brk_cont_element *el;
SAVE_OPLINE();
el = zend_brk_cont(Z_LVAL_P(opline->op2.zv), opline->op1.opline_num,
el = zend_brk_cont(Z_IVAL_P(opline->op2.zv), opline->op1.opline_num,
EX(op_array), execute_data TSRMLS_CC);
ZEND_VM_JMP(EX(op_array)->opcodes + el->brk);
}
@@ -3510,7 +3510,7 @@ ZEND_VM_HANDLER(51, ZEND_CONT, ANY, CONST)
zend_brk_cont_element *el;
SAVE_OPLINE();
el = zend_brk_cont(Z_LVAL_P(opline->op2.zv), opline->op1.opline_num,
el = zend_brk_cont(Z_IVAL_P(opline->op2.zv), opline->op1.opline_num,
EX(op_array), execute_data TSRMLS_CC);
ZEND_VM_JMP(EX(op_array)->opcodes + el->cont);
}
@@ -3522,7 +3522,7 @@ ZEND_VM_HANDLER(100, ZEND_GOTO, ANY, CONST)
zend_brk_cont_element *el;
SAVE_OPLINE();
el = zend_brk_cont(Z_LVAL_P(opline->op2.zv), opline->extended_value,
el = zend_brk_cont(Z_IVAL_P(opline->op2.zv), opline->extended_value,
EX(op_array), execute_data TSRMLS_CC);
brk_opline = EX(op_array)->opcodes + el->brk;
@@ -3697,7 +3697,7 @@ ZEND_VM_HANDLER(99, ZEND_FETCH_CONSTANT, VAR|CONST|UNUSED, CONST)
c = CACHED_PTR(opline->op2.literal->cache_slot);
} else if ((c = zend_quick_get_constant(opline->op2.literal + 1, opline->extended_value TSRMLS_CC)) == NULL) {
if ((opline->extended_value & IS_CONSTANT_UNQUALIFIED) != 0) {
char *actual = (char *)zend_memrchr(Z_STRVAL_P(opline->op2.zv), '\\', Z_STRLEN_P(opline->op2.zv));
char *actual = (char *)zend_memrchr(Z_STRVAL_P(opline->op2.zv), '\\', Z_STRSIZE_P(opline->op2.zv));
if(!actual) {
actual = Z_STRVAL_P(opline->op2.zv);
} else {
@@ -3705,7 +3705,7 @@ ZEND_VM_HANDLER(99, ZEND_FETCH_CONSTANT, VAR|CONST|UNUSED, CONST)
}
/* non-qualified constant - allow text substitution */
zend_error(E_NOTICE, "Use of undefined constant %s - assumed '%s'", actual, actual);
ZVAL_STRINGL(&EX_T(opline->result.var).tmp_var, actual, Z_STRLEN_P(opline->op2.zv)-(actual - Z_STRVAL_P(opline->op2.zv)), 1);
ZVAL_STRINGL(&EX_T(opline->result.var).tmp_var, actual, Z_STRSIZE_P(opline->op2.zv)-(actual - Z_STRVAL_P(opline->op2.zv)), 1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
} else {
@@ -3731,7 +3731,7 @@ ZEND_VM_HANDLER(99, ZEND_FETCH_CONSTANT, VAR|CONST|UNUSED, CONST)
} else if (CACHED_PTR(opline->op1.literal->cache_slot)) {
ce = CACHED_PTR(opline->op1.literal->cache_slot);
} else {
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRSIZE_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
@@ -3749,7 +3749,7 @@ ZEND_VM_HANDLER(99, ZEND_FETCH_CONSTANT, VAR|CONST|UNUSED, CONST)
}
}
if (EXPECTED(zend_hash_quick_find(&ce->constants_table, Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv)+1, Z_HASH_P(opline->op2.zv), (void **) &value) == SUCCESS)) {
if (EXPECTED(zend_hash_quick_find(&ce->constants_table, Z_STRVAL_P(opline->op2.zv), Z_STRSIZE_P(opline->op2.zv)+1, Z_HASH_P(opline->op2.zv), (void **) &value) == SUCCESS)) {
if (IS_CONSTANT_TYPE(Z_TYPE_PP(value))) {
zend_class_entry *old_scope = EG(scope);
@@ -3764,7 +3764,7 @@ ZEND_VM_HANDLER(99, ZEND_FETCH_CONSTANT, VAR|CONST|UNUSED, CONST)
}
ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, *value);
zval_copy_ctor(&EX_T(opline->result.var).tmp_var);
} else if (Z_STRLEN_P(opline->op2.zv) == sizeof("class")-1 && memcmp(Z_STRVAL_P(opline->op2.zv), "class", sizeof("class") - 1) == 0) {
} else if (Z_STRSIZE_P(opline->op2.zv) == sizeof("class")-1 && memcmp(Z_STRVAL_P(opline->op2.zv), "class", sizeof("class") - 1) == 0) {
/* "class" is assigned as a case-sensitive keyword from zend_do_resolve_class_name */
ZVAL_STRINGL(&EX_T(opline->result.var).tmp_var, ce->name, ce->name_length, 1);
} else {
@@ -3816,15 +3816,15 @@ ZEND_VM_HANDLER(72, ZEND_ADD_ARRAY_ELEMENT, CONST|TMP|VAR|CV, CONST|TMP|VAR|UNUS
if (OP2_TYPE != IS_UNUSED) {
zend_free_op free_op2;
zval *offset = GET_OP2_ZVAL_PTR(BP_VAR_R);
ulong hval;
zend_uint_t hval;
switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
hval = zend_dval_to_lval(Z_DVAL_P(offset));
hval = zend_dval_to_ival(Z_DVAL_P(offset));
ZEND_VM_C_GOTO(num_index);
case IS_LONG:
case IS_INT:
case IS_BOOL:
hval = Z_LVAL_P(offset);
hval = Z_IVAL_P(offset);
ZEND_VM_C_LABEL(num_index):
zend_hash_index_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), hval, &expr_ptr, sizeof(zval *), NULL);
break;
@@ -3832,10 +3832,10 @@ ZEND_VM_C_LABEL(num_index):
if (OP2_TYPE == IS_CONST) {
hval = Z_HASH_P(offset);
} else {
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, ZEND_VM_C_GOTO(num_index));
hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset));
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRSIZE_P(offset)+1, hval, ZEND_VM_C_GOTO(num_index));
hval = str_hash(Z_STRVAL_P(offset), Z_STRSIZE_P(offset));
}
zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRSIZE_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
break;
case IS_NULL:
zend_hash_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
@@ -3894,8 +3894,8 @@ ZEND_VM_HANDLER(21, ZEND_CAST, CONST|TMP|VAR|CV, ANY)
case IS_BOOL:
convert_to_boolean(result);
break;
case IS_LONG:
convert_to_long(result);
case IS_INT:
convert_to_int(result);
break;
case IS_DOUBLE:
convert_to_double(result);
@@ -3950,7 +3950,7 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMP|VAR|CV, ANY)
inc_filename = tmp_inc_filename;
}
if (opline->extended_value != ZEND_EVAL && strlen(Z_STRVAL_P(inc_filename)) != Z_STRLEN_P(inc_filename)) {
if (opline->extended_value != ZEND_EVAL && strlen(Z_STRVAL_P(inc_filename)) != Z_STRSIZE_P(inc_filename)) {
if (opline->extended_value == ZEND_INCLUDE_ONCE || opline->extended_value == ZEND_INCLUDE) {
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
} else {
@@ -3963,7 +3963,7 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMP|VAR|CV, ANY)
zend_file_handle file_handle;
char *resolved_path;
resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename) TSRMLS_CC);
resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), Z_STRSIZE_P(inc_filename) TSRMLS_CC);
if (resolved_path) {
failure_retval = zend_hash_exists(&EG(included_files), resolved_path, strlen(resolved_path)+1);
} else {
@@ -4105,7 +4105,7 @@ ZEND_VM_HANDLER(74, ZEND_UNSET_VAR, CONST|TMP|VAR|CV, UNUSED|CONST|VAR)
if (CACHED_PTR(opline->op2.literal->cache_slot)) {
ce = CACHED_PTR(opline->op2.literal->cache_slot);
} else {
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRSIZE_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
if (UNEXPECTED(EG(exception) != NULL)) {
if (OP1_TYPE != IS_CONST && varname == &tmp) {
zval_dtor(&tmp);
@@ -4123,9 +4123,9 @@ ZEND_VM_HANDLER(74, ZEND_UNSET_VAR, CONST|TMP|VAR|CV, UNUSED|CONST|VAR)
} else {
ce = EX_T(opline->op2.var).class_entry;
}
zend_std_unset_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), ((OP1_TYPE == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
zend_std_unset_static_property(ce, Z_STRVAL_P(varname), Z_STRSIZE_P(varname), ((OP1_TYPE == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
} else {
ulong hash_value = zend_inline_hash_func(varname->value.str.val, varname->value.str.len+1);
zend_uint_t hash_value = zend_inline_hash_func(varname->value.str.val, varname->value.str.len+1);
target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
zend_delete_variable(execute_data, target_symbol_table, varname->value.str.val, varname->value.str.len+1, hash_value TSRMLS_CC);
@@ -4147,7 +4147,7 @@ ZEND_VM_HANDLER(75, ZEND_UNSET_DIM, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
zend_free_op free_op1, free_op2;
zval **container;
zval *offset;
ulong hval;
zend_uint_t hval;
SAVE_OPLINE();
container = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_UNSET);
@@ -4163,13 +4163,13 @@ ZEND_VM_HANDLER(75, ZEND_UNSET_DIM, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
hval = zend_dval_to_lval(Z_DVAL_P(offset));
hval = zend_dval_to_ival(Z_DVAL_P(offset));
zend_hash_index_del(ht, hval);
break;
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
hval = Z_LVAL_P(offset);
case IS_INT:
hval = Z_IVAL_P(offset);
zend_hash_index_del(ht, hval);
break;
case IS_STRING:
@@ -4179,13 +4179,13 @@ ZEND_VM_HANDLER(75, ZEND_UNSET_DIM, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
if (OP2_TYPE == IS_CONST) {
hval = Z_HASH_P(offset);
} else {
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, ZEND_VM_C_GOTO(num_index_dim));
hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset));
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRSIZE_P(offset)+1, hval, ZEND_VM_C_GOTO(num_index_dim));
hval = str_hash(Z_STRVAL_P(offset), Z_STRSIZE_P(offset));
}
if (ht == &EG(symbol_table)) {
zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC);
} else {
zend_hash_quick_del(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval);
zend_hash_quick_del(ht, Z_STRVAL_P(offset), Z_STRSIZE_P(offset)+1, hval);
}
if (OP2_TYPE == IS_CV || OP2_TYPE == IS_VAR) {
zval_ptr_dtor(&offset);
@@ -4409,13 +4409,13 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY)
zend_object *zobj = zend_objects_get_address(array_ptr TSRMLS_CC);
while (zend_hash_has_more_elements(fe_ht) == SUCCESS) {
char *str_key;
uint str_key_len;
ulong int_key;
zend_size_t str_key_len;
zend_uint_t int_key;
zend_uchar key_type;
key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL);
if (key_type != HASH_KEY_NON_EXISTENT &&
(key_type == HASH_KEY_IS_LONG ||
(key_type == HASH_KEY_IS_INT ||
zend_check_property_access(zobj, str_key, str_key_len-1 TSRMLS_CC) == SUCCESS)) {
break;
}
@@ -4466,8 +4466,8 @@ ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY)
zend_object *zobj = zend_objects_get_address(array TSRMLS_CC);
int key_type;
char *str_key;
zend_uint str_key_len;
zend_ulong int_key;
zend_size_t str_key_len;
zend_uint_t int_key;
fe_ht = Z_OBJPROP_P(array);
zend_hash_set_pointer(fe_ht, &EX_T(opline->op1.var).fe.fe_pos);
@@ -4479,15 +4479,15 @@ ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY)
key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL);
zend_hash_move_forward(fe_ht);
} while (key_type != HASH_KEY_IS_LONG &&
} while (key_type != HASH_KEY_IS_INT &&
zend_check_property_access(zobj, str_key, str_key_len - 1 TSRMLS_CC) != SUCCESS);
if (key) {
if (key_type == HASH_KEY_IS_LONG) {
ZVAL_LONG(key, int_key);
if (key_type == HASH_KEY_IS_INT) {
ZVAL_INT(key, int_key);
} else {
const char *class_name, *prop_name;
int prop_name_len;
zend_size_t prop_name_len;
zend_unmangle_property_name_ex(
str_key, str_key_len - 1, &class_name, &prop_name, &prop_name_len
);
@@ -4550,7 +4550,7 @@ ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY)
HANDLE_EXCEPTION();
}
} else {
ZVAL_LONG(key, iter->index);
ZVAL_INT(key, iter->index);
}
}
break;
@@ -4611,7 +4611,7 @@ ZEND_VM_HANDLER(114, ZEND_ISSET_ISEMPTY_VAR, CONST|TMP|VAR|CV, UNUSED|CONST|VAR)
if (CACHED_PTR(opline->op2.literal->cache_slot)) {
ce = CACHED_PTR(opline->op2.literal->cache_slot);
} else {
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRSIZE_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
if (UNEXPECTED(ce == NULL)) {
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -4621,7 +4621,7 @@ ZEND_VM_HANDLER(114, ZEND_ISSET_ISEMPTY_VAR, CONST|TMP|VAR|CV, UNUSED|CONST|VAR)
} else {
ce = EX_T(opline->op2.var).class_entry;
}
value = zend_std_get_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 1, ((OP1_TYPE == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
value = zend_std_get_static_property(ce, Z_STRVAL_P(varname), Z_STRSIZE_P(varname), 1, ((OP1_TYPE == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
if (!value) {
isset = 0;
}
@@ -4663,7 +4663,7 @@ ZEND_VM_HELPER_EX(zend_isset_isempty_dim_prop_obj_handler, VAR|UNUSED|CV, CONST|
zval *container;
zval **value = NULL;
int result = 0;
ulong hval;
zend_uint_t hval;
zval *offset;
SAVE_OPLINE();
@@ -4678,12 +4678,12 @@ ZEND_VM_HELPER_EX(zend_isset_isempty_dim_prop_obj_handler, VAR|UNUSED|CV, CONST|
switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
hval = zend_dval_to_lval(Z_DVAL_P(offset));
hval = zend_dval_to_ival(Z_DVAL_P(offset));
ZEND_VM_C_GOTO(num_index_prop);
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
hval = Z_LVAL_P(offset);
case IS_INT:
hval = Z_IVAL_P(offset);
ZEND_VM_C_LABEL(num_index_prop):
if (zend_hash_index_find(ht, hval, (void **) &value) == SUCCESS) {
isset = 1;
@@ -4693,10 +4693,10 @@ ZEND_VM_C_LABEL(num_index_prop):
if (OP2_TYPE == IS_CONST) {
hval = Z_HASH_P(offset);
} else {
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, ZEND_VM_C_GOTO(num_index_prop));
hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset));
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRSIZE_P(offset)+1, hval, ZEND_VM_C_GOTO(num_index_prop));
hval = str_hash(Z_STRVAL_P(offset), Z_STRSIZE_P(offset));
}
if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) {
if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRSIZE_P(offset)+1, hval, (void **) &value) == SUCCESS) {
isset = 1;
}
break;
@@ -4751,26 +4751,26 @@ ZEND_VM_C_LABEL(num_index_prop):
} else if (Z_TYPE_P(container) == IS_STRING && !prop_dim) { /* string offsets */
zval tmp;
if (Z_TYPE_P(offset) != IS_LONG) {
if (Z_TYPE_P(offset) != IS_INT) {
if (Z_TYPE_P(offset) <= IS_BOOL /* simple scalar types */
|| (Z_TYPE_P(offset) == IS_STRING /* or numeric string */
&& IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) {
&& IS_INT == is_numeric_string(Z_STRVAL_P(offset), Z_STRSIZE_P(offset), NULL, NULL, 0))) {
ZVAL_COPY_VALUE(&tmp, offset);
zval_copy_ctor(&tmp);
convert_to_long(&tmp);
convert_to_int(&tmp);
offset = &tmp;
} else {
/* can not be converted to proper offset, return "not set" */
result = 0;
}
}
if (Z_TYPE_P(offset) == IS_LONG) {
if (Z_TYPE_P(offset) == IS_INT) {
if (opline->extended_value & ZEND_ISSET) {
if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_P(container)) {
if (offset->value.lval >= 0 && offset->value.lval < Z_STRSIZE_P(container)) {
result = 1;
}
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_P(container) && Z_STRVAL_P(container)[offset->value.lval] != '0') {
if (offset->value.lval >= 0 && offset->value.lval < Z_STRSIZE_P(container) && Z_STRVAL_P(container)[offset->value.lval] != '0') {
result = 1;
}
}
@@ -4782,9 +4782,9 @@ ZEND_VM_C_LABEL(num_index_prop):
Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
if (opline->extended_value & ZEND_ISSET) {
Z_LVAL(EX_T(opline->result.var).tmp_var) = result;
Z_IVAL(EX_T(opline->result.var).tmp_var) = result;
} else {
Z_LVAL(EX_T(opline->result.var).tmp_var) = !result;
Z_IVAL(EX_T(opline->result.var).tmp_var) = !result;
}
FREE_OP1_IF_VAR();
@@ -4813,8 +4813,8 @@ ZEND_VM_HANDLER(79, ZEND_EXIT, CONST|TMP|VAR|UNUSED|CV, ANY)
zend_free_op free_op1;
zval *ptr = GET_OP1_ZVAL_PTR(BP_VAR_R);
if (Z_TYPE_P(ptr) == IS_LONG) {
EG(exit_status) = Z_LVAL_P(ptr);
if (Z_TYPE_P(ptr) == IS_INT) {
EG(exit_status) = Z_IVAL_P(ptr);
} else {
zend_print_variable(ptr);
}
@@ -4830,8 +4830,8 @@ ZEND_VM_HANDLER(57, ZEND_BEGIN_SILENCE, ANY, ANY)
USE_OPLINE
SAVE_OPLINE();
Z_LVAL(EX_T(opline->result.var).tmp_var) = EG(error_reporting);
Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_LONG; /* shouldn't be necessary */
Z_IVAL(EX_T(opline->result.var).tmp_var) = EG(error_reporting);
Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_INT; /* shouldn't be necessary */
if (EX(old_error_reporting) == NULL) {
EX(old_error_reporting) = &EX_T(opline->result.var).tmp_var;
}
@@ -4879,10 +4879,10 @@ ZEND_VM_HANDLER(58, ZEND_END_SILENCE, TMP, ANY)
zval restored_error_reporting;
SAVE_OPLINE();
if (!EG(error_reporting) && Z_LVAL(EX_T(opline->op1.var).tmp_var) != 0) {
Z_TYPE(restored_error_reporting) = IS_LONG;
Z_LVAL(restored_error_reporting) = Z_LVAL(EX_T(opline->op1.var).tmp_var);
EG(error_reporting) = Z_LVAL(restored_error_reporting);
if (!EG(error_reporting) && Z_IVAL(EX_T(opline->op1.var).tmp_var) != 0) {
Z_TYPE(restored_error_reporting) = IS_INT;
Z_IVAL(restored_error_reporting) = Z_IVAL(EX_T(opline->op1.var).tmp_var);
EG(error_reporting) = Z_IVAL(restored_error_reporting);
convert_to_string(&restored_error_reporting);
if (EXPECTED(EG(error_reporting_ini_entry) != NULL)) {
if (EXPECTED(EG(error_reporting_ini_entry)->modified &&
@@ -4890,7 +4890,7 @@ ZEND_VM_HANDLER(58, ZEND_END_SILENCE, TMP, ANY)
efree(EG(error_reporting_ini_entry)->value);
}
EG(error_reporting_ini_entry)->value = Z_STRVAL(restored_error_reporting);
EG(error_reporting_ini_entry)->value_length = Z_STRLEN(restored_error_reporting);
EG(error_reporting_ini_entry)->value_length = Z_STRSIZE(restored_error_reporting);
} else {
zendi_zval_dtor(restored_error_reporting);
}
@@ -5065,8 +5065,8 @@ ZEND_VM_HANDLER(145, ZEND_DECLARE_INHERITED_CLASS_DELAYED, ANY, ANY)
zend_class_entry **pce, **pce_orig;
SAVE_OPLINE();
if (zend_hash_quick_find(EG(class_table), Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv)+1, Z_HASH_P(opline->op2.zv), (void**)&pce) == FAILURE ||
(zend_hash_quick_find(EG(class_table), Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), Z_HASH_P(opline->op1.zv), (void**)&pce_orig) == SUCCESS &&
if (zend_hash_quick_find(EG(class_table), Z_STRVAL_P(opline->op2.zv), Z_STRSIZE_P(opline->op2.zv)+1, Z_HASH_P(opline->op2.zv), (void**)&pce) == FAILURE ||
(zend_hash_quick_find(EG(class_table), Z_STRVAL_P(opline->op1.zv), Z_STRSIZE_P(opline->op1.zv), Z_HASH_P(opline->op1.zv), (void**)&pce_orig) == SUCCESS &&
*pce != *pce_orig)) {
do_bind_inherited_class(EX(op_array), opline, EG(class_table), EX_T(opline->extended_value).class_entry, 0 TSRMLS_CC);
}
@@ -5140,7 +5140,7 @@ ZEND_VM_HANDLER(144, ZEND_ADD_INTERFACE, ANY, CONST)
if (CACHED_PTR(opline->op2.literal->cache_slot)) {
iface = CACHED_PTR(opline->op2.literal->cache_slot);
} else {
iface = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, opline->extended_value TSRMLS_CC);
iface = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRSIZE_P(opline->op2.zv), opline->op2.literal + 1, opline->extended_value TSRMLS_CC);
if (UNEXPECTED(iface == NULL)) {
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -5168,7 +5168,7 @@ ZEND_VM_HANDLER(154, ZEND_ADD_TRAIT, ANY, ANY)
trait = CACHED_PTR(opline->op2.literal->cache_slot);
} else {
trait = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv),
Z_STRLEN_P(opline->op2.zv),
Z_STRSIZE_P(opline->op2.zv),
opline->op2.literal + 1,
opline->extended_value TSRMLS_CC);
if (UNEXPECTED(trait == NULL)) {
@@ -5280,13 +5280,13 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY)
}
/* restore previous error_reporting value */
if (!EG(error_reporting) && EX(old_error_reporting) != NULL && Z_LVAL_P(EX(old_error_reporting)) != 0) {
if (!EG(error_reporting) && EX(old_error_reporting) != NULL && Z_IVAL_P(EX(old_error_reporting)) != 0) {
zval restored_error_reporting;
Z_TYPE(restored_error_reporting) = IS_LONG;
Z_LVAL(restored_error_reporting) = Z_LVAL_P(EX(old_error_reporting));
Z_TYPE(restored_error_reporting) = IS_INT;
Z_IVAL(restored_error_reporting) = Z_IVAL_P(EX(old_error_reporting));
convert_to_string(&restored_error_reporting);
zend_alter_ini_entry_ex("error_reporting", sizeof("error_reporting"), Z_STRVAL(restored_error_reporting), Z_STRLEN(restored_error_reporting), ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME, 1 TSRMLS_CC);
zend_alter_ini_entry_ex("error_reporting", sizeof("error_reporting"), Z_STRVAL(restored_error_reporting), Z_STRSIZE(restored_error_reporting), ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME, 1 TSRMLS_CC);
zendi_zval_dtor(restored_error_reporting);
}
EX(old_error_reporting) = NULL;
@@ -5396,8 +5396,8 @@ ZEND_VM_HANDLER(143, ZEND_DECLARE_CONST, CONST, CONST)
}
}
c.flags = CONST_CS; /* non persistent, case sensetive */
c.name = str_strndup(Z_STRVAL_P(name), Z_STRLEN_P(name));
c.name_len = Z_STRLEN_P(name)+1;
c.name = str_strndup(Z_STRVAL_P(name), Z_STRSIZE_P(name));
c.name_len = Z_STRSIZE_P(name)+1;
c.module_number = PHP_USER_CONSTANT;
if (zend_register_constant(&c TSRMLS_CC) == FAILURE) {
@@ -5417,7 +5417,7 @@ ZEND_VM_HANDLER(153, ZEND_DECLARE_LAMBDA_FUNCTION, CONST, UNUSED)
SAVE_OPLINE();
if (UNEXPECTED(zend_hash_quick_find(EG(function_table), Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), Z_HASH_P(opline->op1.zv), (void *) &op_array) == FAILURE) ||
if (UNEXPECTED(zend_hash_quick_find(EG(function_table), Z_STRVAL_P(opline->op1.zv), Z_STRSIZE_P(opline->op1.zv), Z_HASH_P(opline->op1.zv), (void *) &op_array) == FAILURE) ||
UNEXPECTED(op_array->type != ZEND_USER_FUNCTION)) {
zend_error_noreturn(E_ERROR, "Base lambda function for closure not found");
}
@@ -5580,10 +5580,10 @@ ZEND_VM_HANDLER(160, ZEND_YIELD, CONST|TMP|VAR|CV|UNUSED, CONST|TMP|VAR|CV|UNUSE
generator->key = key;
}
if (Z_TYPE_P(generator->key) == IS_LONG
&& Z_LVAL_P(generator->key) > generator->largest_used_integer_key
if (Z_TYPE_P(generator->key) == IS_INT
&& Z_IVAL_P(generator->key) > generator->largest_used_integer_key
) {
generator->largest_used_integer_key = Z_LVAL_P(generator->key);
generator->largest_used_integer_key = Z_IVAL_P(generator->key);
}
FREE_OP2_IF_VAR();
@@ -5592,7 +5592,7 @@ ZEND_VM_HANDLER(160, ZEND_YIELD, CONST|TMP|VAR|CV|UNUSED, CONST|TMP|VAR|CV|UNUSE
generator->largest_used_integer_key++;
ALLOC_INIT_ZVAL(generator->key);
ZVAL_LONG(generator->key, generator->largest_used_integer_key);
ZVAL_INT(generator->key, generator->largest_used_integer_key);
}
if (RETURN_VALUE_USED(opline)) {
+898 -898
View File
File diff suppressed because it is too large. Load diff
+352
View File
@@ -0,0 +1,352 @@
This document describes the way to port the PECL extensions for <str_size_and_int64>.
After undertaking the steps suggested, the same PECL extension source should be
compatible with both older and <str_size_and_int64> codebase.
I. Basic changes in <str_size_and_int64>
i. String length
ii. Integer types
iii. Other datatypes
iv. Macros
v. Functions
II. Porting steps
i. Automatic replacements
ii. Compatibility header
iii. zend_parse_parameters()
iv. Manual code fixes
v. Library dependencies
vi. spprintf() formats
vii. Array API
viii. Explicit compilation enablement
ix. Misccellaneous porting steps
x. Follow the white rabbit
III. Pitfalls
i. size_t usage
ii. zend_parse_parameters()
iii. Pointer difference
iv. RETURN_STRINGL, RETVAL_STRINGL
v. Bitwise operations
========================================
I. Basic changes in <str_size_and_int64>
========================================
For extended information, please look at the compat.h header and the wiki RFC page
https://wiki.php.net/rfc/size_t_and_int64
i. String length
String lengths do no more depend on the firm 'int' datatype. The replacement
is a platform dependent size_t datatype. The string length in zval is no more
int but php_size_t.
String length is defined as zend_size_t inside Zend and aliased as php_size_t
anywhere else. The inclusion of php.h is necessary.
ii. Integer types
Integers do no more depend on the firm 'long' type. Instead a platform
dependent integer type is used. That datatype is defined dynamically to
guarantee the consistent 64 bit support. The zval field representing user
land integer it bound to php_int_t.
Signed integer is defined as zend_int_t, unsigned integer as zend_uint_t
inside Zend. Both are aliased as php_int_t and php_uint_t anywhere else,
respectively. The inclusion of php.h is necessary.
iii. Other datatypes
zend_off_t - portable off_t analogue
zend_stat_t - portable 'struct stat' analogue
These datatypes are declared to be portable across platforms. Thus, direct
usage of the functions like fseek, stat, etc. as well as direct usage of
off_t and struct stat is strongly not recommended. Instead the portable
macros should be used.
zend_fseek - portable fseek equivalent
zend_ftell - portable ftell equivalent
zend_lseek - portable lseek equivalent
zend_fstat - portable fstat equivalent
zend_stat - portable stat equivalent
iv. Macros
Z_STRSIZE - replacement for Z_STRLEN family
Z_IVAL - replacement for Z_LVAL family
Z_I - initialize signed integer constant
Z_UI - initialize unsigned integer constant
ZEND_INT_MAX, ZEND_INT_MIN, ZEND_UINT_MAX, ZEND_SIZE_MAX
IS_INT - replacement for IS_LONG
ZVAL_INT - replacement for ZVAL_LONG
RETVAL_INT - RETVAL_LONG
RETURN_INT - RETURN_LONG
ZEND_STRTOI - portable strtol version
ZEND_STRTOUI - portable strtoul version
ZEND_ITOA - portable itoa version
ZEND_ATOI - portable atol version
ZEND_ABS - portable abs version
This macros are safe to use with php_int_t
SIZEOF_ZEND_INT should be used Instead of SIZEOF_LONG with php_int_t
while checking the size.
v. Functions
Various functions became syntactic renames, it concerns functions containing
the 'long' keyword. The new portable aliases also was added.
convert_to_int, add_assoc_int, zend_ini_int, etc.
=================
II. Porting steps
=================
i. Automatic replacements
The tool replace.php will automatically replace a number of syntactic changes
in the old style extension. Note, that only simple cases are processed, for
complicated cases the manual intrusion is unavoidable. Still, this tool will
save a lot of time while porting.
To mention are also the following options
--macros replace old vs. new macro/function names
--zpp replace "lLsp" with "iISP" at appropriate places only
--zpp-compat replace things like
"slO" with ZPP_FMT_COMPAT("slO", "SiO")
--zpp-vars replace datatypes for vars passed to zpp calls. Dont expect this
this option to be the swiss knife! Verify after it!
The macro and zpp options are separated and don't have to be used together.
The PHP_NEED_STRSIZE_COMPAT is defined in the compat.h for versions lower than
<str_size_and_int64>.
You can also use --reverse if you want to have all the changes back to old. One
exception though is when --zpp-compat or --zpp-vars is used - this case isn't
yet implemented. For instance, if some used a custom macros name instead of
ZPP_FMT_COMPAT or some other custom #ifdef, it will be hard to catch.
The replacements with --zpp-vars might go totally insane depending on code
formatting, so revert might be too complex. However one var daclaration per
line should be very good replaceable. Also, --zpp-vars will give you some
warnings where it couldn't replace the corresponding var type, despite it could
be parsed, you should go through those.
ii. Compatibility header
The compat.h header, once copied into the extension source and included, will
compensate many of the syntactic differences. The right place for the
inclusion might depend on the concrete extension code, while in general it
might make sense to include it after all the other headers.
The header itself might of course need some customization for concrete code. The
basic version provides macros PHP_NEED_STRSIZE_COMPAT, which will evaluate to
true when compiling with versions lover than <str_size_and_int64>.
iii. zend_parse_parameters()
The arg specs 'l', 'L', 's' and 'p' are not available anymore. As their
replacements 'i', 'I', 'S' and 'P' was invented. The integer specs expect a
variable of type php_int_t to be passed. The string/path lengths are expected
to be of type php_size_t.
A possible way to declare the argument specs were using the ternary operator,
eq.
#define COMP (PHP_MAJOR_VERSION < 5) || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 6)
php_int_t i0, i1;
char *s0, p0;
php_size_t s0_len, p0_len;
if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, (COMP ? "lLsp" : "iISP"), &i0, &i1, &s0, &s0_len, &p0, &p0_len) == FAILURE) {
return;
}
Another way implemented when using the standard compat.h and replace.php --zpp-compat
will automatically replace the old specs with the macros like
ZPP_FMT_COMPAT("lSsp", "iISP")
iv. Manual code fixes
While for many extensions the mechanic replacements will do the big job to
retain the compatibility, the manual code fixes might be necessary. Here are
especially to mention array API, filesystem API, unsigned string lengths. Also
this is likely the case for extensions with library dependencies, see also the
pitfalls section.
After adjusting the variable types in zpp, the first places you automatically should
look for are the functions where you pass the parameters. Especially those accepting
integers by reference might be broken. If those functions are your own implementations,
it might make sense you to adapt the function signatures. In case of some library
functions an intermediate variable of an appropriate type can be used.
v. Library dependencies
Libraries using incompatible data types for string sizes and integers require
additional checks to ensure the correct value range. This is easy done as in the
example below (assumed the function argument is of type php_int_t and the
dependency library expects a value in integer range)
if (INT_MAX < input_arg || INT_MIN > input_arg) {
return;
}
vi. spprintf() formats
New printf modifier 'p' was implemented to platform independently output php_int_t,
php_uint_t and php_size_t datatypes. That modifier can be used with'd', 'u', 'x' and 'o'
printf format specs with spprintf, snprintf and the wrapping printf implementations.
%pu is sufficient for both php_uint_t and php_size_t.
To ensure compatibility, the macros ZEND_INT_FMT and ZEND_UINT_FMT should be
used
php_int_t i0, i1;
char *s0, p0;
php_size_t s0_len, p0_len;
if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, (COMPAT ? "lLsp" : "iISP"), &i0, &i1, &s0, &s0_len, &p0, &p0_len) == FAILURE) {
return;
}
if (INT_MAX < i0 || INT_MIN > i0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Value '" ZEND_INT_FMT "' is out of range", i0);
return;
}
Please note, that replace.php will not do automatic replacements for the %ld
and other specs. It's up to the porter where such replacement were appropriate.
To ease the process, some automatic still could be used, like here how it could
be done in vim
:%s,%ld," ZEND_INT_FMT ",g
With this in mind, the code using %p spec to output pointer address might
need to be enclosed into #ifdef when it unlickily followed by 'd', 'u', 'x' or 'o'.
vii. Array API
Datatype for array indexes was changed to php_uint_t, for key lengths to php_size_t.
As many places in the array API expect such kind of variables to be passed as
pointers, it's important them to be of the correct datatype.
viii. Explicit compilation enablement
This is not implemented yet, the build system has to be tweaked for this to happen.
The idea is, that an extension has to define some macros like PHP_64BIT_COMP to
be allowed to compile.
ix. Misccellaneous porting steps
In general, any code dealing with string or object size should use php_size_t, any
code dealing with integer available in the userspace should use php_int_t. The
other relevant units are
- socket APIs
- INI settings
- global constants, class constants and properties
- resources
- Zend list and llist API
- local extension specific helper functions
- local extension specific datatypes
x. Follow the white rabbit
While this document and the porting tools are being developed to the best of one's
knowledge and belief, it's indispensable to follow the warnings of your compiler.
While porting, debug mode should be always enabled and care should be taken
specifically about the warnings like
- signed/unsigned mismatch
- incompatible pointer types
- precision loss, like
- assignment to variables of smaller type (say like int64_t to int)
- passing of function args of bigger type (same as above)
- erroneous printf formats
Having any kind of improvement ideas, please don't hesitate sharing them!
=============
III. Pitfalls
=============
i. size_t usage
php_size_t is mapped to the platform dependent size_t datatype, which is unsigned.
The following code will not work as maybe expected, when max_len is negative
char *s0;
php_size_t s0_len;
php_int_t max_len;
if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, (COMPAT ? "sl" : "iS"), &s0, &s0_len, &max_len) == FAILURE) {
return;
}
if (s0_len > max_len) {
return;
}
The reason is, that for the comparsion max_len will be converted to an unsigned value
which most likely will be PHP_SIZE_MAX. The correct check could look like
if (max_len >= 0 && s0_len > max_len) {
return;
}
Please note, that php_size_t is used not only for string length with zpp, but also
widely for array keys and at many other places. Please check the corresponding APIs
to ensure the datatype needed. Predominantly string size uses php_size_t now.
ii. zend_parse_parameters()
The new integer and string format specs are strictly bound to the php_int_t and
php_size_t datatypes. Those datatypes have variable sizes on different
platforms. Especially usage of the old 'long' and 'int' datatypes can lead to
memory errors and crashes on 64 bit platforms.
iii. Pointer difference
When working with pointer arithmetic, the ptrdiff_t type should be used to tell the
difference between two pointers.
char *s0 = "hello"
char *s1 = s0;
ptrdiff_t d;
s1++;
d = s1 - s0; /* Correct datatype to hold the result */
Should the example happen to scale, like for instance working the bigger strings,
using a wrong datatype will lead to an overflow. Though be aware that ptrdiff_t is
signed, so can be negative.
iv. RETURN_STRINGL, RETVAL_STRINGL
RETURN_STRINGL, RETVAL_STRINGL macros now expect php_size_t for the string length.
While it's theoretically possible to use any other datatype with those macros, the
explicit attention should be paid that the values arn't negative.
v. Bitwise operations
Especialy some bitshift operations might bring unexpected results when mixing 32 and
64 bit variables or constants. Here's the example snippet
php_int_t var = 1 << 31;
While a 32 bit variable can hold bits from 0 to 31, a 64 bit variable can hold bits
from 0 to 63. So with the snippet above the result the max negative value of 32 bit
integer. To have it working correct way on 64 bit, an explicit cast
php_int_t var = (php_int_t)1 << 31;
or the special macros in case of a constant
php_int_t var = Z_I(1) << 31;
can be used.
+151
View File
@@ -0,0 +1,151 @@
/*
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.php.net/license/3_01.txt |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Author: Anatol Belski <ab@php.net> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#ifndef PHP_SIZE_INT_COMPAT_H
#define PHP_SIZE_INT_COMPAT_H
/* XXX change the check accordingly to the vote results */
#define PHP_NEED_STRSIZE_COMPAT (PHP_MAJOR_VERSION < 5) || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 6) || defined(PHP_FORCE_STRSIZE_COMPAT)
#if PHP_NEED_STRSIZE_COMPAT
typedef long zend_int_t;
typedef unsigned long zend_uint_t;
typedef long zend_off_t;
typedef int zend_size_t;
typedef struct stat zend_stat_t;
# define ZEND_INT_MAX LONG_MAX
# define ZEND_INT_MIN LONG_MIN
# define ZEND_UINT_MAX ULONG_MAX
# define ZEND_SIZE_MAX SIZE_MAX
# define Z_I(i) i
# define Z_UI(i) i
# define SIZEOF_ZEND_INT SIZEOF_LONG
# define ZEND_STRTOI(s0, s1, base) strtol((s0), (s1), (base))
# define ZEND_STRTOUI(s0, s1, base) strtoul((s0), (s1), (base))
# ifdef PHP_WIN32
# define ZEND_ITOA(i, s, len) _ltoa_s((i), (s), (len), 10)
# define ZEND_ATOI(i, s) i = atol((s))
# else
# define ZEND_ITOA(i, s, len) \
do { \
int st = snprintf((s), (len), "%ld", (i)); \
(s)[st] = '\0'; \
} while (0)
# define ZEND_ATOI(i, s) (i) = atol((s))
# endif
# define ZEND_INT_FMT "%ld"
# define ZEND_UINT_FMT "%lu"
# define ZEND_INT_FMT_SPEC "ld"
# define ZEND_UINT_FMT_SPEC "lu"
# define ZEND_STRTOI_PTR strtol
# define ZEND_STRTOUI_PTR strtoul
# define ZEND_ABS abs
# define zend_fseek fseek
# define zend_ftell ftell
# define zend_lseek lseek
# define zend_fstat fstat
# define zend_stat stat
# define php_fstat fstat
# define php_stat_fn stat
#define php_size_t zend_size_t
#define php_int_t zend_int_t
#define php_uint_t zend_uint_t
#define php_stat_t zend_stat_t
#define PHP_INT_MAX ZEND_INT_MAX
#define PHP_INT_MIN ZEND_INT_MIN
#define PHP_UINT_MAX ZEND_UINT_MAX
#define PHP_SIZE_MAX ZEND_SIZE_MAX
# define MAX_LENGTH_OF_ZEND_INT MAX_LENGTH_OF_LONG
# define Z_STRSIZE Z_STRLEN
# define Z_STRSIZE_P Z_STRLEN_P
# define Z_STRSIZE_PP Z_STRLEN_PP
# define Z_IVAL Z_LVAL
# define Z_IVAL_P Z_LVAL_P
# define Z_IVAL_PP Z_LVAL_PP
# define IS_INT IS_LONG
# define ZVAL_INT ZVAL_LONG
# define RETVAL_INT RETVAL_LONG
# define RETURN_INT RETURN_LONG
# define LITERAL_INT LITERAL_LONG
# define REGISTER_INT_CONSTANT REGISTER_LONG_CONSTANT
# define REGISTER_NS_INT_CONSTANT REGISTER_NS_LONG_CONSTANT
# define REGISTER_MAIN_INT_CONSTANT REGISTER_MAIN_LONG_CONSTANT
# define HASH_KEY_IS_INT HASH_KEY_IS_LONG
# define convert_to_int convert_to_long
# define convert_to_int_ex convert_to_long_ex
# define add_assoc_int add_assoc_long
# define add_property_int add_property_long
# define zendi_convert_to_int zendi_convert_to_long
# define zend_ini_int zend_ini_long
# define ZEND_SIGNED_MULTIPLY_INT ZEND_SIGNED_MULTIPLY_LONG
# define zend_update_property_int zend_update_property_long
# define SET_VAR_INT SET_VAR_LONG
# define zend_declare_class_constant_int zend_declare_class_constant_long
# define add_get_index_int add_get_index_long
# define add_next_index_int add_next_index_long
# define zend_update_static_property_int zend_update_static_property_long
# define zend_register_int_constant zend_register_long_constant
# define add_index_int add_index_long
# define zend_declare_property_int zend_declare_property_long
# define ZEND_MM_INT_CONST ZEND_MM_LONG_CONST
# define REGISTER_PDO_CLASS_CONST_INT REGISTER_PDO_CLASS_CONST_LONG
# define PDO_INT_PARAM_CHECK PDO_LONG_PARAM_CHECK
# define REGISTER_XMLREADER_CLASS_CONST_INT REGISTER_XMLREADER_CLASS_CONST_LONG
# define CALENDAR_DECL_INT_CONST CALENDAR_DECL_LONG_CONST
# define TIMEZONE_DECL_INT_CONST TIMEZONE_DECL_LONG_CONST
# define BREAKITER_DECL_INT_CONST BREAKITER_DECL_LONG_CONST
# define REGISTER_SPL_CLASS_CONST_INT REGISTER_SPL_CLASS_CONST_LONG
# define REGISTER_REFLECTION_CLASS_CONST_INT REGISTER_REFLECTION_CLASS_CONST_LONG
# define REGISTER_PHAR_CLASS_CONST_INT REGISTER_PHAR_CLASS_CONST_LONG
# define MAKE_INT_ZVAL_INCREF MAKE_LONG_ZVAL_INCREF
# define MYSQLI_RETURN_INT_INT MYSQLI_RETURN_INT_LONG
# define MYSQLI_MAP_PROPERTY_FUNC_INT MYSQLI_MAP_PROPERTY_FUNC_LONG
# define REGISTER_ZIP_CLASS_CONST_INT REGISTER_ZIP_CLASS_CONST_LONG
# define REGISTER_SNMP_CLASS_CONST_INT REGISTER_SNMP_CLASS_CONST_LONG
# define PHP_SNMP_INT_PROPERTY_READER_FUNCTION PHP_SNMP_LONG_PROPERTY_READER_FUNCTION
# define ISC_INT_MIN ISC_LONG_MIN
# define ISC_INT_MAX ISC_LONG_MAX
# define int_min_digits long_min_digits
# define zend_dval_to_ival zend_dval_to_lval
# define ZEND_DVAL_TO_IVAL_CAST_OK ZEND_DVAL_TO_LVAL_CAST_OK
# define smart_str_append_int smart_str_append_long
# define cfg_get_int cfg_get_long
# define pdo_attr_ival pdo_attr_lval
# define ZPP_FMT_COMPAT(old_fmt, new_fmt) old_fmt
#else
# define ZPP_FMT_COMPAT(old_fmt, new_fmt) new_fmt
#endif
#endif /* PHP_SIZE_INT_COMPAT_H */
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* indent-tabs-mode: t
* End:
*/
+333
View File
@@ -0,0 +1,333 @@
<?php
/*
Tool for syntactic replacements for <str_size_and_int64>
Autor: ab@php.net
*/
/* Options stuff*/
$shortopts = NULL;
$longopts = array('type:', 'custom:', 'help::', 'reverse', 'zpp', 'zpp-compat', 'macros', 'zpp-vars');
$options = getopt($shortopts, $longopts);
$repl_type = isset($options['type']) ? $options['type'] : 'ext';
$custom_defs_fname = isset($options['custom']) ? $options['custom'] : NULL;
$fname = (count($argv) < 2) ? NULL : $argv[count($argv)-1];
$reverse_replace = isset($options['reverse']);
$replace_zpp = isset($options['zpp']);
$replace_zpp_compat = isset($options['zpp-compat']);
$replace_macros = isset($options['macros']);
$replace_zpp_vars = isset($options['zpp-vars']);
/* Options validation */
if (isset($options['help'])) {
print_usage(0);
} else if (!in_array($repl_type, array('ext', 'zend_ext'))) {
print_error("Invalid replacement type '$repl_type'");
} else if (!$replace_macros && !($replace_zpp || $replace_zpp_compat) && ! $replace_zpp_vars) {
echo "No replacement options specified, nothing to do." . PHP_EOL . PHP_EOL;
print_usage(3);
} else if ($replace_zpp && $replace_zpp_compat) {
print_error("--zpp and --zpp-compat cannot be used at the same time");
} else if (!$fname || !file_exists($fname)) {
print_error("Invalid filename '$fname'");
/*} else if (!is_null($custom_defs_fname) && !file_exists($custom_defs_fname)) {
print_error("Invalid custom replacement definitions file");*/
} else if (!is_null($custom_defs_fname)) {
/* XXX uncomment the above when it's implemented */
print_error("Processing of custom replacement definitions is not implemented yet, feel free to supply a patch");
}
/* Process file */
$file_contents = file_get_contents($fname);
/* replace zpp variable types */
/* XXX handle more complicated cases */
if ($replace_zpp_vars && !$reverse_replace) {
$ptr = array(
"/zend_parse_parameters\(.*\s+TSRMLS_CC,\s*\"([a-zA-Z\*+\|\/!]+)\"\s*,\s*(.*)\)/msxU",
"/zend_parse_parameters_ex\(.*,\s*.*\s+TSRMLS_CC,\s*\"([a-zA-Z\*+\|\/!]+)\"\s*,\s*(.*)\)/msxU",
"/zend_parse_method_parameters\(.*\s+TSRMLS_CC,\s*.*,\s*\"([a-zA-Z\*+\|\/!]+)\"\s*,\s*(.*)\)/msxU",
"/zend_parse_method_parameters_ex\(.*,\s*.*\s+TSRMLS_CC,\s*.*,\s*\"([a-zA-Z\*+\|\/!]+)\"\s*,\s*(.*)\)/msxU",
);
$vars = array();
foreach ($ptr as $p) {
/* XXX Warn about the cases we could find even if we don't replace them */
if (0 < preg_match_all($p, $file_contents, $m)) {
/* get specs and var names in one array */
for ($i = 0; $i < count($m[0]); $i++) {
$vars[$m[1][$i]] = array();
$tmp = explode(',', str_replace(' ', '', $m[2][$i]));
if (!is_array($tmp)) {
echo "WARNING: parse error, zpp spec exist but var names couldn't be parsed" . PHP_EOL;
continue;
}
foreach ($tmp as $it) {
while ($it && !preg_match(',^[a-z0-9_]+$,i', $it)) {
$it = substr($it, 1);
}
$vars[$m[1][$i]][] = $it;
}
}
}
}
/* compute var ingexes */
$var_idx = array();
/* XXX this loop might need to be fixed at some places! */
foreach ($vars as $spec => $var) {
$var_idx[$spec] = array();
$var_idx[$spec]['php_int_t'] = array();
$var_idx[$spec]['php_size_t'] = array();
for ($i = 0, $pos = 0; $i < strlen($spec); $i++, $pos++) {
switch($spec[$i]) {
case 'l':
case 'L':
$var_idx[$spec]['php_int_t'][] = $pos;
break;
case 's':
case 'p':
$pos++;
$var_idx[$spec]['php_size_t'][] = $pos;
break;
case 'a':
case 'A':
case 'b':
case 'C':
case 'd':
case 'h':
case 'H':
case 'o':
case 'r':
case 'Z':
case 'z':
case '*':
case '+':
break;
case '|':
case '/':
case '!':
$pos--;
break;
case 'f':
case 'O':
$pos++;
break;
default:
echo "WARNING: unknown zpp spec '" . $spec[$i] . "'" . PHP_EOL;
break;
}
}
if (empty($var_idx)) {
unset($var_idx);
}
}
/* got indexes and got vars, 1st simple case to match */
$search_replace = array();
foreach ($var_idx as $spec => $data) {
/* handle direct matches with single variable declaration */
foreach ($data['php_int_t'] as $idx) {
$var = $vars[$spec][$idx];
$cnt = preg_match(",(long\s+$var.*;),msxU", $file_contents, $m);
if (1 == $cnt) {
/* XXX probably better to use preg_replace instead of str_replace here */
$search_replace[$m[1]] = str_replace('long', 'php_int_t', $m[1]);
} else {
echo "WARNING: variable $var needs to be php_int_t but couldn't be automatically replaced" . PHP_EOL;
}
}
foreach ($data['php_size_t'] as $idx) {
$var = $vars[$spec][$idx];
$cnt = preg_match(",(int\s+$var.*;),msxU", $file_contents, $m);
if (1 == $cnt) {
/* XXX probably better to use preg_replace instead of str_replace here */
$search_replace[$m[1]] = str_replace('int', 'php_size_t', $m[1]);;
} else {
echo "WARNING: variable $var needs to be php_size_t but couldn't be automatically replaced" . PHP_EOL;
}
}
}
$file_contents = str_replace(array_keys($search_replace), array_values($search_replace), $file_contents);
/* XXX more cases here to go, var_dump($vars, var_idx); to see what data does already exist at this point */
} else if ($reverse_replace) {
echo "WARNING: reverse replace for zpp vars isn't implemented, feel free to supply patch" . PHP_EOL;
}
/* simple macro replacements */
if ($replace_macros) {
$replacements = array(
/*'ZEND_SIZE_MAX_LONG' => 'ZEND_SIZE_MAX',
'ZEND_SIZE_MAX_INT' => 'ZEND_SIZE_MAX',*/
'MAX_LENGTH_OF_LONG' => 'MAX_LENGTH_OF_ZEND_INT',
'Z_STRLEN' => 'Z_STRSIZE',
'Z_LVAL' => 'Z_IVAL',
'IS_LONG' => 'IS_INT',
'ZVAL_LONG' => 'ZVAL_INT',
'RETVAL_LONG' => 'RETVAL_INT',
'RETURN_LONG' => 'RETURN_INT',
'LITERAL_LONG' => 'LITERAL_INT',
'REGISTER_LONG_CONSTANT' => 'REGISTER_INT_CONSTANT',
'REGISTER_NS_LONG_CONSTANT' => 'REGISTER_NS_INT_CONSTANT',
'REGISTER_MAIN_LONG_CONSTANT' => 'REGISTER_MAIN_INT_CONSTANT',
'HASH_KEY_IS_LONG' => 'HASH_KEY_IS_INT',
'convert_to_long' => 'convert_to_int',
'add_assoc_long' => 'add_assoc_int',
'add_property_long' => 'add_property_int',
'zendi_convert_to_long' => 'zendi_convert_to_int',
'zend_ini_long' => 'zend_ini_int',
'ZEND_SIGNED_MULTIPLY_LONG' => 'ZEND_SIGNED_MULTIPLY_INT',
'zend_update_property_long' => 'zend_update_property_int',
'SET_VAR_LONG' => 'SET_VAR_INT',
'zend_declare_class_constant_long' => 'zend_declare_class_constant_int',
'add_get_index_long' => 'add_get_index_int',
'add_next_index_long' => 'add_next_index_int',
'zend_declare_class_constant_long' => 'zend_declare_class_constant_int',
'zend_update_static_property_long' => 'zend_update_static_property_int',
'zend_register_long_constant' => 'zend_register_int_constant',
'add_index_long' => 'add_index_int',
'zend_declare_property_long' => 'zend_declare_property_int',
'ZEND_MM_LONG_CONST' => 'ZEND_MM_INT_CONST',
'REGISTER_PDO_CLASS_CONST_LONG' => 'REGISTER_PDO_CLASS_CONST_INT',
'PDO_LONG_PARAM_CHECK' => 'PDO_INT_PARAM_CHECK',
'REGISTER_XMLREADER_CLASS_CONST_LONG' => 'REGISTER_XMLREADER_CLASS_CONST_INT',
'CALENDAR_DECL_LONG_CONST' => 'CALENDAR_DECL_INT_CONST',
'TIMEZONE_DECL_LONG_CONST' => 'TIMEZONE_DECL_INT_CONST',
'BREAKITER_DECL_LONG_CONST' => 'BREAKITER_DECL_INT_CONST',
'REGISTER_SPL_CLASS_CONST_LONG' => 'REGISTER_SPL_CLASS_CONST_INT',
'REGISTER_REFLECTION_CLASS_CONST_LONG' => 'REGISTER_REFLECTION_CLASS_CONST_INT',
'REGISTER_PHAR_CLASS_CONST_LONG' => 'REGISTER_PHAR_CLASS_CONST_INT',
'MAKE_LONG_ZVAL_INCREF' => 'MAKE_INT_ZVAL_INCREF',
'MYSQLI_RETURN_INT_LONG' => 'MYSQLI_RETURN_INT_INT',
'MYSQLI_MAP_PROPERTY_FUNC_LONG' => 'MYSQLI_MAP_PROPERTY_FUNC_INT',
'REGISTER_ZIP_CLASS_CONST_LONG' => 'REGISTER_ZIP_CLASS_CONST_INT',
'REGISTER_SNMP_CLASS_CONST_LONG' => 'REGISTER_SNMP_CLASS_CONST_INT',
'PHP_SNMP_LONG_PROPERTY_READER_FUNCTION' => 'PHP_SNMP_INT_PROPERTY_READER_FUNCTION',
'ISC_LONG_MIN' => 'ISC_INT_MIN',
'ISC_LONG_MAX' => 'ISC_INT_MAX',
'long_min_digits' => 'int_min_digits',
'zend_dval_to_lval' => 'zend_dval_to_ival',
'ZEND_DVAL_TO_LVAL_CAST_OK' => 'ZEND_DVAL_TO_IVAL_CAST_OK',
'smart_str_append_long' => 'smart_str_append_int',
'cfg_get_long' => 'cfg_get_int',
'pdo_attr_lval' => 'pdo_attr_ival',
);
if ($reverse_replace) {
/* cleanup also mess when convering back and forth */
$replacements['INTERNAL'] = 'LONGERNAL';
$replacements['INTERACTIVE'] = 'LONGERACTIVE';
$replacements['INTEGER'] = 'LONGEGER';
$file_contents = str_replace(array_values($replacements), array_keys($replacements), $file_contents);
} else {
$file_contents = str_replace(array_keys($replacements), array_values($replacements), $file_contents);
}
}
/* zpp spec replacements */
if ($replace_zpp || $replace_zpp_compat) {
$zpp_map = array(
'l' => 'i',
'L' => 'I',
'p' => 'P',
's' => 'S',
);
$ptr = array(
"/zend_parse_parameters\(.*\s+TSRMLS_CC,\s*\"([a-zA-Z\*+\|\/!]+)\"/msxU",
"/zend_parse_parameters_ex\(.*,\s*.*\s+TSRMLS_CC,\s*\"([a-zA-Z\*+\|\/!]+)\"/msxU",
"/zend_parse_method_parameters\(.*\s+TSRMLS_CC,\s*.*,\s*\"([a-zA-Z\*+\|\/!]+)\"/msxU",
"/zend_parse_method_parameters_ex\(.*,\s*.*\s+TSRMLS_CC,\s*.*,\s*\"([a-zA-Z\*+\|\/!]+)\"/msxU",
);
$raw_specs = $specs = array();
foreach ($ptr as $p) {
if (0 < preg_match_all($p, $file_contents, $m)) {
$raw_specs = array_merge($raw_specs, $m[1]);
}
}
$raw_specs = array_unique($raw_specs);
foreach ($raw_specs as $item) {
if ($reverse_replace) {
$rep = str_replace(array_values($zpp_map), array_keys($zpp_map), $item);
if ($rep != $item) {
$specs['"' . $rep . '"'] = '"' . $item .'"';
}
} else {
$rep = str_replace(array_keys($zpp_map), array_values($zpp_map), $item);
if ($rep != $item) {
$specs['"' . $item . '"'] = '"' . $rep .'"';
}
}
}
if ($replace_zpp_compat) {
if ($reverse_replace) {
echo "WARNING: reverse replace with --zpp-compat is ommited";
} else {
foreach ($specs as $spec0 => $spec1) {
$specs[$spec0] = "ZPP_FMT_COMPAT($spec0, $spec1)";
}
$file_contents = str_replace(array_keys($specs), array_values($specs), $file_contents);
}
} else {
if ($reverse_replace) {
$file_contents = str_replace(array_values($specs), array_keys($specs), $file_contents);
} else {
$file_contents = str_replace(array_keys($specs), array_values($specs), $file_contents);
}
}
}
if (false === file_put_contents($fname, $file_contents)) {
print_error("couldnt write into '$fname'");
}
/* Helpers */
function print_usage($code = 0)
{
echo "Replacement tool for old vs. new macro names and more." . PHP_EOL;
echo "Usage: replace.php [OPTIONS] file" . PHP_EOL;
echo " --custom Path to custom replacement definitions file, optional." . PHP_EOL;
echo " --reverse Replace the new names with the old ones, so reverse, optional." . PHP_EOL;
echo " --macros Replace old vs. new macro names, optional." . PHP_EOL;
echo " --zpp Replace the zpp format specs, optional." . PHP_EOL;
echo " --zpp-compat Same as --zpp but will add both old and new specs for compat, optional." . PHP_EOL;
echo " --zpp-vars Do the best and replace the datatypes on zpp vars, might go insane, optional." . PHP_EOL;
echo " --help This help." . PHP_EOL;
echo PHP_EOL;
echo "Example: " . PHP_EOL;
echo " php replace.php --zpp --macros path/to/file" . PHP_EOL;
echo " php replace.php --zpp --macros --reverse path/to/file" . PHP_EOL;
echo " php replace.php --zpp--compat --macros path/to/file" . PHP_EOL;
echo PHP_EOL;
exit($code);
}
function print_error($str)
{
echo "ERROR: " . $str . PHP_EOL;
exit(3);
}
exit(0);
+1 -1
View File
@@ -60,7 +60,7 @@ AH_BOTTOM([
#endif
#if ZEND_BROKEN_SPRINTF
int zend_sprintf(char *buffer, const char *format, ...);
zend_size_t zend_sprintf(char *buffer, const char *format, ...);
#else
# define zend_sprintf sprintf
#endif
+52 -45
View File
@@ -206,12 +206,13 @@ static void php_str2num(bc_num *num, char *str TSRMLS_DC)
PHP_FUNCTION(bcadd)
{
char *left, *right;
long scale_param = 0;
php_int_t scale_param = 0;
bc_num first, second, result;
int left_len, right_len;
int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS();
php_size_t left_len, right_len;
php_int_t scale = BCG(bc_precision);
int argc = ZEND_NUM_ARGS();
if (zend_parse_parameters(argc TSRMLS_CC, "ss|l", &left, &left_len, &right, &right_len, &scale_param) == FAILURE) {
if (zend_parse_parameters(argc TSRMLS_CC, "SS|i", &left, &left_len, &right, &right_len, &scale_param) == FAILURE) {
return;
}
@@ -231,7 +232,7 @@ PHP_FUNCTION(bcadd)
}
Z_STRVAL_P(return_value) = bc_num2str(result);
Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value));
Z_STRSIZE_P(return_value) = strlen(Z_STRVAL_P(return_value));
Z_TYPE_P(return_value) = IS_STRING;
bc_free_num(&first);
bc_free_num(&second);
@@ -245,12 +246,13 @@ PHP_FUNCTION(bcadd)
PHP_FUNCTION(bcsub)
{
char *left, *right;
int left_len, right_len;
long scale_param = 0;
php_size_t left_len, right_len;
php_int_t scale_param = 0;
bc_num first, second, result;
int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS();
php_int_t scale = BCG(bc_precision);
int argc = ZEND_NUM_ARGS();
if (zend_parse_parameters(argc TSRMLS_CC, "ss|l", &left, &left_len, &right, &right_len, &scale_param) == FAILURE) {
if (zend_parse_parameters(argc TSRMLS_CC, "SS|i", &left, &left_len, &right, &right_len, &scale_param) == FAILURE) {
return;
}
@@ -270,7 +272,7 @@ PHP_FUNCTION(bcsub)
}
Z_STRVAL_P(return_value) = bc_num2str(result);
Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value));
Z_STRSIZE_P(return_value) = strlen(Z_STRVAL_P(return_value));
Z_TYPE_P(return_value) = IS_STRING;
bc_free_num(&first);
bc_free_num(&second);
@@ -284,12 +286,13 @@ PHP_FUNCTION(bcsub)
PHP_FUNCTION(bcmul)
{
char *left, *right;
int left_len, right_len;
long scale_param = 0;
php_size_t left_len, right_len;
php_int_t scale_param = 0;
bc_num first, second, result;
int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS();
php_int_t scale = BCG(bc_precision);
int argc = ZEND_NUM_ARGS();
if (zend_parse_parameters(argc TSRMLS_CC, "ss|l", &left, &left_len, &right, &right_len, &scale_param) == FAILURE) {
if (zend_parse_parameters(argc TSRMLS_CC, "SS|i", &left, &left_len, &right, &right_len, &scale_param) == FAILURE) {
return;
}
@@ -309,7 +312,7 @@ PHP_FUNCTION(bcmul)
}
Z_STRVAL_P(return_value) = bc_num2str(result);
Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value));
Z_STRSIZE_P(return_value) = strlen(Z_STRVAL_P(return_value));
Z_TYPE_P(return_value) = IS_STRING;
bc_free_num(&first);
bc_free_num(&second);
@@ -323,12 +326,13 @@ PHP_FUNCTION(bcmul)
PHP_FUNCTION(bcdiv)
{
char *left, *right;
int left_len, right_len;
long scale_param = 0;
php_size_t left_len, right_len;
php_int_t scale_param = 0;
bc_num first, second, result;
int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS();
php_int_t scale = BCG(bc_precision);
int argc = ZEND_NUM_ARGS();
if (zend_parse_parameters(argc TSRMLS_CC, "ss|l", &left, &left_len, &right, &right_len, &scale_param) == FAILURE) {
if (zend_parse_parameters(argc TSRMLS_CC, "SS|i", &left, &left_len, &right, &right_len, &scale_param) == FAILURE) {
return;
}
@@ -348,7 +352,7 @@ PHP_FUNCTION(bcdiv)
result->n_scale = scale;
}
Z_STRVAL_P(return_value) = bc_num2str(result);
Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value));
Z_STRSIZE_P(return_value) = strlen(Z_STRVAL_P(return_value));
Z_TYPE_P(return_value) = IS_STRING;
break;
case -1: /* division by zero */
@@ -368,10 +372,10 @@ PHP_FUNCTION(bcdiv)
PHP_FUNCTION(bcmod)
{
char *left, *right;
int left_len, right_len;
php_size_t left_len, right_len;
bc_num first, second, result;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &left, &left_len, &right, &right_len) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS", &left, &left_len, &right, &right_len) == FAILURE) {
return;
}
@@ -384,7 +388,7 @@ PHP_FUNCTION(bcmod)
switch (bc_modulo(first, second, &result, 0 TSRMLS_CC)) {
case 0:
Z_STRVAL_P(return_value) = bc_num2str(result);
Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value));
Z_STRSIZE_P(return_value) = strlen(Z_STRVAL_P(return_value));
Z_TYPE_P(return_value) = IS_STRING;
break;
case -1:
@@ -404,12 +408,12 @@ PHP_FUNCTION(bcmod)
PHP_FUNCTION(bcpowmod)
{
char *left, *right, *modulous;
int left_len, right_len, modulous_len;
php_size_t left_len, right_len, modulous_len;
bc_num first, second, mod, result;
long scale = BCG(bc_precision);
php_int_t scale = BCG(bc_precision);
int scale_int;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss|l", &left, &left_len, &right, &right_len, &modulous, &modulous_len, &scale) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SSS|i", &left, &left_len, &right, &right_len, &modulous, &modulous_len, &scale) == FAILURE) {
return;
}
@@ -428,7 +432,7 @@ PHP_FUNCTION(bcpowmod)
result->n_scale = scale;
}
Z_STRVAL_P(return_value) = bc_num2str(result);
Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value));
Z_STRSIZE_P(return_value) = strlen(Z_STRVAL_P(return_value));
Z_TYPE_P(return_value) = IS_STRING;
} else {
RETVAL_FALSE;
@@ -447,12 +451,13 @@ PHP_FUNCTION(bcpowmod)
PHP_FUNCTION(bcpow)
{
char *left, *right;
int left_len, right_len;
long scale_param = 0;
php_size_t left_len, right_len;
php_int_t scale_param = 0;
bc_num first, second, result;
int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS();
php_int_t scale = BCG(bc_precision);
int argc = ZEND_NUM_ARGS();
if (zend_parse_parameters(argc TSRMLS_CC, "ss|l", &left, &left_len, &right, &right_len, &scale_param) == FAILURE) {
if (zend_parse_parameters(argc TSRMLS_CC, "SS|i", &left, &left_len, &right, &right_len, &scale_param) == FAILURE) {
return;
}
@@ -472,7 +477,7 @@ PHP_FUNCTION(bcpow)
}
Z_STRVAL_P(return_value) = bc_num2str(result);
Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value));
Z_STRSIZE_P(return_value) = strlen(Z_STRVAL_P(return_value));
Z_TYPE_P(return_value) = IS_STRING;
bc_free_num(&first);
bc_free_num(&second);
@@ -486,12 +491,13 @@ PHP_FUNCTION(bcpow)
PHP_FUNCTION(bcsqrt)
{
char *left;
int left_len;
long scale_param = 0;
php_size_t left_len;
php_int_t scale_param = 0;
bc_num result;
int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS();
php_int_t scale = BCG(bc_precision);
int argc = ZEND_NUM_ARGS();
if (zend_parse_parameters(argc TSRMLS_CC, "s|l", &left, &left_len, &scale_param) == FAILURE) {
if (zend_parse_parameters(argc TSRMLS_CC, "S|i", &left, &left_len, &scale_param) == FAILURE) {
return;
}
@@ -507,7 +513,7 @@ PHP_FUNCTION(bcsqrt)
result->n_scale = scale;
}
Z_STRVAL_P(return_value) = bc_num2str(result);
Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value));
Z_STRSIZE_P(return_value) = strlen(Z_STRVAL_P(return_value));
Z_TYPE_P(return_value) = IS_STRING;
} else {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Square root of negative number");
@@ -523,12 +529,13 @@ PHP_FUNCTION(bcsqrt)
PHP_FUNCTION(bccomp)
{
char *left, *right;
int left_len, right_len;
long scale_param = 0;
php_size_t left_len, right_len;
php_int_t scale_param = 0;
bc_num first, second;
int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS();
php_int_t scale = BCG(bc_precision);
int argc = ZEND_NUM_ARGS();
if (zend_parse_parameters(argc TSRMLS_CC, "ss|l", &left, &left_len, &right, &right_len, &scale_param) == FAILURE) {
if (zend_parse_parameters(argc TSRMLS_CC, "SS|i", &left, &left_len, &right, &right_len, &scale_param) == FAILURE) {
return;
}
@@ -541,8 +548,8 @@ PHP_FUNCTION(bccomp)
bc_str2num(&first, left, scale TSRMLS_CC);
bc_str2num(&second, right, scale TSRMLS_CC);
Z_LVAL_P(return_value) = bc_compare(first, second);
Z_TYPE_P(return_value) = IS_LONG;
Z_IVAL_P(return_value) = bc_compare(first, second);
Z_TYPE_P(return_value) = IS_INT;
bc_free_num(&first);
bc_free_num(&second);
@@ -554,9 +561,9 @@ PHP_FUNCTION(bccomp)
Sets default scale parameter for all bc math functions */
PHP_FUNCTION(bcscale)
{
long new_scale;
php_int_t new_scale;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &new_scale) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "i", &new_scale) == FAILURE) {
return;
}
+1 -1
View File
@@ -45,7 +45,7 @@ ZEND_BEGIN_MODULE_GLOBALS(bcmath)
bc_num _zero_;
bc_num _one_;
bc_num _two_;
long bc_precision;
php_int_t bc_precision;
ZEND_END_MODULE_GLOBALS(bcmath)
#ifdef ZTS
+39 -23
View File
@@ -335,10 +335,10 @@ static PHP_MINFO_FUNCTION(bz2)
static PHP_FUNCTION(bzread)
{
zval *bz;
long len = 1024;
php_int_t len = 1024;
php_stream *stream;
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &bz, &len)) {
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|i", &bz, &len)) {
RETURN_FALSE;
}
@@ -350,15 +350,14 @@ static PHP_FUNCTION(bzread)
}
Z_STRVAL_P(return_value) = emalloc(len + 1);
Z_STRLEN_P(return_value) = php_stream_read(stream, Z_STRVAL_P(return_value), len);
Z_STRSIZE_P(return_value) = php_stream_read(stream, Z_STRVAL_P(return_value), len);
if (Z_STRLEN_P(return_value) < 0) {
if (Z_STRSIZE_P(return_value) == 0) {
efree(Z_STRVAL_P(return_value));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "could not read valid bz2 data from stream");
RETURN_FALSE;
RETURN_STRINGL("", 0, 1);
}
Z_STRVAL_P(return_value)[Z_STRLEN_P(return_value)] = 0;
Z_STRVAL_P(return_value)[Z_STRSIZE_P(return_value)] = 0;
Z_TYPE_P(return_value) = IS_STRING;
}
/* }}} */
@@ -369,12 +368,12 @@ static PHP_FUNCTION(bzopen)
{
zval **file; /* The file to open */
char *mode; /* The mode to open the stream with */
int mode_len;
php_size_t mode_len;
BZFILE *bz; /* The compressed file stream */
php_stream *stream = NULL;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Zs", &file, &mode, &mode_len) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ZS", &file, &mode, &mode_len) == FAILURE) {
return;
}
@@ -385,7 +384,7 @@ static PHP_FUNCTION(bzopen)
/* If it's not a resource its a string containing the filename to open */
if (Z_TYPE_PP(file) == IS_STRING) {
if (Z_STRLEN_PP(file) == 0) {
if (Z_STRSIZE_PP(file) == 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "filename cannot be empty");
RETURN_FALSE;
}
@@ -402,7 +401,7 @@ static PHP_FUNCTION(bzopen)
} else if (Z_TYPE_PP(file) == IS_RESOURCE) {
/* If it is a resource, than its a stream resource */
php_socket_t fd;
int stream_mode_len;
php_size_t stream_mode_len;
php_stream_from_zval(stream, file);
stream_mode_len = strlen(stream->mode);
@@ -486,22 +485,33 @@ static PHP_FUNCTION(bzerror)
static PHP_FUNCTION(bzcompress)
{
char *source; /* Source data to compress */
long zblock_size = 0; /* Optional block size to use */
long zwork_factor = 0;/* Optional work factor to use */
php_int_t zblock_size = 0; /* Optional block size to use */
php_int_t zwork_factor = 0;/* Optional work factor to use */
char *dest = NULL; /* Destination to place the compressed data into */
int error, /* Error Container */
block_size = 4, /* Block size for compression algorithm */
work_factor = 0, /* Work factor for compression algorithm */
argc; /* Argument count */
int source_len; /* Length of the source data */
php_size_t source_len; /* Length of the source data */
unsigned int dest_len; /* Length of the destination buffer */
argc = ZEND_NUM_ARGS();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ll", &source, &source_len, &zblock_size, &zwork_factor) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|ii", &source, &source_len, &zblock_size, &zwork_factor) == FAILURE) {
return;
}
if (source_len > UINT_MAX) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "The string to compress is too large");
RETURN_INT(BZ_PARAM_ERROR);
} else if (argc > 1 && zblock_size > INT_MAX) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid block size");
RETURN_INT(BZ_PARAM_ERROR);
} else if (argc > 2 && zwork_factor > INT_MAX) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid work factor");
RETURN_INT(BZ_PARAM_ERROR);
}
/* Assign them to easy to use variables, dest_len is initially the length of the data
+ .01 x length of data + 600 which is the largest size the results of the compression
could possibly be, at least that's what the libbz2 docs say (thanks to jeremy@nirvani.net
@@ -523,7 +533,7 @@ static PHP_FUNCTION(bzcompress)
error = BZ2_bzBuffToBuffCompress(dest, &dest_len, source, source_len, block_size, 0, work_factor);
if (error != BZ_OK) {
efree(dest);
RETURN_LONG(error);
RETURN_INT(error);
} else {
/* Copy the buffer, we have perhaps allocate a lot more than we need,
so we erealloc() the buffer to the proper size */
@@ -539,8 +549,9 @@ static PHP_FUNCTION(bzcompress)
static PHP_FUNCTION(bzdecompress)
{
char *source, *dest;
int source_len, error;
long small = 0;
php_size_t source_len;
int error;
php_int_t small = 0;
#if defined(PHP_WIN32)
unsigned __int64 size = 0;
#else
@@ -548,14 +559,19 @@ static PHP_FUNCTION(bzdecompress)
#endif
bz_stream bzs;
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &source, &source_len, &small)) {
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|i", &source, &source_len, &small)) {
RETURN_FALSE;
}
if (source_len > UINT_MAX/2) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "The string to decompress is too large");
RETURN_FALSE;
}
bzs.bzalloc = NULL;
bzs.bzfree = NULL;
if (BZ2_bzDecompressInit(&bzs, 0, small) != BZ_OK) {
if (BZ2_bzDecompressInit(&bzs, 0, (int)small) != BZ_OK) {
RETURN_FALSE;
}
@@ -581,7 +597,7 @@ static PHP_FUNCTION(bzdecompress)
RETVAL_STRINGL(dest, (int) size, 0);
} else { /* real error */
efree(dest);
RETVAL_LONG(error);
RETVAL_INT(error);
}
BZ2_bzDecompressEnd(&bzs);
@@ -616,7 +632,7 @@ static void php_bz2_error(INTERNAL_FUNCTION_PARAMETERS, int opt)
/* Determine what to return */
switch (opt) {
case PHP_BZ_ERRNO:
RETURN_LONG(errnum);
RETURN_INT(errnum);
break;
case PHP_BZ_ERRSTR:
RETURN_STRING((char*)errstr, 1);
@@ -624,7 +640,7 @@ static void php_bz2_error(INTERNAL_FUNCTION_PARAMETERS, int opt)
case PHP_BZ_ERRBOTH:
array_init(return_value);
add_assoc_long (return_value, "errno", errnum);
add_assoc_int (return_value, "errno", errnum);
add_assoc_string(return_value, "errstr", (char*)errstr, 1);
break;
}
+10 -10
View File
@@ -358,7 +358,7 @@ static php_stream_filter *php_bz2_filter_create(const char *filtername, zval *fi
zval_copy_ctor(&tmp);
tmp2 = &tmp;
convert_to_boolean_ex(&tmp2);
data->expect_concatenated = Z_LVAL(tmp);
data->expect_concatenated = Z_IVAL(tmp);
tmpzval = NULL;
}
@@ -374,7 +374,7 @@ static php_stream_filter *php_bz2_filter_create(const char *filtername, zval *fi
zval_copy_ctor(&tmp);
tmp2 = &tmp;
convert_to_boolean_ex(&tmp2);
data->small_footprint = Z_LVAL(tmp);
data->small_footprint = Z_IVAL(tmp);
}
}
@@ -394,11 +394,11 @@ static php_stream_filter *php_bz2_filter_create(const char *filtername, zval *fi
tmp = **tmpzval;
zval_copy_ctor(&tmp);
convert_to_long(&tmp);
if (Z_LVAL(tmp) < 1 || Z_LVAL(tmp) > 9) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter given for number of blocks to allocate. (%ld)", Z_LVAL_PP(tmpzval));
convert_to_int(&tmp);
if (Z_IVAL(tmp) < 1 || Z_IVAL(tmp) > 9) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter given for number of blocks to allocate. (%ld)", Z_IVAL_PP(tmpzval));
} else {
blockSize100k = Z_LVAL(tmp);
blockSize100k = Z_IVAL(tmp);
}
}
@@ -408,12 +408,12 @@ static php_stream_filter *php_bz2_filter_create(const char *filtername, zval *fi
tmp = **tmpzval;
zval_copy_ctor(&tmp);
convert_to_long(&tmp);
convert_to_int(&tmp);
if (Z_LVAL(tmp) < 0 || Z_LVAL(tmp) > 250) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter given for work factor. (%ld)", Z_LVAL(tmp));
if (Z_IVAL(tmp) < 0 || Z_IVAL(tmp) > 250) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter given for work factor. (%ld)", Z_IVAL(tmp));
} else {
workFactor = Z_LVAL(tmp);
workFactor = Z_IVAL(tmp);
}
}
}
+5 -5
View File
@@ -31,7 +31,7 @@ PHP_FUNCTION(unixtojd)
time_t ts = 0;
struct tm *ta, tmbuf;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &ts) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|i", &ts) == FAILURE) {
return;
}
@@ -45,7 +45,7 @@ PHP_FUNCTION(unixtojd)
RETURN_FALSE;
}
RETURN_LONG(GregorianToSdn(ta->tm_year+1900, ta->tm_mon+1, ta->tm_mday));
RETURN_INT(GregorianToSdn(ta->tm_year+1900, ta->tm_mon+1, ta->tm_mday));
}
/* }}} */
@@ -53,9 +53,9 @@ PHP_FUNCTION(unixtojd)
Convert Julian Day to UNIX timestamp */
PHP_FUNCTION(jdtounix)
{
long uday;
php_int_t uday;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &uday) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "i", &uday) == FAILURE) {
return;
}
uday -= 2440588 /* J.D. of 1.1.1970 */;
@@ -64,7 +64,7 @@ PHP_FUNCTION(jdtounix)
RETURN_FALSE;
}
RETURN_LONG(uday * 24 * 3600);
RETURN_INT(uday * 24 * 3600);
}
/* }}} */
+68 -68
View File
@@ -178,8 +178,8 @@ enum cal_name_type_t {
CAL_NUM_CALS
};
typedef long int (*cal_to_jd_func_t) (int month, int day, int year);
typedef void (*cal_from_jd_func_t) (long int jd, int *year, int *month, int *day);
typedef php_int_t (*cal_to_jd_func_t) (int month, int day, int year);
typedef void (*cal_from_jd_func_t) (php_int_t jd, int *year, int *month, int *day);
typedef char *(*cal_as_string_func_t) (int year, int month, int day);
struct cal_entry_t {
@@ -225,31 +225,31 @@ static char alef_bet[25] = "0
PHP_MINIT_FUNCTION(calendar)
{
REGISTER_LONG_CONSTANT("CAL_GREGORIAN", CAL_GREGORIAN, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("CAL_JULIAN", CAL_JULIAN, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("CAL_JEWISH", CAL_JEWISH, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("CAL_FRENCH", CAL_FRENCH, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("CAL_NUM_CALS", CAL_NUM_CALS, CONST_CS | CONST_PERSISTENT);
REGISTER_INT_CONSTANT("CAL_GREGORIAN", CAL_GREGORIAN, CONST_CS | CONST_PERSISTENT);
REGISTER_INT_CONSTANT("CAL_JULIAN", CAL_JULIAN, CONST_CS | CONST_PERSISTENT);
REGISTER_INT_CONSTANT("CAL_JEWISH", CAL_JEWISH, CONST_CS | CONST_PERSISTENT);
REGISTER_INT_CONSTANT("CAL_FRENCH", CAL_FRENCH, CONST_CS | CONST_PERSISTENT);
REGISTER_INT_CONSTANT("CAL_NUM_CALS", CAL_NUM_CALS, CONST_CS | CONST_PERSISTENT);
/* constants for jddayofweek */
REGISTER_LONG_CONSTANT("CAL_DOW_DAYNO", CAL_DOW_DAYNO, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("CAL_DOW_SHORT", CAL_DOW_SHORT, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("CAL_DOW_LONG", CAL_DOW_LONG, CONST_CS | CONST_PERSISTENT);
REGISTER_INT_CONSTANT("CAL_DOW_DAYNO", CAL_DOW_DAYNO, CONST_CS | CONST_PERSISTENT);
REGISTER_INT_CONSTANT("CAL_DOW_SHORT", CAL_DOW_SHORT, CONST_CS | CONST_PERSISTENT);
REGISTER_INT_CONSTANT("CAL_DOW_LONG", CAL_DOW_LONG, CONST_CS | CONST_PERSISTENT);
/* constants for jdmonthname */
REGISTER_LONG_CONSTANT("CAL_MONTH_GREGORIAN_SHORT", CAL_MONTH_GREGORIAN_SHORT, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("CAL_MONTH_GREGORIAN_LONG", CAL_MONTH_GREGORIAN_LONG, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("CAL_MONTH_JULIAN_SHORT", CAL_MONTH_JULIAN_SHORT, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("CAL_MONTH_JULIAN_LONG", CAL_MONTH_JULIAN_LONG, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("CAL_MONTH_JEWISH", CAL_MONTH_JEWISH, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("CAL_MONTH_FRENCH", CAL_MONTH_FRENCH, CONST_CS | CONST_PERSISTENT);
REGISTER_INT_CONSTANT("CAL_MONTH_GREGORIAN_SHORT", CAL_MONTH_GREGORIAN_SHORT, CONST_CS | CONST_PERSISTENT);
REGISTER_INT_CONSTANT("CAL_MONTH_GREGORIAN_LONG", CAL_MONTH_GREGORIAN_LONG, CONST_CS | CONST_PERSISTENT);
REGISTER_INT_CONSTANT("CAL_MONTH_JULIAN_SHORT", CAL_MONTH_JULIAN_SHORT, CONST_CS | CONST_PERSISTENT);
REGISTER_INT_CONSTANT("CAL_MONTH_JULIAN_LONG", CAL_MONTH_JULIAN_LONG, CONST_CS | CONST_PERSISTENT);
REGISTER_INT_CONSTANT("CAL_MONTH_JEWISH", CAL_MONTH_JEWISH, CONST_CS | CONST_PERSISTENT);
REGISTER_INT_CONSTANT("CAL_MONTH_FRENCH", CAL_MONTH_FRENCH, CONST_CS | CONST_PERSISTENT);
/* constants for easter calculation */
REGISTER_LONG_CONSTANT("CAL_EASTER_DEFAULT", CAL_EASTER_DEFAULT, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("CAL_EASTER_ROMAN", CAL_EASTER_ROMAN, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("CAL_EASTER_ALWAYS_GREGORIAN", CAL_EASTER_ALWAYS_GREGORIAN, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("CAL_EASTER_ALWAYS_JULIAN", CAL_EASTER_ALWAYS_JULIAN, CONST_CS | CONST_PERSISTENT);
REGISTER_INT_CONSTANT("CAL_EASTER_DEFAULT", CAL_EASTER_DEFAULT, CONST_CS | CONST_PERSISTENT);
REGISTER_INT_CONSTANT("CAL_EASTER_ROMAN", CAL_EASTER_ROMAN, CONST_CS | CONST_PERSISTENT);
REGISTER_INT_CONSTANT("CAL_EASTER_ALWAYS_GREGORIAN", CAL_EASTER_ALWAYS_GREGORIAN, CONST_CS | CONST_PERSISTENT);
REGISTER_INT_CONSTANT("CAL_EASTER_ALWAYS_JULIAN", CAL_EASTER_ALWAYS_JULIAN, CONST_CS | CONST_PERSISTENT);
/* constants for Jewish date formatting */
REGISTER_LONG_CONSTANT("CAL_JEWISH_ADD_ALAFIM_GERESH", CAL_JEWISH_ADD_ALAFIM_GERESH, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("CAL_JEWISH_ADD_ALAFIM", CAL_JEWISH_ADD_ALAFIM, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("CAL_JEWISH_ADD_GERESHAYIM", CAL_JEWISH_ADD_GERESHAYIM, CONST_CS | CONST_PERSISTENT);
REGISTER_INT_CONSTANT("CAL_JEWISH_ADD_ALAFIM_GERESH", CAL_JEWISH_ADD_ALAFIM_GERESH, CONST_CS | CONST_PERSISTENT);
REGISTER_INT_CONSTANT("CAL_JEWISH_ADD_ALAFIM", CAL_JEWISH_ADD_ALAFIM, CONST_CS | CONST_PERSISTENT);
REGISTER_INT_CONSTANT("CAL_JEWISH_ADD_GERESHAYIM", CAL_JEWISH_ADD_GERESHAYIM, CONST_CS | CONST_PERSISTENT);
return SUCCESS;
}
@@ -280,7 +280,7 @@ static void _php_cal_info(int cal, zval **ret)
}
add_assoc_zval(*ret, "months", months);
add_assoc_zval(*ret, "abbrevmonths", smonths);
add_assoc_long(*ret, "maxdaysinmonth", calendar->max_days_in_month);
add_assoc_int(*ret, "maxdaysinmonth", calendar->max_days_in_month);
add_assoc_string(*ret, "calname", calendar->name, 1);
add_assoc_string(*ret, "calsymbol", calendar->symbol, 1);
@@ -290,10 +290,10 @@ static void _php_cal_info(int cal, zval **ret)
Returns information about a particular calendar */
PHP_FUNCTION(cal_info)
{
long cal = -1;
php_int_t cal = -1;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &cal) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|i", &cal) == FAILURE) {
RETURN_FALSE;
}
@@ -313,7 +313,7 @@ PHP_FUNCTION(cal_info)
if (cal != -1 && (cal < 0 || cal >= CAL_NUM_CALS)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid calendar ID %ld.", cal);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid calendar ID %pd.", cal);
RETURN_FALSE;
}
@@ -326,16 +326,16 @@ PHP_FUNCTION(cal_info)
Returns the number of days in a month for a given year and calendar */
PHP_FUNCTION(cal_days_in_month)
{
long cal, month, year;
php_int_t cal, month, year;
struct cal_entry_t *calendar;
long sdn_start, sdn_next;
php_int_t sdn_start, sdn_next;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &cal, &month, &year) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "iii", &cal, &month, &year) == FAILURE) {
RETURN_FALSE;
}
if (cal < 0 || cal >= CAL_NUM_CALS) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid calendar ID %ld.", cal);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid calendar ID %pd.", cal);
RETURN_FALSE;
}
@@ -362,7 +362,7 @@ PHP_FUNCTION(cal_days_in_month)
}
}
RETURN_LONG(sdn_next - sdn_start);
RETURN_INT(sdn_next - sdn_start);
}
/* }}} */
@@ -370,18 +370,18 @@ PHP_FUNCTION(cal_days_in_month)
Converts from a supported calendar to Julian Day Count */
PHP_FUNCTION(cal_to_jd)
{
long cal, month, day, year;
php_int_t cal, month, day, year;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llll", &cal, &month, &day, &year) != SUCCESS) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "iiii", &cal, &month, &day, &year) != SUCCESS) {
RETURN_FALSE;
}
if (cal < 0 || cal >= CAL_NUM_CALS) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid calendar ID %ld.", cal);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid calendar ID %pd.", cal);
RETURN_FALSE;
}
RETURN_LONG(cal_conversion_table[cal].to_jd(year, month, day));
RETURN_INT(cal_conversion_table[cal].to_jd(year, month, day));
}
/* }}} */
@@ -389,17 +389,17 @@ PHP_FUNCTION(cal_to_jd)
Converts from Julian Day Count to a supported calendar and return extended information */
PHP_FUNCTION(cal_from_jd)
{
long jd, cal;
php_int_t jd, cal;
int month, day, year, dow;
char date[16];
struct cal_entry_t *calendar;
if (zend_parse_parameters(ZEND_NUM_ARGS()TSRMLS_CC, "ll", &jd, &cal) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS()TSRMLS_CC, "ii", &jd, &cal) == FAILURE) {
RETURN_FALSE;
}
if (cal < 0 || cal >= CAL_NUM_CALS) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid calendar ID %ld", cal);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid calendar ID %pd", cal);
RETURN_FALSE;
}
calendar = &cal_conversion_table[cal];
@@ -411,13 +411,13 @@ PHP_FUNCTION(cal_from_jd)
snprintf(date, sizeof(date), "%i/%i/%i", month, day, year);
add_assoc_string(return_value, "date", date, 1);
add_assoc_long(return_value, "month", month);
add_assoc_long(return_value, "day", day);
add_assoc_long(return_value, "year", year);
add_assoc_int(return_value, "month", month);
add_assoc_int(return_value, "day", day);
add_assoc_int(return_value, "year", year);
/* day of week */
dow = DayOfWeek(jd);
add_assoc_long(return_value, "dow", dow);
add_assoc_int(return_value, "dow", dow);
add_assoc_string(return_value, "abbrevdayname", DayNameShort[dow], 1);
add_assoc_string(return_value, "dayname", DayNameLong[dow], 1);
/* month name */
@@ -436,11 +436,11 @@ PHP_FUNCTION(cal_from_jd)
Converts a julian day count to a gregorian calendar date */
PHP_FUNCTION(jdtogregorian)
{
long julday;
php_int_t julday;
int year, month, day;
char date[16];
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &julday) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "i", &julday) == FAILURE) {
RETURN_FALSE;
}
@@ -455,13 +455,13 @@ PHP_FUNCTION(jdtogregorian)
Converts a gregorian calendar date to julian day count */
PHP_FUNCTION(gregoriantojd)
{
long year, month, day;
php_int_t year, month, day;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &month, &day, &year) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "iii", &month, &day, &year) == FAILURE) {
RETURN_FALSE;
}
RETURN_LONG(GregorianToSdn(year, month, day));
RETURN_INT(GregorianToSdn(year, month, day));
}
/* }}} */
@@ -469,11 +469,11 @@ PHP_FUNCTION(gregoriantojd)
Convert a julian day count to a julian calendar date */
PHP_FUNCTION(jdtojulian)
{
long julday;
php_int_t julday;
int year, month, day;
char date[16];
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &julday) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "i", &julday) == FAILURE) {
RETURN_FALSE;
}
@@ -488,13 +488,13 @@ PHP_FUNCTION(jdtojulian)
Converts a julian calendar date to julian day count */
PHP_FUNCTION(juliantojd)
{
long year, month, day;
php_int_t year, month, day;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &month, &day, &year) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "iii", &month, &day, &year) == FAILURE) {
RETURN_FALSE;
}
RETURN_LONG(JulianToSdn(year, month, day));
RETURN_INT(JulianToSdn(year, month, day));
}
/* }}} */
@@ -597,13 +597,13 @@ static char *heb_number_to_chars(int n, int fl, char **ret)
Converts a julian day count to a jewish calendar date */
PHP_FUNCTION(jdtojewish)
{
long julday, fl = 0;
php_int_t julday, fl = 0;
zend_bool heb = 0;
int year, month, day;
char date[16], hebdate[32];
char *dayp, *yearp;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|bl", &julday, &heb, &fl) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "i|bi", &julday, &heb, &fl) == FAILURE) {
RETURN_FALSE;
}
@@ -636,13 +636,13 @@ PHP_FUNCTION(jdtojewish)
Converts a jewish calendar date to a julian day count */
PHP_FUNCTION(jewishtojd)
{
long year, month, day;
php_int_t year, month, day;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &month, &day, &year) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "iii", &month, &day, &year) == FAILURE) {
RETURN_FALSE;
}
RETURN_LONG(JewishToSdn(year, month, day));
RETURN_INT(JewishToSdn(year, month, day));
}
/* }}} */
@@ -650,11 +650,11 @@ PHP_FUNCTION(jewishtojd)
Converts a julian day count to a french republic calendar date */
PHP_FUNCTION(jdtofrench)
{
long julday;
php_int_t julday;
int year, month, day;
char date[16];
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &julday) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "i", &julday) == FAILURE) {
RETURN_FALSE;
}
@@ -669,13 +669,13 @@ PHP_FUNCTION(jdtofrench)
Converts a french republic calendar date to julian day count */
PHP_FUNCTION(frenchtojd)
{
long year, month, day;
php_int_t year, month, day;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &month, &day, &year) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "iii", &month, &day, &year) == FAILURE) {
RETURN_FALSE;
}
RETURN_LONG(FrenchToSdn(year, month, day));
RETURN_INT(FrenchToSdn(year, month, day));
}
/* }}} */
@@ -683,11 +683,11 @@ PHP_FUNCTION(frenchtojd)
Returns name or number of day of week from julian day count */
PHP_FUNCTION(jddayofweek)
{
long julday, mode = CAL_DOW_DAYNO;
php_int_t julday, mode = CAL_DOW_DAYNO;
int day;
char *daynamel, *daynames;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|l", &julday, &mode) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "i|i", &julday, &mode) == FAILURE) {
RETURN_FALSE;
}
@@ -704,7 +704,7 @@ PHP_FUNCTION(jddayofweek)
break;
case CAL_DOW_DAYNO:
default:
RETURN_LONG(day);
RETURN_INT(day);
break;
}
}
@@ -714,11 +714,11 @@ PHP_FUNCTION(jddayofweek)
Returns name of month for julian day count */
PHP_FUNCTION(jdmonthname)
{
long julday, mode;
php_int_t julday, mode;
char *monthname = NULL;
int month, day, year;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &julday, &mode) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ii", &julday, &mode) == FAILURE) {
RETURN_FALSE;
}
+2 -2
View File
@@ -12,7 +12,7 @@
*
* int
* DayOfWeek(
* long int sdn);
* php_int_t sdn);
*
* Convert a SDN to a day-of-week number (0 to 6). Where 0 stands for
* Sunday, 1 for Monday, etc. and 6 stands for Saturday.
@@ -32,7 +32,7 @@
#include "sdncal.h"
int DayOfWeek(
long int sdn)
php_int_t sdn)
{
int dow;
+7 -7
View File
@@ -24,14 +24,14 @@
#include "sdncal.h"
#include <time.h>
static void _cal_easter(INTERNAL_FUNCTION_PARAMETERS, int gm)
static void _cal_easter(INTERNAL_FUNCTION_PARAMETERS, php_int_t gm)
{
/* based on code by Simon Kershaw, <webmaster@ely.anglican.org> */
struct tm te;
long year, golden, solar, lunar, pfm, dom, tmp, easter;
long method = CAL_EASTER_DEFAULT;
php_int_t year, golden, solar, lunar, pfm, dom, tmp, easter;
php_int_t method = CAL_EASTER_DEFAULT;
/* Default to the current year if year parameter is not given */
{
@@ -47,7 +47,7 @@ static void _cal_easter(INTERNAL_FUNCTION_PARAMETERS, int gm)
}
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
"|ll", &year, &method) == FAILURE) {
"|ii", &year, &method) == FAILURE) {
return;
}
@@ -112,12 +112,12 @@ static void _cal_easter(INTERNAL_FUNCTION_PARAMETERS, int gm)
te.tm_mday = easter-10;
}
Z_LVAL_P(return_value) = mktime(&te);
Z_IVAL_P(return_value) = mktime(&te);
} else { /* return the days after March 21 */
Z_LVAL_P(return_value) = easter;
Z_IVAL_P(return_value) = easter;
}
Z_TYPE_P(return_value) = IS_LONG;
Z_TYPE_P(return_value) = IS_INT;
}
+5 -5
View File
@@ -11,7 +11,7 @@
*
* void
* SdnToFrench(
* long int sdn,
* php_int_t sdn,
* int *pYear,
* int *pMonth,
* int *pDay);
@@ -24,7 +24,7 @@
* 13, the SDN represents one of the holidays at the end of the year and
* *pDay will be in the range 1 to 6 inclusive.
*
* long int
* php_int_t
* FrenchToSdn(
* int year,
* int month,
@@ -93,12 +93,12 @@
#define LAST_VALID 2380952
void SdnToFrench(
long int sdn,
php_int_t sdn,
int *pYear,
int *pMonth,
int *pDay)
{
long int temp;
php_int_t temp;
int dayOfYear;
if (sdn < FIRST_VALID || sdn > LAST_VALID) {
@@ -114,7 +114,7 @@ void SdnToFrench(
*pDay = dayOfYear % DAYS_PER_MONTH + 1;
}
long int FrenchToSdn(
php_int_t FrenchToSdn(
int year,
int month,
int day)
+5 -5
View File
@@ -11,7 +11,7 @@
*
* void
* SdnToGregorian(
* long int sdn,
* php_int_t sdn,
* int *pYear,
* int *pMonth,
* int *pDay);
@@ -21,7 +21,7 @@
* *pYear will be >= -4714 and != 0; *pMonth will be in the range 1 to 12
* inclusive; *pDay will be in the range 1 to 31 inclusive.
*
* long int
* php_int_t
* GregorianToSdn(
* int inputYear,
* int inputMonth,
@@ -135,7 +135,7 @@
#define DAYS_PER_400_YEARS 146097
void SdnToGregorian(
long int sdn,
php_int_t sdn,
int *pYear,
int *pMonth,
int *pDay)
@@ -144,7 +144,7 @@ void SdnToGregorian(
int year;
int month;
int day;
long int temp;
php_int_t temp;
int dayOfYear;
if (sdn <= 0 ||
@@ -190,7 +190,7 @@ fail:
*pDay = 0;
}
long int GregorianToSdn(
php_int_t GregorianToSdn(
int inputYear,
int inputMonth,
int inputDay)
+24 -24
View File
@@ -11,7 +11,7 @@
*
* void
* SdnToJewish(
* long int sdn,
* php_int_t sdn,
* int *pYear,
* int *pMonth,
* int *pDay);
@@ -22,7 +22,7 @@
* inclusive; *pDay will be in the range 1 to 30 inclusive. Note that Adar
* II is assigned the month number 7 and Elul is always 13.
*
* long int
* php_int_t
* JewishToSdn(
* int year,
* int month,
@@ -382,12 +382,12 @@ char *JewishMonthHebName[14] =
* (called dehiyyot) delays it. These 4 rules can delay the start of the
* year by as much as 2 days.
*/
static long int Tishri1(
static php_int_t Tishri1(
int metonicYear,
long int moladDay,
long int moladHalakim)
php_int_t moladDay,
php_int_t moladHalakim)
{
long int tishri1;
php_int_t tishri1;
int dow;
int leapYear;
int lastWasLeapYear;
@@ -429,10 +429,10 @@ static long int Tishri1(
*/
static void MoladOfMetonicCycle(
int metonicCycle,
long int *pMoladDay,
long int *pMoladHalakim)
php_int_t *pMoladDay,
php_int_t *pMoladHalakim)
{
register unsigned long int r1, r2, d1, d2;
register php_uint_t r1, r2, d1, d2;
/* Start with the time of the first molad after creation. */
r1 = NEW_MOON_OF_CREATION;
@@ -468,14 +468,14 @@ static void MoladOfMetonicCycle(
* us to avoid calculating the length of the year in most cases.
*/
static void FindTishriMolad(
long int inputDay,
php_int_t inputDay,
int *pMetonicCycle,
int *pMetonicYear,
long int *pMoladDay,
long int *pMoladHalakim)
php_int_t *pMoladDay,
php_int_t *pMoladHalakim)
{
long int moladDay;
long int moladHalakim;
php_int_t moladDay;
php_int_t moladHalakim;
int metonicCycle;
int metonicYear;
@@ -523,8 +523,8 @@ static void FindStartOfYear(
int year,
int *pMetonicCycle,
int *pMetonicYear,
long int *pMoladDay,
long int *pMoladHalakim,
php_int_t *pMoladDay,
php_int_t *pMoladHalakim,
int *pTishri1)
{
*pMetonicCycle = (year - 1) / 19;
@@ -546,14 +546,14 @@ static void FindStartOfYear(
* range 1 to 13 inclusive; *pDay will be in the range 1 to 30 inclusive.
*/
void SdnToJewish(
long int sdn,
php_int_t sdn,
int *pYear,
int *pMonth,
int *pDay)
{
long int inputDay;
long int day;
long int halakim;
php_int_t inputDay;
php_int_t day;
php_int_t halakim;
int metonicCycle;
int metonicYear;
int tishri1;
@@ -684,18 +684,18 @@ void SdnToJewish(
* value. To verify that a date is valid, convert it to SDN and then back
* and compare with the original.
*/
long int JewishToSdn(
php_int_t JewishToSdn(
int year,
int month,
int day)
{
long int sdn;
php_int_t sdn;
int metonicCycle;
int metonicYear;
int tishri1;
int tishri1After;
long int moladDay;
long int moladHalakim;
php_int_t moladDay;
php_int_t moladHalakim;
int yearLength;
int lengthOfAdarIAndII;
+5 -5
View File
@@ -11,7 +11,7 @@
*
* void
* SdnToJulian(
* long int sdn,
* php_int_t sdn,
* int *pYear,
* int *pMonth,
* int *pDay);
@@ -21,7 +21,7 @@
* will be >= -4713 and != 0; *pMonth will be in the range 1 to 12
* inclusive; *pDay will be in the range 1 to 31 inclusive.
*
* long int
* php_int_t
* JulianToSdn(
* int inputYear,
* int inputMonth,
@@ -153,7 +153,7 @@
#define DAYS_PER_4_YEARS 1461
void SdnToJulian(
long int sdn,
php_int_t sdn,
int *pYear,
int *pMonth,
int *pDay)
@@ -161,7 +161,7 @@ void SdnToJulian(
int year;
int month;
int day;
long int temp;
php_int_t temp;
int dayOfYear;
if (sdn <= 0) {
@@ -212,7 +212,7 @@ fail:
*pDay = 0;
}
long int JulianToSdn(
php_int_t JulianToSdn(
int inputYear,
int inputMonth,
int inputDay)
+13 -11
View File
@@ -32,7 +32,7 @@
* calculating the number of days between two dates.
*
* When using this software on 16 bit systems, be careful to store SDNs in
* a long int, because it will not fit in the 16 bits that some systems
* a php_int_t, because it will not fit in the 16 bits that some systems
* allocate to an int.
*
* For each calendar, there are two routines provided. One converts dates
@@ -53,7 +53,7 @@
*
* int y1, m1, d1;
* int y2, m2, d2;
* long int sdn;
* php_int_t sdn;
* ...
* sdn = GregorianToSdn(y1, m1, d1);
* if (sdn > 0) {
@@ -65,19 +65,21 @@
*
**************************************************************************/
#include "php.h"
/* Gregorian calendar conversions. */
void SdnToGregorian(long int sdn, int *pYear, int *pMonth, int *pDay);
long int GregorianToSdn(int year, int month, int day);
void SdnToGregorian(php_int_t sdn, int *pYear, int *pMonth, int *pDay);
php_int_t GregorianToSdn(int year, int month, int day);
extern char *MonthNameShort[13];
extern char *MonthNameLong[13];
/* Julian calendar conversions. */
void SdnToJulian(long int sdn, int *pYear, int *pMonth, int *pDay);
long int JulianToSdn(int year, int month, int day);
void SdnToJulian(php_int_t sdn, int *pYear, int *pMonth, int *pDay);
php_int_t JulianToSdn(int year, int month, int day);
/* Jewish calendar conversions. */
void SdnToJewish(long int sdn, int *pYear, int *pMonth, int *pDay);
long int JewishToSdn(int year, int month, int day);
void SdnToJewish(php_int_t sdn, int *pYear, int *pMonth, int *pDay);
php_int_t JewishToSdn(int year, int month, int day);
extern char *JewishMonthName[14];
extern char *JewishMonthNameLeap[14];
extern char *JewishMonthHebName[14];
@@ -85,15 +87,15 @@ extern char *JewishMonthHebNameLeap[14];
extern int monthsPerYear[19];
/* French republic calendar conversions. */
void SdnToFrench(long int sdn, int *pYear, int *pMonth, int *pDay);
long int FrenchToSdn(int inputYear, int inputMonth, int inputDay);
void SdnToFrench(php_int_t sdn, int *pYear, int *pMonth, int *pDay);
php_int_t FrenchToSdn(int inputYear, int inputMonth, int inputDay);
extern char *FrenchMonthName[14];
/* Islamic calendar conversions. */
/* Not implemented yet. */
/* Day of week conversion. 0=Sunday, 6=Saturday */
int DayOfWeek(long int sdn);
int DayOfWeek(php_int_t sdn);
extern char *DayNameShort[7];
extern char *DayNameLong[7];
+6 -6
View File
@@ -56,22 +56,22 @@ string(0) ""
Notice: Array to string conversion in %sjdtomonthname.php on line %d
Array
Warning: jdmonthname() expects parameter 1 to be long, array given in %s on line %d
Warning: jdmonthname() expects parameter 1 to be integer, array given in %s on line %d
bool(false)
Warning: jdmonthname() expects parameter 1 to be long, array given in %s on line %d
Warning: jdmonthname() expects parameter 1 to be integer, array given in %s on line %d
bool(false)
Warning: jdmonthname() expects parameter 1 to be long, array given in %s on line %d
Warning: jdmonthname() expects parameter 1 to be integer, array given in %s on line %d
bool(false)
Warning: jdmonthname() expects parameter 1 to be long, array given in %s on line %d
Warning: jdmonthname() expects parameter 1 to be integer, array given in %s on line %d
bool(false)
Warning: jdmonthname() expects parameter 1 to be long, array given in %s on line %d
Warning: jdmonthname() expects parameter 1 to be integer, array given in %s on line %d
bool(false)
Warning: jdmonthname() expects parameter 1 to be long, array given in %s on line %d
Warning: jdmonthname() expects parameter 1 to be integer, array given in %s on line %d
bool(false)
=== 10000000
+24 -24
View File
@@ -37,7 +37,7 @@ PHP_FUNCTION(com_create_instance)
php_com_dotnet_object *obj;
char *module_name, *typelib_name = NULL, *server_name = NULL;
char *user_name = NULL, *domain_name = NULL, *password = NULL;
int module_name_len, typelib_name_len, server_name_len,
php_size_t module_name_len, typelib_name_len, server_name_len,
user_name_len, domain_name_len, password_len;
OLECHAR *moniker;
CLSID clsid;
@@ -57,11 +57,11 @@ PHP_FUNCTION(com_create_instance)
obj = CDNO_FETCH(object);
if (FAILURE == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET,
ZEND_NUM_ARGS() TSRMLS_CC, "s|s!ls",
ZEND_NUM_ARGS() TSRMLS_CC, "S|S!iS",
&module_name, &module_name_len, &server_name, &server_name_len,
&obj->code_page, &typelib_name, &typelib_name_len) &&
FAILURE == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET,
ZEND_NUM_ARGS() TSRMLS_CC, "sa|ls",
ZEND_NUM_ARGS() TSRMLS_CC, "Sa|iS",
&module_name, &module_name_len, &server_params, &obj->code_page,
&typelib_name, &typelib_name_len)) {
@@ -81,7 +81,7 @@ PHP_FUNCTION(com_create_instance)
"Server", sizeof("Server"), (void**)&tmp)) {
convert_to_string_ex(tmp);
server_name = Z_STRVAL_PP(tmp);
server_name_len = Z_STRLEN_PP(tmp);
server_name_len = Z_STRSIZE_PP(tmp);
ctx = CLSCTX_REMOTE_SERVER;
}
@@ -89,27 +89,27 @@ PHP_FUNCTION(com_create_instance)
"Username", sizeof("Username"), (void**)&tmp)) {
convert_to_string_ex(tmp);
user_name = Z_STRVAL_PP(tmp);
user_name_len = Z_STRLEN_PP(tmp);
user_name_len = Z_STRSIZE_PP(tmp);
}
if (SUCCESS == zend_hash_find(HASH_OF(server_params),
"Password", sizeof("Password"), (void**)&tmp)) {
convert_to_string_ex(tmp);
password = Z_STRVAL_PP(tmp);
password_len = Z_STRLEN_PP(tmp);
password_len = Z_STRSIZE_PP(tmp);
}
if (SUCCESS == zend_hash_find(HASH_OF(server_params),
"Domain", sizeof("Domain"), (void**)&tmp)) {
convert_to_string_ex(tmp);
domain_name = Z_STRVAL_PP(tmp);
domain_name_len = Z_STRLEN_PP(tmp);
domain_name_len = Z_STRSIZE_PP(tmp);
}
if (SUCCESS == zend_hash_find(HASH_OF(server_params),
"Flags", sizeof("Flags"), (void**)&tmp)) {
convert_to_long_ex(tmp);
ctx = (CLSCTX)Z_LVAL_PP(tmp);
convert_to_int_ex(tmp);
ctx = (CLSCTX)Z_IVAL_PP(tmp);
}
}
@@ -288,15 +288,15 @@ PHP_FUNCTION(com_get_active_object)
{
CLSID clsid;
char *module_name;
int module_name_len;
long code_page = COMG(code_page);
php_size_t module_name_len;
php_int_t code_page = COMG(code_page);
IUnknown *unk = NULL;
IDispatch *obj = NULL;
HRESULT res;
OLECHAR *module = NULL;
php_com_initialize(TSRMLS_C);
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l",
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|i",
&module_name, &module_name_len, &code_page)) {
php_com_throw_exception(E_INVALIDARG, "Invalid arguments!" TSRMLS_CC);
return;
@@ -349,7 +349,7 @@ HRESULT php_com_invoke_helper(php_com_dotnet_object *obj, DISPID id_member,
if (silent == 0 && FAILED(hr)) {
char *source = NULL, *desc = NULL, *msg = NULL;
int source_len, desc_len;
php_size_t source_len, desc_len;
switch (hr) {
case DISP_E_EXCEPTION:
@@ -416,7 +416,7 @@ HRESULT php_com_invoke_helper(php_com_dotnet_object *obj, DISPID id_member,
/* map an ID to a name */
HRESULT php_com_get_id_of_name(php_com_dotnet_object *obj, char *name,
int namelen, DISPID *dispid TSRMLS_DC)
php_size_t namelen, DISPID *dispid TSRMLS_DC)
{
OLECHAR *olename;
HRESULT hr;
@@ -461,7 +461,7 @@ HRESULT php_com_get_id_of_name(php_com_dotnet_object *obj, char *name,
}
/* the core of COM */
int php_com_do_invoke_byref(php_com_dotnet_object *obj, char *name, int namelen,
int php_com_do_invoke_byref(php_com_dotnet_object *obj, char *name, php_size_t namelen,
WORD flags, VARIANT *v, int nargs, zval ***args TSRMLS_DC)
{
DISPID dispid, altdispid;
@@ -629,7 +629,7 @@ int php_com_do_invoke_by_id(php_com_dotnet_object *obj, DISPID dispid,
return SUCCEEDED(hr) ? SUCCESS : FAILURE;
}
int php_com_do_invoke(php_com_dotnet_object *obj, char *name, int namelen,
int php_com_do_invoke(php_com_dotnet_object *obj, char *name, php_size_t namelen,
WORD flags, VARIANT *v, int nargs, zval **args, int allow_noarg TSRMLS_DC)
{
DISPID dispid;
@@ -665,7 +665,7 @@ PHP_FUNCTION(com_create_guid)
php_com_initialize(TSRMLS_C);
if (CoCreateGuid(&retval) == S_OK && StringFromCLSID(&retval, &guid_string) == S_OK) {
Z_TYPE_P(return_value) = IS_STRING;
Z_STRVAL_P(return_value) = php_com_olestring_to_string(guid_string, &Z_STRLEN_P(return_value), CP_ACP TSRMLS_CC);
Z_STRVAL_P(return_value) = php_com_olestring_to_string(guid_string, &Z_STRSIZE_P(return_value), CP_ACP TSRMLS_CC);
CoTaskMemFree(guid_string);
} else {
@@ -742,12 +742,12 @@ PHP_FUNCTION(com_print_typeinfo)
zval *arg1;
char *ifacename = NULL;
char *typelibname = NULL;
int ifacelen;
php_size_t ifacelen;
zend_bool wantsink = 0;
php_com_dotnet_object *obj = NULL;
ITypeInfo *typeinfo;
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/|s!b", &arg1, &ifacename,
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/|S!b", &arg1, &ifacename,
&ifacelen, &wantsink)) {
RETURN_FALSE;
}
@@ -776,11 +776,11 @@ PHP_FUNCTION(com_print_typeinfo)
Process COM messages, sleeping for up to timeoutms milliseconds */
PHP_FUNCTION(com_message_pump)
{
long timeoutms = 0;
php_int_t timeoutms = 0;
MSG msg;
DWORD result;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &timeoutms) == FAILURE)
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|i", &timeoutms) == FAILURE)
RETURN_FALSE;
php_com_initialize(TSRMLS_C);
@@ -805,13 +805,13 @@ PHP_FUNCTION(com_message_pump)
PHP_FUNCTION(com_load_typelib)
{
char *name;
int namelen;
php_size_t namelen;
ITypeLib *pTL = NULL;
zend_bool cs = TRUE;
int codepage = COMG(code_page);
php_int_t codepage = COMG(code_page);
int cached = 0;
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &name, &namelen, &cs)) {
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|b", &name, &namelen, &cs)) {
return;
}
+2 -2
View File
@@ -188,7 +188,7 @@ PHP_FUNCTION(com_dotnet_create_instance)
zval *object = getThis();
php_com_dotnet_object *obj;
char *assembly_name, *datatype_name;
int assembly_name_len, datatype_name_len;
php_size_t assembly_name_len, datatype_name_len;
struct dotnet_runtime_stuff *stuff;
OLECHAR *oleassembly, *oletype;
BSTR oleassembly_sys, oletype_sys;
@@ -216,7 +216,7 @@ PHP_FUNCTION(com_dotnet_create_instance)
obj = CDNO_FETCH(object);
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l",
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS|i",
&assembly_name, &assembly_name_len,
&datatype_name, &datatype_name_len,
&obj->code_page)) {
+13 -5
View File
@@ -22,6 +22,8 @@
#include "config.h"
#endif
#include <intsafe.h>
#include "php.h"
#include "php_ini.h"
#include "ext/standard/info.h"
@@ -381,7 +383,13 @@ PHP_MINIT_FUNCTION(com_dotnet)
REGISTER_INI_ENTRIES();
#define COM_CONST(x) REGISTER_LONG_CONSTANT(#x, x, CONST_CS|CONST_PERSISTENT)
#define COM_CONST(x) REGISTER_INT_CONSTANT(#x, x, CONST_CS|CONST_PERSISTENT)
#define COM_ERR_CONST(x) { \
php_int_t __tmp; \
ULongToUIntPtr(x, &__tmp); \
REGISTER_INT_CONSTANT(#x, __tmp, CONST_CS|CONST_PERSISTENT); \
}
COM_CONST(CLSCTX_INPROC_SERVER);
COM_CONST(CLSCTX_INPROC_HANDLER);
@@ -441,10 +449,10 @@ PHP_MINIT_FUNCTION(com_dotnet)
#ifdef NORM_IGNOREKASHIDA
COM_CONST(NORM_IGNOREKASHIDA);
#endif
COM_CONST(DISP_E_DIVBYZERO);
COM_CONST(DISP_E_OVERFLOW);
COM_CONST(DISP_E_BADINDEX);
COM_CONST(MK_E_UNAVAILABLE);
COM_ERR_CONST(DISP_E_DIVBYZERO);
COM_ERR_CONST(DISP_E_OVERFLOW);
COM_ERR_CONST(DISP_E_BADINDEX);
COM_ERR_CONST(MK_E_UNAVAILABLE);
return SUCCESS;
}
+11 -11
View File
@@ -48,7 +48,7 @@ static zval *com_property_read(zval *object, zval *member, int type, const zend_
convert_to_string_ex(&member);
res = php_com_do_invoke(obj, Z_STRVAL_P(member), Z_STRLEN_P(member),
res = php_com_do_invoke(obj, Z_STRVAL_P(member), Z_STRSIZE_P(member),
DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v, 0, NULL, 1 TSRMLS_CC);
if (res == SUCCESS) {
@@ -75,7 +75,7 @@ static void com_property_write(zval *object, zval *member, zval *value, const ze
VariantInit(&v);
convert_to_string_ex(&member);
if (SUCCESS == php_com_do_invoke(obj, Z_STRVAL_P(member), Z_STRLEN_P(member),
if (SUCCESS == php_com_do_invoke(obj, Z_STRVAL_P(member), Z_STRSIZE_P(member),
DISPATCH_PROPERTYPUT|DISPATCH_PROPERTYPUTREF, &v, 1, &value, 0 TSRMLS_CC)) {
VariantClear(&v);
}
@@ -106,10 +106,10 @@ static zval *com_read_dimension(zval *object, zval *offset, int type TSRMLS_DC)
VariantClear(&v);
}
} else if (V_ISARRAY(&obj->v)) {
convert_to_long(offset);
convert_to_int(offset);
if (SafeArrayGetDim(V_ARRAY(&obj->v)) == 1) {
if (php_com_safearray_get_elem(&obj->v, &v, Z_LVAL_P(offset) TSRMLS_CC)) {
if (php_com_safearray_get_elem(&obj->v, &v, Z_IVAL_P(offset) TSRMLS_CC)) {
php_com_wrap_variant(return_value, &v, obj->code_page TSRMLS_CC);
VariantClear(&v);
}
@@ -152,8 +152,8 @@ static void com_write_dimension(zval *object, zval *offset, zval *value TSRMLS_D
vt = V_VT(&obj->v) & ~VT_ARRAY;
}
convert_to_long(offset);
indices = Z_LVAL_P(offset);
convert_to_int(offset);
indices = Z_IVAL_P(offset);
VariantInit(&v);
php_com_variant_from_zval(&v, value, obj->code_page TSRMLS_CC);
@@ -205,7 +205,7 @@ static int com_property_exists(zval *object, zval *member, int check_empty, cons
if (V_VT(&obj->v) == VT_DISPATCH) {
convert_to_string_ex(&member);
if (SUCCEEDED(php_com_get_id_of_name(obj, Z_STRVAL_P(member), Z_STRLEN_P(member), &dispid TSRMLS_CC))) {
if (SUCCEEDED(php_com_get_id_of_name(obj, Z_STRVAL_P(member), Z_STRSIZE_P(member), &dispid TSRMLS_CC))) {
/* TODO: distinguish between property and method! */
return 1;
}
@@ -259,7 +259,7 @@ static PHP_FUNCTION(com_method_handler)
INTERNAL_FUNCTION_PARAM_PASSTHRU);
}
static union _zend_function *com_method_get(zval **object_ptr, char *name, int len, const zend_literal *key TSRMLS_DC)
static union _zend_function *com_method_get(zval **object_ptr, char *name, php_size_t len, const zend_literal *key TSRMLS_DC)
{
zend_internal_function f, *fptr = NULL;
php_com_dotnet_object *obj;
@@ -442,7 +442,7 @@ static zend_class_entry *com_class_entry_get(const zval *object TSRMLS_DC)
return obj->ce;
}
static int com_class_name_get(const zval *object, const char **class_name, zend_uint *class_name_len, int parent TSRMLS_DC)
static int com_class_name_get(const zval *object, const char **class_name, php_size_t *class_name_len, int parent TSRMLS_DC)
{
php_com_dotnet_object *obj;
obj = CDNO_FETCH(object);
@@ -507,7 +507,7 @@ static int com_object_cast(zval *readobj, zval *writeobj, int type TSRMLS_DC)
}
switch(type) {
case IS_LONG:
case IS_INT:
vt = VT_INT;
break;
case IS_DOUBLE:
@@ -540,7 +540,7 @@ static int com_object_cast(zval *readobj, zval *writeobj, int type TSRMLS_DC)
return zend_std_cast_object_tostring(readobj, writeobj, type TSRMLS_CC);
}
static int com_object_count(zval *object, long *count TSRMLS_DC)
static int com_object_count(zval *object, php_int_t *count TSRMLS_DC)
{
php_com_dotnet_object *obj;
LONG ubound = 0, lbound = 0;
+3 -3
View File
@@ -32,7 +32,7 @@
struct php_com_iterator {
zend_object_iterator iter;
IEnumVARIANT *ev;
ulong key;
php_uint_t key;
VARIANT v; /* cached element */
int code_page;
VARIANT safe_array;
@@ -78,10 +78,10 @@ static void com_iter_get_key(zend_object_iterator *iter, zval *key TSRMLS_DC)
{
struct php_com_iterator *I = (struct php_com_iterator*)iter->data;
if (I->key == (ulong)-1) {
if (I->key == (php_uint_t)-1) {
ZVAL_NULL(key);
} else {
ZVAL_LONG(key, I->key);
ZVAL_INT(key, I->key);
}
}
+7 -3
View File
@@ -22,6 +22,8 @@
#include "config.h"
#endif
#include <intsafe.h>
#include "php.h"
#include "php_ini.h"
#include "ext/standard/info.h"
@@ -32,18 +34,20 @@
void php_com_throw_exception(HRESULT code, char *message TSRMLS_DC)
{
int free_msg = 0;
php_uint_t cd;
if (message == NULL) {
message = php_win32_error_to_msg(code);
free_msg = 1;
}
zend_throw_exception(php_com_exception_class_entry, message, (long)code TSRMLS_CC);
ULongToUIntPtr(code, &cd);
zend_throw_exception(php_com_exception_class_entry, message, (php_int_t)cd TSRMLS_CC);
if (free_msg) {
LocalFree(message);
}
}
PHP_COM_DOTNET_API void php_com_wrap_dispatch(zval *z, IDispatch *disp,
int codepage TSRMLS_DC)
php_int_t codepage TSRMLS_DC)
{
php_com_dotnet_object *obj;
@@ -66,7 +70,7 @@ PHP_COM_DOTNET_API void php_com_wrap_dispatch(zval *z, IDispatch *disp,
}
PHP_COM_DOTNET_API void php_com_wrap_variant(zval *z, VARIANT *v,
int codepage TSRMLS_DC)
php_int_t codepage TSRMLS_DC)
{
php_com_dotnet_object *obj;
+2 -2
View File
@@ -30,7 +30,7 @@
#include "php_com_dotnet_internal.h"
PHP_COM_DOTNET_API OLECHAR *php_com_string_to_olestring(char *string, uint string_len, int codepage TSRMLS_DC)
PHP_COM_DOTNET_API OLECHAR *php_com_string_to_olestring(char *string, php_size_t string_len, php_int_t codepage TSRMLS_DC)
{
OLECHAR *olestring = NULL;
DWORD flags = codepage == CP_UTF8 ? 0 : MB_PRECOMPOSED | MB_ERR_INVALID_CHARS;
@@ -71,7 +71,7 @@ PHP_COM_DOTNET_API OLECHAR *php_com_string_to_olestring(char *string, uint strin
return olestring;
}
PHP_COM_DOTNET_API char *php_com_olestring_to_string(OLECHAR *olestring, uint *string_len, int codepage TSRMLS_DC)
PHP_COM_DOTNET_API char *php_com_olestring_to_string(OLECHAR *olestring, php_size_t *string_len, php_int_t codepage TSRMLS_DC)
{
char *string;
uint length = 0;
+7 -7
View File
@@ -349,7 +349,7 @@ CPH_METHOD(GetCurFileName)
if (res == S_OK) {
Z_TYPE_P(return_value) = IS_STRING;
Z_STRVAL_P(return_value) = php_com_olestring_to_string(olename,
&Z_STRLEN_P(return_value), helper->codepage TSRMLS_CC);
&Z_STRSIZE_P(return_value), helper->codepage TSRMLS_CC);
CoTaskMemFree(olename);
return;
} else if (res == S_FALSE) {
@@ -370,7 +370,7 @@ CPH_METHOD(SaveToFile)
{
HRESULT res;
char *filename, *fullpath = NULL;
int filename_len;
php_size_t filename_len;
zend_bool remember = TRUE;
OLECHAR *olefilename = NULL;
CPH_FETCH();
@@ -379,7 +379,7 @@ CPH_METHOD(SaveToFile)
res = get_persist_file(helper);
if (helper->ipf) {
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p!|b",
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "P!|b",
&filename, &filename_len, &remember)) {
php_com_throw_exception(E_INVALIDARG, "Invalid arguments" TSRMLS_CC);
return;
@@ -433,8 +433,8 @@ CPH_METHOD(LoadFromFile)
{
HRESULT res;
char *filename, *fullpath;
int filename_len;
long flags = 0;
php_size_t filename_len;
php_int_t flags = 0;
OLECHAR *olefilename;
CPH_FETCH();
@@ -443,7 +443,7 @@ CPH_METHOD(LoadFromFile)
res = get_persist_file(helper);
if (helper->ipf) {
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|l",
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "P|i",
&filename, &filename_len, &flags)) {
php_com_throw_exception(E_INVALIDARG, "Invalid arguments" TSRMLS_CC);
return;
@@ -501,7 +501,7 @@ CPH_METHOD(GetMaxStreamSize)
php_com_throw_exception(res, NULL TSRMLS_CC);
} else {
/* TODO: handle 64 bit properly */
RETURN_LONG((LONG)size.QuadPart);
RETURN_INT((php_int_t)size.QuadPart);
}
}
/* }}} */
+17 -17
View File
@@ -118,7 +118,7 @@ static zval *saproxy_read_dimension(zval *object, zval *offset, int type TSRMLS_
VariantInit(&v);
res = php_com_do_invoke(proxy->obj, Z_STRVAL_P(proxy->indices[0]),
Z_STRLEN_P(proxy->indices[0]), DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v,
Z_STRSIZE_P(proxy->indices[0]), DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v,
proxy->dimensions, args, 0 TSRMLS_CC);
if (res == SUCCESS) {
@@ -139,7 +139,7 @@ static zval *saproxy_read_dimension(zval *object, zval *offset, int type TSRMLS_
/* the SafeArray case */
/* offset/index must be an integer */
convert_to_long(offset);
convert_to_int(offset);
sa = V_ARRAY(&proxy->obj->v);
dims = SafeArrayGetDim(sa);
@@ -154,7 +154,7 @@ static zval *saproxy_read_dimension(zval *object, zval *offset, int type TSRMLS_
SafeArrayGetLBound(sa, proxy->dimensions, &lbound);
SafeArrayGetUBound(sa, proxy->dimensions, &ubound);
if (Z_LVAL_P(offset) < lbound || Z_LVAL_P(offset) > ubound) {
if (Z_IVAL_P(offset) < lbound || Z_IVAL_P(offset) > ubound) {
php_com_throw_exception(DISP_E_BADINDEX, "index out of bounds" TSRMLS_CC);
return return_value;
}
@@ -171,12 +171,12 @@ static zval *saproxy_read_dimension(zval *object, zval *offset, int type TSRMLS_
/* copy indices from proxy */
for (i = 0; i < dims; i++) {
convert_to_long(proxy->indices[i]);
indices[i] = Z_LVAL_P(proxy->indices[i]);
convert_to_int(proxy->indices[i]);
indices[i] = Z_IVAL_P(proxy->indices[i]);
}
/* add user-supplied index */
indices[dims-1] = Z_LVAL_P(offset);
indices[dims-1] = Z_IVAL_P(offset);
/* now fetch the value */
if (FAILED(SafeArrayGetVartype(sa, &vt)) || vt == VT_EMPTY) {
@@ -230,7 +230,7 @@ static void saproxy_write_dimension(zval *object, zval *offset, zval *value TSRM
convert_to_string(proxy->indices[0]);
VariantInit(&v);
if (SUCCESS == php_com_do_invoke(proxy->obj, Z_STRVAL_P(proxy->indices[0]),
Z_STRLEN_P(proxy->indices[0]), DISPATCH_PROPERTYPUT, &v, proxy->dimensions + 1,
Z_STRSIZE_P(proxy->indices[0]), DISPATCH_PROPERTYPUT, &v, proxy->dimensions + 1,
args, 0 TSRMLS_CC)) {
VariantClear(&v);
}
@@ -245,13 +245,13 @@ static void saproxy_write_dimension(zval *object, zval *offset, zval *value TSRM
indices = safe_emalloc(dims, sizeof(LONG), 0);
/* copy indices from proxy */
for (i = 0; i < dims; i++) {
convert_to_long(proxy->indices[i]);
indices[i] = Z_LVAL_P(proxy->indices[i]);
convert_to_int(proxy->indices[i]);
indices[i] = Z_IVAL_P(proxy->indices[i]);
}
/* add user-supplied index */
convert_to_long(offset);
indices[dims-1] = Z_LVAL_P(offset);
convert_to_int(offset);
indices[dims-1] = Z_IVAL_P(offset);
if (FAILED(SafeArrayGetVartype(V_ARRAY(&proxy->obj->v), &vt)) || vt == VT_EMPTY) {
vt = V_VT(&proxy->obj->v) & ~VT_ARRAY;
@@ -321,7 +321,7 @@ static HashTable *saproxy_properties_get(zval *object TSRMLS_DC)
return NULL;
}
static union _zend_function *saproxy_method_get(zval **object, const char *name, int len, const zend_literal *key TSRMLS_DC)
static union _zend_function *saproxy_method_get(zval **object, const char *name, php_size_t len, const zend_literal *key TSRMLS_DC)
{
/* no methods */
return NULL;
@@ -343,7 +343,7 @@ static zend_class_entry *saproxy_class_entry_get(const zval *object TSRMLS_DC)
return php_com_saproxy_class_entry;
}
static int saproxy_class_name_get(const zval *object, const char **class_name, zend_uint *class_name_len, int parent TSRMLS_DC)
static int saproxy_class_name_get(const zval *object, const char **class_name, php_size_t *class_name_len, int parent TSRMLS_DC)
{
*class_name = estrndup(php_com_saproxy_class_entry->name, php_com_saproxy_class_entry->name_length);
*class_name_len = php_com_saproxy_class_entry->name_length;
@@ -360,7 +360,7 @@ static int saproxy_object_cast(zval *readobj, zval *writeobj, int type TSRMLS_DC
return FAILURE;
}
static int saproxy_count_elements(zval *object, long *count TSRMLS_DC)
static int saproxy_count_elements(zval *object, php_int_t *count TSRMLS_DC)
{
php_com_saproxy *proxy = SA_FETCH(object);
LONG ubound, lbound;
@@ -526,7 +526,7 @@ static void saproxy_iter_get_key(zend_object_iterator *iter, zval *key TSRMLS_DC
if (I->key == -1) {
ZVAL_NULL(key);
} else {
ZVAL_LONG(key, I->key);
ZVAL_INT(key, I->key);
}
}
@@ -571,8 +571,8 @@ zend_object_iterator *php_com_saproxy_iter_get(zend_class_entry *ce, zval *objec
I->indices = safe_emalloc(proxy->dimensions + 1, sizeof(LONG), 0);
for (i = 0; i < proxy->dimensions; i++) {
convert_to_long(proxy->indices[i]);
I->indices[i] = Z_LVAL_P(proxy->indices[i]);
convert_to_int(proxy->indices[i]);
I->indices[i] = Z_IVAL_P(proxy->indices[i]);
}
SafeArrayGetLBound(V_ARRAY(&proxy->obj->v), proxy->dimensions, &I->imin);
+11 -10
View File
@@ -35,7 +35,7 @@
* b) a CLSID, major, minor e.g. "{00000200-0000-0010-8000-00AA006D2EA4},2,0"
* c) a Type Library name e.g. "Microsoft OLE DB ActiveX Data Objects 1.0 Library"
*/
PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib(char *search_string, int codepage TSRMLS_DC)
PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib(char *search_string, php_int_t codepage TSRMLS_DC)
{
ITypeLib *TL = NULL;
char *strtok_buf, *major, *minor;
@@ -153,7 +153,7 @@ PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib(char *search_string, int codep
}
/* Given a type-library, merge it into the current engine state */
PHP_COM_DOTNET_API int php_com_import_typelib(ITypeLib *TL, int mode, int codepage TSRMLS_DC)
PHP_COM_DOTNET_API int php_com_import_typelib(ITypeLib *TL, int mode, php_int_t codepage TSRMLS_DC)
{
int i, j, interfaces;
TYPEKIND pTKind;
@@ -206,10 +206,10 @@ PHP_COM_DOTNET_API int php_com_import_typelib(ITypeLib *TL, int mode, int codepa
/* register the constant */
php_com_zval_from_variant(&value, pVarDesc->lpvarValue, codepage TSRMLS_CC);
if (Z_TYPE(value) == IS_LONG) {
if (Z_TYPE(value) == IS_INT) {
c.flags = mode;
c.value.type = IS_LONG;
c.value.value.lval = Z_LVAL(value);
c.value.type = IS_INT;
c.value.value.lval = Z_IVAL(value);
c.module_number = 0;
zend_register_constant(&c TSRMLS_CC);
}
@@ -229,12 +229,12 @@ void php_com_typelibrary_dtor(void *pDest)
}
PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib_via_cache(char *search_string,
int codepage, int *cached TSRMLS_DC)
php_int_t codepage, int *cached TSRMLS_DC)
{
ITypeLib **TLp;
ITypeLib *TL;
char *name_dup;
int l;
php_size_t l;
l = strlen(search_string);
@@ -431,14 +431,14 @@ static char *php_com_string_from_clsid(const CLSID *clsid, int codepage TSRMLS_D
}
int php_com_process_typeinfo(ITypeInfo *typeinfo, HashTable *id_to_name, int printdef, GUID *guid, int codepage TSRMLS_DC)
int php_com_process_typeinfo(ITypeInfo *typeinfo, HashTable *id_to_name, int printdef, GUID *guid, php_int_t codepage TSRMLS_DC)
{
TYPEATTR *attr;
FUNCDESC *func;
int i;
OLECHAR *olename;
char *ansiname = NULL;
unsigned int ansinamelen;
php_size_t ansinamelen;
int ret = 0;
if (FAILED(ITypeInfo_GetTypeAttr(typeinfo, &attr))) {
@@ -492,7 +492,8 @@ int php_com_process_typeinfo(ITypeInfo *typeinfo, HashTable *id_to_name, int pri
if (printdef) {
int j;
char *funcdesc;
unsigned int funcdesclen, cnames = 0;
php_size_t funcdesclen;
UINT cnames = 0;
BSTR *names;
names = (BSTR*)safe_emalloc((func->cParams + 1), sizeof(BSTR), 0);
+45 -45
View File
@@ -32,16 +32,16 @@
* Only creates a single-dimensional array of variants.
* The keys of the PHP hash MUST be numeric. If the array
* is sparse, then the gaps will be filled with NULL variants */
static void safe_array_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC)
static void safe_array_from_zval(VARIANT *v, zval *z, php_int_t codepage TSRMLS_DC)
{
SAFEARRAY *sa = NULL;
SAFEARRAYBOUND bound;
HashPosition pos;
int keytype;
char *strindex;
int strindexlen;
long intindex = -1;
long max_index = 0;
php_size_t strindexlen;
php_int_t intindex = -1;
php_int_t max_index = 0;
VARIANT *va;
zval **item;
@@ -98,7 +98,7 @@ bogus:
}
}
PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC)
PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, php_int_t codepage TSRMLS_DC)
{
OLECHAR *olestring;
php_com_dotnet_object *obj;
@@ -141,9 +141,9 @@ PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codep
safe_array_from_zval(v, z, codepage TSRMLS_CC);
break;
case IS_LONG:
case IS_INT:
V_VT(v) = VT_I4;
V_I4(v) = Z_LVAL_P(z);
V_I4(v) = Z_IVAL_P(z);
break;
case IS_DOUBLE:
@@ -153,11 +153,11 @@ PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codep
case IS_STRING:
V_VT(v) = VT_BSTR;
olestring = php_com_string_to_olestring(Z_STRVAL_P(z), Z_STRLEN_P(z), codepage TSRMLS_CC);
olestring = php_com_string_to_olestring(Z_STRVAL_P(z), Z_STRSIZE_P(z), codepage TSRMLS_CC);
if (CP_UTF8 == codepage) {
V_BSTR(v) = SysAllocStringByteLen((char*)olestring, wcslen(olestring) * sizeof(OLECHAR));
} else {
V_BSTR(v) = SysAllocStringByteLen((char*)olestring, Z_STRLEN_P(z) * sizeof(OLECHAR));
V_BSTR(v) = SysAllocStringByteLen((char*)olestring, Z_STRSIZE_P(z) * sizeof(OLECHAR));
}
efree(olestring);
break;
@@ -171,7 +171,7 @@ PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codep
}
}
PHP_COM_DOTNET_API int php_com_zval_from_variant(zval *z, VARIANT *v, int codepage TSRMLS_DC)
PHP_COM_DOTNET_API int php_com_zval_from_variant(zval *z, VARIANT *v, php_int_t codepage TSRMLS_DC)
{
OLECHAR *olestring = NULL;
int ret = SUCCESS;
@@ -183,28 +183,28 @@ PHP_COM_DOTNET_API int php_com_zval_from_variant(zval *z, VARIANT *v, int codepa
ZVAL_NULL(z);
break;
case VT_UI1:
ZVAL_LONG(z, (long)V_UI1(v));
ZVAL_INT(z, (php_int_t)V_UI1(v));
break;
case VT_I1:
ZVAL_LONG(z, (long)V_I1(v));
ZVAL_INT(z, (php_int_t)V_I1(v));
break;
case VT_UI2:
ZVAL_LONG(z, (long)V_UI2(v));
ZVAL_INT(z, (php_int_t)V_UI2(v));
break;
case VT_I2:
ZVAL_LONG(z, (long)V_I2(v));
ZVAL_INT(z, (php_int_t)V_I2(v));
break;
case VT_UI4: /* TODO: promote to double if large? */
ZVAL_LONG(z, (long)V_UI4(v));
ZVAL_INT(z, (php_int_t)V_UI4(v));
break;
case VT_I4:
ZVAL_LONG(z, (long)V_I4(v));
ZVAL_INT(z, (php_int_t)V_I4(v));
break;
case VT_INT:
ZVAL_LONG(z, V_INT(v));
ZVAL_INT(z, V_INT(v));
break;
case VT_UINT: /* TODO: promote to double if large? */
ZVAL_LONG(z, (long)V_UINT(v));
ZVAL_INT(z, (php_int_t)V_UINT(v));
break;
case VT_R4:
ZVAL_DOUBLE(z, (double)V_R4(v));
@@ -220,7 +220,7 @@ PHP_COM_DOTNET_API int php_com_zval_from_variant(zval *z, VARIANT *v, int codepa
if (olestring) {
Z_TYPE_P(z) = IS_STRING;
Z_STRVAL_P(z) = php_com_olestring_to_string(olestring,
&Z_STRLEN_P(z), codepage TSRMLS_CC);
&Z_STRSIZE_P(z), codepage TSRMLS_CC);
olestring = NULL;
}
break;
@@ -399,8 +399,8 @@ PHP_COM_DOTNET_API int php_com_copy_variant(VARIANT *dstvar, VARIANT *srcvar TSR
/* {{{ com_variant_create_instance - ctor for new VARIANT() */
PHP_FUNCTION(com_variant_create_instance)
{
/* VARTYPE == unsigned short */ long vt = VT_EMPTY;
long codepage = CP_ACP;
/* VARTYPE == unsigned short */ php_int_t vt = VT_EMPTY;
php_int_t codepage = CP_ACP;
zval *object = getThis();
php_com_dotnet_object *obj;
zval *zvalue = NULL;
@@ -414,7 +414,7 @@ PHP_FUNCTION(com_variant_create_instance)
obj = CDNO_FETCH(object);
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
"z!|ll", &zvalue, &vt, &codepage)) {
"z!|ii", &zvalue, &vt, &codepage)) {
php_com_throw_exception(E_INVALIDARG, "Invalid arguments" TSRMLS_CC);
return;
}
@@ -437,7 +437,7 @@ PHP_FUNCTION(com_variant_create_instance)
but will probably fail (original behavior)
*/
if ((vt & VT_ARRAY) && (V_VT(&obj->v) & VT_ARRAY)) {
long orig_vt = vt;
php_int_t orig_vt = vt;
vt &= ~VT_ARRAY;
if (vt) {
@@ -519,7 +519,7 @@ static void variant_binary_operation(enum variant_binary_opcode op, INTERNAL_FUN
zval *zleft = NULL, *zright = NULL;
php_com_dotnet_object *obj;
HRESULT result;
int codepage = CP_ACP;
php_int_t codepage = CP_ACP;
VariantInit(&left_val);
VariantInit(&right_val);
@@ -727,7 +727,7 @@ static void variant_unary_operation(enum variant_unary_opcode op, INTERNAL_FUNCT
zval *zleft = NULL;
php_com_dotnet_object *obj;
HRESULT result;
int codepage = CP_ACP;
php_int_t codepage = CP_ACP;
VariantInit(&left_val);
VariantInit(&vres);
@@ -824,18 +824,18 @@ PHP_FUNCTION(variant_round)
VARIANT *vleft = NULL;
zval *zleft = NULL;
php_com_dotnet_object *obj;
int codepage = CP_ACP;
long decimals = 0;
php_int_t codepage = CP_ACP;
php_int_t decimals = 0;
VariantInit(&left_val);
VariantInit(&vres);
if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET,
ZEND_NUM_ARGS() TSRMLS_CC, "Ol", &zleft, php_com_variant_class_entry, &decimals)) {
ZEND_NUM_ARGS() TSRMLS_CC, "Oi", &zleft, php_com_variant_class_entry, &decimals)) {
obj = CDNO_FETCH(zleft);
vleft = &obj->v;
} else if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
"z!l", &zleft, &decimals)) {
"z!i", &zleft, &decimals)) {
vleft = &left_val;
php_com_variant_from_zval(vleft, zleft, codepage TSRMLS_CC);
} else {
@@ -859,9 +859,9 @@ PHP_FUNCTION(variant_cmp)
VARIANT *vleft = NULL, *vright = NULL;
zval *zleft = NULL, *zright = NULL;
php_com_dotnet_object *obj;
int codepage = CP_ACP;
long lcid = LOCALE_SYSTEM_DEFAULT;
long flags = 0;
php_int_t codepage = CP_ACP;
php_int_t lcid = LOCALE_SYSTEM_DEFAULT;
php_int_t flags = 0;
/* it is safe to ignore the warning for this line; see the comments in com_handlers.c */
STDAPI VarCmp(LPVARIANT pvarLeft, LPVARIANT pvarRight, LCID lcid, DWORD flags);
@@ -869,28 +869,28 @@ PHP_FUNCTION(variant_cmp)
VariantInit(&right_val);
if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET,
ZEND_NUM_ARGS() TSRMLS_CC, "OO|ll", &zleft, php_com_variant_class_entry,
ZEND_NUM_ARGS() TSRMLS_CC, "OO|ii", &zleft, php_com_variant_class_entry,
&zright, php_com_variant_class_entry, &lcid, &flags)) {
obj = CDNO_FETCH(zleft);
vleft = &obj->v;
obj = CDNO_FETCH(zright);
vright = &obj->v;
} else if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET,
ZEND_NUM_ARGS() TSRMLS_CC, "Oz!|ll", &zleft, php_com_variant_class_entry,
ZEND_NUM_ARGS() TSRMLS_CC, "Oz!|ii", &zleft, php_com_variant_class_entry,
&zright, &lcid, &flags)) {
obj = CDNO_FETCH(zleft);
vleft = &obj->v;
vright = &right_val;
php_com_variant_from_zval(vright, zright, codepage TSRMLS_CC);
} else if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET,
ZEND_NUM_ARGS() TSRMLS_CC, "z!O|ll", &zleft, &zright, php_com_variant_class_entry,
ZEND_NUM_ARGS() TSRMLS_CC, "z!O|ii", &zleft, &zright, php_com_variant_class_entry,
&lcid, &flags)) {
obj = CDNO_FETCH(zright);
vright = &obj->v;
vleft = &left_val;
php_com_variant_from_zval(vleft, zleft, codepage TSRMLS_CC);
} else if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
"z!z!|ll", &zleft, &zright, &lcid, &flags)) {
"z!z!|ii", &zleft, &zright, &lcid, &flags)) {
vleft = &left_val;
php_com_variant_from_zval(vleft, zleft, codepage TSRMLS_CC);
@@ -902,7 +902,7 @@ PHP_FUNCTION(variant_cmp)
return;
}
ZVAL_LONG(return_value, VarCmp(vleft, vright, lcid, flags));
ZVAL_INT(return_value, VarCmp(vleft, vright, lcid, flags));
VariantClear(&left_val);
VariantClear(&right_val);
@@ -941,7 +941,7 @@ PHP_FUNCTION(variant_date_to_timestamp)
tmv.tm_isdst = -1;
tzset();
RETVAL_LONG(mktime(&tmv));
RETVAL_INT(mktime(&tmv));
}
VariantClear(&vres);
@@ -952,13 +952,13 @@ PHP_FUNCTION(variant_date_to_timestamp)
Returns a variant date representation of a unix timestamp */
PHP_FUNCTION(variant_date_from_timestamp)
{
long timestamp;
php_int_t timestamp;
time_t ttstamp;
SYSTEMTIME systime;
struct tm *tmv;
VARIANT res;
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l",
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "i",
&timestamp)) {
return;
}
@@ -1003,7 +1003,7 @@ PHP_FUNCTION(variant_get_type)
}
obj = CDNO_FETCH(zobj);
RETURN_LONG(V_VT(&obj->v));
RETURN_INT(V_VT(&obj->v));
}
/* }}} */
@@ -1013,11 +1013,11 @@ PHP_FUNCTION(variant_set_type)
{
zval *zobj;
php_com_dotnet_object *obj;
/* VARTYPE == unsigned short */ long vt;
/* VARTYPE == unsigned short */ php_int_t vt;
HRESULT res;
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
"Ol", &zobj, php_com_variant_class_entry, &vt)) {
"Oi", &zobj, php_com_variant_class_entry, &vt)) {
return;
}
obj = CDNO_FETCH(zobj);
@@ -1048,12 +1048,12 @@ PHP_FUNCTION(variant_cast)
{
zval *zobj;
php_com_dotnet_object *obj;
/* VARTYPE == unsigned short */ long vt;
/* VARTYPE == unsigned short */ php_int_t vt;
VARIANT vres;
HRESULT res;
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
"Ol", &zobj, php_com_variant_class_entry, &vt)) {
"Oi", &zobj, php_com_variant_class_entry, &vt)) {
return;
}
obj = CDNO_FETCH(zobj);
+20 -20
View File
@@ -176,7 +176,7 @@ static HRESULT STDMETHODCALLTYPE disp_getidsofnames(
for (i = 0; i < cNames; i++) {
char *name;
unsigned int namelen;
php_size_t namelen;
zval **tmp;
name = php_com_olestring_to_string(rgszNames[i], &namelen, COMG(code_page) TSRMLS_CC);
@@ -186,7 +186,7 @@ static HRESULT STDMETHODCALLTYPE disp_getidsofnames(
ret = DISP_E_UNKNOWNNAME;
rgDispId[i] = 0;
} else {
rgDispId[i] = Z_LVAL_PP(tmp);
rgDispId[i] = Z_IVAL_PP(tmp);
}
efree(name);
@@ -220,7 +220,7 @@ static HRESULT STDMETHODCALLTYPE disp_getdispid(
{
HRESULT ret = DISP_E_UNKNOWNNAME;
char *name;
unsigned int namelen;
php_size_t namelen;
zval **tmp;
FETCH_DISP("GetDispID");
@@ -231,7 +231,7 @@ static HRESULT STDMETHODCALLTYPE disp_getdispid(
/* Lookup the name in the hash */
if (zend_hash_find(disp->name_to_dispid, name, namelen+1, (void**)&tmp) == SUCCESS) {
trace("found it\n");
*pid = Z_LVAL_PP(tmp);
*pid = Z_IVAL_PP(tmp);
ret = S_OK;
}
@@ -260,7 +260,7 @@ static HRESULT STDMETHODCALLTYPE disp_invokeex(
if (SUCCESS == zend_hash_index_find(disp->dispid_to_name, id, (void**)&name)) {
/* TODO: add support for overloaded objects */
trace("-- Invoke: %d %20s [%d] flags=%08x args=%d\n", id, Z_STRVAL_PP(name), Z_STRLEN_PP(name), wFlags, pdp->cArgs);
trace("-- Invoke: %d %20s [%d] flags=%08x args=%d\n", id, Z_STRVAL_PP(name), Z_STRSIZE_PP(name), wFlags, pdp->cArgs);
/* convert args into zvals.
* Args are in reverse order */
@@ -287,9 +287,9 @@ static HRESULT STDMETHODCALLTYPE disp_invokeex(
* and expose it as a COM exception */
if (wFlags & DISPATCH_PROPERTYGET) {
retval = zend_read_property(Z_OBJCE_P(disp->object), disp->object, Z_STRVAL_PP(name), Z_STRLEN_PP(name)+1, 1 TSRMLS_CC);
retval = zend_read_property(Z_OBJCE_P(disp->object), disp->object, Z_STRVAL_PP(name), Z_STRSIZE_PP(name)+1, 1 TSRMLS_CC);
} else if (wFlags & DISPATCH_PROPERTYPUT) {
zend_update_property(Z_OBJCE_P(disp->object), disp->object, Z_STRVAL_PP(name), Z_STRLEN_PP(name)+1, *params[0] TSRMLS_CC);
zend_update_property(Z_OBJCE_P(disp->object), disp->object, Z_STRVAL_PP(name), Z_STRSIZE_PP(name)+1, *params[0] TSRMLS_CC);
} else if (wFlags & DISPATCH_METHOD) {
zend_try {
if (SUCCESS == call_user_function_ex(EG(function_table), &disp->object, *name,
@@ -389,7 +389,7 @@ static HRESULT STDMETHODCALLTYPE disp_getmembername(
FETCH_DISP("GetMemberName");
if (SUCCESS == zend_hash_index_find(disp->dispid_to_name, id, (void**)&name)) {
OLECHAR *olestr = php_com_string_to_olestring(Z_STRVAL_P(name), Z_STRLEN_P(name), COMG(code_page) TSRMLS_CC);
OLECHAR *olestr = php_com_string_to_olestring(Z_STRVAL_P(name), Z_STRSIZE_P(name), COMG(code_page) TSRMLS_CC);
*pbstrName = SysAllocString(olestr);
efree(olestr);
return S_OK;
@@ -453,9 +453,9 @@ static void generate_dispids(php_dispatchex *disp TSRMLS_DC)
HashPosition pos;
char *name = NULL;
zval *tmp;
int namelen;
php_size_t namelen;
int keytype;
ulong pid;
php_uint_t pid;
if (disp->dispid_to_name == NULL) {
ALLOC_HASHTABLE(disp->dispid_to_name);
@@ -471,8 +471,8 @@ static void generate_dispids(php_dispatchex *disp TSRMLS_DC)
zend_hash_get_current_key_ex(Z_OBJPROP_P(disp->object), &name,
&namelen, &pid, 0, &pos))) {
char namebuf[32];
if (keytype == HASH_KEY_IS_LONG) {
snprintf(namebuf, sizeof(namebuf), "%d", pid);
if (keytype == HASH_KEY_IS_INT) {
snprintf(namebuf, sizeof(namebuf), ZEND_UINT_FMT, pid);
name = namebuf;
namelen = strlen(namebuf)+1;
}
@@ -490,7 +490,7 @@ static void generate_dispids(php_dispatchex *disp TSRMLS_DC)
zend_hash_index_update(disp->dispid_to_name, pid, (void*)&tmp, sizeof(zval *), NULL);
MAKE_STD_ZVAL(tmp);
ZVAL_LONG(tmp, pid);
ZVAL_INT(tmp, pid);
zend_hash_update(disp->name_to_dispid, name, namelen, (void*)&tmp, sizeof(zval *), NULL);
}
}
@@ -503,7 +503,7 @@ static void generate_dispids(php_dispatchex *disp TSRMLS_DC)
&name, &namelen, &pid, 0, &pos))) {
char namebuf[32];
if (keytype == HASH_KEY_IS_LONG) {
if (keytype == HASH_KEY_IS_INT) {
snprintf(namebuf, sizeof(namebuf), "%d", pid);
name = namebuf;
namelen = strlen(namebuf) + 1;
@@ -522,7 +522,7 @@ static void generate_dispids(php_dispatchex *disp TSRMLS_DC)
zend_hash_index_update(disp->dispid_to_name, pid, (void*)&tmp, sizeof(zval *), NULL);
MAKE_STD_ZVAL(tmp);
ZVAL_LONG(tmp, pid);
ZVAL_INT(tmp, pid);
zend_hash_update(disp->name_to_dispid, name, namelen, (void*)&tmp, sizeof(zval *), NULL);
}
}
@@ -585,9 +585,9 @@ PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *si
HashPosition pos;
char *name = NULL;
zval *tmp, **ntmp;
int namelen;
php_size_t namelen;
int keytype;
ulong pid;
php_uint_t pid;
disp->dispid_to_name = id_to_name;
@@ -601,14 +601,14 @@ PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *si
while (HASH_KEY_NON_EXISTENT != (keytype =
zend_hash_get_current_key_ex(id_to_name, &name, &namelen, &pid, 0, &pos))) {
if (keytype == HASH_KEY_IS_LONG) {
if (keytype == HASH_KEY_IS_INT) {
zend_hash_get_current_data_ex(id_to_name, (void**)&ntmp, &pos);
MAKE_STD_ZVAL(tmp);
ZVAL_LONG(tmp, pid);
ZVAL_INT(tmp, pid);
zend_hash_update(disp->name_to_dispid, Z_STRVAL_PP(ntmp),
Z_STRLEN_PP(ntmp)+1, (void*)&tmp, sizeof(zval *), NULL);
Z_STRSIZE_PP(ntmp)+1, (void*)&tmp, sizeof(zval *), NULL);
}
zend_hash_move_forward_ex(id_to_name, &pos);
+1 -1
View File
@@ -48,7 +48,7 @@ ZEND_BEGIN_MODULE_GLOBALS(com_dotnet)
zend_bool autoreg_on;
zend_bool autoreg_case_sensitive;
void *dotnet_runtime_stuff; /* opaque to avoid cluttering up other modules */
int code_page; /* default code_page if left unspecified */
php_int_t code_page; /* default code_page if left unspecified */
zend_bool rshutdown_started;
ZEND_END_MODULE_GLOBALS(com_dotnet)
+15 -15
View File
@@ -36,7 +36,7 @@ typedef struct _php_com_dotnet_object {
int modified;
ITypeInfo *typeinfo;
long code_page;
php_int_t code_page;
zend_class_entry *ce;
@@ -85,9 +85,9 @@ int php_com_saproxy_create(zval *com_object, zval *proxy_out, zval *index TSRMLS
/* com_olechar.c */
PHP_COM_DOTNET_API char *php_com_olestring_to_string(OLECHAR *olestring,
uint *string_len, int codepage TSRMLS_DC);
php_size_t *string_len, php_int_t codepage TSRMLS_DC);
PHP_COM_DOTNET_API OLECHAR *php_com_string_to_olestring(char *string,
uint string_len, int codepage TSRMLS_DC);
php_size_t string_len, php_int_t codepage TSRMLS_DC);
/* com_com.c */
@@ -102,12 +102,12 @@ PHP_FUNCTION(com_get_active_object);
HRESULT php_com_invoke_helper(php_com_dotnet_object *obj, DISPID id_member,
WORD flags, DISPPARAMS *disp_params, VARIANT *v, int silent, int allow_noarg TSRMLS_DC);
HRESULT php_com_get_id_of_name(php_com_dotnet_object *obj, char *name,
int namelen, DISPID *dispid TSRMLS_DC);
php_size_t namelen, DISPID *dispid TSRMLS_DC);
int php_com_do_invoke_by_id(php_com_dotnet_object *obj, DISPID dispid,
WORD flags, VARIANT *v, int nargs, zval **args, int silent, int allow_noarg TSRMLS_DC);
int php_com_do_invoke(php_com_dotnet_object *obj, char *name, int namelen,
int php_com_do_invoke(php_com_dotnet_object *obj, char *name, php_size_t namelen,
WORD flags, VARIANT *v, int nargs, zval **args, int allow_noarg TSRMLS_DC);
int php_com_do_invoke_byref(php_com_dotnet_object *obj, char *name, int namelen,
int php_com_do_invoke_byref(php_com_dotnet_object *obj, char *name, php_size_t namelen,
WORD flags, VARIANT *v, int nargs, zval ***args TSRMLS_DC);
/* com_wrapper.c */
@@ -147,9 +147,9 @@ PHP_FUNCTION(variant_get_type);
PHP_FUNCTION(variant_set_type);
PHP_FUNCTION(variant_cast);
PHP_COM_DOTNET_API void php_com_variant_from_zval_with_type(VARIANT *v, zval *z, VARTYPE type, int codepage TSRMLS_DC);
PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC);
PHP_COM_DOTNET_API int php_com_zval_from_variant(zval *z, VARIANT *v, int codepage TSRMLS_DC);
PHP_COM_DOTNET_API void php_com_variant_from_zval_with_type(VARIANT *v, zval *z, VARTYPE type, php_int_t codepage TSRMLS_DC);
PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, php_int_t codepage TSRMLS_DC);
PHP_COM_DOTNET_API int php_com_zval_from_variant(zval *z, VARIANT *v, php_int_t codepage TSRMLS_DC);
PHP_COM_DOTNET_API int php_com_copy_variant(VARIANT *dst, VARIANT *src TSRMLS_DC);
/* com_dotnet.c */
@@ -160,20 +160,20 @@ void php_com_dotnet_mshutdown(TSRMLS_D);
/* com_misc.c */
void php_com_throw_exception(HRESULT code, char *message TSRMLS_DC);
PHP_COM_DOTNET_API void php_com_wrap_dispatch(zval *z, IDispatch *disp,
int codepage TSRMLS_DC);
php_int_t codepage TSRMLS_DC);
PHP_COM_DOTNET_API void php_com_wrap_variant(zval *z, VARIANT *v,
int codepage TSRMLS_DC);
php_int_t codepage TSRMLS_DC);
PHP_COM_DOTNET_API int php_com_safearray_get_elem(VARIANT *array, VARIANT *dest, LONG dim1 TSRMLS_DC);
/* com_typeinfo.c */
PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib_via_cache(char *search_string,
int codepage, int *cached TSRMLS_DC);
PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib(char *search_string, int codepage TSRMLS_DC);
php_int_t codepage, int *cached TSRMLS_DC);
PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib(char *search_string, php_int_t codepage TSRMLS_DC);
PHP_COM_DOTNET_API int php_com_import_typelib(ITypeLib *TL, int mode,
int codepage TSRMLS_DC);
php_int_t codepage TSRMLS_DC);
void php_com_typelibrary_dtor(void *pDest);
ITypeInfo *php_com_locate_typeinfo(char *typelibname, php_com_dotnet_object *obj, char *dispname, int sink TSRMLS_DC);
int php_com_process_typeinfo(ITypeInfo *typeinfo, HashTable *id_to_name, int printdef, GUID *guid, int codepage TSRMLS_DC);
int php_com_process_typeinfo(ITypeInfo *typeinfo, HashTable *id_to_name, int printdef, GUID *guid, php_int_t codepage TSRMLS_DC);
/* com_iterator.c */
zend_object_iterator *php_com_iter_get(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC);
Loaded 100 of 1006 files, more files were not shown because too many files have changed in this diff. Show more