Commit Graph

10487 Commits

Author SHA1 Message Date
Nikita Popov
8542befa7b Remove ZEND_BRK/ZEND_CONT from VM
These are no longer used at run-time now, only temporarily during
compilation.
2015-05-23 10:51:33 +02:00
Nikita Popov
7a88d16cf3 Use ZEND_JMP instead of ZEND_BRK/ZEND_CONT
Emit necessary FREEs during compilation, convert to JMP during
pass_two (we may not know target opline beforehand).
2015-05-23 10:51:33 +02:00
Nikita Popov
9325ada725 Embed break/continue depth into opline
Previously a separate lval literal was used - this is probably a
leftover from the time where the break level could still be
specified dynamically.
2015-05-23 10:51:33 +02:00
Nikita Popov
3cbe3903fa Move loop var stack management into begin/end loop
Also set start to -1 in begin_loop already, so the info that a
loop variable is not used is already available at compile-time.
2015-05-23 10:51:33 +02:00
Nikita Popov
d0e265392f Drop FREE_ON_RETURN flag, check brk_cont->start instead
Start >= 0 already tells us whether or not the loop has a loop
variable, no need to add extra flags to opcodes.

Also added a test for a case where FREE_ON_RETURN is relevant,
we didn't seem to have any coverage for this.
2015-05-23 10:51:33 +02:00
Nikita Popov
1bee093eca Drop THIS_HASHVAL define
No longer used
2015-05-23 10:51:32 +02:00
Nikita Popov
3dba00bc31 Fix scope_is_known() for class constants
Here the active_op_array is still the surrounding file, but we
do know the scope.
2015-05-21 21:07:05 +02:00
Dmitry Stogov
58c484a0bb Fixed typo in ZEND_GCC_GLOBAL_REGS configure test (Albert) 2015-05-21 16:34:59 +03:00
Dmitry Stogov
ca64b41b99 Fixed zend_update_class_constants() to always resolve all constants.
Call zend_update_class_constants() only when necessary.
2015-05-21 04:13:10 +03:00
Dmitry Stogov
d6bcf2bf2e Micro optimization 2015-05-20 22:51:45 +03:00
Dmitry Stogov
e57aceed42 Fixed access to wrong opline (it may be the last ZEND_THROW in op_array->opcodes) 2015-05-20 22:49:37 +03:00
Nikita Popov
4e03ba4a6e Add GC support for ArrayObject
gc_024 test changes because the array that ArrayObject holds is
now counted separately from the ArrayObject.
2015-05-20 18:28:09 +02:00
Nikita Popov
4ea1d8a9c7 Show argument causing TypeException in trace
Not sure why that check was there, did I miss something?
2015-05-20 18:28:09 +02:00
Anatol Belski
890a28d4b9 Fixed bug #69511 Off-by-one bufferoverflow in php_sys_readlink 2015-05-19 15:44:55 +02:00
Dmitry Stogov
eebab8282b Improved hash table copying 2015-05-19 13:23:13 +03:00
Dmitry Stogov
6c8d49b6b0 Improved hash table copying 2015-05-19 13:22:58 +03:00
Remi Collet
a861019b7f Add consistency check in FAST_ZPP call
So ensure Z_PARAM_OPTIONAL is correctly call at the right place
Only in DEBUG build

Will raise 'Assertion `_i > _min_num_args || _optional==0' failed.'
or         'Assertion `_i <= _min_num_args || _optional==1' failed.'
Thus will allow to detect bad code early.
2015-05-19 10:54:10 +02:00
Dmitry Stogov
b3d053b036 Eliminated useless check in FAST_ZPP (this also fixed few wrong -Wmaybe-uninitialized compilation warnings) (Remi) 2015-05-19 11:06:01 +03:00
Dmitry Stogov
fb8891d9fc Reset heap usage statistics on request shutdown 2015-05-18 23:06:23 +03:00
Dmitry Stogov
cee88571d9 Fixed bug #69649 (segfault with --enable-dtrace) 2015-05-18 12:44:40 +03:00
Xinchen Hui
ab680e7f6e Added Test (the lineno should be fixed) 2015-05-18 11:16:57 +08:00
Xinchen Hui
a5f408c91b 1. Fixed bug #69640 Unhandled EngineExceptions thrown from userland do not produce any output
2. Fixed Segfault introduced by latest changes
2015-05-18 11:13:55 +08:00
Reeze Xia
d02deee677 Prefer isfinite to finite
Since finite() is not part of ANSI C

@see http://bytes.com/topic/c/answers/217761-finite-ansi-c
2015-05-18 10:44:42 +08:00
Nikita Popov
440481fb3e Display TypeExceptions like normal exceptions
We currently don't show the argument at which the error actually
occured in the trace - should probably either add it or don't
display args on incomplete frames altogether, otherwise this'll
probably be confusing.
2015-05-17 19:54:12 +02:00
Nikita Popov
3ae995f03c Tweak uncaught exception message display
This implements a reduced variant of #1226 with just the following
change:

-Fatal error: Uncaught exception 'EngineException' with message 'Call to private method foo::bar() from context ''' in %s:%d
+Fatal error: Uncaught EngineException: Call to private method foo::bar() from context '' in %s:%d

The '' wrapper around messages is very weird if the exception
message itself contains ''. Futhermore having the message wrapped
in '' doesn't work for the "and defined" suffix of
TypeExceptions.
2015-05-17 18:47:06 +02:00
Nikita Popov
0df2f470fa Don't write prop if read prop threw exception 2015-05-17 13:46:54 +02:00
Stanislav Malyshev
2660fb96aa Merge branch 'pull-request/1277'
* pull-request/1277:
  fix typos
2015-05-16 14:20:41 -07:00
Nikita Popov
c9f27ee422 Display EngineExceptions like ordinary exceptions
TypeException stays as-is for now because it uses messages that are
incompatible with the way exception messages are displayed.

closure_038.phpt and a few others now show that we're generating
too many exceptions for compound operations on undefined properties
-- this needs to be fixed in a followup.
2015-05-15 23:40:32 +02:00
Nikita Popov
230b435ed4 Fix exception leak in interactive console
Shows up there because it throws at E_WARNING severity level and
as such leak detection is not suppressed.
2015-05-15 22:43:13 +02:00
Dmitry Stogov
196b951728 Optimized === and !== with NULL, FALSE, TRUE. 2015-05-15 01:11:29 +03:00
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
Dmitry Stogov
0604df8a82 Fixed phpdbg build 2015-05-14 16:47:22 +03:00
Dmitry Stogov
8e9b4b5aa7 Refactored custom storage API. 2015-05-14 14:56:13 +03:00
olshevskiy87
8bdec7a248 fix typos
Signed-off-by: olshevskiy87 <olshevskiy87@bk.ru>
2015-05-13 22:28:35 +04:00
Dmitry Stogov
d72a94468e Merged FE_FETCH_R[W] with the following ASSIGN[_REF] when assigne to CV. 2015-05-13 12:55:42 +03:00
Stanislav Malyshev
5a1bef8eef Merge branch 'PHP-5.6'
* PHP-5.6:
  fix format
  update NEWS
  Add test for bug #69522
  Update tests
  Fix bug #69522 - do not allow int overflow
  Forgot test file
  Fix bug #69403 and other int overflows
  Fixed bug #69418 - more s->p fixes for filenames
  Fixed bug #69364 - use smart_str to assemble strings
  Fix bug #69453 - don't try to cut empty string
  Fix bug #69545 - avoid overflow when reading list

Conflicts:
	Zend/zend_alloc.c
	Zend/zend_operators.c
	ext/ftp/ftp.c
	ext/pcntl/pcntl.c
	ext/standard/basic_functions.c
	ext/standard/dir.c
	ext/standard/file.c
	ext/standard/pack.c
	ext/standard/string.c
	main/rfc1867.c
2015-05-12 15:00:24 -07:00
Stanislav Malyshev
587ddf6ddc Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix format
  update NEWS
  Add test for bug #69522
  Update tests
  Fix bug #69522 - do not allow int overflow
  Forgot test file
  Fix bug #69403 and other int overflows
  Fixed bug #69418 - more s->p fixes for filenames
  Fixed bug #69364 - use smart_str to assemble strings
  Fix bug #69453 - don't try to cut empty string
  Fix bug #69545 - avoid overflow when reading list

Conflicts:
	ext/standard/pack.c
2015-05-12 14:26:06 -07:00
Stanislav Malyshev
c08f9c2c78 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  fix format
  update NEWS
  Add test for bug #69522
  Update tests
  Fix bug #69522 - do not allow int overflow
  Forgot test file
  Fix bug #69403 and other int overflows
  Fixed bug #69418 - more s->p fixes for filenames
  Fixed bug #69364 - use smart_str to assemble strings
  Fix bug #69453 - don't try to cut empty string
  Fix bug #69545 - avoid overflow when reading list

Conflicts:
	ext/pcntl/pcntl.c
	ext/standard/basic_functions.c
	ext/standard/pack.c
	ext/standard/tests/dir/opendir_variation1-win32.phpt
2015-05-12 14:24:15 -07: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
Dmitry Stogov
0586702d32 Mark first call frames of stack segment with ZEND_CALL_ALLOCATED flag to simplify checks on stack deallocation. 2015-05-12 15:56:42 +03: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
Stanislav Malyshev
c591f022f8 Fix bug #69403 and other int overflows 2015-05-10 02:20:08 -07:00
Leigh
5f1b83e9bb Improve CSPRNG implementation 2015-05-09 21:57: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
Dmitry Stogov
3cc59b3fa0 Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  Add some NEWS entries
  Allow self etc in eval / file scope
  fix typo in php.ini
2015-05-07 17:27:29 +03:00
Dmitry Stogov
a989c0a1a9 Improved fast path locality 2015-05-07 17:26:35 +03:00