Commit Graph

1253 Commits

Author SHA1 Message Date
Dmitry Stogov
9f7564b12b Removed zend_execute_data->prev_nested_call. Reuse prev_execute_data instead. 2014-10-01 10:46:13 +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
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
Timm Friebe
0a9e207a77 zend_uint -> uint32_t 2014-09-25 21:42:19 +02:00
Timm Friebe
e83580c1f0 Merge branch 'master' into catchable-fatals/methods-on-non-objects 2014-09-25 19:45:05 +02: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
8ea2409e44 Fixed immutable arrays support 2014-09-24 15:39:54 +04:00
Dmitry Stogov
73275a55f5 Avoid double checks 2014-09-24 12:20:46 +04:00
Dmitry Stogov
d429e87d18 Removed useless helper 2014-09-23 23:26:39 +04: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
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
2c8ac3a252 Replace IS_OP?_TMP_FREE() with more clear (OP?_TYPE == IS_TMP_VAR) 2014-09-22 12:47:10 +04: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
Dmitry Stogov
bccc653185 Avoid double IS_INTERNED() check 2014-09-19 17:32:50 +04:00
Dmitry Stogov
551ee4165b Use runtime-cache to avoid hash lookups in BIND_GLOBAL instruction 2014-09-17 00:52:45 +04:00
Anatol Belski
65c401672e redo the fix with cast to size_t 2014-09-16 21:17:22 +02:00
Nikita Popov
69e7c9d89c Initial coalesce operator implementation 2014-09-16 19:14:46 +01:00
Dmitry Stogov
ca37c02520 code optimization 2014-09-16 13:52:50 +04:00
Dmitry Stogov
d17487f827 We don't have to check for undefined CV if we fetch it for isset() operation 2014-09-16 09:15:47 +04:00
Nikita Popov
079409bbc2 Switch (un)mangle property name to size_t and zend_string
Also use the _ex variants where possible.
2014-09-16 00:31:27 +02:00
Dmitry Stogov
6991780793 Optimized FE_RESET and FE_FETCH 2014-09-16 01:34:27 +04:00
Anatol Belski
ea94210e8c fix most of signed/unsigned warnings in vm def 2014-09-15 19:46:24 +02:00
Dmitry Stogov
8527657ca6 Fixed refcounting for references 2014-09-11 19:12:12 +04:00
Dmitry Stogov
b8c36e199e Simplify ASSIGN code 2014-09-11 17:00:06 +04:00
Dmitry Stogov
82096dc151 Removed ZEND_QM_ASSIGN_VAR and ZEND_JMP_SET_VAR opcodes (in PHPNG they did exacly the same as ZEND_QM_ASSIGN and ZEND_JMP_SET) 2014-09-11 12:29:54 +04:00
Dmitry Stogov
e85545eca5 Removed IS_STR_OFFSET type and corresponding macros. Optimized string offset handling in ASSIGN_DIM opcode. 2014-09-08 15:46:45 +04:00
Anatol Belski
cfa2b3bf63 fixed string index handling with references 2014-09-07 13:34:18 +02:00
Anatol Belski
acad6f4700 fix 64 bit string index usage 2014-09-07 00:55:36 +02:00
Dmitry Stogov
9a958a086d Simplify BEGIN_SILENCE/END_SILENCE to not modify ini entry value back and force 2014-09-03 15:17:50 +04:00
Dmitry Stogov
b0f0211b1a Revert "Fixed memory leaks"
This reverts commit 0940e54ffc.
2014-09-03 02:38:04 +04:00
Dmitry Stogov
0940e54ffc Fixed memory leaks 2014-09-03 02:07:38 +04:00
Dmitry Stogov
f0ad7472b0 Avoid memory allocation/deallocation in BEGIN_SILENCE/END_SILENCE opcode handlers. 2014-09-02 22:13:24 +04:00
Dmitry Stogov
88d7ca44f6 Refactored INI subsystem to use zend_string* instead of char* 2014-09-01 20:57:33 +04:00
Dmitry Stogov
319ce224d2 LOAD_REGS() is not used anymore 2014-08-28 10:55:16 +04:00
Dmitry Stogov
f2b0370193 Use 'const' qualifier for pointrs to code used at run-time (the code must not be changed) 2014-08-28 02:44:06 +04:00
Dmitry Stogov
b1f53ca415 Use efree_size() instead of efree() where posible 2014-08-27 20:49:56 +04:00
Dmitry Stogov
8ec40397cd Cleanup IS_VAR handling 2014-08-27 19:10:29 +04:00
Tjerk Meesters
a79b933384 Fixed corruption of execute_data when ZEND_STRLEN has to cast an object to string. 2014-08-27 23:00:11 +08:00
Nikita Popov
d2a3bf9daf Fix compiler warnings 2014-08-25 23:08:01 +02:00
Nikita Popov
899a1ed59a Merge branch 'ast'
Conflicts:
	Zend/zend_compile.c
2014-08-25 22:04:33 +02:00
Nikita Popov
6db293d5e0 Merge remote-tracking branch 'php-src/master' into ast
Conflicts:
	Zend/zend_compile.c
	Zend/zend_compile.h
	Zend/zend_globals.h
	Zend/zend_language_parser.y
	Zend/zend_language_scanner.c
	Zend/zend_language_scanner.l
	Zend/zend_types.h
2014-08-25 21:52:18 +02:00
Anatol Belski
af59e92b24 master renames phase 7 2014-08-25 21:51:49 +02:00
Anatol Belski
6f9f0bf205 master renames phase 2 2014-08-25 19:28:33 +02:00
Anatol Belski
c3e3c98ec6 master renames phase 1 2014-08-25 19:24:55 +02:00
Anatol Belski
6d54e89916 Merge remote-tracking branch 'php/master' 2014-08-20 21:29:49 +02:00
Dmitry Stogov
9507aa99fc Fixed immutable array support 2014-08-20 21:42:49 +04:00
Anatol Belski
66e7090e61 Merge remote-tracking branch 'php/master' 2014-08-20 18:19:37 +02:00
Dmitry Stogov
04aa96d28d Removed a hack that allowed passing of function return value by reference depending on value of reference-counter (Fixed Zend/tests/bug35393.phpt test failure) 2014-08-20 15:04:40 +04:00
Anatol Belski
07359785c3 Merge remote-tracking branch 'php/master' 2014-08-20 08:48:43 +02:00
Dmitry Stogov
8ea7e4e4e2 fixed memory leak 2014-08-20 10:43:37 +04:00
Anatol Belski
53a8d8e627 Merge remote-tracking branch 'php/master' 2014-08-20 00:34:17 +02:00
Dmitry Stogov
14439b79b4 Fixed referenced value separation 2014-08-20 00:00:59 +04:00
Anatol Belski
c586133d07 rename zval_get_long and fixes to some string functions 2014-08-18 08:39:39 +02:00
Timm Friebe
3db67313c9 Fix nesting for *non*-compile-time-resolveable functions
See a1a4ba9511 (commitcomment-7414223)
2014-08-16 22:03:56 +02:00
Nikita Popov
71675a4bf8 Merge remote-tracking branch 'php-src/phpng' into ast
Conflicts:
	Zend/zend_ast.c
	Zend/zend_compile.c
	Zend/zend_language_parser.y

Incomplete merge!
2014-08-16 21:55:08 +02:00
Timm Friebe
a1a4ba9511 Make list of opcodes used for nesting calculation consistent
with `zend_do_convert_call_user_func()` in Zend/zend_compile.c
2014-08-16 17:47:21 +02:00
Timm Friebe
c3d214aa08 MFH 2014-08-16 17:38:20 +02:00
Anatol Belski
864172d9a4 further fixes to ext/standard and zend 2014-08-16 17:31:40 +02:00
Anatol Belski
8ee2a4a9b5 first shot on merging the core fro the int64 branch 2014-08-16 11:16:11 +02:00
Dmitry Stogov
773d80c6df Fixed support for references 2014-08-14 22:44:25 +04:00
krakjoe
dc70139d85 update zend_make_printable_zval to take TSRM context 2014-08-11 06:09:46 +01:00
Dmitry Stogov
e677e8cc87 Fixed ext/wddx/tests/bug48562.phpt 2014-08-05 23:48:27 +04:00
Dmitry Stogov
ce1af1e47b Fixed bug #67725 (now we create immutable arrays only in SHM) 2014-08-05 15:38:43 +04:00
Bob Weinand
d5ddd2dbb2 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
2014-07-30 17:57:07 +02:00
Dmitry Stogov
70fb0e7519 Fixed incinsitency in passing arguments by reference to call_user_func() 2014-07-29 20:27:48 +04:00
Dmitry Stogov
507e3b9193 fixed support for references 2014-07-29 15:29:22 +04:00
Dmitry Stogov
ea1d5dcacb Removed second zval_copy_ctor() 2014-07-24 01:16:00 +04:00
Dmitry Stogov
c49a06168e Fixed support for constant arrays in context of "const" statement (Zend/tests/constant_expressions_arrays.phpt failed when opcache.protect_memort was set) 2014-07-23 22:47:58 +04:00
Nikita Popov
7892b89465 Implement ZEND_TYPE_CHECK optimization 2014-07-22 23:15:47 +02:00
Nikita Popov
d4d4b69e72 Merge branch 'phpng' into ast
Conflicts:
	Zend/zend_compile.c
	Zend/zend_compile.h
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h

Some of dmitry's optimizations are not merged in yet!
2014-07-22 18:24:58 +02:00
Dmitry Stogov
f163f625e8 fixed "isset($array[true]);" 2014-07-22 18:40:29 +04:00
Dmitry Stogov
f2a2fccece Merge branch 'master' into phpng
* master:
  fix nmake snap when ext name is different in target dll
  force atoll macro usage on windows
  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

Conflicts:
	Zend/zend_opcode.c
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
	ext/session/session.c
2014-07-22 15:42:17 +04:00
Dmitry Stogov
821b8bbb39 Fixed support for executor override 2014-07-22 11:24:16 +04:00
Xinchen Hui
1c0e22f50c Merge branch 'PHP-5.6' 2014-07-19 17:19:57 +08:00
Xinchen Hui
1d2f232bd2 Merge branch 'PHP-5.5' into PHP-5.6 2014-07-19 17:19:39 +08:00
Xinchen Hui
8ff00e6e85 Improve fix for #66608 2014-07-19 17:19:01 +08:00
Xinchen Hui
110bf9c720 Merge remote-tracking branch 'origin/master' into phpng
Conflicts:
	Zend/zend_compile.h
	ext/openssl/xp_ssl.c
2014-07-18 16:25:43 +08:00
Xinchen Hui
f6f621ef69 Merge branch 'PHP-5.6' 2014-07-18 15:51:24 +08:00
Xinchen Hui
550b3e4306 Merge branch 'PHP-5.5' into PHP-5.6
Conflicts:
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
2014-07-18 15:48:56 +08:00
Xinchen Hui
de433d4c47 Fixed bug #66608 (Incorrect behavior with nested "finally" blocks) 2014-07-18 15:45:31 +08:00
Dmitry Stogov
2febfbab8e Micro optimization for the main interpreter loop 2014-07-17 11:18:44 +04:00
Dmitry Stogov
af7cb16907 Implemented builtin instruction for strlen() 2014-07-14 15:43:11 +04:00
Dmitry Stogov
7dfb4f6b38 Implemented builtin instruction for type check functions - is_*() 2014-07-14 10:33:11 +04:00
Timm Friebe
a49ca6fde8 Rewrite code to use ZEND_VM_JMP() instead of repeated ZEND_VM_INC_OPCODE() calls 2014-07-12 16:40:27 +02:00
Dmitry Stogov
6c8db864e0 Implemented builtin instruction for strlen() 2014-07-11 18:52:27 +04:00
Dmitry Stogov
de306e7088 Implement call_user_func() and call_user_func_array() using special opcodes.
In some rare cases it leads to insignificant changes in error messages.
2014-07-11 00:32:18 +04:00
Dmitry Stogov
d81b287ce1 Fixed delayed closure destruction and reference support 2014-07-10 18:36:11 +04:00
Dmitry Stogov
19729aa7fe Use data stored in current call frame instead of EG() if possible 2014-07-09 17:07:41 +04:00
Dmitry Stogov
9d6e45a0ee Changed zend_make_printable_zval() to return "use_copy" instead of additional reference argument.
Improved branch prediction.
2014-07-09 16:05:55 +04:00
Dmitry Stogov
1dd07d6bf4 Partial fix that allows internal constructors to set $this to null.
The address of $this passed to drectly called internal constructor in execute_data->return_value.
Internal constructors should use ZEND_CTOR_MAKE_NULL() macro (insted of previous ZEND_NULL(EG(This))) to do the work.

This patch doesn't fix the problem for indirectly called constructors. e.g. parant::__construct().
2014-07-09 11:57:42 +04:00
Dmitry Stogov
0abd626269 code cleanup 2014-07-08 13:24:23 +04:00
Dmitry Stogov
b36aaea6ed ZEND_SEND_VAR and ZEND_SEND_VAL specialization 2014-07-08 02:13:53 +04:00
Dmitry Stogov
2ed8a17045 Refactored run_time_cache usage in object handlers 2014-07-07 20:54:31 +04:00
Dmitry Stogov
7ce2d59ad2 Merge branch 'call-frame' into phpng
* call-frame:
  Simplify call-frame handling
  Removed EG(active_symbol_table) and use corresponding value from EG(current_execute_data)
  Use values from current_execute_data instead of globals where possible
  Removed EG(called_scope) and use corresponding value from EG(current_execute_data)
  Removed EG(in_execution). If EG(currentent_execute_data) is not NULL we are executing something.
  Removed EG(opline_ptr) and use corresponding value from EG(current_execute_data)
  Removed EG(active_op_array) and use corresponding value from EG(current_execute_data)
  Uinified call frame handling for user and internal functions. Now EG(current_execute_data) always point to the call frame of the currently executed function.
  Fixed cleanup of incompleytely passed parameters
  Prohibited parameter redefinition
  Fixed support for extra arguments in conjunction with variadiv argument. Use compile time flags to check if we call constructor and result of ZEND_NEW is used or not.
  Fixed uninitialized variables
  Optimization
  Changed zend_execute_data layout to reduce memory overhead
  Help C compilet to do the better job optimizing target code
  Use fast comparison for (func->type == ZEND_USER_FUNCTION || func->type == ZEND_EVAL_CODE)
  Keep extra args in the same VM stack segment (after all CV and TMP vars)
  Refactoring: merge call_frame and end_execute_data into single data structure. Keep only single copy of each argument on VM stack (previously ZE kept two copies of each arguments for user functions)
  Refactoring: use call_frames instead of call_slots

Conflicts:
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
2014-07-07 16:19:24 +04:00
Dmitry Stogov
5aa91be509 Simplify call-frame handling 2014-07-07 15:50:44 +04:00
Timm Friebe
dacd4c84cb 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.
2014-07-06 18:58:37 +02:00
Timm Friebe
a1554ca634 Merge in changes from master
Now also includes "on [TYPE]" in "Call to a member function" error
2014-07-06 17:07:01 +02:00
Timm Friebe
7e2e4ebc69 Handle ZEND_NEW nesting 2014-07-06 15:17:16 +02:00
Timm Friebe
9dbc91f2ff Handle ZEND_INIT_NS_FCALL_BY_NAME nesting 2014-07-06 15:10:50 +02:00
Timm Friebe
ff66e59731 Support nested static calls 2014-07-06 14:58:44 +02:00
Timm Friebe
df908275f6 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%)

$ make test TESTS=Zend/tests/*-on-non-objects-*phpt
# Tests passed    :   11 (100.0%)

Before, this would cause a SEGV. Thanks @nikic for raising this concern
2014-07-06 14:48:42 +02:00
Timm Friebe
dc68aa32bc Only allocate NULL return value if it's actually used 2014-07-06 12:50:32 +02:00
Timm Friebe
a782f697df Also handle nested function calls via variable 2014-07-06 12:44:02 +02:00
Timm Friebe
abd42ea4c2 QA: Simplify code to initialize a NULL value
See https://github.com/php/php-src/pull/647#discussion_r14560540
2014-07-06 12:38:29 +02:00
Timm Friebe
2758824940 Remove return statement which would break goto and switch VMs
See https://github.com/php/php-src/pull/647#discussion_r14560483
2014-07-06 12:31:20 +02:00
Timm Friebe
17b3791a01 Handle nesting correctly
See feedback by @nikic, https://github.com/php/php-src/pull/647#issuecomment-48050551
2014-07-06 12:27:04 +02:00
Nikita Popov
439a95908b Fix leak when generator return value is not used 2014-07-05 15:07:25 +02:00
Nikita Popov
2d4c962c61 Fix ZTS build 2014-07-05 14:12:20 +02:00
Dmitry Stogov
6bf24f4dd0 Removed EG(active_symbol_table) and use corresponding value from EG(current_execute_data) 2014-07-04 18:03:45 +04:00
Dmitry Stogov
d2890963e4 Use values from current_execute_data instead of globals where possible 2014-07-04 17:03:44 +04:00
Dmitry Stogov
c4d99ec982 Removed EG(called_scope) and use corresponding value from EG(current_execute_data) 2014-07-03 02:34:43 +04:00
Dmitry Stogov
0a77dcd4b9 Removed EG(in_execution). If EG(currentent_execute_data) is not NULL we are executing something. 2014-07-03 01:02:25 +04:00
Dmitry Stogov
63c057e331 Removed EG(opline_ptr) and use corresponding value from EG(current_execute_data) 2014-07-02 23:29:53 +04:00
Dmitry Stogov
4b09dd69e6 Removed EG(active_op_array) and use corresponding value from EG(current_execute_data) 2014-07-02 22:03:21 +04:00
Dmitry Stogov
412ad4b254 Uinified call frame handling for user and internal functions.
Now EG(current_execute_data) always point to the call frame of the currently executed function.
2014-07-02 22:01:25 +04:00
Dmitry Stogov
8c9b3e664c Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed possible crash because of race conditions on modifying constants in shared memory
2014-07-01 00:17:55 +04:00
Dmitry Stogov
2330be5641 Fixed possible crash because of race conditions on modifying constants in shared memory 2014-07-01 00:13:34 +04:00
Dmitry Stogov
b7715c7e8a Refactored parameter passing mechanism.
In PHP-5.6 and below each argument passed to user function was copies on VM stack twice.
Now we always have ZEND_INIT_FCALL (or simular) opcode that pushes "call frame" on top of VM stack.
"Call frame" is actually the same zend_execute_data structure.
All the following ZEND_SEND instructions push arguments on top of the stack in a way that they directly comes into corresponding CV variables of the called frame. Extra arguments are copied at the end of stack frame (after all CV and TMP variables) on function enterance.

There are two minor incompatibilities:
1) It's not allowed to decalre functions redefining arguments e.g. "function foo($a,$a) {}".
2) func_get_arg() and func_get args() return the current value of argument and not the original value that was sent.
2014-06-30 15:43:45 +04:00
Dmitry Stogov
b4a7a1bacc Fixed cleanup of incompleytely passed parameters 2014-06-30 15:41:16 +04:00
Dmitry Stogov
3f0ee308a0 Fixed support for extra arguments in conjunction with variadiv argument.
Use compile time flags to check if we call constructor and result of ZEND_NEW is used or not.
2014-06-30 14:17:17 +04:00
Dmitry Stogov
a3c8fbdd12 Fixed uninitialized variables 2014-06-27 21:13:05 +04:00
Dmitry Stogov
31087ee8b0 Optimization 2014-06-27 20:22:17 +04:00
Dmitry Stogov
032f33591a Keep extra args in the same VM stack segment (after all CV and TMP vars) 2014-06-27 12:25:36 +04:00
Dmitry Stogov
c69781393c Refactoring: merge call_frame and end_execute_data into single data structure. Keep only single copy of each argument on VM stack (previously ZE kept two copies of each arguments for user functions) 2014-06-26 23:51:14 +04:00
Dmitry Stogov
43477bc7a2 Refactoring: use call_frames instead of call_slots 2014-06-24 02:17:16 +04:00
Dmitry Stogov
909acec231 Avoid useles constants update 2014-06-16 23:32:58 +04:00
Dmitry Stogov
3b2fb7abc5 Fixed support for references 2014-06-16 13:08:48 +04:00
Dmitry Stogov
83817ddb1c Fixed reference counting 2014-06-12 13:01:44 +04:00
Dmitry Stogov
dd1c68e67f Merge branch 'master' into phpng
* master: (77 commits)
  NEWS entry for Fix potential segfault in dns_get_record()
  NEWS entry for "Fix potential segfault in dns_get_record()"
  NEWS entry for Fix potential segfault in dns_get_record(
  Fix potential segfault in dns_get_record()
  Revert "Add optional second arg to unserialize()"
  5.5.15 now
  update NEWS
  Fix bug #66127 (Segmentation fault with ArrayObject unset)
  5.4.31 next
  Add NEWS. This doesn't need UPGRADING (or an RFC), IMO.
  Fix broken test.
  Add a mime type map generation script and update the header.
  Move the mime type map out of php_cli_server.c for easier generation.
  Replace the CLI server's linear search for extensions with a hash table.
  fix test
  Remove unused included file
  NEWS
  NEWS
  NEWS
  Fixed Bug #67413 	fileinfo: cdf_read_property_info insufficient boundary chec
  ...

Conflicts:
	Zend/zend_closures.c
	Zend/zend_execute.c
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
	ext/spl/spl_array.c
	ext/standard/basic_functions.c
	ext/standard/dns.c
	ext/standard/var.c
2014-06-12 05:07:33 +04:00
Dmitry Stogov
593b125eb9 Fixed reference handling 2014-06-12 03:14:57 +04:00
Dmitry Stogov
14e6ee7f42 Use absolute addresses as branch targets for NEW, FE_RESET and FE_FETCH 2014-06-11 11:39:42 +04:00
Dmitry Stogov
371345bed6 Avoid reallocation 2014-06-09 17:36:37 +04:00
Stanislav Malyshev
9fceb05fcf Merge branch 'PHP-5.6'
* PHP-5.6:
  Bug 64744 Show the type of the non-object for more descriptive errors
2014-06-08 19:18:09 -07:00
Boro Sitnikovski
cfccdc6362 Bug 64744
Show the type of the non-object for more descriptive errors
2014-06-08 19:14:58 -07:00
Stanislav Malyshev
a17734fb04 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix bug 666222
  Fix bug 666222
2014-06-08 19:02:51 -07:00
Stanislav Malyshev
8f527fbf14 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fix bug 666222
  Fix bug 666222
2014-06-08 19:02:24 -07:00
Levi Morrison
f47976dd9b Fix bug 666222
This also adds some smaller, isolated tests related to bug 66622.
2014-06-08 18:59:44 -07:00
Dmitry Stogov
e499c3d259 Introduced new BIND_GLOBAL instraction instead of FETCH_W+ASSIGN_REF pair that caused a lot of useles checks 2014-06-06 15:04:30 +04:00
Dmitry Stogov
730beec16e Simplify code 2014-06-05 18:42:17 +04:00
Dmitry Stogov
c1965f58d4 Use reference counting instead of zval duplication 2014-06-05 16:04:11 +04:00
Dmitry Stogov
3f6f0d5a70 Simplified and optimized ZEND_HANDLE_NUMERIC() 2014-06-03 13:10:42 +04:00
Dmitry Stogov
bc2ba841f9 Optimized conditions order 2014-06-03 09:45:09 +04:00
Dmitry Stogov
30c05577f7 Optimized conditions order 2014-06-03 03:54:03 +04:00
Dmitry Stogov
af78ea1d97 Avoid copying of immutable arrays 2014-06-03 02:43:53 +04:00
Dmitry Stogov
0427ae08fb cleanup 2014-06-03 00:36:31 +04:00
Nikita Popov
8515b96e53 Handle FUNC_ARG fetches on temporaries 2014-05-31 20:15:55 +02:00
Nikita Popov
96b32ec532 Support isset() on temporaries 2014-05-31 20:05:03 +02:00
Nikita Popov
f0ac7f7d7b Properly handle property read on const/tmp 2014-05-31 17:51:22 +02:00
Nikita Popov
c53a7ea4e5 Property handle calls on [] and '' consts/tmps 2014-05-31 17:37:30 +02:00
Nikita Popov
64e4c9eff1 Support directly calling closure 2014-05-31 17:18:37 +02:00
Dmitry Stogov
b3b616cf7e Introduced immutable arrays. They don't need to be copyed and may be used directly from SHM. 2014-05-29 18:21:56 +04:00
Nikita Popov
47e85b1b35 Improve class constant fetch fix
Dereference the cached constant for Test::TEST as well (and not just
self::TEST).

Also improve the phpt file to test this case as well - previously
this only manifested with opcache enabled, due to literal sharing.

Additionally the Z_TYPE_P != IS_REFERENCE assertion is now moved
into the TMP_VAR fetching code (as it applies to more than just
property assignments.)
2014-05-29 11:17:33 +02:00
Nikita Popov
d9a35c7e97 Fix class constant fetching
If a class is extended after the constant fetch has been cached
the cached value will be turned into a reference. On the next
fetch the polymorphic cache will return this reference, which
will be directly returned. The object assignment code then
dereferences this result and performs a shallow copy, which is
invalid for references. This subsequently leads to the constant
value being prematurely freed.

This is fixed by dereferencing the value returned from the
polymorphic cache. Furthermore the incorrect dereference from
in the object assignment code is replaced with an assertion that
we're dealing with a non-reference, so ensure that this kind of
problem cannot go unnoticed in the future.
2014-05-29 00:15:50 +02:00
Dmitry Stogov
40256e0f9c Use specialized functions instead of macros 2014-05-26 17:16:16 +04:00
Xinchen Hui
066c1d5451 This seems better 2014-05-26 12:05:21 +08:00
Xinchen Hui
02fde346f8 Save one zval copy 2014-05-26 11:49:43 +08:00
Dmitry Stogov
0c6a6f0fba Re-applyed Bob's patch with minor fixes 2014-05-07 15:03:56 +04:00
Dmitry Stogov
4ecc527976 Reverted Bob's patch (it breaks many tests when run with opcache and needs to be fixed first). 2014-05-07 03:26:13 +04:00
Nikita Popov
80f8d20b72 Remove dead code from ZEND_THROW
The IS_CONST case always throws an E_ERROR two lines above that,
so no need to handle it further.
2014-05-06 20:02:26 +02:00
Nikita Popov
767b5eea7e Fix throw by reference
Reported by Timm Friebe
2014-05-06 20:01:19 +02:00
Bob Weinand
f3c1881f1d Re-added fix for bug #66015 and adapted for phpng branch 2014-05-06 14:59:03 +02:00
Dmitry Stogov
28a8135331 Restored original EG(scope) behavior when call object methods 2014-05-06 02:04:05 +04:00
Nikita Popov
2c24cdb4a3 Comment out cast_object for IS_NULL 2014-05-01 00:25:23 +02:00
Dmitry Stogov
52e79186b2 JMPZ/JMPNZ/JMPZNZ optimization 2014-05-01 01:24:38 +04:00
Dmitry Stogov
17d027ed47 Split IS_BOOL into IS_FALSE and IS_TRUE 2014-04-30 18:32:42 +04:00
Dmitry Stogov
6a911e833f Optimized JMPZNZ to avoid multiplication at runtime (may be it makes sense to use relative addresses everywere it'll lead to Position Independent Code) 2014-04-30 11:23:19 +04:00
Nikita Popov
4cd97b3ebd Fix by-reference argument unpacking 2014-04-26 10:40:12 +02:00
Nikita Popov
4c16b777fe Uhm, do we really need to support that? 2014-04-25 23:21:05 +02:00
Nikita Popov
9263d18bd9 Optimize ZEND_CAST to avoid zval copies
The scalar type casts IS_NULL, IS_BOOL, IS_LONG, IS_DOUBLE and
IS_STRING will no longer require a copy when casting.

A copy is now only made when casting to IS_ARRAY and IS_OBJECT, if
the type doesn't already match.

I tweaked the reference handling for the type-already-correct case
to DEREF the zval after that check. References require a copy anyway,
so they can go through the slow codepath.
2014-04-25 23:21:05 +02:00
Dmitry Stogov
f9927a6c97 Merge mainstream 'master' branch into refactoring
During merge I had to revert:
	Nikita's patch for php_splice() (it probably needs to be applyed again)
	Bob Weinand's patches related to constant expression handling (we need to review them carefully)
	I also reverted all our attempts to support sapi/phpdbg (we didn't test it anyway)

Conflicts:
	Zend/zend.h
	Zend/zend_API.c
	Zend/zend_ast.c
	Zend/zend_compile.c
	Zend/zend_compile.h
	Zend/zend_constants.c
	Zend/zend_exceptions.c
	Zend/zend_execute.c
	Zend/zend_execute.h
	Zend/zend_execute_API.c
	Zend/zend_hash.c
	Zend/zend_highlight.c
	Zend/zend_language_parser.y
	Zend/zend_language_scanner.c
	Zend/zend_language_scanner_defs.h
	Zend/zend_variables.c
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
	ext/date/php_date.c
	ext/dom/documenttype.c
	ext/hash/hash.c
	ext/iconv/iconv.c
	ext/mbstring/tests/zend_multibyte-10.phpt
	ext/mbstring/tests/zend_multibyte-11.phpt
	ext/mbstring/tests/zend_multibyte-12.phpt
	ext/mysql/php_mysql.c
	ext/mysqli/mysqli.c
	ext/mysqlnd/mysqlnd_reverse_api.c
	ext/mysqlnd/php_mysqlnd.c
	ext/opcache/ZendAccelerator.c
	ext/opcache/zend_accelerator_util_funcs.c
	ext/opcache/zend_persist.c
	ext/opcache/zend_persist_calc.c
	ext/pcre/php_pcre.c
	ext/pdo/pdo_dbh.c
	ext/pdo/pdo_stmt.c
	ext/pdo_pgsql/pgsql_driver.c
	ext/pgsql/pgsql.c
	ext/reflection/php_reflection.c
	ext/session/session.c
	ext/spl/spl_array.c
	ext/spl/spl_observer.c
	ext/standard/array.c
	ext/standard/basic_functions.c
	ext/standard/html.c
	ext/standard/mail.c
	ext/standard/php_array.h
	ext/standard/proc_open.c
	ext/standard/streamsfuncs.c
	ext/standard/user_filters.c
	ext/standard/var_unserializer.c
	ext/standard/var_unserializer.re
	main/php_variables.c
	sapi/phpdbg/phpdbg.c
	sapi/phpdbg/phpdbg_bp.c
	sapi/phpdbg/phpdbg_frame.c
	sapi/phpdbg/phpdbg_help.c
	sapi/phpdbg/phpdbg_list.c
	sapi/phpdbg/phpdbg_print.c
	sapi/phpdbg/phpdbg_prompt.c
2014-04-26 00:32:51 +04:00
Dmitry Stogov
65e2ed6e50 Redesigned zend_execute_data layout now EX(object), EX(scope) and EX(called_scope) arr properties of the current function execution co
ntext. They are set during zend_execute_data initialization and never changed.
2014-04-24 15:53:20 +04:00
Dmitry Stogov
7e424f5a95 Use symbolic names instead of magic constants + optimization 2014-04-23 02:47:41 +04:00
Nikita Popov
9c70603f4a Initialize hash as unpacked if it contains string keys 2014-04-22 21:33:49 +02:00
Nikita Popov
3d3a55cbcb Pass expected array size hint in INIT_ARRAY
To avoid unnecessary rehashes
2014-04-22 18:57:03 +02:00
Dmitry Stogov
5864ce8a44 Fixed compilation warnings 2014-04-22 17:46:34 +04:00
Dmitry Stogov
e295518bf3 Fixed typo 2014-04-22 13:11:07 +04:00
Dmitry Stogov
32e6e89887 Optimized ZEND_SEND_REF 2014-04-22 13:10:53 +04:00
Dmitry Stogov
5d479ef693 ZEND_SEND_* optimization 2014-04-22 12:33:00 +04:00
Dmitry Stogov
ff6dc3e1f2 zend_isset_isempty_dim_prop_obj_handler() split into separate handlers. (Actually, it shared near nothing) 2014-04-22 00:32:29 +04:00
Dmitry Stogov
b9d45cc0a9 Handle references in "slow path" 2014-04-21 23:30:19 +04:00
Dmitry Stogov
8ad8254a16 Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-04-21 21:39:15 +04:00
Dmitry Stogov
4533269839 Fast path for pre/post inc/dec 2014-04-21 21:38:44 +04:00
Nikita Popov
bda96e3c58 Use zval_get_string in print_zval and propagate TSRMLS 2014-04-21 17:55:58 +02:00
Dmitry Stogov
3c42593735 Removed duplicate code 2014-04-21 15:17:48 +04:00
Dmitry Stogov
e9f4d822b0 Avoid useles copy ctor 2014-04-21 13:19:52 +04:00
Timm Friebe
f5efee1d22 Regenerate 2014-04-19 14:01:38 +02:00
Dmitry Stogov
54d9ad53f4 More ZEND_HASH_FOREACH_* related changes 2014-04-19 00:08:14 +04:00
Dmitry Stogov
ea2e1bb1eb Optimized zend_leave_helper() 2014-04-18 13:46:36 +04:00
Dmitry Stogov
e7b3b1132a Fixed support for references 2014-04-17 17:21:59 +04:00
Dmitry Stogov
3cca67f740 Use local variables instead of opline operands to access cache_slots 2014-04-17 16:10:16 +04:00
Dmitry Stogov
e96073b1e4 Moved zend_literal->cache_slot right into zval.
It should be accessed using Z_CACHE_SLOT() macro.
zend_literal structure is removed.
API functions that accepted pointer to zend_literal now accept pointer to zval or cache_slot directly.
Calls of such functiond that now accept cache_slot need to be changed to pass -1 instead of NULL.
2014-04-17 15:40:45 +04:00
Nikita Popov
f98937fa80 Don't copy in ZEND_CAST if type is already correct 2014-04-16 22:39:50 +02:00
Dmitry Stogov
533a8b65f8 Fixed typo 2014-04-16 16:35:41 +04:00
Dmitry Stogov
e99e6958bc Cleanup 2014-04-16 01:45:40 +04:00
Dmitry Stogov
f9b26bc39a Cleanup (2-nd round) 2014-04-15 21:56:30 +04:00
Dmitry Stogov
93d3a613d8 Fixed support for references 2014-04-15 11:13:23 +04:00
Xinchen Hui
a0690ff288 Fixed zend_object_get_t in simpleXML 2014-04-15 11:05:03 +08:00
Dmitry Stogov
460120c887 Fixed reference counting 2014-04-15 01:16:09 +04:00
Dmitry Stogov
5dc52e4880 Fixed interface constants inheritance.
Now we use IS_REFERENCE for inhereted class constants.
I might miss some edje cases.
2014-04-14 13:24:43 +04:00
Nikita Popov
4fc3d2d104 Copy varname before unset
Otherwise we get issues when the varname variable coincides with
the variable that is deleted.
2014-04-13 23:07:10 +02:00
Bob Weinand
ccf863c8ce Merge branch 'PHP-5.6' 2014-04-11 19:35:11 +02:00
Bob Weinand
35b895fdf0 Removed useless void* parameter and replaced with zend_bool on zval_update_constant* functions 2014-04-11 19:18:58 +02:00
Bob Weinand
38ec4d20bf Merge branch 'PHP-5.6' 2014-04-11 18:24:41 +02:00
Bob Weinand
ee2a7c7d41 Fixed disallowal of array usage in constants at run-time
Added at the same time the possibility of array dereferencing
to complete the set of features (useful application of arrays in constants)
2014-04-11 18:21:46 +02:00
Bob Weinand
53e71e47b9 Merge branch 'PHP-5.6' 2014-04-11 16:21:15 +02:00
Bob Weinand
ad05d3898e Updated zend_vm_execute.h 2014-04-11 16:18:42 +02:00
Dmitry Stogov
e27eca90a5 for some reason gcc -O2 compiled the previous code in unexpected way 2014-04-11 18:16:03 +04:00
Dmitry Stogov
b6af031e52 Fixed support for references 2014-04-11 15:05:12 +04:00
Dmitry Stogov
ec4314f818 Fixed reference counting 2014-04-11 12:43:22 +04:00
Dmitry Stogov
aeb64f5447 Fixed support for references 2014-04-11 11:15:31 +04:00
Dmitry Stogov
abbb1c0f00 Unset CV before calling zval_ptr_dtor(), because its destructor may bailout and stay CV value in inconsistet state 2014-04-09 10:47:24 +04:00
Dmitry Stogov
0e7d30e8d3 Optimized ASSIGN_OP 2014-04-08 02:25:49 +04:00
Dmitry Stogov
f3c57716f7 Optimized ZEND_FETCH_R and family 2014-04-08 00:38:54 +04:00
Dmitry Stogov
3d17219cd8 Refactored zend_hash_* iteration API zend_hash_fove_forward_ex(ht, pos) and family require second argument to be real pointer.
&(ht)->nInternalPointer should be passed instead of NULL.
zend_hash_update_current_key() may work only with internal pointer.
2014-04-07 23:14:17 +04:00
Dmitry Stogov
bf35b22af5 Optimized ISSET_ISEMPTY_DIM_OBJ 2014-04-07 14:56:34 +04:00
Dmitry Stogov
8b2bb30137 Use macros 2014-04-07 10:57:58 +04:00
Dmitry Stogov
a94923d5cb Avoid double zval copying in ZEND_SEND_VAL and zend_send_by_var_helper 2014-04-05 02:14:17 +04:00
Dmitry Stogov
a80e945835 Optimized ZEND_FETCH_DIM_* 2014-04-05 01:56:51 +04:00
Dmitry Stogov
c11dc75b4e Refactored IS_INDIRECT IS_VAR passing between opcodes to avoid reference counting 2014-04-04 19:01:53 +04:00
Dmitry Stogov
cea26aa2eb Tergets of ASSIGN and ASSIGN_REF don't have to be initialized 2014-04-04 15:22:41 +04:00
Dmitry Stogov
eaeb3c39b4 Optimized RECV_* opcodes 2014-04-04 14:36:34 +04:00
Dmitry Stogov
3bc8810b1e Constant duplication optimization
Argument receiving optimization
2014-04-04 03:55:27 +04:00
Dmitry Stogov
58f0f2503c Various VM optimizations 2014-04-04 02:52:53 +04:00
Dmitry Stogov
58871730c8 ASSIGN_REF optimization 2014-04-03 16:53:30 +04:00
Dmitry Stogov
76cc99fe60 Refactored ZVAL flags usage to simplify various checks (e.g. Z_REFCOUNTED(), candidate for GC, etc) 2014-04-03 15:26:23 +04:00
Dmitry Stogov
d8099d0468 Changed data layout to allow more efficient operations 2014-04-02 14:34:44 +04:00
Dmitry Stogov
5c912a805b Use "fast" comparison function 2014-04-02 00:48:26 +04:00
Dmitry Stogov
ea85451b65 Refactored data structures to keep zend_object* instead of a whole zval in some places 2014-03-28 02:11:22 +04:00
Dmitry Stogov
68385716a4 Fixed support for references & cleanup 2014-03-27 18:14:57 +04:00
Dmitry Stogov
9a8fbdf2f4 Use CV variable offset instead of CV variable number 2014-03-27 16:00:25 +04:00
Dmitry Stogov
d83d34ba6d Cleanup 2014-03-27 14:55:52 +04:00
Dmitry Stogov
c6cba55454 Use ZVAL_DEREF() macro 2014-03-27 13:39:09 +04:00
Dmitry Stogov
54d559d893 Replaced (Z_TYPE(x) == IS_REFERENCE) with (Z_ISREF(x)) 2014-03-27 11:50:45 +04:00
Dmitry Stogov
92aef5279a Fixed support for references 2014-03-27 00:05:06 +04:00
Dmitry Stogov
de6a76d16e fixed support for references 2014-03-26 22:06:44 +04:00
Dmitry Stogov
887189ca31 Refactored IS_INDIRECT usage for CV and object properties to support HashTable resizing 2014-03-26 18:07:31 +04:00
Dmitry Stogov
c36294c4da Cleanup 2014-03-21 21:48:38 +04:00
Dmitry Stogov
a3abf6f291 Fixed refcounting 2014-03-21 15:33:08 +04:00
Dmitry Stogov
d735434e47 Fixed refcounting 2014-03-21 12:07:27 +04:00
Dmitry Stogov
6186bc6dff Fixed iterator dtor 2014-03-20 23:28:24 +04:00
Dmitry Stogov
3c0feb51bc Fixed assignment of "new" by reference 2014-03-19 23:51:28 +04:00
Dmitry Stogov
b7938ab1bd Refactored GC (incomplete) 2014-03-19 17:00:28 +04:00
Dmitry Stogov
aa5f55306b Refactored EG(active_symbol_table) to be zend_array* instead of HashTable* 2014-03-17 23:15:22 +04:00
Dmitry Stogov
b8089696c4 Fixed support for references 2014-03-13 22:56:18 +04:00
Dmitry Stogov
c1236214fe REFERENCE is always REFCOUNTED 2014-03-13 22:07:37 +04:00
Dmitry Stogov
25d55d16fc Fixed foreach (now we store HashPointer in additional IS_TMP_VAR slot(s)) 2014-03-13 17:01:28 +04:00
Dmitry Stogov
e0dd8a4f4b Fixed IS_INDIRECT handling when assign array element by reference.
This might cause passing invalid pointer if the array could be resized before IS_INDIRECT usage.
Now we use IS_REFERENCE instead of IS_INDIRECT.
The following test crashed before:
<?php $a = array(0,1,2,3,4,5,6,7); $a[8] = &$a[7]; ?>
2014-03-13 00:30:53 +04:00
Dmitry Stogov
72f738c368 Fixed reference afto conversion 2014-03-12 12:07:03 +04:00
Dmitry Stogov
8863df3653 Fixed reference handling 2014-03-11 14:49:25 +04:00
Xinchen Hui
53e312c663 Review ended
Revert "An demo(for review) to show how to fix the problem(symbol table resize)"

This reverts commit 60c354510b.
2014-03-11 14:23:14 +08:00
Xinchen Hui
60c354510b An demo(for review) to show how to fix the problem(symbol table resize) 2014-03-10 16:25:05 +08:00
Xinchen Hui
80625f20e5 Revert "An demo(for review) to show how to fix the problem we meet"
This reverts commit 4aeae15706.
2014-03-10 16:24:35 +08:00
Xinchen Hui
4aeae15706 An demo(for review) to show how to fix the problem we meet 2014-03-10 11:29:28 +08:00
Xinchen Hui
6c557d867c Fixed ref hanlding in ADD_ARRAY_ELEMENT (by ext/standard/tests/array/bug30074.phpt) 2014-03-09 19:45:45 +08:00
Dmitry Stogov
e9855b1992 Fixed pass by reference special cases 2014-03-07 16:45:32 +04:00
Dmitry Stogov
03c7ab5a95 Fixed return by reference 2014-03-07 12:25:55 +04:00
Dmitry Stogov
70260d133e Fixed memory leak 2014-03-07 00:26:21 +04:00
Dmitry Stogov
9ed631a4d0 Fixed ArrayAccess behavior 2014-03-06 17:59:17 +04:00
Dmitry Stogov
60eac8b860 Fixed string offset handling 2014-03-06 16:00:38 +04:00
Xinchen Hui
b212461297 IS_REFERENCE is unfrequent 2014-03-06 18:23:16 +08:00
Dmitry Stogov
076da5a372 Fixed IS_REFERENCE support 2014-03-06 13:59:15 +04:00
Dmitry Stogov
9727b47418 Fixed ArrayAccess handling 2014-03-06 13:11:23 +04:00
Dmitry Stogov
018be97c0d Fixed support for undefined constants in RECV_INIT 2014-03-06 00:15:56 +04:00
Dmitry Stogov
712dd6c68e Fixed "foreach ($reference as $val)" 2014-03-05 23:22:50 +04:00
Dmitry Stogov
c5af715f2b Fixed hidden property handling 2014-03-05 17:57:21 +04:00
Dmitry Stogov
28aacbfe15 It's not possible to create reference to string-offset 2014-03-05 17:32:23 +04:00
Dmitry Stogov
b763baff97 Temporary fix for lazy symbol table initialization called from zemd_error(), that converts CV variables into IS_INDIRECT 2014-03-05 15:33:31 +04:00
Dmitry Stogov
3733737328 Handle interned strings as non-refcounted scalars 2014-03-05 13:55:56 +04:00
Dmitry Stogov
6b8c46dc76 Fixed passing by reference 2014-03-04 23:54:05 +04:00
Dmitry Stogov
8b82b3e735 Fixed return of references by value 2014-03-04 17:38:19 +04:00
Dmitry Stogov
38151a38ec Fixed dereferencing of value returned from function (foo()[1] = ...) 2014-03-04 17:23:23 +04:00
Dmitry Stogov
dbb6837627 EG(error_zval) must be passed as IS_INDIRECT 2014-03-04 16:32:40 +04:00
Dmitry Stogov
1be0df935f Fixed destruction of VM handler operands (FREE_OP1 and family) 2014-03-04 12:27:50 +04:00
Dmitry Stogov
53128644f3 Redesigned SRR_OFFSET handling 2014-02-28 17:39:08 +04:00
Dmitry Stogov
a18a95f70a Fixed support for references 2014-02-28 15:58:11 +04:00
Dmitry Stogov
17a009ddce Fixed isset($str[$double]) 2014-02-28 13:04:46 +04:00
Dmitry Stogov
3ed445f749 Fixed IS_REFERENCE support 2014-02-28 12:54:38 +04:00
Dmitry Stogov
6f578b57bc Fixed FETCH_OBJ_UNSET, FETCH_DIM_UNSET 2014-02-28 00:09:43 +04:00
Dmitry Stogov
3960b0acc4 Temporarry commented 2014-02-27 23:50:43 +04:00
Dmitry Stogov
10fd93343e Fixed reference counting 2014-02-27 23:25:41 +04:00
Dmitry Stogov
e43d0d1717 fixed refcounting in "$a->magic_prop += 2" 2014-02-27 23:18:37 +04:00
Dmitry Stogov
1c3ba95bb5 Refactored read_property() and read_dimension() handlers 2014-02-27 15:40:13 +04:00
Dmitry Stogov
ee3254a2e8 Temporary refcounting fix 2014-02-27 13:06:11 +04:00
Dmitry Stogov
1493b30501 Temporarry refcounting fix 2014-02-27 12:53:40 +04:00
Dmitry Stogov
054917619a Fixed empty() 2014-02-27 12:48:53 +04:00
Nikita Popov
bfd967c11f Merge branch 'PHP-5.6' 2014-02-26 16:42:55 +01:00
Nikita Popov
95c73f99d3 Don't add num_additional_args in SEND opcodes
Now that trailing positional args are disallowed,
num_additional_args will always be zero in SEND opcodes (and
FUNC_ARG fetches).
2014-02-26 16:40:25 +01:00
Dmitry Stogov
60eadc80b8 Fixed return anf yield by reference 2014-02-26 18:07:16 +04:00
Dmitry Stogov
0bde8c9857 Fixed argument unpacking 2014-02-26 16:17:28 +04:00
Dmitry Stogov
6829be6c26 ifixed foreach() by reference 2014-02-26 15:38:58 +04:00
Dmitry Stogov
ff1778a89f Temorary fix for implicit IS_CV conversion into IS_INDIRECTR 2014-02-26 15:17:08 +04:00
Dmitry Stogov
495551aa8c Fixed iterators API. zend_iterator_init() has to be used in each get_iterator() callback. 2014-02-26 15:01:08 +04:00
Dmitry Stogov
d062fb3344 Generator related fixes 2014-02-26 13:58:59 +04:00
Dmitry Stogov
f0e9a108a7 Fixed support for references 2014-02-25 23:26:04 +04:00
Dmitry Stogov
4fd84823f6 Fixed foreach() over object properties 2014-02-25 17:56:03 +04:00
Dmitry Stogov
cabfbf7128 Fixed IS_REFERENCE handling 2014-02-25 13:47:33 +04:00
Dmitry Stogov
4e63cf9b16 Fixed POST_INC/POST_DEC 2014-02-25 13:20:43 +04:00
Dmitry Stogov
fea971e1e4 Better IS_REFERENCE handling 2014-02-25 00:17:13 +04:00
Dmitry Stogov
e9cde67d47 Fixed double free 2014-02-24 18:00:24 +04:00
Dmitry Stogov
a3448b7cfa Support for IS_REFERENCE 2014-02-24 16:51:38 +04:00
Dmitry Stogov
074391de88 ZEND_CATCH support for IS_INDIRECT 2014-02-24 12:29:35 +04:00
Dmitry Stogov
f1dcbf4750 ASSIGN_REF related fixes 2014-02-24 12:15:11 +04:00
Dmitry Stogov
e43f57e215 Fixed ++/-- of references 2014-02-24 11:23:25 +04:00
Xinchen Hui
91e2a91396 Missing handling of IS_REF in ext/standard/tests/strings/bug47842.php 2014-02-23 19:36:38 +08:00
Dmitry Stogov
bc3fb147cf Fixed char/zend_string mesh 2014-02-22 00:31:39 +04:00
Dmitry Stogov
c8663929a2 Fixed error messages 2014-02-21 20:44:26 +04:00
Dmitry Stogov
52bd62eca8 Fixed assertions 2014-02-21 20:35:40 +04:00
Dmitry Stogov
2520f0801d Fix Z_COUNTED() -> Z_REFCOUNTED() 2014-02-21 19:19:52 +04:00
Xinchen Hui
013cc55395 Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2
Conflicts:
	Zend/zend_language_scanner.c
	Zend/zend_language_scanner.l
2014-02-21 22:41:48 +08:00
Xinchen Hui
92450f9d6c Fixed test tests/classes/__call_007.php 2014-02-21 21:47:41 +08:00
Dmitry Stogov
7113ae0b24 Fixed include_once() handling 2014-02-21 17:23:13 +04:00
Xinchen Hui
e193944b3e Fixed segfault in ext/standard/tests/strings/addslashes_variation1.php 2014-02-21 16:56:23 +08:00
Xinchen Hui
b917458490 Fixed segfault (Zend/tests/026.phpt now pass) 2014-02-20 15:39:46 +08:00
Dmitry Stogov
ff61b46941 Use better data structures (incomplete) 2014-02-19 16:50:09 +04:00
Dmitry Stogov
a22d27a756 Use better data structures (incomplete) 2014-02-19 15:34:32 +04:00
Xinchen Hui
a28ce57bc5 Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-02-19 18:42:22 +08:00
Xinchen Hui
75f583de91 Fixed memory leak (forgot to release the zval) 2014-02-19 18:41:50 +08:00
Dmitry Stogov
9187abfaef Merge branch 'refactoring2' of github.com:zend-dev/php into refactoring2 2014-02-19 14:36:05 +04:00
Dmitry Stogov
8bae1daa0c Use better data structures (incomplete) 2014-02-19 14:35:28 +04:00
Xinchen Hui
757facf6c1 Fixed segfault in BEGIN/END SILENT 2014-02-19 18:34:27 +08:00
Dmitry Stogov
9067dbcd0d Use better data structures (incomplete) 2014-02-19 12:03:01 +04:00
Dmitry Stogov
557994d50d Use better data structures (incomplete) 2014-02-19 01:12:05 +04:00
Dmitry Stogov
bb58ea348c Use better data structures (incomplete) 2014-02-18 18:10:54 +04:00
Dmitry Stogov
5de7115679 Use better data structures (incomplete; able to run bench.php) 2014-02-18 16:27:38 +04:00
Dmitry Stogov
1c4f3d39a8 Use better data structures (incomplete) 2014-02-18 11:44:58 +04:00
Dmitry Stogov
a0fe8e5a91 Use better data structures (incomplete) 2014-02-18 01:41:23 +04:00
Dmitry Stogov
be82a07776 Use better data structures (incomplete) 2014-02-12 18:08:11 +04:00
Dmitry Stogov
4e66abad54 Use better data structures (incomplete) - refactored return_value handling 2014-02-12 14:29:51 +04:00
Dmitry Stogov
f4cfaf36e2 Use better data structures (incomplete) 2014-02-10 10:04:30 +04:00
datibbaw
aff56f3c45 add T_POW (**) operator
Fixed recognition of the operator

Added opcode, still doing multiply instead of pow()

opcode now always returns int(42)

The right answer, but always a float

Yanked code from pow() implementation.

Should not handle negative long as exponent ourselves

Added test cases from pow()

Moved precedence higher than '~'

Added GMP operator overloading

Added ZEND_ASSIGN_POW (**=) operator.

Added pow() as a language construct.

Adjusted test cases for changed precedence.

Reduced pow() to shell function around ZEND_API pow_function()

Reduced test case to only contain edge cases
Added overloading test case

Moved unary minus above T_POW

Revert "Added pow() as a language construct."

Bad bad bad idea.

This reverts commit f60b98cf7a8371233d800a6faa286ddba4432d02.

Reverted unary minus behaviour due to previous revert.
Convert arrays to int(0)
Exponent with array as a base becomes int(0)

Rebase against master

Fixed tokenizer test case
2014-02-06 14:41:21 +01:00
Bob Weinand
44dcdd146d Merge branch 'PHP-5.6' 2014-02-06 14:48:56 +01:00
Nikita Popov
89eab884d9 Merge branch 'PHP-5.6' 2014-01-18 14:44:57 +01:00
Nikita Popov
31a2ac470c Fix argument unpacking across stack pages
If multiple unpacks were used (or mixed with normal arguments)
parts of the arguments could land on different stack pages. If
this occurs the arguments will now be copied to a new stack page.

The code used to do this is copied verbatim from the PHP 5.4 branch
and only modified to reduce the amount of inlined code.
2014-01-18 14:41:33 +01:00
Nikita Popov
4facc35413 Merge branch 'PHP-5.6' 2014-01-11 12:54:08 +01:00
Nikita Popov
2c47dfbaeb Implement argument unpacking
RFC: https://wiki.php.net/rfc/argument_unpacking
2014-01-11 12:42:08 +01:00
Xinchen Hui
0f53e37494 Merge branch 'PHP-5.6' 2014-01-03 11:09:07 +08:00
Xinchen Hui
c081ce628f Bump year 2014-01-03 11:08:10 +08:00
Xinchen Hui
47c9027772 Bump year 2014-01-03 11:06:16 +08:00
krakjoe
8ce521a6a7 missing, apparently 2013-12-22 13:19:35 +00: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
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
Xinchen Hui
b331a219be Use memcmp here is better 2013-12-17 15:37:10 +08:00
Xinchen Hui
794a888a48 Fixed bug #65784 (Segfault with finally). 2013-12-13 00:16:08 +08:00
Nikita Popov
e2a8d7dc17 Merge branch 'PHP-5.5' into PHP-5.6 2013-11-30 13:40:17 +01:00
Nikita Popov
9589cae8cb Fixed bug #66041: list() fails to unpack yielded ArrayAccess object
Yield return values now use IS_VAR rather than IS_TMP_VAR. This
fixes the issue with list() and should also be faster as it avoids
doing a zval copy.
2013-11-30 13:08:31 +01:00
Bob Weinand
d36cf90291 Merge branch 'const_scalar_exprs' into PHP-5.6
Conflicts:
	Zend/zend_extensions.h
2013-11-28 13:41:42 +01:00
Dmitry Stogov
57c1335fec Don't check argument types for internal functions without type hinting 2013-11-28 11:44:14 +04:00
Dmitry Stogov
43e3933fa3 Removed deprecated AI_SET_PTR()s 2013-11-27 20:30:35 +04:00
Dmitry Stogov
a908afeaa5 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed bug #65969 (Chain assignment with T_LIST failure)

Conflicts:
	NEWS
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
2013-11-27 14:56:18 +04:00
Dmitry Stogov
92b76680e9 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed bug #65969 (Chain assignment with T_LIST failure)

Conflicts:
	NEWS
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
2013-11-27 14:39:40 +04:00
Dmitry Stogov
16d59aa171 Fixed bug #65969 (Chain assignment with T_LIST failure) 2013-11-27 14:26:34 +04:00
Dmitry Stogov
9647c61dc1 Constant expressions refactoring 2013-11-06 22:21:07 +04:00
Dmitry Stogov
af600c240d Merge branch 'const_scalar_exprs' of github.com:bwoebi/php-src into const_scalar_exprs
* 'const_scalar_exprs' of github.com:bwoebi/php-src:
  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.

Conflicts:
	Zend/Makefile.am
	configure.in
	win32/build/config.w32
2013-11-06 15:41:33 +04:00
Bob Weinand
b45043a1b7 converted several switches to ifs and made more opcache friendly 2013-11-01 16:16:58 +01:00
Bob Weinand
2361745806 Working commit for constant scalar expressions (with constants).
Tests will follow.
2013-10-31 08:57:12 +01:00
Dmitry Stogov
3b2ca392f1 Removed unnecessary GC checks 2013-10-31 11:33:39 +04:00
Dmitry Stogov
592be912c2 Merge branch 'PHP-5.5'
* PHP-5.5:
  Use zval* instead of zval**

Conflicts:
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
2013-10-28 15:23:10 +04:00
Dmitry Stogov
2d14cc2a49 Use zval* instead of zval** 2013-10-28 14:44:07 +04:00
Nikita Popov
ff46b6f633 Merge branch 'PHP-5.5' 2013-10-04 13:15:45 +02:00
Nikita Popov
536260f2c5 Fix bug #65821: By-ref foreach on property access of string offset segfaults
This removes the now unnecessary ZEND_FETCH_ADD_LOCK on the
container of a property fetch of a by-reference foreach.
2013-10-04 13:13:46 +02:00
Nikita Popov
0d7a638866 Implement variadic function syntax
As per RFC: https://wiki.php.net/rfc/variadics
2013-09-26 18:39:17 +02:00
Nikita Popov
bdfa03d79d Save a TSRMLS_FETCH() for zval_ptr_dtor in executor
This gives me about 9% improvement on Zend/bench.php for a zts build.
2013-09-14 23:02:26 +02:00
Nikita Popov
96b1c2145c Provide more macros for handling of interned strings
* str_erealloc behaves like erealloc for normal strings, but will
   use emalloc+memcpy for interned strings.
 * str_estrndup behaves like estrndup for normal strings, but will
   not copy interned strings.
 * str_strndup behaves like zend_strndup for normal strings, but
   will not copy interned strings.
 * str_efree_rel behaves like efree_rel for normal strings, but
   will not free interned strings.
 * str_hash will return INTERNED_HASH for interned strings and
   compute it using zend_hash_func for normal strings.
2013-09-13 19:42:10 +02:00
Gustavo André dos Santos Lopes
d515455589 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-09-02 01:53:06 +02:00
Nikita Popov
0856714576 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-08-31 13:16:41 +02:00
Anatol Belski
07fa043cc3 Merge branch 'PHP-5.5'
* PHP-5.5:
  Suppress static analyzer warnings in specialized executor
  Update NEWS
2013-08-23 17:45:45 +02:00
Anatol Belski
716fc80fda Suppress static analyzer warnings in specialized executor
As things like if(0) will be removed by the compiler, no need
to see that tons of warnings with static analyzer enabled.
2013-08-23 17:41:07 +02:00
Xinchen Hui
b6fa0b40f7 Merge branch 'PHP-5.5' 2013-08-14 11:44:53 +08:00
Xinchen Hui
f3d18add08 Merge branch 'PHP-5.4' into PHP-5.5 2013-08-14 11:44:37 +08:00
Xinchen Hui
f4dc2240a0 Fixed #65431 (Discarded qualifiers from pointer target warnings when using --enable-dtrace) by Sixd 2013-08-14 11:42:39 +08:00
Dmitry Stogov
52dac3e8cd Fixed bug #65382 (Segfault in closure_030.phpt) 2013-08-12 10:53:20 +04:00
Xinchen Hui
9b38673776 Merge branch 'PHP-5.5' 2013-08-06 15:39:46 +08:00
Xinchen Hui
aa042d0c35 Merge branch 'PHP-5.4' into PHP-5.5 2013-08-06 15:39:33 +08:00
Xinchen Hui
a831499b4a Re-fix Bug #65372 (Segfault in gc_zval_possible_root when return reference fails)
Missed a zval_copy_ctor there
2013-08-06 15:37:20 +08:00
Xinchen Hui
78673d1bad Merge branch 'PHP-5.5' 2013-08-02 18:39:58 +08:00
Xinchen Hui
1e942dde24 Merge branch 'PHP-5.4' into PHP-5.5 2013-08-02 18:39:18 +08:00
Xinchen Hui
ce9169e360 Fixed bug Bug #65372 (Segfault in gc_zval_possible_root when return reference fails) 2013-08-02 18:37:15 +08:00
Stanislav Malyshev
02457554a3 Merge branch 'PHP-5.5'
* PHP-5.5:
  backward compatibility
  HASH_KEY_NON_EXISTANT fix
2013-07-21 20:10:31 -07:00
Veres Lajos
4749457a49 HASH_KEY_NON_EXISTANT fix 2013-07-21 20:09:53 -07:00
Xinchen Hui
75808151e3 Merge branch 'PHP-5.5'
Conflicts:
	Zend/zend_vm_execute.h
2013-07-14 12:01:50 +08:00
Xinchen Hui
2c4f823437 Merge branch 'PHP-5.4' into PHP-5.5
Conflicts:
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
2013-07-14 11:53:56 +08:00
Xinchen Hui
ebad5178c4 Fixed bug #65254 (Exception not catchable when exception thrown in autoload with a namespace). 2013-07-14 11:47:06 +08:00
Xinchen Hui
e14800dd46 Fixed merge wrongly 2013-06-09 14:24:05 +08:00
Xinchen Hui
4600578830 Merge branch 'PHP-5.5' 2013-06-09 13:50:06 +08:00
Xinchen Hui
f372e00332 Merge branch 'PHP-5.4' into PHP-5.5
Conflicts:
	Zend/zend_vm_def.h
2013-06-09 13:49:26 +08:00
Xinchen Hui
ab22fda7e5 Merge branch 'PHP-5.3' into PHP-5.4 2013-06-09 13:35:45 +08:00
Xinchen Hui
e8f004d542 Fixed bug #64966 (segfault in zend_do_fcall_common_helper_SPEC) 2013-06-09 13:20:40 +08:00
Dmitry Stogov
273ad58295 Improved IS_VAR operands fetching 2013-05-17 13:15:09 +04:00
Dmitry Stogov
302de03a5a Merge branch 'PHP-5.5'
* PHP-5.5:
  Fixed incorrect check. SEND_REF may be executed before DO_FCALL when EX(function_state).function is not yet set to the calling function.
2013-04-24 00:04:00 +04:00
Dmitry Stogov
758b666c0a Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed incorrect check. SEND_REF may be executed before DO_FCALL when EX(function_state).function is not yet set to the calling function.

Conflicts:
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
2013-04-23 23:59:00 +04:00
Dmitry Stogov
43ab915b41 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fixed incorrect check. SEND_REF may be executed before DO_FCALL when EX(function_state).function is not yet set to the calling function.

Conflicts:
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
2013-04-23 23:55:47 +04:00
Dmitry Stogov
4cf0647399 Fixed incorrect check. SEND_REF may be executed before DO_FCALL when EX(function_state).function is not yet set to the calling function. 2013-04-23 23:43:23 +04:00
Xinchen Hui
bcb223a626 Merge branch 'PHP-5.5' 2013-04-11 14:29:51 +08:00
Xinchen Hui
a5cfe57e08 Merge branch 'PHP-5.4' into PHP-5.5 2013-04-11 14:29:09 +08:00
Xinchen Hui
ba292b037f Fixed bug (Wrong ce cached) 2013-04-11 14:28:42 +08:00
Xinchen Hui
c2afd2765b Merge branch 'PHP-5.5' 2013-03-26 12:03:37 +08:00
Xinchen Hui
ed31582301 Fixed bug #64515 (Memoryleak when using the same variablename 2times in function declaration) 2013-03-26 12:02:48 +08:00
Xinchen Hui
5e9377ebd5 Fixed bug #64515 (Memoryleak when using the same variablename 2times in function declaration) 2013-03-26 11:44:57 +08:00
Dmitry Stogov
a4c386f32c Merge branch 'PHP-5.5'
* PHP-5.5:
  Fixed bug #63914 (zend_do_fcall_common_helper_SPEC does not handle exceptions properly). (Jeff Welch)
2013-03-25 15:48:13 +04:00
Dmitry Stogov
96e5f5eb05 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed bug #63914 (zend_do_fcall_common_helper_SPEC does not handle exceptions properly). (Jeff Welch)

Conflicts:
	NEWS
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
2013-03-25 15:47:45 +04:00
Dmitry Stogov
e9f996c00d Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fixed bug #63914 (zend_do_fcall_common_helper_SPEC does not handle exceptions properly). (Jeff Welch)

Conflicts:
	NEWS
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
2013-03-25 15:23:49 +04:00
Dmitry Stogov
c4686b4de9 Fixed bug #63914 (zend_do_fcall_common_helper_SPEC does not handle exceptions properly). (Jeff Welch) 2013-03-25 15:07:27 +04:00
Dmitry Stogov
22b0f5d829 Merge branch 'PHP-5.5'
* PHP-5.5:
  Removed redundand code
2013-03-14 14:22:51 +04:00
Dmitry Stogov
dd1c358d1b Merge branch 'PHP-5.5' of git.php.net:php-src into PHP-5.5
* 'PHP-5.5' of git.php.net:php-src:
  fix the fix
  fix for bug  #63530 	mysqlnd_stmt::bind_one_parameter uses wrong alloc for stmt->param_bind
  Forgot to remove some now unused variables
  Add support for non-scalar Iterator keys in foreach
  fixed headers order
  - Updated to version 2013.2 (2013b)
  fixed the test
  Fixed bug #64370 (microtime(true) less than $_SERVER['REQUEST_TIME_FLOAT'])
  Disable zend_always_inline in debug build
2013-03-14 14:19:41 +04:00
Dmitry Stogov
d77c865aff Removed redundand code 2013-03-13 17:51:10 +04:00
Nikita Popov
81623d3a60 Merge branch 'PHP-5.5'
Conflicts:
	UPGRADING
	UPGRADING.INTERNALS
2013-03-12 17:29:54 +01:00
Nikita Popov
fcc6611de9 Add support for non-scalar Iterator keys in foreach
RFC: https://wiki.php.net/rfc/foreach-non-scalar-keys
2013-03-12 17:27:31 +01:00
Stanislav Malyshev
4c293bfe91 Merge branch 'PHP-5.5'
* PHP-5.5:
  news for bug #49348
  fix tests
  fix bug #49348 - issue notice on get_property_ptr_ptr when used for read
2013-02-21 00:57:52 -08:00
Stanislav Malyshev
0c6d903ce7 fix bug #49348 - issue notice on get_property_ptr_ptr when used for read 2013-02-18 20:56:02 -08:00
Xinchen Hui
92046b7ef1 Merge branch 'PHP-5.5' 2013-02-16 22:25:37 +08:00
Xinchen Hui
75742d57eb Exceptions triggered by undefined variable should be handled before FATAL error
this is a enhancement of the fix for bug #64135
2013-02-16 22:22:22 +08:00
Xinchen Hui
7fb07acf98 Merge branch 'PHP-5.5' 2013-02-07 23:46:15 +08:00
Xinchen Hui
290509755a Fixed bug #64135 (Exceptions from set_error_handler are not always propagated) 2013-02-07 23:44:46 +08:00
Gustavo Lopes
ddc98aa814 Merge branch 'PHP-5.5'
* PHP-5.5:
  Fix bug #64023 (__toString() & SplFileInfo)
2013-01-23 13:26:15 +01:00
Gustavo Lopes
fc7b054c2d Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fix bug #64023 (__toString() & SplFileInfo)
2013-01-23 13:24:50 +01:00
Gustavo Lopes
b8b3bb08b2 Merge branch 'bug64023' into PHP-5.4
* bug64023:
  Fix bug #64023 (__toString() & SplFileInfo)

Conflicts:
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
2013-01-22 12:24:33 +01:00
Gustavo Lopes
aa0adce47d Fix bug #64023 (__toString() & SplFileInfo)
Defining a __toString() method was having no effect when concatenating
the object. This was because the cast_object() handler would ignore
__toString().

Using echo() directly would actually use __toString(), but this was a
bug: the ECHO handler would try zend_std_cast_object_tostring() before
cast_object(), but cast_object() should have priority as
zend_std_cast_object_tostring() assumes an object with a
zend_class_entry.
2013-01-22 11:33:29 +01:00
Lars Strojny
b1ddfcbee3 Merge branch 'PHP-5.5' 2013-01-19 01:01:39 +01:00
Lars Strojny
8991ed016f Class Name Resolution As Scalar Via "class" Keyword 2013-01-19 01:00:47 +01:00
Xinchen Hui
f6260b36dd Merge branch 'PHP-5.5' 2013-01-14 16:24:26 +08:00
Xinchen Hui
62059c16ee Fixed bug #63980 (object members get trimmed by zero bytes) 2013-01-14 16:23:22 +08:00
Xinchen Hui
642721b38a Merge branch 'PHP-5.5' 2013-01-01 16:39:03 +08:00
Xinchen Hui
a666285bc2 Happy New Year 2013-01-01 16:37:09 +08:00
Xinchen Hui
0a7395e009 Happy New Year 2013-01-01 16:28:54 +08:00
Xinchen Hui
831fbcf385 Happy New Year 2013-01-01 16:23:31 +08:00
Nikita Popov
4509016309 Merge branch 'PHP-5.5' 2012-12-21 01:58:29 +01:00
Nikita Popov
ffb848b275 Fix bug #63822: Crash when using closures with ArrayAccess
op_array->T was used after the closure's op_array was already freed. This just
swaps the freeing order.
2012-12-21 01:56:37 +01:00
Nikita Popov
5f7c478d53 Merge branch 'PHP-5.5' 2012-12-18 21:41:55 +01:00
Nikita Popov
d53f1bf8ab Fix leak when generator ignores sent value
When the return value of yield wasn't used it was leaked.

This is fixed by using a TMP_VAR return value instead of VAR. TMP_VARs are
automatically freed when they aren't used.
2012-12-18 21:39:02 +01:00
Xinchen Hui
210d428f99 ixed bug that exception won't be catched
Related failed test Zend/tests/bug35437.phpt (after he latest
execute_data improvement, run with non CALL vm kind)
2012-12-18 15:34:47 +08:00
Xinchen Hui
d3ec9ceb25 Revert "Fixed bug that exception won't be catched"
This reverts commit 28db07a0e3.

Unexpected vm kind change
2012-12-18 15:27:54 +08:00
Xinchen Hui
28db07a0e3 Fixed bug that exception won't be catched
related failed test Zend/tests/bug35437.phpt (after he latest
execute_data improvement, run with non CALL vm kind)
2012-12-18 15:20:58 +08:00
Xinchen Hui
9fb5cfdeb1 Fixed warning of no return in non-void funciton 2012-12-14 17:21:43 +08:00
Dmitry Stogov
e65b966aac Fixed uninitialized EX(call)->called_scope 2012-12-14 12:10:29 +04:00
Dmitry Stogov
d5c2da5756 Removed unreachable code 2012-12-13 17:51:04 +04:00
Dmitry Stogov
438cd86378 Removed unnecessary checks 2012-12-13 17:29:30 +04:00
Dmitry Stogov
6b0b4bf8eb An exception thrown in try or catch block is disacarded by return statement in finally block. 2012-12-13 02:48:51 +04:00
Dmitry Stogov
9c96fe52d9 Restored proper generators behaviour in conjunction with "finally". (Nikita) 2012-12-12 17:47:55 +04:00
Dmitry Stogov
a9a5f7aca6 - generators API exported for extensions
- improved RETURN sequence to avoid redundant check if op_array is a generator
2012-12-11 17:25:32 +04:00
Dmitry Stogov
e3b2a5cf74 Generatirs are going to be used less than regular functions 2012-12-06 13:14:31 +04:00
Dmitry Stogov
fa30e4754b Slight performance improvement 2012-12-05 13:23:37 +04:00
Dmitry Stogov
61dbf35cfc Moved zend_create_execute_data_from_op_array() implementation from zend_vm_execute.skl to zend_execute.c 2012-12-04 10:42:19 +04:00
Dmitry Stogov
7651d64556 Optimized access to temporary and compiled VM variables 2012-12-04 10:14:39 +04:00
Dmitry Stogov
70f83f35d0 . The VM stacks for passing function arguments and syntaticaly nested calls were merged into a single stack. The stack size needed for op_array execution is calculated at compile time and preallocated at once. As result all the stack push operatins don't require checks for stack overflow any more.
. Generators implementation was improved using the new VM stack. Now it's a bit more clear and faster.
2012-11-30 13:39:23 +04:00
Dmitry Stogov
eb4825b50b Improved "finally" im[plementation 2012-11-22 15:17:05 +04:00