Commit Graph

1878 Commits

Author SHA1 Message Date
Bob Weinand
c6a6b9746d Fix memleak in generators using symtable 2015-05-14 17:17:39 +02:00
Dmitry Stogov
fc75d07652 Fixed memory leak 2015-05-14 17:07:32 +03:00
Nikita Popov
c6b986b4e7 Merge branch 'PHP-5.6'
Conflicts:
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
2015-05-12 15:09:25 +02:00
Nikita Popov
e1cb22a23e Fix bug #69599 2015-05-12 15:08:12 +02:00
Aaron Piotrowski
071111ecfc Add support for $callable() sytnax with 'Class::method'
Using the $callable() syntax when used with a string of
the form 'Class::method' would error as an undefined
function, even if the string passed is_callable() or the
callable type-hint. The fix adds support for the $callable()
syntax for any string accepted by is_callable() or the
callable type-hint.

Fix bug 68475 test with deprecated notice

Reduced scope of unit test.

Added tests with arguments.
2015-05-12 13:33:28 +02:00
Julien Pauli
0b22cf04e3 Fixed tests 2015-05-12 11:18:35 +02:00
Stanislav Malyshev
ef8bb69a14 Ban rebinding closures to different internal classes 2015-05-12 10:54:59 +02:00
Nikita Popov
8f9f21e8d2 Fix static closure error in call_user_func opcode
I'm assuming this is the only error that is_callable() can generate
with retval=1.

This problem manifested after making closures in static methods
not implicitly static, but would also occur when binding any non-static
closure to a scope without a $this.
2015-05-08 15:17:15 +02:00
Nikita Popov
6ef8ae65a2 Allow self etc in eval / file scope
This fixes a regression from 16a9bc1ec2.
Together with the recent closure related changes this should allow
all usages of self etc, while previously (in PHP 5) some things like
self::class did not work.
2015-05-07 15:38:16 +02:00
Dmitry Stogov
2a9f9860d7 Fixed bug #69534 (Cycle leaks through declared properties on internal classes) 2015-05-06 21:33:49 +03:00
Nikita Popov
ab97606b8a Fix compiler assumptions about self/etc wrt closures
* Don't throw an error if self/parent/static are used in a closure
  (outside a class).
* Don't propagate self:: constants into closures
* Use runtime fetch for self::class in closures

Fixes bug #66811.
2015-05-06 18:13:19 +02:00
Nikita Popov
bc2ff4a299 Don't implicitly make closures in static methods static
It makes no sense that you can't write a closure using $this in a
static method, even though you can write one outside a class.

Now only closures that have been marked as static will be considered
to be static.

Fixes bug #65598.
2015-05-06 17:29:05 +02:00
Nikita Popov
d9c2959c27 Fix LSB handling for closures
Closures will now use the called_scope from their instantiation
site. If they are rebound either the class of $this is used or if
no $this is provided the bound scope is used.

With this change the scope for static closures can be changed back
to use EG(scope) rather than EX(called_scope), thus fixing
bug #69568.
2015-05-05 21:14:03 +02:00
Nikita Popov
16a9bc1ec2 Disallow self etc outside classes at compile-time
Also fix a bug with return types where "self" was rejected inside
a class, but not on a method.

Fallout: A couple of tests changed to more generic error messages.
2015-04-29 20:51:08 +02:00
Nikita Popov
8361893444 Fix implementing_class handling 2015-04-26 16:03:58 +02:00
krakjoe
49608e0608 Rebase Joe's anon classes implementation 2015-04-26 15:04:22 +02:00
Nikita Popov
75b4fa079f Fix bug #69532
Partial revert of ea2fc7f935.
2015-04-25 18:47:26 +02:00
Dmitry Stogov
fc80305e48 Cleanup comments and add related tests. 2015-04-23 17:52:05 +03:00
Nikita Popov
62aabf5d9f Fix "invalid opcode" error
Method call can happen on CONST, it'll just throw an error.

Not forbidding this at compile-time, so this can be overridden in
an extension.
2015-04-22 17:46:25 +02:00
Bob Weinand
4376373da3 Fix yield from with iterator (first element missing) 2015-04-21 19:42:23 +02:00
Nikita Popov
d2607a0110 Move more stuff to file_context
Introduce helper macro FC(x) for CG(file_context).x.

end_compilation() now handled by file_context_end().

While at it, dropped zval wrapper for ticcks.
2015-04-21 17:39:07 +02:00
Xinchen Hui
a090977419 Merge branch 'PHP-5.6'
Conflicts:
	Zend/zend_compile.c
2015-04-21 22:39:46 +08:00
Xinchen Hui
9d9ba493a2 Merge branch 'PHP-5.5' into PHP-5.6 2015-04-21 22:37:00 +08:00
Xinchen Hui
c667c26f61 Fixed Bug #69467 (Wrong checked for the interface by using Trait) 2015-04-21 22:36:32 +08:00
Xinchen Hui
8362aebdbf Fixed mem leak in assign_to_obj with reference 2015-04-21 21:04:20 +08:00
Dmitry Stogov
736b7cf419 Added test 2015-04-17 18:45:46 +03:00
Nikita Popov
5c214fc10d Add test for recursive __debugInfo()
This also got fixed by switching to object apply count.
2015-04-15 22:38:50 +02:00
Bob Weinand
3dcad2eea2 Fix bug #69458 2015-04-15 21:56:11 +02:00
Nikita Popov
acd61be985 Add "yield from" support to ast pretty printer 2015-04-14 19:15:40 +02:00
Dmitry Stogov
00445ba22d Fixed bug #69446 (GC leak relating to removal of nested data after dtors run) 2015-04-14 19:53:56 +03:00
Bob Weinand
f3e124d58d Merge branch 'coroutineDelegation' of https://github.com/bwoebi/php-src 2015-04-14 17:58:58 +02:00
Nikita Popov
a7059f1eac Merge branch 'PHP-5.6'
Conflicts:
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
2015-04-14 16:38:09 +02:00
Nikita Popov
ed7e6d4758 Merge branch 'PHP-5.5' into PHP-5.6 2015-04-14 16:36:36 +02:00
Nikita Popov
95650d0942 Fixed bug #69419 2015-04-14 16:35:23 +02:00
Dmitry Stogov
65baab7741 Merge branch 'PHP-5.6'
* PHP-5.6:
  Bug #63336 is not a bug
  fix test

Conflicts:
	Zend/tests/bug63336.phpt
2015-04-14 17:18:55 +03:00
Dmitry Stogov
e8fb5201ba Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Bug #63336 is not a bug
2015-04-14 17:16:57 +03:00
Dmitry Stogov
dc024f0bdc Bug #63336 is not a bug 2015-04-14 17:15:50 +03:00
Dmitry Stogov
9806a62545 GC improved to support inner-cycles. 2015-04-14 00:16:27 +03:00
Xinchen Hui
cefad04f0d Fixed bug #69427 (Segfault on magic method __call of private method in superclass) 2015-04-11 23:57:42 +08:00
Dmitry Stogov
5e8133f453 Squashed commit of the following:
commit 2399fc84c5
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Apr 10 12:38:08 2015 +0300

    Removed useless assignment

commit 796b633817
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Apr 10 12:35:31 2015 +0300

    Fixed execution with overriden zend_execute_ex()

commit 4a9fb125aa
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Apr 10 02:02:58 2015 +0300

    Fixed executor without global registers

commit d456c30e00
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Apr 10 01:30:35 2015 +0300

    Restored original behavior for tests/classes/__call_004.phpt

commit 479646d37f
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Apr 10 00:32:17 2015 +0300

    Fixed test. We don't keep stack frame for fake function anymore.

commit 9ae61e33e2
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Apr 10 00:30:09 2015 +0300

    Use ZEND_ACC_CALL_VIA_TRAMPOLINE instead of ZEND_ACC_CALL_VIA_HANDLER. Keep ZEND_ACC_CALL_VIA_HANDLER for compatibility.

commit 0a8403a2a0
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Apr 10 00:05:43 2015 +0300

    Rename PROXY_CALL into CALL_TRAMPLINE.
    Generalize API to allow reuse EG(trampline) for other purposes.

commit 4ea0525c10
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Apr 9 23:22:25 2015 +0300

    Reuse EG(proxy_call_op) for all proxy. Move proxy related functions from zend_objects_API to zend_object_handlers.

commit 529bf737ca
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Apr 9 21:42:23 2015 +0300

    Accurate use of proxy_call

commit 5d62837d5b
Merge: 83e749f 690843f
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Apr 9 19:40:00 2015 +0300

    Merge branch 'master' into opcodefy-call

    * master:
      Fixed GOTO executor
      Fixed typo
      Changed ArrayIterator implementation using zend_hash_iterator_... API. Allowed modification of itterated ArrayObject using the same behavior as proposed in `Fix "foreach" behavior`. Removed "Array was modified outside object and internal position is no longer valid" hack.

commit 83e749ff3b
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Apr 9 19:39:10 2015 +0300

    Improved ZEND_PROXY_CALL

commit 0c829afc53
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Apr 9 15:14:49 2015 +0300

    Reverted white-space changes

commit df65144488
Merge: 5fd2f97 97756d9
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Apr 9 14:37:07 2015 +0300

    Merge branch 'opcodefy-call' of github.com:laruence/php-src into opcodefy-call

    * 'opcodefy-call' of github.com:laruence/php-src:
      Ready for PR
      Fixed static call
      Improve performance by using prealloated op_arrray
      Respect called_scope
      Support internal magical __call/__callStatic
      opcode-fy magical __callStatic
      Opcode-fy magical __call

commit 97756d9190
Author: Xinchen Hui <laruence@gmail.com>
Date:   Thu Apr 9 19:07:59 2015 +0800

    Ready for PR

commit 74f9930846
Author: Xinchen Hui <laruence@gmail.com>
Date:   Thu Apr 9 19:03:00 2015 +0800

    Fixed static call

commit ec1d9eb592
Author: Xinchen Hui <laruence@gmail.com>
Date:   Thu Apr 9 18:23:17 2015 +0800

    Improve performance by using prealloated op_arrray

commit df7fbbf949
Author: Xinchen Hui <laruence@gmail.com>
Date:   Thu Apr 9 15:10:02 2015 +0800

    Respect called_scope

commit 769d1d59fb
Author: Xinchen Hui <laruence@gmail.com>
Date:   Thu Apr 9 12:19:23 2015 +0800

    Support internal magical __call/__callStatic

commit a980fedd5b
Author: Xinchen Hui <laruence@gmail.com>
Date:   Wed Apr 8 18:35:41 2015 +0800

    opcode-fy magical __callStatic

commit 73855f7d53
Author: Xinchen Hui <laruence@gmail.com>
Date:   Wed Apr 8 14:21:55 2015 +0800

    Opcode-fy magical __call
2015-04-10 23:01:00 +03:00
Xinchen Hui
c5903e79be Merge branch 'PHP-5.6'
Conflicts:
	Zend/zend_compile.c
2015-04-10 22:50:15 +08:00
Xinchen Hui
fa0608077b Merge branch 'PHP-5.5' into PHP-5.6 2015-04-10 22:48:36 +08:00
Xinchen Hui
429f411eb3 Fixed bug #69420 (Invalid read in zend_std_get_method) 2015-04-10 22:47:06 +08:00
Dmitry Stogov
e1d6b24da8 Addef test for bug #63734 (Garbage collector can free zvals that are still referenced) 2015-04-08 22:18:10 +03:00
Dmitry Stogov
91e84bb168 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #67314 (Segmentation fault in gc_remove_zval_from_buffer)

Conflicts:
	NEWS
	Zend/zend_execute_API.c
2015-04-08 21:26:45 +03:00
Dmitry Stogov
1f5f78d4aa Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed bug #67314 (Segmentation fault in gc_remove_zval_from_buffer)
  Fixed bug #67314 (Segmentation fault in gc_remove_zval_from_buffer)
2015-04-08 21:24:24 +03:00
Dmitry Stogov
174b9ee634 Fixed bug #67314 (Segmentation fault in gc_remove_zval_from_buffer) 2015-04-08 21:20:35 +03:00
Dmitry Stogov
4d9a1883aa Fixed bug #68887 (resources are not freed correctly) 2015-04-08 13:29:42 +03:00
Dmitry Stogov
55cdde3dd6 Fixed bug #69376 (Wrong ref counting). 2015-04-07 02:35:52 +03:00
Nikita Popov
f53e20e595 Merge branch 'PHP-5.6'
Conflicts:
	Zend/zend_compile.c
	Zend/zend_compile.h
	Zend/zend_language_parser.y
2015-04-06 22:09:22 +02:00