Commit Graph

81 Commits

Author SHA1 Message Date
Niels Dossche
a60c6ee0ac
Mark constant static arrays in function bodies actually as const (#10325) 2023-01-15 14:51:31 +00:00
Nikita Popov
d28f6e694d Move php_gcvt to zend_gcvt
Also move PHP_DOUBLE_MAX_LENGTH to ZEND_DOUBLE_MAX_LENGTH.
2021-08-02 14:51:46 +02:00
George Peter Banyard
10f416f5c2 Use standard bool type instead of bool_int 2021-07-15 10:40:36 +02:00
twosee
9066d695e9
Remove all *_EXTERN_C() in C source files (#7054) 2021-05-27 15:52:54 +08:00
Josh Soref
462da6e09c Fix spelling and grammar mistakes
This PR corrects misspellings identified by the check-spelling action.

The misspellings have been reported at jsoref@b6ba3e2#commitcomment-48946465

The action reports that the changes in this PR would make it happy: jsoref@602417c

Closes GH-6822.
2021-04-13 12:09:37 +02:00
George Peter Banyard
5caaf40b43
Introduce pseudo-keyword ZEND_FALLTHROUGH
And use it instead of comments
2021-04-07 00:46:29 +01:00
George Peter Banyard
589bdf30b2 Implement Explicit octal notation for integers RFC
RFC: https://wiki.php.net/rfc/explicit_octal_notation

Add an extensive test suits for other variants of integer literals

Closes GH-6360
2021-01-04 21:09:23 +01:00
Dmitry Stogov
4a2ae84188 Add "const". Move constant strings to read-only memory. 2020-09-07 21:35:48 +03:00
Christoph M. Becker
a582931f42 Revert "Revert "Merge branch 'PHP-7.4'""
This reverts commit 28e650a, which reverted commit 046dcfb, which had
to be reverted due to phpdbg issues.  The culprit was that we did not
properly reset `zend_handler_table` to `NULL`, which is required for
SAPIs which may restart the engine after shutdown.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=28e650abf8097a28789a005e5028fee095359583>
[2] <http://git.php.net/?p=php-src.git;a=commit;h=046dcfb531e242d36a7af2942b9b148290c3c7fe>
2020-05-20 14:11:42 +02:00
Christoph M. Becker
28e650abf8 Revert "Merge branch 'PHP-7.4'"
This reverts commit 046dcfb531, due to
segfaults on Travis.  This needs to be investigated.
2020-01-23 13:12:16 +01:00
Christoph M. Becker
4130fe437a Make MSVCRT memory leak checking usable for the test suite
While basic support for MSVCRT debugging has been added long
ago[1], the leak checking is not usable for the test suite, because we
are no longer calling `xmlCleanupParser()` on RSHUTDOWN of
ext/libxml[2], and therefore a few bogus leaks are reported whenever
ext/libxml is unloaded.

We therefore ignore memory leaks for this case.  We introduce
`ZEND_IGNORE_LEAKS_BEGIN()` and `ZEND_IGNORE_LEAKS_END()` to keep
those ignores better readable, and also because these *might* be
useful for other leak checkers as well.

We also explicitly free the `zend_handlers_table` and the `p5s` to
avoid spurious leak reports.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=d756e1db2324c1f4ab6f9b52e329959ce6a02bc3>
[2] <http://git.php.net/?p=php-src.git;a=commit;h=8742276eb3905eb97a585417000c7b8df85006d4>
2020-01-23 11:47:20 +01:00
Nikita Popov
b8cba88904 Suppress overflow UB in zend_strtod 2019-06-19 15:57:57 +02:00
Nikita Popov
8740533ddf Avoid more UB in round() 2019-06-19 15:09:00 +02:00
Nikita Popov
e1ab686228 Avoid uninit warning in dtoa
This code is extremely convoluted, I have no idea whether or not
this one is legitimate. Suppressing with explicit initialization.
2019-04-12 15:12:39 +02:00
Peter Kokot
92ac598aab Remove local variables
This patch removes the so called local variables defined per
file basis for certain editors to properly show tab width, and
similar settings. These are mainly used by Vim and Emacs editors
yet with recent changes the once working definitions don't work
anymore in Vim without custom plugins or additional configuration.
Neither are these settings synced across the PHP code base.

A simpler and better approach is EditorConfig and fixing code
using some code style fixing tools in the future instead.

This patch also removes the so called modelines for Vim. Modelines
allow Vim editor specifically to set some editor configuration such as
syntax highlighting, indentation style and tab width to be set in the
first line or the last 5 lines per file basis. Since the php test
files have syntax highlighting already set in most editors properly and
EditorConfig takes care of the indentation settings, this patch removes
these as well for the Vim 6.0 and newer versions.

With the removal of local variables for certain editors such as
Emacs and Vim, the footer is also probably not needed anymore when
creating extensions using ext_skel.php script.

Additionally, Vim modelines for setting php syntax and some editor
settings has been removed from some *.phpt files.  All these are
mostly not relevant for phpt files neither work properly in the
middle of the file.
2019-02-03 21:03:00 +01:00
Anatol Belski
4b3ed311aa Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Move the define into the header to reduce diff for future upgrade
2017-07-21 11:16:15 +02:00
Anatol Belski
9b3c26d4f4 Move the define into the header to reduce diff for future upgrade 2017-07-21 09:12:06 +02:00
Xinchen Hui
84926a0d71 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #74947 (Segfault in scanner on INF number)

Conflicts:
	Zend/zend_language_scanner.c
2017-07-21 11:58:07 +08:00
Xinchen Hui
95d2908814 Fixed bug #74947 (Segfault in scanner on INF number) 2017-07-21 11:56:49 +08:00
Stanislav Malyshev
3b78cabc88 More int->size_t and string overflow fixes 2016-11-05 14:00:47 -07:00
Stanislav Malyshev
f7f8aae33c Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  More int->size_t and string overflow fixes
2016-11-05 13:59:35 -07:00
Stanislav Malyshev
669763d88a More int->size_t and string overflow fixes 2016-11-05 13:22:17 -07:00
Dmitry Stogov
ebb99a1a3a Fixed compilation warnings 2016-06-21 16:55:17 +03:00
Xinchen Hui
b62f7e338d Remove unnecessary strlen check 2016-05-07 22:04:31 -07:00
Xinchen Hui
29079f263e Strlen cleanup (additions for previous one fix)
Probably compilers will do similar optimization
2016-05-07 00:08:15 -07:00
Xinchen Hui
f7439afeda Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	Zend/zend_strtod.c
2016-05-06 23:52:48 -07:00
Xinchen Hui
1c7f608071 Fixed bug #72172 (zend_hex_strtod should not use strlen) 2016-05-06 23:52:06 -07:00
Xinchen Hui
9aa73d3800 Fixed bug #71729 (Possible crash in zend_bin_strtod, zend_oct_strtod, zend_hex_strtod) 2016-03-09 12:16:24 +08:00
Anatol Belski
c17289e59c fix thread safety 2015-07-29 17:26:51 +02:00
Dmitry Stogov
acfc31c0f8 Use zend_error_noreturn() for fatal errors 2015-04-01 13:32:23 +03:00
Anatol Belski
956bab0566 fix endianness check plus better visual origin compat 2015-03-18 00:39:06 +01:00
Anatol Belski
b3788cd200 this check isn't applicable anymore 2015-03-18 00:14:20 +01:00
Anatol Belski
0ac1075002 catching up with the git history 2015-03-17 22:11:31 +01:00
Anatol Belski
9903767734 fix undefined symbol 2015-03-17 22:11:30 +01:00
Anatol Belski
a160a9097a restore freeing stuff and some small improvements 2015-03-17 22:11:27 +01:00
Anatol Belski
5d4616e2b0 first shot on updating strtod stuff 2015-03-17 22:11:26 +01:00
Stanislav Malyshev
b7a7b1a624 trailing whitespace removal 2015-01-10 15:07:38 -08:00
Lior Kaplan
c062c18d42 Replace invalid code with a proper #error
This code creates a nasty error as mentioned in bugs #31131, #37062
Patch taken from Debian's PHP package: 044-strtod_arm_fix
2013-12-08 15:49:22 -08:00
Dmitry Stogov
75df0499f6 Fixed Bug #55649 (Undefined function Bug()). (Laruence) 2011-09-13 07:07:06 +00:00
David Soria Parra
fa7c07b10c Check if given string is long enough in zend_*_strtod 2011-07-27 14:17:45 +00:00
Pierre Joye
6e4435d628 - add binary suport, FR #50638, as defined in RFC https://wiki.php.net/rfc/binnotation4ints, patch by Jonah Harris 2011-07-27 00:14:02 +00:00
Rasmus Lerdorf
dc444e8a37 Fix bug #53682 2011-01-06 22:48:20 +00:00
Scott MacVicar
bb08994d71 Fix bug #53632 with x87 fpu 2011-01-04 22:36:23 +00:00
Hartmut Holzgraefe
aaa2f1c30b marked char pointer arguments as const in lots of
places where strings pointed to are not modified 
to prevent compiler warnings about discarded qualifiers ...
2010-10-14 21:33:10 +00:00
Dmitry Stogov
31c0af245e Fixed floating point mathematic speed degradation (Christian) 2009-03-18 10:18:10 +00:00
Christian Seiler
04c528609a - MFH: Changed floating point behaviour to consistently use double precision
on all platforms and with all compilers.
2008-12-02 16:19:10 +00:00
Dmitry Stogov
1474d9dfad Fixed bug #43053 (Regression: some numbers shown in scientific notation). (int-e at gmx dot de)
some 64bit test files may need to be fixed
2008-09-15 11:47:16 +00:00
Dmitry Stogov
b2eba97d8b Fix for bug #43487 (Wrong conversion of float to string) 2008-07-27 11:29:10 +00:00
Marcus Boerger
af316021e8 - Rewrite scanner to be based on re2c instead of flex
The full patch is available as:
  http://php.net/~helly/php-re2c-5.3-20080316.diff.txt
  This is against php-re2c repository version 98
  An older patch against version 97 is available under:
  http://php.net/~helly/php-re2c-97-20080316.diff.txt
2008-03-16 21:06:55 +00:00
Antony Dovgal
2198abb1c4 MFH: detect endianness in compile time when using Apple's GCC (fixes universal binary build) 2007-09-04 18:46:21 +00:00