Commit Graph

1113 Commits

Author SHA1 Message Date
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
d062fb3344 Generator related fixes 2014-02-26 13:58:59 +04:00
Dmitry Stogov
329a576f39 Fixed EG(error_zval) handling 2014-02-25 23:39:25 +04:00
Dmitry Stogov
068ea84a84 THIS MAY BE A REAL PROBLEM 2014-02-25 16:38:18 +04:00
Dmitry Stogov
fea971e1e4 Better IS_REFERENCE handling 2014-02-25 00:17:13 +04:00
Dmitry Stogov
55bca5868a Fixed $this handling 2014-02-24 17:07:44 +04:00
Dmitry Stogov
a3448b7cfa Support for IS_REFERENCE 2014-02-24 16:51:38 +04:00
Dmitry Stogov
844887ed56 Fixed IS_RESOURCE handling 2014-02-24 13:12:53 +04:00
Dmitry Stogov
f1dcbf4750 ASSIGN_REF related fixes 2014-02-24 12:15:11 +04:00
Dmitry Stogov
52bd62eca8 Fixed assertions 2014-02-21 20:35:40 +04:00
Xinchen Hui
47fb198533 Revert "Use zend_string for arg_info to fixed segfault in Zend/tests/argument_restriction_003.phpt"
This reverts commit b96318105b.
2014-02-21 23:02:24 +08:00
Xinchen Hui
b96318105b Use zend_string for arg_info to fixed segfault in Zend/tests/argument_restriction_003.phpt 2014-02-21 22:34:30 +08:00
Xinchen Hui
b917458490 Fixed segfault (Zend/tests/026.phpt now pass) 2014-02-20 15:39:46 +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
2b9b9afa7a Use better data structures (incomplete) 2014-02-17 17:59:18 +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
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
Bob Weinand
69edad213a Fixed build (making zend_is_by_ref_func_arg_fetch function static) 2014-01-12 01:59:22 +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
c081ce628f Bump year 2014-01-03 11:08:10 +08:00
Xinchen Hui
794a888a48 Fixed bug #65784 (Segfault with finally). 2013-12-13 00:16:08 +08: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
krakjoe
1a1e83a5d9 export more Zend API 2013-11-20 16:24:22 +00:00
Anatol Belski
c675980046 Merge branch 'pull-request/500'
* pull-request/500:
  limit virtual_cwd_activate() duplicated call to ZTS only
  reverted the previous commit, both calls are needed in TS mode
  virtual_cwd_activate() should be called only in one place
  back to do_alloca()
  removed unnecessary call
  simplify the state free macros
  compact the code to preserve the error info after state freeing
  back to do_alloca(), reverted the wrong replacement
  enabled windows to use stack in both ts/nts mode, some more fixes
  moved to do_alloca() usage where appropriate
  fixed invalid free
  fixed virtual cwd header in phar
  updated NEWS
  fixed all the places where last error could be lost
  preserve the error code
  applied and fixed the original patch
  initial move on renaming files and fixing includes

Conflicts:
	ext/opcache/ZendAccelerator.c
2013-11-05 19:23:23 +01:00
Dmitry Stogov
3b2ca392f1 Removed unnecessary GC checks 2013-10-31 11:33:39 +04:00
Anatol Belski
e30b2aae5a initial move on renaming files and fixing includes 2013-10-17 09:43:52 +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
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
Dmitry Stogov
273ad58295 Improved IS_VAR operands fetching 2013-05-17 13:15:09 +04:00
Xinchen Hui
65e368debd Merge branch 'PHP-5.4' into PHP-5.5 2013-04-04 14:48:53 +08:00
Xinchen Hui
db3d629f05 Merge branch 'PHP-5.3' into PHP-5.4 2013-04-04 13:40:46 +08:00
Xinchen Hui
7fc8077e4c Fixed Bug #64578 2013-04-04 13:40:21 +08:00
Dmitry Stogov
aa791a4d72 Removed deprecated check 2013-03-29 03:18:04 +04: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
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
Dmitry Stogov
8e6bf9e5e5 spelling 2012-12-25 16:23:52 +04:00
Dmitry Stogov
ff1e1d7a8e Removed redundand checks from release build 2012-12-13 14:46:44 +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
27528b601f Fixed comments 2012-12-05 16:02:47 +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
Stanislav Malyshev
531e2533dd Use zend_execute_internal always to call internal functions 2012-10-05 08:14:20 +02:00
Nikita Popov
f4ce364628 Merge remote-tracking branch 'php-src/master' into addGeneratorsSupport
This is just an intial merge. It does not yet make generators and finally
work together.

Conflicts:
	Zend/zend_language_scanner.c
	Zend/zend_language_scanner_defs.h
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
	Zend/zend_vm_execute.skl
	Zend/zend_vm_opcodes.h
2012-08-13 16:54:53 +02:00
Marc Easen
896ac689c9 Fixed the common misspelling of the word occurred (occured -> occurred) 2012-06-30 16:54:03 -07:00
Nikita Popov
6233408a2a Fix thread safe build 2012-06-20 21:31:23 +02:00
Nikita Popov
f169b26dd7 Fix backtraces and func_get_args()
To make the generator function show up in backtraces one has to insert an
additional execute_data into the chain, as prev_execute_data->function_state
is used to determine the called function.

Adding the additional stack frame is also required for func_get_args(), as
the arguments are fetched from there too. The arguments have to be copied
in order to keep them around. Due to the way they are saved doing so is
quite ugly, so I added another function zend_copy_arguments to zend_execute.c
which handles this.
2012-06-09 00:40:47 +02:00
Nikita Popov
4aab08b64c Properly free resources when generator return value not used
To keep things clean two new functions are introduced:

zend_clean_and_cache_symbol_table(HashTable *symbol_table)
zend_free_compiled_variables(zval ***CVs, int num)
2012-05-28 06:43:18 +02:00
Nikita Popov
46fa26ab85 Make generator functions return a Generator object
Right now generator functions simply immediately return a new Generator
object (no suspension yet).
2012-05-20 14:45:01 +02:00
Xinchen Hui
6a5095582a Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fixed Bug #62005 (unexpected behavior when incrementally assigning to a member of a null object)
  fix stack overflow in php_intlog10abs()

Conflicts:
	Zend/zend_execute.c
2012-05-12 13:19:55 +08:00
Xinchen Hui
3332943c9d Fixed Bug #62005 (unexpected behavior when incrementally assigning to a member of a null object) 2012-05-12 13:13:44 +08:00
Dmitry Stogov
49ce9b9bff Added ability to reset user opcode handlers (Yoram) 2012-02-14 09:27:08 +00:00
Dmitry Stogov
e16ec62d20 Added ability to reset user opcode handlers (Yoram) 2012-02-14 09:27:08 +00:00
Felipe Pena
e4ca0ed09f - Year++ 2012-01-01 13:15:04 +00:00
Felipe Pena
8775a37559 - Year++ 2012-01-01 13:15:04 +00:00
Felipe Pena
4e19825281 - Year++ 2012-01-01 13:15:04 +00:00
Stanislav Malyshev
1f4f33afcf implement the solution for isset/string offsets, fix bug #60362 2011-12-19 02:05:03 +00:00
Stanislav Malyshev
622412d8e6 implement the solution for isset/string offsets, fix bug #60362 2011-12-19 02:05:03 +00:00
Felipe Pena
0ebd2309b1 - Fixed bug #55705 (Omitting a callable typehinted argument causes a segfault)
patch by: laruence@php
2011-09-17 00:16:11 +00:00
Felipe Pena
5441cd1f0d - Fixed bug #55705 (Omitting a callable typehinted argument causes a segfault)
patch by: laruence@php
2011-09-17 00:16:11 +00:00
Dmitry Stogov
4a25a7740d Fixed ZE specific compile warnings (Bug #55629) 2011-09-13 13:29:35 +00:00
Dmitry Stogov
e43ff1359e Fixed ZE specific compile warnings (Bug #55629) 2011-09-13 13:29:35 +00:00
Felipe Pena
35c9c4ed2d - Fixed ZTS build 2011-08-16 12:01:36 +00:00
Felipe Pena
074c7e6a3a - Fixed ZTS build 2011-08-16 12:01:36 +00:00
Hannes Magnusson
306c42023e Callable typehint following the rules of is_callable($arg, false); 2011-08-16 10:44:47 +00:00
Hannes Magnusson
550980cfe5 Callable typehint following the rules of is_callable($arg, false); 2011-08-16 10:44:47 +00:00
Johannes Schlüter
07aa25b442 - Fixed bug #54265 (crash when variable gets reassigned in error handler)
(re-apply 309308, dmitry)
2011-03-17 11:49:18 +00:00
Johannes Schlüter
6f15da050e - Revert r309308 temporarily to get 5.3.6 out 2011-03-17 07:46:57 +00:00
Dmitry Stogov
b60e4fe4f0 Fixed bug #54265 (crash when variable gets reassigned in error handler) 2011-03-16 15:21:38 +00:00
Dmitry Stogov
e90ac23f58 Fixed bug #54265 (crash when variable gets reassigned in error handler) 2011-03-16 15:21:38 +00:00
Stanislav Malyshev
a5b9eda06a fix UMR when setting forward string offset 2011-03-16 05:41:50 +00:00
Dmitry Stogov
b84967d3e2 Fixed Bug #53971 (isset() and empty() produce apparently spurious runtime error) 2011-02-14 08:46:53 +00:00
Dmitry Stogov
ac057c610c Fixed Bug #53971 (isset() and empty() produce apparently spurious runtime error) 2011-02-14 08:46:53 +00:00
Felipe Pena
927bf09c29 - Year++ 2011-01-01 02:19:59 +00:00
Felipe Pena
0203cc3d44 - Year++ 2011-01-01 02:17:06 +00:00
Scott MacVicar
6144da7e35 Silently casting an empty string, null or false into an object by adding a property
is pretty non-intuitive. If the same value was 1 or true you get a warning and it halts.

Since we can't break BC completely (yet) lets bump this from E_STRICT.

Also added a new section to UPGRADING for engine changes.

<?php
$x = '';
// $x = null;
// $x = false;
$x->baz = 1;
var_dump($x);

$y = 1;
$y->baz = 1;
var_dump($y);
2010-12-31 16:57:45 +00:00
Felipe Pena
965c30dc2e - Removed unused variable 2010-11-24 20:50:07 +00:00
Dmitry Stogov
7628da98c4 Removed support for break/continue $var syntax 2010-11-24 12:19:56 +00:00
Dmitry Stogov
68e154b1bf reduced size of temp_variariable 2010-10-22 14:51:07 +00:00
Dmitry Stogov
968bdc576c Simplified foreach() handling, we don't have to inctrement/decrement refcount twice 2010-10-22 13:59:23 +00:00
Derick Rethans
0e24a7c400 - Strip out the typehint *checks* only. They are still parsed, and they are
still accessible through the reflection API.
2010-10-19 10:42:38 +00:00
Hartmut Holzgraefe
aaa2f1c30b marked char pointer arguments as const in lots of
places where strings pointed to are not modified 
to prevent compiler warnings about discarded qualifiers ...
2010-10-14 21:33:10 +00:00
Dmitry Stogov
fa3f0bb63f Fixed bug #51008 (Zend/tests/bug45877.phpt fails) 2010-10-05 11:28:56 +00:00
Dmitry Stogov
5c6f0ebeab Prevented crash in GC because of incorrect reference counting 2010-09-30 14:11:51 +00:00
Dmitry Stogov
53d3320951 Prevented crash in GC because of incorrect reference counting 2010-09-30 14:11:51 +00:00
Dmitry Stogov
f2df6a4a3e - Improved memory usage
. zend_function.pass_rest_by_reference is replaced by
    ZEND_ACC_PASS_REST_BY_REFERENCE in zend_function.fn_flags
  . zend_function.return_reference is replaced by ZEND_ACC_RETURN_REFERENCE
    in zend_function.fn_flags
  . zend_arg_info.required_num_args removed. it was needed only for internal
    functions. Now the first arg_info for internal function (which has special
    meaning) is represented by zend_internal_function_info structure.
  . zend_op_array.size, size_var, size_literal, current_brk_cont,
    backpatch_count moved into CG(context), because they are used only during
    compilation.
  . zend_op_array.start_op is moved into EG(start_op), because it's used
    only for 'interactive' execution of single top-level op-array.
  . zend_op_array.done_pass_two is replaced by ZEND_ACC_DONE_PASS_TWO in
    zend_op_array.fn_flags.
  . op_array.vars array is trimmed (reallocated) during pass_two.
  . zend_class_entry.constants_updated is replaced by
     ZEND_ACC_CONSTANTS_UPDATED in zend_class_entry.ce_flags
  . the size of zend_class_entry is reduced by sharing the same memory space
    by different information for internal and user classes.
    See zend_class_inttry.info union.
2010-09-15 07:38:52 +00:00
Dmitry Stogov
f48999ca3b Optimization of ASSIGN instruction 2010-08-11 15:34:06 +00:00
Dmitry Stogov
808fd3f1f7 Optimization 2010-08-10 14:43:17 +00:00
Dmitry Stogov
ca4de03eed ZEND_FETCH_*_R operations simplified and can't be used with EXT_TYPE_UNUSED flag any more. Thit is very rare and useless case. ZEND_FREE might be required after them instead. 2010-07-16 13:38:09 +00:00
Dmitry Stogov
8aad91d14a Simplified string offset reading 2010-07-16 11:44:30 +00:00
Dmitry Stogov
09943e56cd Removed redundant code 2010-06-22 14:15:08 +00:00
Ilia Alshanetsky
33fae4caa0 Added support for numeric & scalar type hint as defined within
http://wiki.php.net/rfc/typecheckingstrictandweak RFC
2010-05-24 18:32:59 +00:00
Derick Rethans
1bc9247651 - Added scalar typehinting. 2010-05-20 19:18:35 +00:00
David Soria Parra
08b9fdc8a3 Add DTrace probes 2010-04-24 13:32:30 +00:00
Dmitry Stogov
0d1398457f Removed unused function 2010-04-22 15:51:03 +00:00
Johannes Schlüter
5ec6f1e9a1 WS 2010-04-20 15:29:03 +00:00
Dmitry Stogov
4c252d805d Fixed bug #48781 (Cyclical garbage collector memory leak) 2010-04-20 12:30:35 +00:00
Dmitry Stogov
b6ae8a964b Fixed bug #48781 (Cyclical garbage collector memory leak) 2010-04-20 12:30:35 +00:00
Dmitry Stogov
453b49ed20 Added a number of small performance tweaks and optimizations
. ZEND_RECV now always has IS_CV as its result
  . ZEND_CATCH now has to be used only with constant class names
  . ZEND_FETCH_DIM_? may fetch array and dimension operans in a different order
2010-04-20 11:16:39 +00:00
Dmitry Stogov
dd5c478be6 Added concept of interned strings. All strings constants known at compile time are allocated in a single copy and never changed. 2010-04-20 11:05:54 +00:00
Dmitry Stogov
94dd83722b Changed the structure of op_array.opcodes. The constant values are moved from opcode operands into a separate literal table 2010-04-20 10:57:45 +00:00
Pierre Joye
5eb4db5e8f - Ensure that stderr output are not buffered, portability for tests 2010-01-25 14:47:19 +00:00
Sebastian Bergmann
d2281d1dff sed -i "s#1998-2009#1998-2010#g" **/*.c **/*.h **/*.php 2010-01-05 20:46:53 +00:00
Matt Wilmas
b907aa4331 MFH:
Restored double->long conversion behavior to that of PHP 5.2 (on most platforms) and prior:
 * Out-of-range numbers overflow/preserve least significant bits (no LONG_MAX/MIN limit)
 * See bug #42868 (presumably-rare platform with different results in 5.2)
 * On 32-bit platforms with 64-bit long type, a zend_long64 cast has been added,
    otherwise it's the same as 5.2
 * Use this conversion method everywhere instead of some plain (long) casts

Added 'L' parameter parsing specifier to ensure a LONG_MAX/MIN limit:
 * Essentially what 5.3's new conversion was doing in most cases
 * Functions with "limit" or "length" type params could be updated to use this,
    and prevent confusing overflow behavior with huge numbers (*also* in 5.2)
  - See bug #47854, for example; or even #42868 again

# Test updates coming
2009-06-04 18:20:45 +00:00
Dmitry Stogov
197a950b49 Fixed bug #48004 (Error handler prevents creation of default object) 2009-04-21 09:40:13 +00:00
Dmitry Stogov
fb3c73daef Fixed bug #48004 (Error handler prevents creation of default object) 2009-04-21 08:12:07 +00:00
Dmitry Stogov
e66bd02bc6 Inline only the most useful code 2009-03-18 14:15:28 +00:00
Dmitry Stogov
ff5620524c Fixed bug #47704 (crashes on some "bad" operations with string offsets)
Removed unnecessary checks
2009-03-18 12:53:17 +00:00
Dmitry Stogov
742d0b6b68 Fixed speed degradation on gcc-4.3 because of less agressive inlining 2009-03-11 12:14:34 +00:00
Felipe Pena
f8689552a4 MFH:
- Fixed bug #46701 (Creating associative array with long values in the key fails on 32bit linux)
Patch by Shire
2009-01-05 20:31:54 +00:00
Sebastian Bergmann
08659c2dcd MFH: Bump copyright year, 3 of 3. 2008-12-31 11:15:49 +00:00
Felipe Pena
85ab423565 - MFH: Removed some TSRMLS_FETCH()s 2008-08-15 19:47:33 +00:00
Felipe Pena
cf7384aa40 - MFH: Constness (Added const qualifier to several function parameters) 2008-08-12 17:20:25 +00:00
Dmitry Stogov
f5f8cba8e9 Fixed bug #44660 (Indexed and reference assignment to propery of non-object don't trigger warning) 2008-07-26 17:59:54 +00:00
Dmitry Stogov
4f81a0c358 Fixed crashes and memory leak for objects with NULL write_property/has_property/unset_property handlers 2008-07-26 14:08:11 +00:00
Dmitry Stogov
d5ef2f466c Added support for lambda functions and closures 2008-07-14 09:49:03 +00:00
Dmitry Stogov
578cfc6088 Removed redundant code 2008-07-01 13:20:48 +00:00
Dmitry Stogov
76a9a42ee2 - Removed direct executor recursion.
- Use fastcall calling convention in executor on x86.
2008-06-11 13:18:41 +00:00
Matt Wilmas
805b6dd3b5 MFH: Fixed bug #44681 (Resources used as array keys get converted to 0) 2008-05-09 09:23:03 +00:00
Dmitry Stogov
833e01343d GC fix 2008-05-06 16:03:16 +00:00
Dmitry Stogov
1b317f1526 - Use ZEND_FREE() opcode instead of ZEND_SWITCH_FREE(IS_TMP_VAR)
- Fixed bug #44913 (Segfault when using return in combination with nested loops
and continue 2)
2008-05-05 11:03:35 +00:00
Dmitry Stogov
2ecf4bb0a7 Lazy EG(active_symbol_table) initialization 2008-04-29 08:15:20 +00:00
Dmitry Stogov
8fac72574d Optimized handlers for ZEND_RECV and ZEND_RECV_INIT opocdes 2008-04-24 15:45:46 +00:00
Felipe Pena
2b10c53ae1 MFH: Dropped zend.ze1_compatibility_mode
[DOC]
2008-03-18 14:10:45 +00:00
Felipe Pena
579e46dd76 Cosmetics (removed space on error message) 2008-03-08 11:47:13 +00:00
Felipe Pena
ddc8a63168 Fixed bug #39018 (Error control operator '@' fails to suppress "Uninitialized string offset") 2008-03-08 11:35:12 +00:00
Dmitry Stogov
8365e71cb9 Fixed wrong result of cascading assignment to string offset
Fixed memory corruption on cascading assignment of IS_TMP_VAR into string offset
Fixed opcode caches shared memory corruption on cascading assignment of IS_CONST
 into string offset
2008-03-04 10:06:52 +00:00
Dmitry Stogov
4cf7073a84 Removed redundant refcount manipulations 2008-02-18 12:11:47 +00:00
Dmitry Stogov
0b6825102d Changed EG(argument_stack) implementation. 2008-01-24 09:41:39 +00:00
Stanislav Malyshev
529c17665f fix build 2008-01-23 19:55:37 +00:00
Dmitry Stogov
0095544c4d Additional executor specialization 2008-01-23 17:55:55 +00:00
Dmitry Stogov
71592cec06 Added garbage collector 2008-01-22 09:27:48 +00:00
Dmitry Stogov
fa47e900e2 Changed exception handling. Now each op_array doesn't contain ZEND_HANDLE_EXCEPTION opcode in the end 2008-01-21 19:39:55 +00:00
Dmitry Stogov
e6588b6620 Fixed bug #43851 (Memory corrution on reuse of assigned value) 2008-01-15 11:52:45 +00:00
Dmitry Stogov
059bc1d593 Simplified assignment to string offset 2008-01-11 15:10:24 +00:00
Dmitry Stogov
ab5bddd976 Fixed bug #39346 (Unsetting a static variable inside a destructor causes segfault later on) 2008-01-11 08:42:06 +00:00
Sebastian Bergmann
d1dded8751 MFH: Bump copyright year, 2 of 2. 2007-12-31 07:17:19 +00:00
Dmitry Stogov
72de143266 Fixed possible memory corruption 2007-12-28 15:32:09 +00:00
Dmitry Stogov
f817a1ce6a executor optimization 2007-12-14 14:14:50 +00:00
Dmitry Stogov
648fbe9d58 Fixed bug #43128 (Very long class name causes segfault) 2007-11-22 13:27:13 +00:00
Dmitry Stogov
e0ae3d22c1 Safe exit from executor() 2007-11-21 12:28:13 +00:00
Dmitry Stogov
de46d94589 ZEND_FETCH_DIM optimization 2007-11-20 11:01:28 +00:00
Dmitry Stogov
c3ab6bd091 Fixed bug #43136 (possible crash on script execution timeout. The EG(function_state_ptr) is completely removed, EG(current_execute_data)->function_state must be used instead) 2007-11-20 09:51:12 +00:00
Yiduo (David) Wang
4b4d634cb9 MFH: Added macros for managing zval refcounts and is_ref statuses 2007-10-07 05:22:07 +00:00
Dmitry Stogov
41e9b6b61c Fixed bug #42802 (Namespace not supported in typehints) 2007-10-01 10:37:14 +00:00
Dmitry Stogov
166266df68 Added support for Late Static Binding. (Dmitry, Etienne Kneuss) 2007-09-29 07:28:34 +00:00
Dmitry Stogov
6c810b0d4c Improved memory usage by movig constants to read only memory. (Dmitry, Pierre) 2007-09-27 18:00:48 +00:00
Jani Taskinen
fb7efdab86 MFH: Use SEPARATE_ZVAL_IF_NOT_REF for cleaner code. 2007-07-19 15:29:30 +00:00
Ilia Alshanetsky
4e68effc2e Commit previously missing patch for bug #41919 2007-07-12 23:33:50 +00:00
Dmitry Stogov
9f62beabfd Fixed bug #41919 2007-07-09 08:53:14 +00:00
Antony Dovgal
8e26df9523 fix #41813 (segmentation fault when using string offset as an object)
patch by judas dot iscariote at gmail dot com
2007-06-27 08:51:40 +00:00
Antony Dovgal
3790227f9d MFH: fix #41608 (segfault on a weird code with objects and switch()) 2007-06-06 08:35:23 +00:00
Dmitry Stogov
e1814f0dbe WIN64 support 2007-04-16 08:09:56 +00:00
Antony Dovgal
bb0def99a8 fix #41075 (memleak when creating default object caused exception) 2007-04-13 14:41:36 +00:00
Dmitry Stogov
e470e22e20 - Fixed bug #35106 (nested foreach fails when array variable has a reference).
- Fixed bug #36214 (__get method works properly only when conditional operator is used).
- Fixed bug #39449 (Overloaded array properties do not work correctly).
- Fixed bug #39990 (Cannot "foreach" over overloaded properties).
2007-01-10 15:58:08 +00:00
Sebastian Bergmann
4223aa4d5e MFH: Bump year. 2007-01-01 09:36:18 +00:00
Dmitry Stogov
e57a60698b Fixed bug #39944 (References broken) 2006-12-25 14:16:27 +00:00
Dmitry Stogov
108a2fc64c Fixed bug #39775 ("Indirect modification ..." message is not shown)
The fix breaks two SimpleXML tests those must be fixed
2006-12-08 15:55:31 +00:00
Ilia Alshanetsky
cb96148912 Fixed bug #33282 (Re-assignment by reference does not clear the is_ref flag)
# Original patch by Matt Wilmas
2006-11-07 20:23:30 +00:00
Antony Dovgal
2b1b2db8ec MFH: fix #39003 (__autoload() is called for type hinting) 2006-10-02 11:09:52 +00:00
Dmitry Stogov
29ed52ffa4 New memory manager 2006-07-18 09:06:33 +00:00
Marcus Boerger
704eced26b - MFH Fixed Bug #37667 (Object is not added into array returned by __get) 2006-07-10 00:36:28 +00:00
Zeev Suraski
51d495850a Restore ZE1 compatibility mode (Zend Engine part - the modules patches
will follow later today)
2006-06-05 13:58:52 +00:00
Antony Dovgal
29be5946f9 MFH: throw a warning when using invalid offset types with strings 2006-06-01 11:56:44 +00:00
Marcus Boerger
26145c2e0c - WS/CS 2006-05-27 18:04:13 +00:00
Marcus Boerger
1d5f721fd9 - MFH Sync error messages and simplify error message generation code 2006-05-26 00:36:13 +00:00
Marcus Boerger
7577130156 - MFH improve error messages 2006-05-21 18:10:31 +00:00
Dmitry Stogov
963c7fa016 Optimized require_once/include_once (eliminated fopen() on second usage) 2006-05-15 15:31:27 +00:00
Marcus Boerger
7a5240e846 - MFH missing bits and pieces of the partial sync with head
# This time i added:
# ZEND_FE_RESET_VARIABLE
# ZEND_FE_RESET_REFERENCE
# and dapted parser,compiler,executor,interfaces to handle these flags
# their purpose is to be able to pass whetehr foreach is done by ref to
# the current() handler so that it can error out in case it is not capable
# to comply to the requested return signature/protocol/semantics (weyp).
2006-05-11 21:07:39 +00:00
Marcus Boerger
0dacd6d5c0 - ze1 cleanup (bjori) /thx 2006-05-10 19:41:34 +00:00
Marcus Boerger
637a40423c - MFH as discussed
. zend_exception_get_default() -> zend_exception_get_default(TSRMLS_D)
  . zend_get_error_exception()   -> zend_get_error_exception(TSRMLS_D)
  . added E_RECOVERABLE_ERROR
  . added ZEND_TOSTRING_FUNC_NAME
  . added __tostring function cache to zend_class_entry
  . added ZEND_NAMED_ME
  . modified ZEND_ME_MAPPING to support method flags
  . added ZEND_MN
  . method entries now use prefix "zim_" instead of "zif_"
  . drop EG(ze1_compatibility_mode)
  . changed cast handler, now without (int should_free):
    typedef int (*zend_object_cast_t)(zval *readobj, zval *retval, int type TSRMLS_DC);
  . changed get_iterator, now receives whether value is by ref:
    zend_object_iterator *(*get_iterator)(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC);
  . added zend_objects_store_add_ref_by_handle
  . added zend_objects_store_del_ref_by_handle
  . convert_to_explicit_type(pzv, type)
2006-05-09 23:53:23 +00:00
Marcus Boerger
5a69b29082 - Warning fixes by Steph 2006-02-26 10:57:00 +00:00
Dmitry Stogov
c447acf863 Fixed bug #36071 (Engine Crash related with 'clone') 2006-01-19 07:23:32 +00:00
Andi Gutmans
61e93ccfe8 - Update copyright notices to 2006 2006-01-04 23:53:05 +00:00
Dmitry Stogov
56d78654a3 Reverted invalid fix for bug #35785 2005-12-26 08:18:38 +00:00
Marcus Boerger
9a6a266b16 - MFH Fixed Bug #35785 (SimpleXML memory read error) 2005-12-23 20:32:15 +00:00
Dmitry Stogov
ad90780930 Fixed memory leak 2005-12-22 09:16:11 +00:00
Dmitry Stogov
6b8bf38333 Fixed bug #35239 (Objects can lose references) 2005-11-16 11:52:27 +00:00
Dmitry Stogov
681405fc4a Fixed bug #35017 (Exception thrown in error handler may cause unexpected behavior) 2005-10-31 19:25:14 +00:00
foobar
eb7e9b6bfc - Fixed error message grammar 2005-09-15 13:10:31 +00:00
Marcus Boerger
650b76e542 - MFH: Improve error message 2005-09-14 18:23:48 +00:00
Sara Golemon
196e54fc43 MFH(r-1.719) Plug leak of 1/2 bytes when converting from string/unicode 2005-09-12 17:44:21 +00:00
Dmitry Stogov
4f161fe289 Fixed bug #34137 (assigning array element by reference causes binary mess) 2005-09-01 13:21:37 +00:00
Dmitry Stogov
32d69c853a Fixed bug #33996 (No information given for fatal error on passing invalid value to typed argument) 2005-08-05 09:35:09 +00:00
foobar
916815b779 Bump up the year 2005-08-03 13:30:58 +00:00
Dmitry Stogov
7aca138456 Fixed bug #33710 (ArrayAccess objects doen't initialize $this) 2005-07-19 07:33:00 +00:00
Dmitry Stogov
343af548a6 Fixed SIGSEGV on 'global ${"{$blah}_ID"};' 2005-07-04 13:24:46 +00:00
Stanislav Malyshev
fb0c96d07b fix conditions for freeing 2005-06-29 08:44:01 +00:00
Antony Dovgal
aa88cd901f fix leak: when dup was <success>ful zend_std_object_get_class_name() returns SUCCESS aka 0 2005-06-28 22:04:07 +00:00
Stanislav Malyshev
b95ec3528a fix previous patch 2005-06-28 12:42:56 +00:00
Stanislav Malyshev
e3601d22a7 fixes for non-php objects 2005-06-28 10:49:56 +00:00
Dmitry Stogov
2037023874 Fixed bug #27268 (Bad references accentuated by clone). 2005-06-23 08:21:03 +00:00
Marcus Boerger
7f544adbb5 - Fix TSRM build 2005-06-16 17:29:29 +00:00
Dmitry Stogov
aedbdb087d Allowed return by refrence from internal functions 2005-06-16 14:56:13 +00:00
Stanislav Malyshev
999998ecaa rename to zend_ 2005-06-16 14:27:08 +00:00
Dmitry Stogov
faacd7f865 Compilation warnings 2005-06-16 12:26:44 +00:00
Stanislav Malyshev
87c9e68c91 export zval getters 2005-06-16 11:50:08 +00:00
Dmitry Stogov
14b80ad199 Specializer optimization 2005-06-13 17:50:07 +00:00
Dmitry Stogov
cec2347c96 Fixed bug #33212 ([GCC 4]: 'zend_error_noreturn' aliased to external symbol 'zend_error').
The fix is not tested on Solaris and DARWIN!
2005-06-13 11:22:59 +00:00
Dmitry Stogov
84b96e9b03 Fix so that extensions like xdebug, can overload opcodes in all execution modes including goto/switch 2005-06-10 09:54:38 +00:00
Dmitry Stogov
4658513d70 fixed memory leak in bug #28972 ([] operator overflow treatment is incorrect), not the bug itself. 2005-06-07 10:21:52 +00:00
Dmitry Stogov
3d7b0bab28 Fixed memory allocation bugs related to magic object handlers (__get(), __set(),
...)
2005-06-03 11:16:19 +00:00
Dmitry Stogov
1a72341328 Added array type hinting. (This patch requires full re-make) 2005-05-26 13:46:17 +00:00
Dmitry Stogov
b2d28102a8 Fixed bug #30641 (Compile error: error: symbol "zend_error" is used but not defined) 2005-05-04 12:38:49 +00:00
Dmitry Stogov
8db238b075 Fixed bug #32852 (Crash with singleton and __destruct when zend.ze1_compatibility_mode = On)
Fixed bug #31828 (Crash with zend.ze1_compatibility_mode=On)
Fixed bug #32080 (segfault when assigning object to itself with zend.ze1_compatibility_mode=On)
2005-04-29 07:03:54 +00:00
Andrei Zmievski
4fbddd03d7 Fix certain operations to stop relying on presence of read_property and
write_property handlers. They may be NULL'ed out by certain objects
pretending to be pure arrays, for example. Do checks first.
2005-04-15 17:15:18 +00:00
Andrei Zmievski
992c28db75 Consolidate: call _get_zval_ptr_var() for IS_VAR case in
_get_zval_ptr().
2005-03-23 21:05:56 +00:00
Andi Gutmans
8838c0f860 - Two new API calls for Derick (retreive CV name and value) by Dmitry 2005-01-22 02:29:18 +00:00
Dmitry Stogov
30445fb661 Fixed bug #28444 (Cannot access undefined property for object with overloaded property access). 2005-01-18 09:05:39 +00:00
Dmitry Stogov
72d02269a9 Restore behavior of $str["str"]. (Now $str["str"] is equivalent to $str[0] again) 2005-01-14 09:01:22 +00:00
Dmitry Stogov
ce0884c287 Additional fix for fix of bug #29883 2005-01-13 08:49:06 +00:00
Dmitry Stogov
6fa37163f2 Fixed bug #31098 (isset false positive) 2005-01-12 09:18:31 +00:00
Dmitry Stogov
beaff87d50 "Undefined variable: %s" noticies were fixed to use one space 2004-12-27 13:43:26 +00:00
Dmitry Stogov
e986a1f47e "Undefined variable: %s" noticies were fixed to be compatible with PHP_5_0 2004-12-24 08:24:55 +00:00
Moriyoshi Koizumi
ae78d7d4bf - Checks for Darwin'ish systems that uses Mach-O, which apparently doesn't
support weak symbol aliasing at this time.
2004-11-03 23:05:18 +00:00
Andi Gutmans
e50a6fde11 - Commit new VM
- Old one is tagged as PRE_NEW_VM_GEN_PATCH
- Still doing work so more commits to come. Don't complain (yet) :)
2004-10-22 21:42:14 +00:00
Andi Gutmans
fd92acac4f - Fix crash (MFB PHP5_0) 2004-10-22 01:55:39 +00:00
Dmitry Stogov
3d383e45dc Fixed unset() bug that was introduced with CV optimization patch 2004-10-05 09:09:18 +00:00
Andi Gutmans
db507dd153 - Commit the variable fetch optimization.
- Extensions which delete global variables need to use new special function
- delete_global_variable() (I'm about to rename it) to remove them.
- Will post to internals@ or via commit messages if there's anything else.
2004-10-04 19:54:35 +00:00
Andi Gutmans
f82ed13625 - Commit new VM architecture. This one allows people (aka Derick) to
- ask the engine to use function handler mode. Will update the README
- about that.
2004-09-23 21:43:32 +00:00
Anantha Kesari H Y
b04db9d9e0 Reverted the NetWare Specific Stack limit related patches as asked by Andi 2004-09-23 06:23:36 +00:00
Anantha Kesari H Y
8eb7503078 Stack limit will be checked while executing the script 2004-09-22 14:20:19 +00:00
Dmitry Stogov
3009a073b0 Fixed bug #29566 (foreach/string handling strangeness (crash)). 2004-09-22 07:14:26 +00:00
Dmitry Stogov
81a5af36a1 Fixed bug in fix for bug #29707 2004-09-22 06:32:19 +00:00
Andi Gutmans
d9252aa1ea - Fix for bug #29707 2004-09-21 22:09:22 +00:00
Stanislav Malyshev
29fec3febc Antony Dovgal's error message improvement - #27290 2004-09-13 10:41:39 +00:00
Andi Gutmans
96ab56e146 - Roll back VM commit 2004-09-09 16:47:22 +00:00
Andi Gutmans
8eb8850c90 - Some architectural changes:
a) We specialize opcodes according to op_type fields. Each opcode has to
    be marked with which op_type's it uses.
 b) We support different execution methods. Function handlers, switch()
    and goto dispatching. goto seems to be the fastest but it really
    depends on the compiler and how well it optimizes. I suggest playing
    around with optimization flags.

- Warning: Things might break so keep us posted on how things are going.
  (Dmitry, Andi)
2004-09-08 22:14:12 +00:00
Stanislav Malyshev
4f68f3774c fix crash #29893 2004-08-30 08:57:40 +00:00
Marcus Boerger
0eaa26fc31 String offset starts with 0, fix isset($str[$len]) 2004-08-29 19:15:08 +00:00
Andi Gutmans
a36e7b0ab1 - Cleanup 2004-08-19 20:42:20 +00:00
Andi Gutmans
edb7c7d4f5 - Stop using garbage. Please let me know if you find any bugs resulting
- of this patch (very likely). (Dmitry, Andi)
2004-08-19 20:03:06 +00:00
Andi Gutmans
993f70c1d2 - Don't use magic numbers 2004-08-12 05:54:11 +00:00
Andi Gutmans
de25255b6d - Significantly improve performance of foreach($arr as $data). (Marcus) 2004-08-12 05:41:01 +00:00
Marcus Boerger
be022a813f More meaningfull error message 2004-08-11 20:19:49 +00:00
Marcus Boerger
51505045e6 - Fix warnings 2004-08-10 07:01:54 +00:00