Commit Graph

946 Commits

Author SHA1 Message Date
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