Commit Graph

9797 Commits

Author SHA1 Message Date
Guilherme Blanco
d51fb69c01 Removed parsing support traits to have extends and implements. 2015-01-09 15:45:02 +01:00
Guilherme Blanco
f48c232740 Decoupled class declaration statement into more granular pieces. 2015-01-09 15:45:01 +01:00
Nikita Popov
3e826c9736 Fix the same leak with %= 2015-01-07 23:21:12 +01:00
Nikita Popov
98c2ceacf8 Fix leak for compound shift self-assign error cases 2015-01-07 23:13:45 +01:00
Nikita Popov
1266515e19 Fix uses of zval_add_ref and add comment on usage
zval_add_ref should be used as a copy ctor, after the value was
already copied.

In particular when used with hash insertions, it should be applied
to the return value of the insert function.
2015-01-05 17:02:11 +01:00
Xinchen Hui
faa4171507 Add test script and use efree_size 2015-01-05 22:21:37 +08:00
Xinchen Hui
40230eef81 Revert "Revert "Fix memory leak when dereferencing reference with refcount 1""
This reverts commit 7aab9659ee.
2015-01-05 22:13:22 +08:00
Xinchen Hui
7aab9659ee Revert "Fix memory leak when dereferencing reference with refcount 1"
This reverts commit f4cb5cc09d.

breaks tests Zend/tests/bug27268.phpt and Zend/tests/bug68262.phpt
2015-01-05 00:26:10 -05:00
Bob Weinand
f4cb5cc09d Fix memory leak when dereferencing reference with refcount 1 2015-01-05 00:28:53 +01:00
Nikita Popov
2269b1801d Add missing string cast for non-cv var fetches 2015-01-04 18:07:44 +01:00
Nikita Popov
69a4b135f3 Fix use after free for variables with integer names 2015-01-04 17:57:23 +01:00
Anatol Belski
95e04fed24 cleanup redundand macros 2014-12-31 16:25:42 +01:00
Andrea Faulds
41e3fdba8e Make zend_parse_parameters share fast zpp implementation where possible
Rename shared implementation functions and build them unconditionally

Don't fail on empty path for zend_parse_arg_path

Update type names

Fix behaviour of by-reference "z"

Make 'o' use zend_parse_arg_object

Fix NULL string check in zend_parse_arg_path(_str)
2014-12-29 12:28:28 +00:00
Dmitry Stogov
cd5ea1619e Micro optimization for better register allocation 2014-12-29 14:21:16 +03:00
Dmitry Stogov
0fa50fb95d Reored conditions 2014-12-29 14:20:52 +03:00
Dmitry Stogov
d909a837e2 Cleanup 2014-12-29 13:38:36 +03:00
Kalle Sommer Nielsen
2bcf69d073 Fixed bug #68676 (Explicit Double Free) 2014-12-29 10:55:14 +01:00
Xinchen Hui
3bd96e0735 Use internd string as key 2014-12-29 14:35:08 +08:00
Anatol Belski
68dd8e8bd7 fix invalid free mentioned in bug 68665
thanks honey at internot dot info
2014-12-28 16:36:07 +01:00
Anatol Belski
67c47e7861 added test for bug #68665 2014-12-28 16:29:07 +01:00
Dmitry Stogov
107ae86ca6 Introduce specialized functions to compare with integer and string, to eliminate repeatable checks on each loop iteration in in_array() function. 2014-12-27 11:11:40 +03:00
Dmitry Stogov
37466b0368 Use special flag (HASH_FLAG_INITIALIZED) instead of (nTableMask == 0) to indicate that HashTable is allocated.
Make nTableMask to be 0 for packed arrays.
Remove checks fo HASH_FLAG_PACKED in zend_hash_find/zend_hash_del and family (string keys are resolved through uninitialized_bucket).
Change HashTable layout for better locality.
2014-12-27 11:07:12 +03:00
Nikita Popov
2d212b426a Drop duplicate arg from hash_get_current_key_ex 2014-12-26 21:06:18 +01:00
Nikita Popov
3d12fc796b Small cleanups in hash implementation
* Drop unnecessary checks in non-inlined part of numeric key
   detection
 * Drop zend_hash_apply_deleter in favor of zend_hash_del_el.
   Also move block/unblock interruption macros in there.
2014-12-26 21:06:18 +01:00
Dmitry Stogov
ab0b15b8ff Optimized destruction of extra arguments passed to user functions.
If no refcounted arguments are passed, then destruction code is not triggered at all.
(Full rebuild required)
2014-12-26 22:34:44 +03:00
Anatol Belski
86af370b81 remove unused variable 2014-12-24 14:14:29 +01:00
Anatol Belski
385bda6cdf C89 compat 2014-12-24 14:14:28 +01:00
Dmitry Stogov
f2c2acb9a9 For disabled function, to disable arguments checks, we have to reset num_args and some related flags (in addition to arg_info) 2014-12-24 15:34:52 +03:00
Dmitry Stogov
c42ac09518 Added new API function 'zend_string* zend_string_tolower(zend_string*)'.
It simplifies code and avoids unnecessary allocation and copying if string is already in lower case.
2014-12-24 15:04:51 +03:00
Anatol Belski
e46852d2d5 better fix for script encoding ini 2014-12-23 17:33:30 +01:00
Anatol Belski
e2e5ed06d1 fix NULL deref when the script encoding wasn't previously set 2014-12-23 17:09:13 +01:00
Dmitry Stogov
106b1017d4 API for fast construction of packed arrays 2014-12-23 19:08:28 +03:00
K.
c462ff7ac2 zend_hash_do_resize: fix compacting condition
nNumUsed should always be greater or equal to nNumOfElements so original condition is never true and arrays are always doubled in size and compaction is never triggered
2014-12-23 15:32:15 +01:00
Anatol Belski
e60b7207db cleanup 2014-12-23 13:00:29 +01:00
Xinchen Hui
62e2973602 Revert "Improve Hash foreach macros"
This reverts commit 95bb0a0f7a.
2014-12-23 03:51:06 -05:00
Xinchen Hui
95bb0a0f7a Improve Hash foreach macros 2014-12-23 00:50:39 -05:00
Xinchen Hui
4b26c5d004 Please becareful with the tailed space after slash 2014-12-22 22:59:17 -05:00
Andrea Faulds
b2853e7494 share that hunk of code 2014-12-23 01:51:19 +00:00
Dmitry Stogov
f3506dfacb Improved get_object_vars() 2014-12-23 02:49:47 +03:00
krakjoe
854ccf50c9 remove 3.0 from excluded versions because limitation lifted by native-tls 2014-12-22 21:32:14 +00:00
Dmitry Stogov
fd4844e079 Removed useless checks 2014-12-22 19:04:29 +03:00
Dmitry Stogov
2646f7bcb9 Don't count variadic argument in zend_func.common.num_args. This allows faster CALL/RETURN code. 2014-12-22 16:44:39 +03:00
Dmitry Stogov
552c06d439 typo 2014-12-22 12:31:00 +03:00
Xinchen Hui
b5b617674e Micro optimaztion (yeah, I know compiler supposed to do that) 2014-12-22 00:10:46 -05:00
Xinchen Hui
cc4a198d19 Fixed segfault 2014-12-21 23:18:56 -05:00
Xinchen Hui
c24125e2f9 Micro optimization 2014-12-21 23:16:25 -05:00
Xinchen Hui
201e1b8a8d Micro optimizations 2014-12-21 22:35:25 -05:00
Andrea Faulds
e5eb9530ab Use "float" and "integer" in typehint and zpp errors 2014-12-21 13:23:02 +00:00
Dmitry Stogov
0833fd4619 Allow arrays with define(), to match const syntax support 2014-12-21 03:03:49 +00:00
Nikita Popov
c94f62d0d9 Merge branch 'PHP-5.6'
Conflicts:
	ext/opcache/Optimizer/pass2.c
2014-12-19 21:51:05 +01:00