Commit Graph

1599 Commits

Author SHA1 Message Date
Nikita Popov
290d71de75 Drop unused RAISE_ABSTRACT_ERROR opcode
Abstract methods are being prevented from being called in DO_FCALL
etc.
2014-09-29 22:50:56 +02:00
Nikita Popov
ab288b01d5 CT substitute unqualified true/false/null in namespaces
Substituation now always happens on the resolved name and
unqualified usages of true/false/null in namespaced code are
substituted as well.
2014-09-29 21:18:12 +02:00
Nikita Popov
877eb02fd6 Update operand types for coalesce operator 2014-09-28 12:20:04 +02:00
Andrea Faulds
2d069f640e Merge branch 'coalesce_operator'
* coalesce_operator:
  Extended coalesce operator test case for ordering/short-circuiting
  Ensure not evaluated twice
  Added test
  Initial coalesce operator implementation
2014-09-28 00:07:04 +01:00
Nikita Popov
3e042e1f83 Move list() condition into assign_znode
The condition in compile_foreach was using ->attr instead of ->kind
and as such never passed. It only worked because assign_znode already
supported this case by indirecting via zend_compile_assign. Now it
implements it with a direct call.
2014-09-24 12:06:18 +02:00
Dmitry Stogov
58a41cf795 Make QM_ASSIGN, JMP_SET and CAST return IS_TMP_VAR. 2014-09-24 01:57:40 +04:00
Nikita Popov
4a221bd881 Drop unused result argument 2014-09-23 21:04:30 +02:00
Nikita Popov
67a5ca6697 Fix ct binding for cuf/cufa functions
It was checking against the wrong AST kind, so the binding was
never actually done.
2014-09-23 21:02:32 +02:00
Nikita Popov
9070eb38e9 Fix detection of write to built-in function for references 2014-09-23 20:42:22 +02:00
Nikita Popov
231dcc94e8 Test use of string names with \ prefix
And drop piece of dead code
2014-09-23 20:36:00 +02:00
Nikita Popov
182ddfeaf2 Add zend_add_literal_string
And simplify additional of special literals based on it.
2014-09-23 20:21:28 +02:00
Nikita Popov
4571271de1 Drop dead code 2014-09-23 19:32:02 +02:00
Dmitry Stogov
06103d65b1 Use zval_ptr_dtor_nogc() to free IS_TMP_VAR operands.
Removed ZEND_SWITCH_FREE opcode (ZEND_FREE used instead).
2014-09-23 17:21:29 +04:00
Nikita Popov
75533c9b23 Test a few more error conditions in the compiler 2014-09-23 00:57:00 +02:00
Nikita Popov
51119054ff Test error conditions for ct class const refs
And fix a bug found while doing so...
2014-09-23 00:40:17 +02:00
Nikita Popov
f30f28ec47 Fix list() destructuring to special variables 2014-09-22 18:34:40 +02:00
Nikita Popov
7d4c81d8d9 Fix two memory errors by interning earlier 2014-09-21 23:56:09 +02:00
Nikita Popov
6219a4e844 Merge branch 'PHP-5.6'
Conflicts:
	Zend/zend_compile.c
2014-09-20 21:58:06 +02:00
Nikita Popov
308c0a727e Merge branch 'PHP-5.5' into PHP-5.6 2014-09-20 21:47:59 +02:00
Nikita Popov
5e977e69e1 Fixed bug #67633 2014-09-20 21:46:25 +02:00
Nikita Popov
98891ee118 Simplify foreach flags
* FE_RESET_VARIABLE and FE_RESET_REFERENCE were always set
   together.
 * In some places the code checked FE_FETCH_BYREF instead of
   FE_RESET_REFERENCE and relied on them having the same value.
 * Now the FE_RESET_* flags are dropped and everything uses
   FE_FETCH_BYREF
2014-09-20 12:56:05 +02:00
Xinchen Hui
95836a3504 Avoid strlen usage 2014-09-20 15:27:36 +08:00
Nikita Popov
c7446bbd39 Remove superfluous Z_REFCOUNTED_P check
The string is never interned and IS_CONSTANT_EX is always refcounted.
2014-09-19 23:39:06 +02:00
Nikita Popov
c343ca4efb Split inheritance into separate file
This moves handling of inheritance and interface implementation
from zend_compile.c into a separate zend_inheritance.c file, as
this is not really related to compilation.
2014-09-19 19:54:37 +02:00
Dmitry Stogov
bccc653185 Avoid double IS_INTERNED() check 2014-09-19 17:32:50 +04:00
Dmitry Stogov
35f8467687 Reverted incorrect chunk 2014-09-19 17:05:03 +04:00
Dmitry Stogov
3bc8a958c5 Fixed useless or duplicated IS_INTERNED() checks 2014-09-19 15:41:01 +04:00
Dmitry Stogov
551ee4165b Use runtime-cache to avoid hash lookups in BIND_GLOBAL instruction 2014-09-17 00:52:45 +04:00
Nikita Popov
69e7c9d89c Initial coalesce operator implementation 2014-09-16 19:14:46 +01:00
krakjoe
6967f78cc9 Merge branch 'pull-request/808' 2014-09-16 15:40:31 +01:00
Nikita Popov
079409bbc2 Switch (un)mangle property name to size_t and zend_string
Also use the _ex variants where possible.
2014-09-16 00:31:27 +02:00
Nikita Popov
ee75848b78 Drop superfluous opline for non-cv variables 2014-09-13 22:31:27 +02:00
Nikita Popov
88e07324d9 Drop dead assignments 2014-09-13 22:31:21 +02:00
Dmitry Stogov
82096dc151 Removed ZEND_QM_ASSIGN_VAR and ZEND_JMP_SET_VAR opcodes (in PHPNG they did exacly the same as ZEND_QM_ASSIGN and ZEND_JMP_SET) 2014-09-11 12:29:54 +04:00
Levi Morrison
b476eca826 Error on multiple default blocks in a switch
Part of RFC: https://wiki.php.net/rfc/switch.default.multiple
2014-09-05 16:07:07 -06:00
Nikita Popov
9e75353184 Use zval_ptr_dtor_nogc to destroy literals
Also move the definition of zval_ptr_dtor_nogc to zend_variables.h
(from zend_execute.h/.c) as it's used in a few places.
2014-09-03 15:18:06 +02:00
Dmitry Stogov
c52511c307 Disabled usage of built-in functions in write context (e.g. strlen($s)[] = ...) 2014-09-03 16:30:48 +04:00
Dmitry Stogov
9a958a086d Simplify BEGIN_SILENCE/END_SILENCE to not modify ini entry value back and force 2014-09-03 15:17:50 +04:00
Nikita Popov
c59292570c Merge branch 'PHP-5.6'
Conflicts:
	Zend/zend_compile.c
2014-08-30 20:45:10 +02:00
Nikita Popov
d7368c2531 Fix bug #67938: Segfault when extending interface method with variadic
We only want to check extra optional args if the proto function is
variadic, not when we're adding extra variadic args.
2014-08-30 20:43:34 +02:00
Nikita Popov
b73bea9cc8 Combine foreach copy / switch cond stacks
Now one common stack to handle both, which stores znodes instead of
full oplines (foreach copy stack) or switch entries (switch cond
stack).

Also removed EG(start_op) while at it.
2014-08-29 21:53:09 +02:00
Nikita Popov
545fd5168e Don't distinguish between ast/list in parser
This removes the need to use $<ast>{n} or $<list>$ casts in the
reduction actions.

Keeping the distinction in the parser doesn't really give us any
benefit and only makes changing the grammar harder.
2014-08-29 21:02:10 +02:00
Xinchen Hui
0763d6b98d use zend_string_equals_ci 2014-08-29 13:19:14 +08:00
Xinchen Hui
49bd049b7e Keep folder mark style in this file 2014-08-29 13:05:58 +08:00
Johannes Schlüter
6592706340 Fix comparison in case of constant NULL as default value
Fixes "Fatal error: Default value for parameters with a class type hint
can only be NULL in ext/phar/phar.php on line 1120" whie creating phar.phar
2014-08-29 01:34:46 +02:00
Nikita Popov
ae7e663330 Fix bug #67922 2014-08-29 00:18:38 +02:00
Andrea Faulds
389d285973 Special-case aliases, add warning comments to implementations 2014-08-29 00:10:52 +02:00
Anatol Belski
d3bfbc079f remove duplicate condition already present a line upper 2014-08-28 17:03:39 +02:00
Dmitry Stogov
f2b0370193 Use 'const' qualifier for pointrs to code used at run-time (the code must not be changed) 2014-08-28 02:44:06 +04:00
Dmitry Stogov
ee552b628c Reorder fields for better nenory consumtion and data locality on 64-bit systems 2014-08-27 22:45:27 +04:00