Dmitry Stogov
f216176bc9
Initialize only the necessary fields.
10 years ago
Nikita Popov
921b3251b3
Fix bug #71604
Alternatively could throw some kind of uncatchable dummy exception
into the generator. Right now just checking for NULL in two places
seems simpler.
10 years ago
Nikita Popov
4746e5efcb
Forbid "yield from" in force closed generators
Same check we do for "yield", was missed when "yield from" was
added. We could make this more granular by only forbidding to
actually yield values and still allow something like "yield from []",
but this does not seem worthwhile.
10 years ago
Dmitry Stogov
2ae21abdf7
Fixed bug #72213 (Finally leaks on nested exceptions).
Squashed commit of the following:
commit 8461b0407f
Author: Dmitry Stogov <dmitry@zend.com>
Date: Wed May 25 00:34:42 2016 +0300
Rmoved zend_try_catch_element.parent and walk through op_array.try_catch_array backward from the current try_cacth_offset.
commit 0c71e24964
Author: Dmitry Stogov <dmitry@zend.com>
Date: Wed May 25 00:04:53 2016 +0300
Move SAVE_OPLINE() to its original place
commit 111432a4df
Author: Dmitry Stogov <dmitry@zend.com>
Date: Wed May 25 00:01:10 2016 +0300
Separate the common part of ZEND_HANDLE_EXCEPTION and FAST_RET into zend_dispatch_try_catch_finally_helper.
commit 4f21c06c2e
Author: Nikita Popov <nikic@php.net>
Date: Tue May 24 14:55:27 2016 +0200
Improve finally fix
commit da5c727499
Author: Dmitry Stogov <dmitry@zend.com>
Date: Tue May 24 10:36:08 2016 +0300
Fixed Zend/tests/try/bug70228_3.phpt and Zend/tests/try/bug70228_4.phpt
commit cfcedf2fb4
Author: Dmitry Stogov <dmitry@zend.com>
Date: Tue May 24 02:59:27 2016 +0300
Added test
commit 4c6aa93d43
Author: Dmitry Stogov <dmitry@zend.com>
Date: Tue May 24 00:38:20 2016 +0300
Added tests
commit 8a8f4704b0
Author: Dmitry Stogov <dmitry@zend.com>
Date: Mon May 23 23:27:34 2016 +0300
Fixed bug #72213 (Finally leaks on nested exceptions)
10 years ago
Nikita Popov
91f5940329
Forbid dynamic calls to scope introspection functions
Per RFC:
https://wiki.php.net/rfc/forbid_dynamic_scope_introspection
10 years ago
Dmitry Stogov
88196e9151
Added specialized handler for ZEND_FETCH_DIM_R opcode with only numeric indexes.
10 years ago
Xinchen Hui
fad91468db
Revert "Fixed Bug #72213 (Finally leaks on nested exceptions)"
This reverts commit 5037ebf058
.
10 years ago
Dmitry Stogov
c466df6813
Inlined fast paths of the freqently execute handlers for FETCH_DIM_R.
10 years ago
Dmitry Stogov
34a6c93b25
Specialize ZEND_ASSIGN_ADD and family according to value of opline->extended_value
10 years ago
Xinchen Hui
5037ebf058
Fixed Bug #72213 (Finally leaks on nested exceptions)
10 years ago
Dmitry Stogov
8f7b1a3248
IS_CONST operands don't have to be separated. Use reference-counting instead of duplication.
- with opcache all IS_CONST operands are not refcounted (scalars, interned strings or immutable arrays)
- without opcache IS_CONST operands are not shared between processes or threads and may use common reference counters
10 years ago
Dmitry Stogov
1fe7b3bca1
micro-optimisation
10 years ago
Dmitry Stogov
97bf4e0b12
Check if generator object is created by GENERATOR_CREATE when throw exceptions from generator function
10 years ago
Dmitry Stogov
414c4c6776
Revert "Check if generator object is created by GENERATOR_CREATE when throw exceptions from generator function."
This reverts commit a9b517c614
.
10 years ago
Dmitry Stogov
a9b517c614
Check if generator object is created by GENERATOR_CREATE when throw exceptions from generator function.
10 years ago
Dmitry Stogov
be071702b3
Fixed bug #72188 (Nested try/finally blocks losing return value)
10 years ago
Dmitry Stogov
ccf18da450
Eliminated checks for (func->op_array.fn_flags & ZEND_ACC_GENERATOR) in fast path of DO_FCALL* handlers.
This slightly improves calls to regular function and method calls in cost of a bit slower generator initialization.
Separate call frame for generators, allocated on heap, now created by ZEND_GENERATOR_CREATE instruction.
10 years ago
Dmitry Stogov
7b94b958cc
Intern some known (and offten used) strings.
10 years ago
Dmitry Stogov
cca2c8ecc4
Reimplemented Bob's commit bac6fdb0c5
without insignificant renaming and white-space changes
10 years ago
Dmitry Stogov
c19cb70dac
Revert "Refactor zval cleanup into single function"
This reverts commit bac6fdb0c5
.
10 years ago
Bob Weinand
bac6fdb0c5
Refactor zval cleanup into single function
Also use zval_ptr_dtor_nogc() everywhere in Zend in favor of zval_dtor()
10 years ago
Dmitry Stogov
26adba38bc
Micro-optimization
10 years ago
Joe Watkins
c38310f25a
change fcall and statement handlers to accept frame
10 years ago
Nikita Popov
fbae590bf0
Fix leaks in QM_ASSIGN, JMP_SET and COALESCE
The QM_ASSIGN code was rewritten to use the standard pattern for
handling CVs and VARs.
10 years ago
Bob Weinand
7c174b6197
Fix use after free on AST expressions in constant declarations
10 years ago
Dmitry Stogov
3e9419dd28
Fixed compilation warnings
10 years ago
Dmitry Stogov
747a482b9c
Don't initialize EX(call)->symbol_table on each function call.
Keep it uninitialized, and check ZEND_CALL_HAS_SYMBOL_TABLE flag when necessary.
10 years ago
Dmitry Stogov
6499162ff0
- get rid of EG(scope). zend_get_executed_scope() should be used instead.
- ichanged zval_update_constant_ex(). Use IS_TYPE_IMMUTABLE flag on shared constants and AST, instead of "inline_change" parameter.
10 years ago
Dmitry Stogov
92233dd736
Fixed bug #72101 (crash on complex code)
10 years ago
Nikita Nefedov
19759a5602
Fix RECV opcode to handle all kinds of exceptions
fix RECV opcode to handle exceptions thrown from user-defined error handler
as a result Notice error from failed type coercion
10 years ago
Nikita Nefedov
ed9a1a9d68
Fix RECV opcode to handle all kinds of exceptions
fix RECV opcode to handle exceptions thrown from user-defined error handler
as a result Notice error from failed type coercion
10 years ago
Dmitry Stogov
f484801483
Reduced amount of code generated for interrupt handling.
Improved ZEND_VM_INTERRUPT_CHECK() placement (always perform checks after opcode handler completion, when instruction pointer value is alredy changed to the next opcode).
10 years ago
Nikita Popov
73958ca62d
Fix SEND_USER as well
Missed copy&paste code here
10 years ago
Nikita Popov
a8792158bd
Fix SEND_ARRAY+PREFER_REF SHM corruption
Make the behavior consistent between namespaced and not and with
PHP 5.6.
10 years ago
Xinchen Hui
aa9f8e695c
combine conditions
10 years ago
Nikita Popov
d1a38743a5
Fix SEND_UNPACK array separation
Separating only immutable arrays is not enough.
10 years ago
Bob Weinand
15d1d4f45b
Fixed bug #72038 (Function calls with values to a by-ref parameter don't always throw a notice)
10 years ago
Nikita Popov
dd6c6b1c48
Cleanup condition in SEND_VAR_NO_REF
Was overly convoluted after the IS_VAR_RET_REF removal.
10 years ago
Nikita Popov
64f91774f2
Remove IS_VAR_RET_REF flag
Instead decide whether a function returned by reference or by value
by checking whether the return value has REFERENCE type. This means
that functions returning by reference must always return a reference
and functions returning by value must not return a reference.
10 years ago
Dmitry Stogov
562d6315b1
Optimize zend_binary_assign_op_dim_helper()
10 years ago
Dmitry Stogov
e95efb6312
Move rare cases of DO_FCALL into separate helpers.
10 years ago
Dmitry Stogov
85f35a8fc1
Separate unspecializeble code of INCLIDE_OR_EVAL into helper functions
10 years ago
Dmitry Stogov
f48b20721c
ASSIGN_ADD micro optimization
10 years ago
Dmitry Stogov
a809444b64
Delay IS_UNDEF check for FETCH_DIM_W and family
10 years ago
Dmitry Stogov
0b3e2fe2b1
Delay IS_UNDEF check for FETCH_DIM_R and family
10 years ago
Dmitry Stogov
23b65bf732
Reuse zend_fetch_dimension_address_read() for FETCH_LIST
10 years ago
Dmitry Stogov
43b1618023
Added missing "goto"
10 years ago
Dmitry Stogov
eaf489ac2b
Optimize ASSIGN_DIM (separate common unspecializeble code into helper functions).
10 years ago
Nikita Popov
4e585eb429
Fix ZEND_SEPARATE for by-val func returning ref zval
10 years ago
Nikita Popov
6a2eee520a
Drop unnecessary ZEND_SEPARATE code
The following write ops will separate if necessary.
10 years ago