Commit Graph

350 Commits

Author SHA1 Message Date
Sammy Kaye Powers
dac6c639bb Update copyright headers to 2017 2017-01-04 11:23:42 -06:00
Xinchen Hui
46ab107936 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #73423 (Reproducible crash with GDB backtrace)
2016-11-02 12:11:48 +08:00
Xinchen Hui
1efb9fd32d Fixed bug #73423 (Reproducible crash with GDB backtrace) 2016-11-02 12:11:30 +08:00
Stanislav Malyshev
94b7ab185c Syncronize with 5.6 - __toString should return ""
(cherry picked from commit 2301608736)
2016-10-14 01:58:08 +02:00
Stanislav Malyshev
2301608736 Syncronize with 5.6 - __toString should return "" 2016-10-12 23:09:49 -07:00
Nikita Popov
2205fadac5 Merge branch 'PHP-7.0' into PHP-7.1 2016-09-22 12:50:29 +02:00
Nikita Popov
c38f88ddb0 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-22 12:48:38 +02:00
Márcio Almada
4397306b32 fix bug related to #865
In case USE_KEY flag is active, RegexIterator->accept() should keep it's
old behavior which is to accept keys mapping arrays.

This broke after PHP 5.5 but was not noticed due to lack of tests for USE_KEY.
2016-09-22 12:46:19 +02:00
Pierrick Charron
a8c4a4262e Merge branch 'PHP-7.0' into PHP-7.1 2016-07-26 20:37:04 -04:00
Pierrick Charron
2597f5d665 Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	ext/spl/spl_iterators.c
2016-07-26 20:36:34 -04:00
Pierrick Charron
4c2e1a13be Fixed bug #72684 (AppendIterator segfault with closed generator) 2016-07-26 20:34:16 -04:00
Loz Calver
f5ccd71d0c Fix 72122 - don't use EH_THROW for calls to getIterator 2016-07-12 10:10:35 +02:00
Aaron Piotrowski
24237027bc Merge branch 'throw-error-in-extensions' 2016-07-05 02:08:39 -05:00
Dmitry Stogov
323b2733f6 Fixed compilation warnings 2016-06-22 00:40:50 +03:00
Dmitry Stogov
1616038698 Added ZEND_ATTRIBUTE_FORMAT to some middind functions.
"%p" replaced by ZEND_LONG_FMT to avoid compilation warnings.
Fixed most incorrect use cases of format specifiers.
2016-06-21 16:00:37 +03:00
Aaron Piotrowski
771e5cc247 Replace zend_ce_error with NULL and replace more E_ERROR with thrown Error 2016-06-13 09:02:17 -05:00
Aaron Piotrowski
e3c681aa5c Merge branch 'master' into throw-error-in-extensions 2016-06-10 22:02:23 -05:00
Xinchen Hui
7648f20de3 Fixed bug #72051 (The reference in CallbackFilterIterator doesn't work as expected) 2016-04-19 10:59:10 +08:00
Lior Kaplan
ed35de784f Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Happy new year (Update copyright to 2016)
2016-01-01 19:48:25 +02:00
Lior Kaplan
49493a2dcf Happy new year (Update copyright to 2016) 2016-01-01 19:21:47 +02:00
Xinchen Hui
27aef97f65 Fixed bug #70868 (PCRE JIT and pattern reuse segfault) 2015-11-06 11:37:17 +08:00
Dmitry Stogov
ad4fa8f758 Fixed incorrect usage of HASH_OF() macro. Replaced HASH_OF() with more appropriate Z_ARRVAL_P() or Z_OBJPROP_P(). 2015-09-24 22:39:59 +03:00
Dmitry Stogov
c72559ddf6 Cleanup: removed deprecated commented code 2015-09-22 17:02:25 +03:00
Xinchen Hui
fff374feba Merge branch 'PHP-5.6'
Conflicts:
	ext/spl/spl_iterators.c
2015-07-07 21:28:51 +08:00
Xinchen Hui
e41f600365 Fixed bug #69970 (Use-after-free vulnerability in spl_recursive_it_move_forward_ex()) 2015-07-07 21:25:28 +08:00
Aaron Piotrowski
7ec1e17464 Update memory freeing and other issues, revert some changes 2015-07-05 23:25:53 -05:00
Aaron Piotrowski
907476f34c Convert E_ERROR to thrown Error in extensions 2015-07-05 12:16:57 -05:00
Dmitry Stogov
53403fe56d Get rid of ZVAL_ZVAL() macro usages. Replace them with more clear and optimal equialent sequences. 2015-07-01 02:05:21 +03:00
Dmitry Stogov
4a2e40bb86 Use ZSTR_ API to access zend_string elements (this is just renaming without semantick changes). 2015-06-30 04:05:24 +03:00
Rasmus Lerdorf
28d7bb97a1 Fix more proto comments 2015-06-23 17:46:20 -04:00
Nikita Popov
fb346c8f93 Support references in convert_to_*
conver_to_* functions now accept REFERENCE values, which will be
unwrapped before performing the usual conversion. This is consistent
with convert_scalar_to_number and matches the expected behavior in
a couple random use-sites I checked.

Also includes a couple fixes/cleanups elsewhere and two tests for
cases that previously didn't work (though the reference issue existed
all over the place).
2015-06-16 19:55:33 +02:00
Dmitry Stogov
8e10e8f921 Avoid zval duplication in ZVAL_ZVAL() macro (it was necessary only in few places).
Switch from ZVAL_ZVAL() to simpler macros where possible (it makes sense to review remaining places)
2015-06-12 12:33:23 +03:00
Nikita Popov
5d3cf577aa Make convert_to_* safe with rc>1
This only involves switching zval_dtor to zval_ptr_dtor for arrays
and making the convert_to_object for arrays a bit more generic.

All the other changes outside zend_operators.c just make use of
this new ability (use COPY instead of DUP).

What's still missing: Proper references handling. I've seen many
convert_to* calls that will break when a reference is used.

Also fixes bug #69788.
2015-06-11 23:23:57 +02:00
Nikita Popov
b4b872f4c9 Fix leak in RecursiveRegexIterator::getChildren() 2015-04-15 20:03:15 +02:00
Nikita Popov
7605e02e3b Fix leaks in recursive iterator construction 2015-04-15 19:51:02 +02:00
Nikita Popov
122d759618 Always throw TypeException on throwing zpp failures
Introduces a ZEND_PARSE_PARAMS_THROW flag for zpp, which forces to
report FAILURE errors using a TypeException instead of a Warning,
like it would happen in strict mode.

Adds a zend_parse_parameters_throw() convenience function, which
invokes zpp with this flag.

Converts all cases I could identify, where we currently have
throwing zpp usage in constructors and replaces them with this API.
Error handling is still replaced to EH_THROW in some cases to handle
other, domain-specific errors in constructors.
2015-04-06 11:27:34 +02:00
Dmitry Stogov
8633685675 Use specialized macro for string zval creation 2015-03-12 16:53:51 +03:00
Dmitry Stogov
48deb1cd94 Free memory if destructor wasn't called 2015-03-11 00:57:28 +03:00
Dmitry Stogov
4241a090ad Avoid reallocation in preg_replace() if nothing was replaced 2015-02-10 13:30:25 +03:00
Dmitry Stogov
9e70d7672d Move zend_object->guards into additional slot of zend_object->properties_table[]. As result size of objects without __get/__set/__unset/__isset magic methods is reduced. 2015-02-04 15:24:13 +03:00
Dmitry Stogov
3e31838d19 zend_read_property() has to provide a holder for return value.
Previously it was possible that zend_read_property() returned pointer to zval allocated on stack.
2015-01-22 11:50:42 +03:00
Xinchen Hui
fc33f52d8c bump year 2015-01-15 23:27:30 +08:00
Xinchen Hui
0579e8278d bump year 2015-01-15 23:26:37 +08:00
Stanislav Malyshev
8d26c53f7c Fix bug #68816 - pointer to local outside of scope 2015-01-14 16:14:43 -08:00
Stanislav Malyshev
b7a7b1a624 trailing whitespace removal 2015-01-10 15:07:38 -08:00
Anatol Belski
bdeb220f48 first shot remove TSRMLS_* things 2014-12-13 23:06:14 +01:00
Anatol Belski
110cf649b7 fix datatype mismatches
especially spl_dual_it_object current.pos should have the same datatype as
limit.offset, also this doesn't increase the struct size.
2014-10-29 15:30:12 +01:00
Tjerk Meesters
1f4f2ef403 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #68128

Conflicts:
	ext/spl/spl_iterators.c
2014-10-14 23:00:17 +08:00
Tjerk Meesters
fb35d7c56e Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed bug #68128
2014-10-14 22:50:07 +08:00
Tjerk Meesters
71ba533640 Fixed bug #68128
Three issues are addressed:

- RecursiveRegexIterator::accept() should accept non-empty arrays without
  applying any regular expression and RegexIterator::accept() should not accept
  an array.
- RegexIterator::accept() should not accept an atom that fails to match
  anything, even when PREG_PATTERN_ORDER is used (which would return an array
  of empty arrays).
- RecursiveRegexIterator::getChildren() should pass all constructor arguments
  to its child iterator instead of just the regular expression.
2014-10-14 22:49:01 +08:00