Commit Graph

9651 Commits

Author SHA1 Message Date
Anatol Belski
b0d86d87d8 fix datatype mismatches 2014-10-27 16:38:40 +01:00
Anatol Belski
5b5e2d3d45 fix datatype mismatch warnings 2014-10-27 16:38:39 +01:00
Anatol Belski
8fdaeef8e8 fix datatype mismatches 2014-10-27 16:38:38 +01:00
Anatol Belski
1b4fd5825a fix datatype mismatch warnings 2014-10-24 20:57:38 +02:00
Anatol Belski
89ed34e3e9 fix datatype mismatches 2014-10-24 20:50:09 +02:00
Anatol Belski
283947af74 fix datatype mismatches
and convert APIs to size_t where zend_string internally used
2014-10-24 20:50:08 +02:00
Anatol Belski
f7d3355e75 fix datatype mismatches
and convert len args to size_t where the underlaying API uses zend_string
2014-10-24 20:50:06 +02:00
Anatol Belski
35576ea0ac fix datatype mismatch warnings 2014-10-24 20:50:05 +02:00
Anatol Belski
ca46bd04b1 fix datatype mismatch warnings 2014-10-24 20:50:04 +02:00
Dmitry Stogov
6e396961c5 Fixed "instanceof" with undefined classes 2014-10-23 14:50:57 +04:00
Anatol Belski
88ca46d92b fix datatype mismatches 2014-10-23 11:45:44 +02:00
Anatol Belski
e70dce7d99 fix datatype mismatch 2014-10-23 10:29:57 +02:00
Anatol Belski
53797ec1c9 move the more common case up 2014-10-23 10:29:56 +02:00
Anatol Belski
f227922446 move key lengths to use size_t as zend_string is used internally anyway 2014-10-23 10:29:54 +02:00
Dmitry Stogov
4fd435abab Embed FETCH_CLASS <string> into the following NEW 2014-10-23 11:52:34 +04:00
Dmitry Stogov
8793aa407e Optimized HashTable size calculation 2014-10-23 00:26:32 +04:00
Dmitry Stogov
8dedd863bc Get rid of ZEND_FETCH_MAKE_REF 2014-10-22 21:45:02 +04:00
Anatol Belski
d5ccf4d276 eliminate one branch when computing the initial table size 2014-10-22 19:23:29 +02:00
Anatol Belski
a5e4f1f598 fix several datatype mismatches 2014-10-22 17:56:30 +02:00
Anatol Belski
f59daf2104 micro optimized initial hash size calculation
most of the calls are with a size <= 8, so don't even bother any
bitshifts. For the bigger sizes, use an intrinsic (should be extended
with gcc ones though).
2014-10-22 17:56:24 +02:00
Anatol Belski
5e24ae321d all the key_len use uint, fix the warning when using strlen on 64 bit 2014-10-22 17:56:22 +02:00
Anatol Belski
944d2c65e1 fix datatype mismatches 2014-10-22 17:56:19 +02:00
Anatol Belski
7959e3faf2 fix datatype mismatches for strings from userspace 2014-10-22 17:56:17 +02:00
Dmitry Stogov
534d854fb2 Embed FETCH_CLASS <string> into the following INSTANCEOF 2014-10-22 17:23:43 +04:00
Dmitry Stogov
779ca61e32 Don't use opline->extended_value for FETCH_CLASS flags where it's unnecessary 2014-10-22 17:22:21 +04:00
Dmitry Stogov
36fa572aaa ZEND_RECV didn't really use opline->extended_value for FETCH_CLASS flags 2014-10-22 15:22:30 +04:00
Xinchen Hui
c584798b05 Useless assignment 2014-10-22 17:30:19 +08:00
Dmitry Stogov
fe8577efb1 Optimized ASSIGN_DIM and related opcodes 2014-10-21 19:30:43 +04:00
Dmitry Stogov
33645f4f55 micro optimization 2014-10-21 16:18:06 +04:00
Dmitry Stogov
5d9792de9a Avoid "goto" 2014-10-21 11:43:13 +04:00
Dmitry Stogov
089f496799 Moved proxy object support in ASSIGN_ADD (and family) from VM to slow paths of corresponding operators 2014-10-21 03:24:20 +04:00
Dmitry Stogov
ae127faf5b Simplification 2014-10-21 00:56:48 +04:00
Dmitry Stogov
8e1dc33db5 zend_get_property_info_quick() cleanup and optimization 2014-10-20 20:33:35 +04:00
Dmitry Stogov
0e270661a4 Use ADDREF instead of DUP, it must be enough. 2014-10-20 13:55:55 +04:00
Dmitry Stogov
1480d26fb9 fixed compilation error 2014-10-20 12:51:02 +04:00
Nikita Popov
4b892439e6 Fix bug #68262: Broken reference across cloned objects 2014-10-19 13:22:44 +02:00
Dmitry Stogov
7471c21781 Optimized property access handlers. Removed EG(std_property_info). 2014-10-17 19:10:05 +04:00
Dmitry Stogov
f2fa7a41cf Don't make difference between undefined and unaccessible properies when call __get() and family 2014-10-17 15:01:54 +04:00
Dmitry Stogov
6b203aa262 Don't make useless CSE 2014-10-17 15:00:54 +04:00
Dmitry Stogov
176b8d7ca3 Micro optimizations for isset/empty 2014-10-17 00:17:13 +04:00
Dmitry Stogov
2a1250fa57 Micro optimization for zend_hash_next_index_insert_new() 2014-10-16 19:19:10 +04:00
Nikita Popov
cf5920e8aa Fix procedural finfo calls in methods
getThis() will return the $this of the calling method.
2014-10-16 14:24:23 +02:00
Nikita Popov
53a8584123 Fix allocator for 64bit zend_long with 32bit long 2014-10-16 12:42:23 +02:00
Nikita Popov
876965d20a Use intptr_t for zend_intptr_t typedef
Current code doesn't work for 64bit zend_long with 32bit pointers.

If intptr_t isn't defined on some platform, we should add it to
our php_stdint.h header.
2014-10-16 12:42:23 +02:00
Nikita Popov
b65518faf3 Fix format strings in zend_alloc 2014-10-16 12:42:22 +02:00
Nikita Popov
2a9daf2e15 Drop zend_long64 in favor of int64_t
Also drop ZEND_HAVE_LONG64, because we already require the
presence of a int64_t type.
2014-10-16 12:42:22 +02:00
Dmitry Stogov
9527877930 Removed deprecated fields 2014-10-16 13:41:27 +04:00
Dmitry Stogov
ed18d67c5e Fixed bug #68215 (Behavior of foreach has changed) 2014-10-15 17:02:54 +04:00
Dmitry Stogov
d2daa19701 Added API function to retrive current custom heap handlers 2014-10-14 14:20:25 +04:00
Dmitry Stogov
2842766d7f Allow to substitute storage layer in memory manager. 2014-10-14 09:41:16 +04:00
Anatol Belski
66e47446e4 fix signed/unsigned mismatch warning 2014-10-13 18:43:13 +02:00
Anatol Belski
b2de68a81f more signed/unsigned mismatch fix 2014-10-13 18:43:12 +02:00
Anatol Belski
84477c7c39 fix some signed/unsigned mismatch 2014-10-13 18:43:09 +02:00
Nikita Popov
5d94ba6ec3 More fixes for array/object casts with temporary variables 2014-10-13 15:31:59 +02:00
Nikita Popov
e62edf2e58 Fix array/object cast of refcounted tmp var 2014-10-13 15:31:59 +02:00
Nikita Popov
2622cfc2fb Deref right value for compound assign ops
Currently we do not support IS_REFERENCE operands for most of our
*_function's (should we?), so we need to deref here.
2014-10-13 15:31:59 +02:00
Nikita Popov
0b09ba84b9 Ensure __LINE__ is always accurate 2014-10-12 20:55:52 +02:00
Nikita Popov
b7e139a59c Fix incdec of referenced properties
I thought these SEPARATE_ZVAL_IF_NOT_REF usages were safe at first,
because incdec op supports reference variables. However this
violates the constraint that IS_TMP_VAR variables may not be
references (which is an issue if you use the result of the incdec
op).

Still need to fix the cases where read_property/write_property is
used.
2014-10-12 20:55:52 +02:00
Anatol Belski
8a55159258 Merge branch 'PHP-5.6'
* PHP-5.6:
  DLL export several APIs needed for phpdbg
2014-10-12 19:22:40 +02:00
Anatol Belski
c96a6b4493 DLL export several APIs needed for phpdbg 2014-10-12 19:22:03 +02:00
Anatol Belski
e33e4b2d8c int to size_t where the underlaying API supports it 2014-10-10 19:00:20 +02:00
Dmitry Stogov
af3354dc43 Improved specialisation $this variable accessed through IS_UNUSED operand must be IS_OBJECT, so we don't have to check for its type or perform dereference. 2014-10-10 16:36:12 +04:00
Dmitry Stogov
2c434470a6 Help to CPU branch predictor 2014-10-09 23:58:41 +04:00
Dmitry Stogov
cbe4fa444f Removed unused EG(orig_error_reporting) 2014-10-09 23:38:39 +04:00
Nikita Popov
df79b9b27a Update get_class_name semantics
* get_class_name is now only used for displaying the class name
   in debugging functions like var_dump, print_r, etc. It is no
   longer used in get_class() etc.
 * As it is no longer used in get_parent_class() the parent
   argument is now gone. This also fixes incorrect parent classes
   being reported in COM.
 * get_class_name is now always required (previously some places
   made it optional and some required it) and is also required
   to return a non-NULL value.
 * Remove zend_get_object_classname. This also fixes a number of
   potential leaks due to incorrect usage of this function.
2014-10-09 20:48:27 +02:00
Nikita Popov
c061c82945 Remove Z_OBJ_CLASS_NAME_P
Doesn't make much sense anymore, now that get_class_entry is
gone.
2014-10-09 20:48:27 +02:00
Dmitry Stogov
0390cde428 Improved VM stack primitives for fast paths. Slow paths are not inlined anymore. 2014-10-09 20:29:02 +04:00
Nikita Popov
e5e9d8346f Remove zend_get_class_entry function 2014-10-09 14:17:30 +02:00
Nikita Popov
b3a779de68 Remove get_class_entry object handler 2014-10-09 14:08:10 +02:00
Nikita Popov
116c5ecda1 Remove proxy object implementation 2014-10-09 14:01:08 +02:00
Nikita Popov
ee5b30fa19 Remove support for classes without class entries
get_class_entry must be non-NULL and return non-NULL.
2014-10-09 13:58:14 +02:00
Nikita Popov
43f1c94dda Review a few more SEPARATE_ZVAL_IF_NOT_REF usages 2014-10-09 12:51:05 +02:00
Nikita Popov
e919caca86 Fix bug #68191: Broken reference across objects 2014-10-09 12:05:56 +02:00
Dmitry Stogov
7fd3375fb5 Exposed zend_clean_and_cache_symbol_table() and fixed incorrect efree() 2014-10-08 16:08:26 +04:00
Dmitry Stogov
fe501914f0 Micro optimization 2014-10-07 23:48:55 +04:00
Dmitry Stogov
2ea97c6f5a Improved return by reference handling 2014-10-07 22:38:37 +04:00
Dmitry Stogov
75b5dc6369 Reorder fields for better alignment on both 32-bit and 64-bit systems 2014-10-07 18:12:09 +04:00
Dmitry Stogov
67be34ec95 Remove useless parts of EX(old_error_reporting) 2014-10-07 17:54:24 +04:00
Dmitry Stogov
33e137d409 Merged EX(frame_kind) and EX(flags) into single word 2014-10-07 17:12:12 +04:00
Nikita Popov
e24c24c108 Fix bug #68162: isset($$varname) always true 2014-10-06 20:39:00 +02:00
Nikita Popov
2a0c4edfda Drop convert_to usage in zend_exceptions
To make everything work correctly with refs.

I'm unsure whether the GET_PROPERTY_SILENT distinction is really
necessary, because the choice seemed pretty random, but kept it
around.
2014-10-06 20:14:30 +02:00
Nikita Popov
390900cbcb Fix isset/unset on by-ref names as well 2014-10-06 18:56:23 +02:00
Nikita Popov
03c726d728 Fix bug #68163 2014-10-06 18:45:08 +02:00
Anatol Belski
741bf0ee96 fix the empty_strings SAPI shutdown leak in TS build
still the NTS variant is somewhat different as it needs
zend_new_interned_string_int because the normal callbacks might
be not initialized, but at least no leaks anymore and some more
structure
2014-10-06 15:48:55 +02:00
Dmitry Stogov
cc7c14cb76 Use fastcall calling convention for heap functions 2014-10-06 16:32:15 +04:00
Anatol Belski
72b34e1372 fix leaking the empty_string in TS builds 2014-10-06 13:38:13 +02:00
Timm Friebe
43f3d250f4 Add tests verifying calls work inside echo, concatenation and array access 2014-10-06 06:08:02 +08:00
Tjerk Meesters
82523c0752 Merge branch 'pr/647'
* pr/647: (33 commits)
  zend_uint -> uint32_t
  Fix nesting for *non*-compile-time-resolveable functions See a1a4ba9511 (commitcomment-7414223)
  Add tests for calls to nested, *non*-compile-time-resolveable functions See a1a4ba9511 (commitcomment-7414362)
  Make list of opcodes used for nesting calculation consistent   with `zend_do_convert_call_user_func()` in Zend/zend_compile.c
  Rewrite code to use ZEND_VM_JMP() instead of repeated ZEND_VM_INC_OPCODE() calls
  QA: Simplify code to find matching ZEND_DO_FCALL_BY_NAME CG(context).nested_calls is stored inside the initializer's result.num and inside the finalizer's op2.num, by comparing these we don't need to count manually, and are thus safer from future expansion with specialized opcodes e.g.
  Fix expected fatal error, now is catchable fatal
  Adjust expected fatal error message Now also includes "on [TYPE]" after merge from master
  Check for memory leaks when not using return value
  Adjust expected fatal error message Now also includes "on [TYPE]" after merge from master
  Add tests with arrays as parameters
  Handle ZEND_NEW nesting
  Also verify nesting with dynamically called static methods
  Handle ZEND_INIT_NS_FCALL_BY_NAME nesting
  QA: Refactor: Split tests a bit to make them more comprehendable
  Support nested static calls
  Handle ZEND_EXT_FCALL_END, skipping if necessary Verified with running tests with new "-e" run-tests arg: $ make test TESTS=Zend/tests/*-on-non-objects-*phpt TEST_PHP_ARGS=-e # Tests passed    :   11 (100.0%)
  Add support for PHP's 'extended information for debugger/profiler' mode
  Verify non-CV-operands also work See discussion https://github.com/php/php-src/pull/647#issuecomment-48050551
  Only allocate NULL return value if it's actually used
  ...

Conflicts:
	ext/date/tests/bug67118.phpt
2014-10-06 05:52:43 +08:00
Nikita Popov
58f389772f Fix $this CV init for include/eval
Fixes bug #68148
2014-10-05 23:38:59 +02:00
Nikita Popov
9bc14f9632 Fix dynamic calls to static methods with fci->object
func may already be freed at the time the static flag was checked.
2014-10-05 23:11:17 +02:00
Nikita Popov
fb34cd90f8 Fix $arr =& $arr[0]
value_ptr can be invalidated by the ptr_dtor, so backup the
zend_reference in an extra variable.
2014-10-05 22:58:40 +02:00
Nikita Popov
292421d3a1 Fix unused variable warning 2014-10-05 21:58:38 +02:00
Nikita Popov
e756333bbb Remove <% and <script language="php"> tags
As per https://wiki.php.net/rfc/remove_alternative_php_tags.

Removes:
 * <% opening tag
 * %> closing tag
 * <%= short opening tag
 * /<script\s+language\s*=\s*(php|"php"|'php')\s*>/i opening tag
 * /</script>/i closing tag
 * asp_tags ini directive
2014-10-05 21:57:05 +02:00
Dmitry Stogov
7c7b9184b1 Fixed list() behavior inconsistency (string handling is disabled for all cases, ArrayAccess objects handling is enabled for all cases, ZEND_FETCH_DIM_TMP_VAR opcode is renamed into ZEND_FETCH_LIST, ZEND_FETCH_ADD_LOCK flag is removed). 2014-10-05 13:02:58 +04:00
Dmitry Stogov
2e1b8ba4b7 Moved checks and error reporting related to static methods from DO_FCALL inti INTI_FCALL* opcodes that may really deal with static methods. (In some rare cases it may lead to different order of warning messages). 2014-10-04 14:55:44 +04:00
Nikita Popov
f1e21c4979 Fix test gc_029_zts.phpt
In ZTS the default properties are duplicated (instead of copied),
so the array has one lower RC than on NTS and as such gets destroyed
during GC, increasing the cycle count by 3. PHP 5.6 didn't always
copy default properties on ZTS, which is where the difference comes
from.
2014-10-04 00:37:15 +02:00
Nikita Popov
b68886f7b5 Mark test for full GC root buffer as XFAIL 2014-10-03 22:02:02 +02:00
Nikita Popov
443374675e Merge branch 'PHP-5.6'
Conflicts:
	Zend/zend_object_handlers.c
2014-10-03 21:30:06 +02:00
Nikita Popov
8617f2fa8d Merge branch 'PHP-5.5' into PHP-5.6 2014-10-03 21:27:07 +02:00
Nikita Popov
93288d0095 Fix bug #68188 2014-10-03 21:26:39 +02:00
Nikita Popov
e7623f470f Fix bug #68133 and bug #68135 2014-10-03 21:06:26 +02:00
Anatol Belski
647ebe6bf2 remove misprint parentheses 2014-10-03 19:23:33 +02:00
Dmitry Stogov
bd9a234645 Replaced EG(This) and EX(object) with EX(This).
Internal functions now recieves zend_execute_data as the first argument.
2014-10-03 19:32:46 +04:00
Xinchen Hui
5e39d0c19c And this one... 2014-10-03 19:07:02 +08:00
Xinchen Hui
aa5f937958 It should be in extern c 2014-10-03 18:35:57 +08:00
Xinchen Hui
f54f5368e4 Merge branch 'master' of https://git.php.net/repository/php-src 2014-10-03 18:35:18 +08:00
Xinchen Hui
54bad8bf57 Remove useless condition 2014-10-03 18:35:05 +08:00
Dmitry Stogov
5c63a4f72b Micro optimization for the most frequency case 2014-10-03 12:18:15 +04:00
Nikita Popov
51c90e999f Fix ZTS build 2014-10-02 21:58:29 +02:00
Anatol Belski
c41fbcfb4c improved file size computation in stat()
On 32 bit it's still overwlowing, so nothing is changed there. But
the usage of LARGE_INTEGER instead of bit shifting is a better way
to go.
2014-10-02 12:18:02 +02:00
Dmitry Stogov
ccb24caa6d Fixed incorrect compilation 2014-10-02 13:37:44 +04:00
Dmitry Stogov
c4419e7a5b Expose zend_throw_exception_internal() 2014-10-01 16:37:21 +04:00
Dmitry Stogov
8857af8494 Use inline finction for OBJ_RELEASE() macro 2014-10-01 16:35:56 +04:00
Dmitry Stogov
9f7564b12b Removed zend_execute_data->prev_nested_call. Reuse prev_execute_data instead. 2014-10-01 10:46:13 +04:00
Dmitry Stogov
63dc9bbc02 Micro optimization 2014-09-30 15:19:51 +04:00
Nikita Popov
67a11b61cd Drop unused INIT_STRING opcode
INIT_STRING has been implemented as an UNUSED op1 to ADD_* for
some time now.
2014-09-29 22:59:57 +02:00
Nikita Popov
290d71de75 Drop unused RAISE_ABSTRACT_ERROR opcode
Abstract methods are being prevented from being called in DO_FCALL
etc.
2014-09-29 22:50:56 +02:00
Nikita Popov
ab288b01d5 CT substitute unqualified true/false/null in namespaces
Substituation now always happens on the resolved name and
unqualified usages of true/false/null in namespaced code are
substituted as well.
2014-09-29 21:18:12 +02:00
Nikita Popov
142a01db92 Fix a couple compile warnings 2014-09-29 20:57:17 +02:00
Dmitry Stogov
e15be6c8cd Use more readable inline functions 2014-09-29 19:41:00 +04:00
Xinchen Hui
f248b17e07 Fixed segfault 2014-09-29 12:06:56 +08:00
Timm Friebe
e14b7f629b Fix segmentation fault in debug_backtrace() 2014-09-28 20:58:55 +02:00
Anatol Belski
4b3e198023 removed *.dsw and *.dsp files 2014-09-28 19:02:09 +02:00
Nikita Popov
877eb02fd6 Update operand types for coalesce operator 2014-09-28 12:20:04 +02:00
Andrea Faulds
2d069f640e Merge branch 'coalesce_operator'
* coalesce_operator:
  Extended coalesce operator test case for ordering/short-circuiting
  Ensure not evaluated twice
  Added test
  Initial coalesce operator implementation
2014-09-28 00:07:04 +01:00
vagrant
5c6ca24dc0 Merge branch 'master' into catchable-fatals/methods-on-non-objects 2014-09-27 17:49:54 +00:00
Timm Friebe
0a9e207a77 zend_uint -> uint32_t 2014-09-25 21:42:19 +02:00
Anatol Belski
c1e92d9fed fix C89 compat 2014-09-25 20:28:34 +02:00
Timm Friebe
e83580c1f0 Merge branch 'master' into catchable-fatals/methods-on-non-objects 2014-09-25 19:45:05 +02:00
krakjoe
eabad90acb fix indentation 2014-09-25 16:31:39 +01:00
krakjoe
abdc8c3061 fix zts build 2014-09-25 16:15:02 +01:00
Dmitry Stogov
1833ab0230 Use macro 2014-09-25 17:00:17 +04:00
Dmitry Stogov
8b034ec69a Optimized (PRE|POST)_(INC|DEC) handlers. Moved proxy object handling into helper function. 2014-09-25 13:42:46 +04:00
Dmitry Stogov
6a09bdff6a Fixed C++ incompatibility 2014-09-24 20:31:22 +04:00
Dmitry Stogov
8ea2409e44 Fixed immutable arrays support 2014-09-24 15:39:54 +04:00
Nikita Popov
c45924b954 Remove dead code 2014-09-24 12:06:19 +02:00
Nikita Popov
1664e70ade Test use($this) being an error 2014-09-24 12:06:19 +02:00
Nikita Popov
3e042e1f83 Move list() condition into assign_znode
The condition in compile_foreach was using ->attr instead of ->kind
and as such never passed. It only worked because assign_znode already
supported this case by indirecting via zend_compile_assign. Now it
implements it with a direct call.
2014-09-24 12:06:18 +02:00
Dmitry Stogov
73275a55f5 Avoid double checks 2014-09-24 12:20:46 +04:00
Dmitry Stogov
58a41cf795 Make QM_ASSIGN, JMP_SET and CAST return IS_TMP_VAR. 2014-09-24 01:57:40 +04:00
Dmitry Stogov
e8612b72ee Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  Drop unused result argument
  Fix ct binding for cuf/cufa functions
  Fix detection of write to built-in function for references
  Test use of string names with \ prefix
  Add zend_add_literal_string
  Drop dead code
2014-09-23 23:27:20 +04:00
Dmitry Stogov
d429e87d18 Removed useless helper 2014-09-23 23:26:39 +04:00
Nikita Popov
4a221bd881 Drop unused result argument 2014-09-23 21:04:30 +02:00
Nikita Popov
67a5ca6697 Fix ct binding for cuf/cufa functions
It was checking against the wrong AST kind, so the binding was
never actually done.
2014-09-23 21:02:32 +02:00
Nikita Popov
9070eb38e9 Fix detection of write to built-in function for references 2014-09-23 20:42:22 +02:00
Nikita Popov
231dcc94e8 Test use of string names with \ prefix
And drop piece of dead code
2014-09-23 20:36:00 +02:00
Nikita Popov
182ddfeaf2 Add zend_add_literal_string
And simplify additional of special literals based on it.
2014-09-23 20:21:28 +02:00
Nikita Popov
4571271de1 Drop dead code 2014-09-23 19:32:02 +02:00
Dmitry Stogov
06103d65b1 Use zval_ptr_dtor_nogc() to free IS_TMP_VAR operands.
Removed ZEND_SWITCH_FREE opcode (ZEND_FREE used instead).
2014-09-23 17:21:29 +04:00
Dmitry Stogov
7cef08c5d1 Allocate copies of internal functions inherited in user classes at CG(arena), instead of permanent heap (malloc). 2014-09-23 12:35:42 +04:00
Xinchen Hui
e029042c36 It is not likely a string 2014-09-23 13:50:00 +08:00
Xinchen Hui
22fbfdfb8e Simply make_printable_zval
it's possible to remove make_printable_zval at all
but it will be a API break
2014-09-23 12:56:59 +08:00
Nikita Popov
75533c9b23 Test a few more error conditions in the compiler 2014-09-23 00:57:00 +02:00
Nikita Popov
51119054ff Test error conditions for ct class const refs
And fix a bug found while doing so...
2014-09-23 00:40:17 +02:00
Nikita Popov
c0c431b702 Test some additional cases for constexpr evaluation 2014-09-23 00:31:38 +02:00
Nikita Popov
982f02afe6 Remove zend_dynamic_array
This was introduced back in 2000 to test a new hashtable
implementation and is no longer used.
2014-09-22 23:45:13 +02:00
Nikita Popov
02bb637bb8 Remove static allocator
We didn't even compile this file anymore
2014-09-22 23:45:13 +02:00
Nikita Popov
f30f28ec47 Fix list() destructuring to special variables 2014-09-22 18:34:40 +02:00
Dmitry Stogov
0c0d43bd4e Avoid useless reference counting 2014-09-22 17:52:38 +04:00
Dmitry Stogov
826abe9d62 Specialization (only IS_VAR ad IS_CV operands may be references) 2014-09-22 16:17:35 +04:00
Dmitry Stogov
a057f060e8 Optimized unset() 2014-09-22 14:41:44 +04:00
Dmitry Stogov
9c0fa4106c Make error paths to be UNEXPECTED 2014-09-22 13:18:49 +04:00
Dmitry Stogov
2c8ac3a252 Replace IS_OP?_TMP_FREE() with more clear (OP?_TYPE == IS_TMP_VAR) 2014-09-22 12:47:10 +04:00
Anatol Belski
065edced71 added a comment 2014-09-22 09:41:56 +02:00
Anatol Belski
dc7a66a1c4 fix the REPARSE_DATA_BUFFER struct def 2014-09-22 09:41:54 +02:00
Nikita Popov
7d4c81d8d9 Fix two memory errors by interning earlier 2014-09-21 23:56:09 +02:00
Nikita Popov
a770d29df7 Add smart_str_append for appending zend_strings
Also replaces usages in Zend/ and ext/standard
2014-09-21 20:58:31 +02:00
Nikita Popov
2a7de9fdbb Rename smart_str_append to smart_str_append_smart_str
It's used only rarely and I'm running out of append names...
2014-09-21 20:49:39 +02:00
Nikita Popov
e0df8cc810 Use smart_str for exception stack traces 2014-09-21 20:49:39 +02:00
Nikita Popov
e26a688871 Use smart_str in get_function_declaration
Instead of custom smart string implementation
2014-09-21 20:49:39 +02:00
Nikita Popov
e33f3d3b7c Move smart_str implementation into Zend/
So we can use it there as well...

For now I've retained the zend_smart_str_public.h header, though
it would probably be better to just move that one struct into
zend_types.h.
2014-09-21 20:49:39 +02:00
Andrea Faulds
12b15e5ca4 Merge branch 'master' into integer_semantics 2014-09-21 00:29:48 +01:00
Nikita Popov
6219a4e844 Merge branch 'PHP-5.6'
Conflicts:
	Zend/zend_compile.c
2014-09-20 21:58:06 +02:00
Nikita Popov
308c0a727e Merge branch 'PHP-5.5' into PHP-5.6 2014-09-20 21:47:59 +02:00
Nikita Popov
5e977e69e1 Fixed bug #67633 2014-09-20 21:46:25 +02:00
Anatol Belski
2fc1a1dce5 fixed copying of the struct as it's not being modified
in the subsequent function call
2014-09-20 20:58:00 +02:00
Nikita Popov
98891ee118 Simplify foreach flags
* FE_RESET_VARIABLE and FE_RESET_REFERENCE were always set
   together.
 * In some places the code checked FE_FETCH_BYREF instead of
   FE_RESET_REFERENCE and relied on them having the same value.
 * Now the FE_RESET_* flags are dropped and everything uses
   FE_FETCH_BYREF
2014-09-20 12:56:05 +02:00
Nikita Popov
1027f0d978 Fix leak in foreach with by-ref iteration of ref array 2014-09-20 12:46:05 +02:00
Xinchen Hui
95836a3504 Avoid strlen usage 2014-09-20 15:27:36 +08:00
Xinchen Hui
7ecc7e6bc2 folder marks 2014-09-20 15:16:09 +08:00
Xinchen Hui
96ccf3ef98 Added missed mod str 2014-09-20 15:12:08 +08:00
Xinchen Hui
3e71f5ff7b Fixed built on OSX 2014-09-20 13:51:58 +08:00
Anatol Belski
ea6da30396 make the return value more logic
as if clz() were returning 32 on empty size
2014-09-20 02:14:35 +02:00
Anatol Belski
7b4e8c64e0 make use of intrinsics available with VS for bitset lookups 2014-09-20 01:43:06 +02:00
Nikita Popov
31e842472f Make number printing functions less generic
Now that zend_ulong is 64bit on 64bit platforms, it should be
sufficient to always use it, rather than supporting multiple
types.

API changes:
 * _zend_print_unsigned_to_buf and _zend_print_signed_to_buf
   no longer exist.
 * smart_str(ing)_print_long and smart_str(ing)_print_unsigned
   no longer exist.
 * Instead of all these, zend_print_ulong_to_buf and
   zend_print_long_to_buf should be used.
 * smart_str_append_generic_ex no longer exists.
 * smart_str(ing)_append_off_t(_ex) no longer exists, use
   smart_str(ing)_append_long(_ex) instead.
2014-09-19 23:39:07 +02:00
Nikita Popov
c7446bbd39 Remove superfluous Z_REFCOUNTED_P check
The string is never interned and IS_CONSTANT_EX is always refcounted.
2014-09-19 23:39:06 +02:00
Nikita Popov
c343ca4efb Split inheritance into separate file
This moves handling of inheritance and interface implementation
from zend_compile.c into a separate zend_inheritance.c file, as
this is not really related to compilation.
2014-09-19 19:54:37 +02:00
Johannes Schlüter
d0cb715373 s/PHP 5/PHP 7/ 2014-09-19 18:33:14 +02:00
Anatol Belski
d1131d4278 reverted some previous IS_ABSOLUTE_PATH related changes
It's fine with strlen usage now, only one call
2014-09-19 16:30:05 +02:00
Anatol Belski
149db936d4 expand IS_ABSOLUTE_PATH on Windows, so then strlen() isn't called twice 2014-09-19 16:30:03 +02:00
Dmitry Stogov
bccc653185 Avoid double IS_INTERNED() check 2014-09-19 17:32:50 +04:00
Dmitry Stogov
35f8467687 Reverted incorrect chunk 2014-09-19 17:05:03 +04:00
Dmitry Stogov
3bc8a958c5 Fixed useless or duplicated IS_INTERNED() checks 2014-09-19 15:41:01 +04:00
Anatol Belski
3ec7c28084 forgot to replace the strlen call 2014-09-19 13:14:16 +02:00
Anatol Belski
6bbebc60ea avoid multiple strlen calls for the same buffer 2014-09-19 12:39:17 +02:00
Anatol Belski
babcad063f fix length data types 2014-09-19 12:14:46 +02:00
Anatol Belski
c45f4f5461 generalized the case with secure memory zeroing 2014-09-19 01:46:14 +02:00
Dmitry Stogov
21514b0d9a Fix for Clang 2014-09-19 00:38:34 +04:00
Dmitry Stogov
db6306dd0e Split is_numeric_string_ex() into inline and non-inline parts 2014-09-18 22:19:51 +04:00
Anatol Belski
761e347b75 that's not char * but zend_string * 2014-09-18 17:14:57 +02:00