Dmitry Stogov
6a32d44392
cleanup
2016-06-01 18:07:05 +03:00
Dmitry Stogov
b111da96d9
Split ZEND_SEND_VAR_NO_REF into ZEND_SEND_VAR_NO_REF and ZEND_SEND_VAR_NO_REF_EX (similar to ZEND_SEND_VAL) and remove ZEND_ARG_* flags.
2016-05-31 04:06:00 +03:00
Dmitry Stogov
f216176bc9
Initialize only the necessary fields.
2016-05-31 00:04:52 +03:00
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.
2016-05-28 14:40:32 +02:00
Nikita Popov
79de9fa4aa
Merge branch 'PHP-7.0'
...
Conflicts:
Zend/zend_vm_execute.h
2016-05-28 13:22:49 +02:00
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.
2016-05-28 13:21:05 +02:00
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)
2016-05-25 01:25:12 +03:00
Nikita Popov
91f5940329
Forbid dynamic calls to scope introspection functions
...
Per RFC:
https://wiki.php.net/rfc/forbid_dynamic_scope_introspection
2016-05-24 20:48:24 +02:00
Dmitry Stogov
88196e9151
Added specialized handler for ZEND_FETCH_DIM_R opcode with only numeric indexes.
2016-05-18 15:06:49 +03:00
Xinchen Hui
37b1226af1
Merge branch 'master' of git.php.net:/php-src
...
* 'master' of git.php.net:/php-src:
Inlined fast paths of the freqently execute handlers for FETCH_DIM_R.
2016-05-17 20:28:26 +08:00
Xinchen Hui
fad91468db
Revert "Fixed Bug #72213 (Finally leaks on nested exceptions)"
...
This reverts commit 5037ebf058
.
2016-05-17 20:27:16 +08:00
Dmitry Stogov
c466df6813
Inlined fast paths of the freqently execute handlers for FETCH_DIM_R.
2016-05-17 15:08:04 +03:00
Dmitry Stogov
34a6c93b25
Specialize ZEND_ASSIGN_ADD and family according to value of opline->extended_value
2016-05-17 11:46:25 +03:00
Xinchen Hui
5037ebf058
Fixed Bug #72213 (Finally leaks on nested exceptions)
2016-05-17 15:32:43 +08:00
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
2016-05-17 08:45:06 +03:00
Dmitry Stogov
1fe7b3bca1
micro-optimisation
2016-05-17 02:09:29 +03:00
Dmitry Stogov
97bf4e0b12
Check if generator object is created by GENERATOR_CREATE when throw exceptions from generator function
2016-05-16 12:42:13 +03:00
Dmitry Stogov
414c4c6776
Revert "Check if generator object is created by GENERATOR_CREATE when throw exceptions from generator function."
...
This reverts commit a9b517c614
.
2016-05-16 11:51:29 +03:00
Dmitry Stogov
a9b517c614
Check if generator object is created by GENERATOR_CREATE when throw exceptions from generator function.
2016-05-16 10:24:13 +03:00
Dmitry Stogov
be071702b3
Fixed bug #72188 (Nested try/finally blocks losing return value)
2016-05-13 14:38:43 +03:00
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.
2016-05-13 01:40:15 +03:00
Dmitry Stogov
7b94b958cc
Intern some known (and offten used) strings.
2016-05-12 13:47:22 +03:00
Dmitry Stogov
cca2c8ecc4
Reimplemented Bob's commit bac6fdb0c5
without insignificant renaming and white-space changes
2016-05-06 10:47:58 +03:00
Dmitry Stogov
c19cb70dac
Revert "Refactor zval cleanup into single function"
...
This reverts commit bac6fdb0c5
.
2016-05-06 10:47:58 +03:00
Bob Weinand
bac6fdb0c5
Refactor zval cleanup into single function
...
Also use zval_ptr_dtor_nogc() everywhere in Zend in favor of zval_dtor()
2016-05-05 23:31:57 +02:00
Dmitry Stogov
26adba38bc
Micro-optimization
2016-05-05 16:19:59 +03:00
Joe Watkins
c38310f25a
change fcall and statement handlers to accept frame
2016-05-04 09:28:13 +01:00
Nikita Popov
d06431bf1b
Merge branch 'PHP-7.0'
2016-05-03 18:15:29 +02:00
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.
2016-05-03 18:12:56 +02:00
Bob Weinand
7c174b6197
Fix use after free on AST expressions in constant declarations
2016-05-02 18:22:15 +02:00
Dmitry Stogov
3e9419dd28
Fixed compilation warnings
2016-04-29 14:03:33 +03:00
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.
2016-04-28 15:17:24 +03:00
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.
2016-04-28 04:13:34 +03:00
Dmitry Stogov
11e06e91ec
Merge branch 'PHP-7.0'
...
* PHP-7.0:
Fixed bug #72101 (crash on complex code)
2016-04-25 14:15:06 +03:00
Dmitry Stogov
92233dd736
Fixed bug #72101 (crash on complex code)
2016-04-25 14:11:46 +03:00
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
2016-04-20 08:40:44 -07:00
Xinchen Hui
f768a2ea3b
Merge branch 'fix-recv-opcode-handle-exception' of https://github.com/nikita2206/php-src
2016-04-20 08:40:11 -07:00
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
2016-04-20 11:56:07 +03:00
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).
2016-04-20 11:06:52 +03:00
Nikita Popov
d79288c6bb
Merge branch 'PHP-7.0'
2016-04-18 22:46:36 +02:00
Nikita Popov
73958ca62d
Fix SEND_USER as well
...
Missed copy&paste code here
2016-04-18 22:45:38 +02:00
Nikita Popov
5a538e1d82
Merge branch 'PHP-7.0'
2016-04-18 18:26:30 +02:00
Nikita Popov
a8792158bd
Fix SEND_ARRAY+PREFER_REF SHM corruption
...
Make the behavior consistent between namespaced and not and with
PHP 5.6.
2016-04-18 18:26:20 +02:00
Xinchen Hui
b5d01ab5a1
Merge branch 'PHP-7.0'
...
* PHP-7.0:
combine conditions
2016-04-18 19:14:30 +08:00
Xinchen Hui
aa9f8e695c
combine conditions
2016-04-18 19:13:54 +08:00
Nikita Popov
12f42346a8
Merge branch 'PHP-7.0'
2016-04-16 22:34:32 +02:00
Nikita Popov
d1a38743a5
Fix SEND_UNPACK array separation
...
Separating only immutable arrays is not enough.
2016-04-16 22:33:23 +02:00
Bob Weinand
3ed4a592aa
Merge branch 'PHP-7.0'
2016-04-16 20:38:10 +02:00
Bob Weinand
15d1d4f45b
Fixed bug #72038 (Function calls with values to a by-ref parameter don't always throw a notice)
2016-04-16 20:36:19 +02:00
Nikita Popov
dd6c6b1c48
Cleanup condition in SEND_VAR_NO_REF
...
Was overly convoluted after the IS_VAR_RET_REF removal.
2016-04-16 14:32:48 +02:00