Commit Graph

295 Commits

Author SHA1 Message Date
Dmitry Stogov
d5ef2f466c Added support for lambda functions and closures 2008-07-14 09:49:03 +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
Felipe Pena
cc23d3bade - Fixed bug #45089 (__callStatic $name case sensitivity) 2008-06-03 18:11:12 +00:00
Dmitry Stogov
a6ec1850e0 MFH: small CSE optimizations 2008-05-16 14:34:31 +00:00
Dmitry Stogov
af1ed80274 Fixed bug #44952 (isset() does not checks correctly variable variable) 2008-05-12 09:09:05 +00:00
Dmitry Stogov
5521912b15 Use IS_CV for dirrent access to $this variable 2008-05-07 12:04:39 +00:00
Dmitry Stogov
10aa1146ab Fixed possible memory leak 2008-05-06 16:59:38 +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
3adf158d79 IS_CONST operands are always have is_ref==1 and refcount==2, so we can eliminate unnecessary checks at specialization/compilation stage 2008-04-30 10:44:08 +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
Dmitry Stogov
e4213bedb8 Optimized function call helper 2008-04-21 10:14:20 +00:00
Dmitry Stogov
d9dd1b9e14 Optimized ZEND_RETURN opcode to not allocate and copy return value if it is not
used.
2008-04-11 09:43:28 +00:00
Felipe Pena
f66f55edc5 MFH: Implemented "jump label" operator (limited "goto")
[DOC]
2008-03-28 14:35:01 +00:00
Felipe Pena
2b10c53ae1 MFH: Dropped zend.ze1_compatibility_mode
[DOC]
2008-03-18 14:10:45 +00:00
Dmitry Stogov
8c885b8913 Implemented concept of "delayed early binding" that allows opcode caches to perform class declaration (early and/or run-time binding) in exactly the same order as vanila php.
The following pseudo-code explains how it should be used in opcode cache.

function cache_compile_file($filename) {
        if (!is_cached($filename)) {
                ...
                orig_compiler_options = CG(compiler_optins);
                CG(compiler_options) |= ZEND_COMPILE_IGNORE_INTERNAL_CLASSES |
                                        ZEND_COMPILE_DELAYED_BINDING;
                $op_array = orig_compile_file($filename);
                CG(compiler_options) = orig_copiler_options;
                ...
        } else {
                $op_array = restore_from_cache($filename);
        }
        zend_do_delayed_early_binding($op_array);
}
2008-03-18 08:36:30 +00:00
Marcus Boerger
af316021e8 - Rewrite scanner to be based on re2c instead of flex
The full patch is available as:
  http://php.net/~helly/php-re2c-5.3-20080316.diff.txt
  This is against php-re2c repository version 98
  An older patch against version 97 is available under:
  http://php.net/~helly/php-re2c-97-20080316.diff.txt
2008-03-16 21:06:55 +00:00
Dmitry Stogov
be8daf1f47 Optimized ZEND_FETCH_CLASS + ZEND_ADD_INTERFACE into single ZEND_ADD_INTERFACE opcode 2008-03-12 10:32:12 +00:00
Dmitry Stogov
ab232458c7 Optimized require_once() and include_once() by eliminationg open() syscall on second usage. 2008-03-05 13:34:12 +00:00
Dmitry Stogov
430e54d457 Fixed shared memory corruption of opcode caches 2008-03-04 11:43:51 +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
Marcus Boerger
d3e5026564 - MFH Add E_DEPRECATED (Lars Strojny, Felipe Pena, Marcus)
[DOC] Finally added deprecation messages
2008-02-23 17:06:22 +00:00
Dmitry Stogov
8c32f99c25 Fixed bug #44184 (Double free of loop-variable on exception) 2008-02-20 12:05:57 +00:00
Hannes Magnusson
86c9b5e46c Fix segfaults when calling "ctors statically" 2008-02-11 15:46:10 +00:00
Marcus Boerger
da5b979f88 - MFH Add comment that explains why we need E_ERROR in those cases 2008-02-02 15:48:04 +00:00
Marcus Boerger
95a3cccf5f - Fix flag handling in message generation 2008-02-02 13:56:59 +00:00
Dmitry Stogov
d90ebc65a6 Fixed comilation warnings 2008-01-24 18:07:45 +00:00
Dmitry Stogov
0b6825102d Changed EG(argument_stack) implementation. 2008-01-24 09:41:39 +00:00
Dmitry Stogov
07000cc2ba Fixed error message 2008-01-24 08:51:38 +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
48379d53e6 Eliminate unnecessary checks for INC/DEC IS_CV 2008-01-21 14:22:59 +00:00
Dmitry Stogov
6be997dca9 Fixed unspecialized executor 2008-01-11 10:08:49 +00:00
Sebastian Bergmann
d1dded8751 MFH: Bump copyright year, 2 of 2. 2007-12-31 07:17:19 +00:00
Dmitry Stogov
f817a1ce6a executor optimization 2007-12-14 14:14:50 +00:00
Dmitry Stogov
6484b3c458 Fixed bug #43344 (Wrong error message for undefined namespace constant) 2007-12-07 17:11:24 +00:00
Dmitry Stogov
ea0a1c09e9 Speed-up of ZEND_DO_FCALL and ZEND_INIT_FCALL_BY_NAME by lowercasing and calculating hash values at compile time. 2007-11-22 09:02:55 +00:00
Dmitry Stogov
e0ae3d22c1 Safe exit from executor() 2007-11-21 12:28:13 +00:00
Johannes Schlüter
45f6b4ce2f - MFH Improved version of ternary shortcut (Marcus) 2007-11-21 09:41:35 +00:00
Dmitry Stogov
a29a9d5a42 Optimization of zend_do_fcall_common_helper() 2007-11-20 13:53:08 +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
Dmitry Stogov
52f25f6132 Fixed bug #43175 (__destruct() throwing an exception with __call() causes segfault) 2007-11-06 14:56:14 +00:00
Dmitry Stogov
22db451fdd Fixed bug #43201 (Crash on using unitialized vals and __get/__set) 2007-11-06 14:11:59 +00:00
Antony Dovgal
0d74798914 fix bug37251.phpt failure (two error messages instead of one)
should I merge this to 5_2?
2007-11-02 18:05:55 +00:00
Dmitry Stogov
1530fe99c8 Fixed variations of bug #35163 2007-10-23 12:52:40 +00:00
Dmitry Stogov
b599e434ad Fixed bug #35163 (Array elements can lose references) 2007-10-23 09:55:11 +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
Ilia Alshanetsky
4c619a3f5f Fixed bug #42817 (clone() on a non-object does not result in a fatal error) 2007-10-04 23:19:20 +00:00
Dmitry Stogov
68055015eb Fixed bug #42818 ($foo = clone(array()); leaks memory) 2007-10-03 09:47:45 +00:00
Dmitry Stogov
1491992f76 Fixed bug #42772 (Storing $this in a static var fails while handling a cast to string) 2007-10-03 08:02:36 +00:00
Dmitry Stogov
69edb0131a ws 2007-10-03 06:49:15 +00:00
Dmitry Stogov
9aee9e0417 Fixed access to freed memory in tests/classes/__call_001.phpt 2007-10-02 08:47:22 +00:00
Dmitry Stogov
220641af70 Fixed bug #42819 (namespaces in indexes of constant arrays) 2007-10-02 08:26:50 +00:00
Dmitry Stogov
41e9b6b61c Fixed bug #42802 (Namespace not supported in typehints) 2007-10-01 10:37:14 +00:00
Dmitry Stogov
72d0454bf6 Added support for __callstatic() magic method (missing part). (Sara) 2007-09-29 09:34:24 +00:00
Dmitry Stogov
c560a96848 Removed commented code 2007-09-29 08:29:56 +00:00
Dmitry Stogov
166266df68 Added support for Late Static Binding. (Dmitry, Etienne Kneuss) 2007-09-29 07:28:34 +00:00
Dmitry Stogov
f32ffe9b43 Namespaces 2007-09-28 19:52:53 +00:00
Jani Taskinen
338a12a018 MFH: Nuked unnecessary TSRMLS_FETCH() call 2007-09-27 16:55:25 +00:00
Jani Taskinen
82626c1868 MFH: - Fixed the rest of bug #41561 ( @ operator not working ) 2007-09-07 09:37:38 +00:00
Dmitry Stogov
e13b4c2c4e Fixed bug #40705 (Iterating within function moves original array pointer)
Fixed bug #40509 (key() function changed behaviour if global array is used within function)
2007-07-24 19:24:40 +00:00
Dmitry Stogov
28bc39500a Fixed some class constant issues related to bug #41633 2007-06-13 14:50:13 +00:00
Dmitry Stogov
80d2409fd8 Improved compilation of heredocs and interpolated strings. (Matt, Dmitry) 2007-05-18 13:12:05 +00:00
Dmitry Stogov
d2fe65c191 Fixed bug #39542 (Behaviour of require/include different to < 5.2.0) 2007-05-11 08:02:43 +00:00
Dmitry Stogov
e1814f0dbe WIN64 support 2007-04-16 08:09:56 +00:00
Ilia Alshanetsky
d9adb6715f Fixed foreach by-ref bug.
# Patch from Brian Shire
2007-04-05 23:48:43 +00:00
Dmitry Stogov
b0a875104e Fixed bug #40833 (Crash when using unset() on an ArrayAccess object retrieved via __get()) 2007-03-19 18:31:30 +00:00
Stanislav Malyshev
8779d1cdd3 fix crash on $x['x']['y'] += 1, patch by Brian Shire 2007-03-08 20:59:31 +00:00
Dmitry Stogov
c373324692 Fixed bug #40591 (list()="string"; gives invalid opcode) 2007-02-25 16:02:43 +00:00
Antony Dovgal
e058ba92f9 MFH: fix #40621 (Crash when constructor called inappropriately (statically)) 2007-02-24 21:30:48 +00:00
Dmitry Stogov
44297ddea8 Removed dead code 2007-02-01 16:23:28 +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
4480c5eb5d Fixed bug #39825 (foreach produces memory error) 2006-12-25 19:23:03 +00:00
Dmitry Stogov
e57a60698b Fixed bug #39944 (References broken) 2006-12-25 14:16:27 +00:00
Dmitry Stogov
7ff822ee49 Fixed bug #39304 (Segmentation fault with list unpacking of string offset) 2006-10-30 11:05:00 +00:00
Dmitry Stogov
9875fe44e2 Fixed bug #39017 (foreach(($obj = new myClass) as $v); echo $obj; segfaults) 2006-10-03 09:05:14 +00:00
Dmitry Stogov
9dcdfd993f Fixed memory leak (Nuno) 2006-10-03 07:30:46 +00:00
Dmitry Stogov
c3272ab020 Fixed bug #38808 ("maybe ref" issue for current() and others) 2006-09-26 10:30:51 +00:00
Dmitry Stogov
cd6537ed6d Fixed bugs #34065 and #38623 (throw in foreach/switch causes memory leaks) 2006-09-19 21:36:54 +00:00
Dmitry Stogov
8982cc0472 Small optimization of ZEND_INIT_ARRAY/ZEND_ADD_ARRAY_ELEMENT. (Nuno, Dmitry) 2006-09-18 14:23:52 +00:00
Dmitry Stogov
afb8af1f5f Reverted last Ilia's patch (for bug #38579).
The patch didn't fix the bug and made new one.
2006-09-06 06:37:42 +00:00
Ilia Alshanetsky
229137cad4 Fixed bug #38579 require_once/include_once optimization causes files to be
loaded multiple times.
2006-09-05 15:50:07 +00:00
Dmitry Stogov
87eaaf494b Removed unreachable handlers 2006-09-04 13:58:54 +00:00
Marcus Boerger
05206b42d8 - Speling 2006-08-08 00:40:19 +00:00
Marcus Boerger
c1c2a0d294 - MFH Fixed Bug #38064 ignored constructor visibility 2006-08-07 23:24:33 +00:00
Dmitry Stogov
f5543a428d Fixed bug #38287 (static variables mess up global vars) 2006-08-07 15:15:22 +00:00
Antony Dovgal
bc8f1bc4f0 make it consistent 2006-08-03 10:57:41 +00:00
Antony Dovgal
c173c26b64 MFH: improve error message 2006-08-03 10:53:15 +00:00
Dmitry Stogov
a98e5c674f Fixed bug #38234 (Exception in __clone makes memory leak) 2006-07-27 10:44:03 +00:00
Dmitry Stogov
e447baafa1 Fixed bug #38211 (variable name and cookie name match breaks script execution) 2006-07-26 09:24:26 +00:00
Marcus Boerger
519ed8e13b - Better fix for #34505 and related, drop zend_unmangle_property_name_ex() 2006-07-24 17:58:32 +00:00
Dmitry Stogov
9a98904ddd Fixed wrong "type" argument to read_property() handler 2006-07-21 08:39:30 +00:00
Dmitry Stogov
f7c99da2fe Fixed bug #37144 (PHP crashes trying to assign into property of dead object) 2006-07-19 09:55:19 +00:00
Antony Dovgal
a9469060e5 MFH: init variables and get rid of annoying warnings 2006-07-12 21:17:30 +00:00
Dmitry Stogov
631a00a0a0 Fixed memory leak in case of exception in iterator callbacks in 'foreach(new Iterator()...' (spl/tests/iterator_047.phpt). 2006-07-11 08:52:28 +00:00
Sara Golemon
86bbbbdce4 MFH (def.h rev:1.121, execute.h rev:1.120)
Silence FETCH_OBJ_IS / undefined notices
2006-07-06 15:32:07 +00:00
Stefan Esser
7bbf35320d MFH: Added hook for compile_string() 2006-06-13 12:57:48 +00:00
Dmitry Stogov
2a7d16f8fd Proper fix for bug #37707 ("clone $x" must call __clone() enven if result value is not used) 2006-06-08 08:56:27 +00:00
Dmitry Stogov
6e24feb80d Wrap "wrong" unreachable code with "#if 0" 2006-06-08 08:37:51 +00:00
Ilia Alshanetsky
8d4bb9ca74 Fixed bug #37707 clone without assigning leaks memory
# Based on a patch by Nuno
2006-06-07 13:41:49 +00:00
Marcus Boerger
5cdefd07cd - MFH Fix issue with interfaces being inherited multiple times 2006-06-07 09:21:06 +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
Marcus Boerger
1be624e7ba - MFH Sync vm generation with head
- Regenerate vm
2006-05-21 18:00:14 +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
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
Dmitry Stogov
f23d01ad4d Fixed bug #37046 (foreach breaks static scope) 2006-04-12 11:37:50 +00:00
Marcus Boerger
6ea747d8e4 - MFH Iterators from overloaded objects are allowed to not have keys... 2006-04-10 23:16:29 +00:00
Dmitry Stogov
6f76b17079 Added E_STRICT warning in case of calling non-static method from incompatible context (this feature is staying for BC with php-4). 2006-03-15 11:12:45 +00:00
Dmitry Stogov
056bea6de7 Fixed "zend_vm_gen.php --without-specializer" 2006-03-15 08:06:28 +00:00
Marcus Boerger
5a69b29082 - Warning fixes by Steph 2006-02-26 10:57:00 +00:00
Marcus Boerger
941b0651dc - MFH: Function deprecation flag 2006-02-25 18:25:45 +00:00
Dmitry Stogov
38409e944c Fixed bug #36303 (foreach on error_zval produces segfault) 2006-02-06 11:45:56 +00:00
Andi Gutmans
61e93ccfe8 - Update copyright notices to 2006 2006-01-04 23:53:05 +00:00
Dmitry Stogov
02aad34c43 Fixed bug #35470 (Assigning global using variable name from array doesn't function) 2005-11-30 10:09:37 +00:00
Dmitry Stogov
14594953d2 Fixed bug #35393 (changing static protected members from outside the class, one more reference issue) 2005-11-28 14:33:03 +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
Dmitry Stogov
844cb82c45 $id:$ tatgs are removed from generated files to avoid committing of Zend/zend_vm_opcodes.h without real changes. 2005-10-28 06:05:57 +00:00
Dmitry Stogov
8212034254 Fixed SIGSEGV 2005-10-27 19:25:52 +00:00
Dmitry Stogov
ad1f706fda Removed unnecesary local variable 2005-10-20 11:31:41 +00:00
Dmitry Stogov
c095e20ca8 Fixed bug #31177 (menory leaks and corruption because of incorrect refcounting) 2005-10-20 07:23:26 +00:00
Dmitry Stogov
3019a1c6a3 Fixed bug #34786 (2 @ results in change to error_reporting() to random value) 2005-10-10 10:53:52 +00:00
Antony Dovgal
d38a901189 - store current value of error_reporting only if it's not stored yet
- reset old_error_reporting to NULL only it points to the tmp_var at current opline
2005-09-23 09:36:43 +00:00
Dmitry Stogov
d6c7d9630b MFH 2005-09-23 07:12:07 +00:00
Antony Dovgal
f8e8c5534b MFH: fix #33771 (error_reporting falls to 0 when @ was used inside try/catch block) 2005-09-22 19:03:18 +00:00
Derick Rethans
a51fc50b6e - MFH: Moved the FREE_OP to after the execution of the included file, or eval
statement so that it is safe to access this information in the overridden
  zend_execute() function, which is what Xdebug does.
2005-09-21 08:13:43 +00:00
Dmitry Stogov
0ce7487110 Fixed access to memory that is already freed (in case of __call() method) 2005-09-19 16:28:54 +00:00
Dmitry Stogov
46488c8bb4 Fixed parameter passing incompatibilities.
Now it is possible to call array_pop(explode("&","1&2&3")) again.
2005-09-19 16:02:21 +00:00
Antony Dovgal
f43767b249 fix #34505 (possible memory corruption when unmangling properties with empty names)
1st part
2005-09-16 17:05:09 +00:00
Dmitry Stogov
e4a4ab60c7 Fixed bug #34518 (Unset doesn't separate container in CV) 2005-09-16 14:42:46 +00:00
Dmitry Stogov
19dc0411f7 Fixed return-by-reference from internal functions 2005-08-24 10:41:06 +00:00
foobar
a23aec662c MFH: nuked eol from error message 2005-08-18 12:34:22 +00:00
Dmitry Stogov
daba35fead Fixed bug #34062 (Crash in catch block when many arguments are used) 2005-08-10 13:11:05 +00:00
Dmitry Stogov
779e6d203e Fixed bug #34064 (arr[] as param to function in class gives invalid opcode) 2005-08-10 10:39:55 +00:00
Dmitry Stogov
f0f1557998 Fixed bug #34045 (Buffer overflow with serialized object) 2005-08-10 06:37:19 +00:00
Dmitry Stogov
a744a6feb5 Fixed memory leak in foreach() on undefined variable (Zend/tests/foreach_undefined.php) 2005-08-05 06:29:46 +00:00
Ilia Alshanetsky
70f72d39e4 Fixed warning message generated when isset() or empty() are given invalid
offset type.
2005-07-29 16:27:32 +00:00
Andi Gutmans
9c392835de - Tiny fixlet 2005-07-28 21:39:57 +00:00
Dmitry Stogov
6b5f4da085 Fixed bug with returning from internal function by reference 2005-07-21 13:48:10 +00:00
Dmitry Stogov
f90bdf8933 Fixed bug #33558 (warning with nested calls to functions returning by reference) 2005-07-18 07:13:34 +00:00
Dmitry Stogov
d7baf87c61 Removed some compilation warnings. 2005-07-18 06:34:42 +00:00
Ilia Alshanetsky
8a9fc3439a Make references misuse emit E_NOTICE rather E_STRICT to be compatible with
PHP 4.4.0
2005-07-11 18:44:37 +00:00
Dmitry Stogov
343af548a6 Fixed SIGSEGV on 'global ${"{$blah}_ID"};' 2005-07-04 13:24:46 +00:00
Dmitry Stogov
f4b5a51952 Fixed memory leak 2005-07-03 11:09:42 +00:00
Stanislav Malyshev
fb0c96d07b fix conditions for freeing 2005-06-29 08:44:01 +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
7662d4df64 Fixed SIGSEGV on assigment string offset by reference 2005-06-27 06:15:35 +00:00
Dmitry Stogov
61b9dedd90 Export zend_do_fcall() helper from executor 2005-06-24 12:33:53 +00:00