Commit graph

2866 commits

Author SHA1 Message Date
Nikita Popov
e433c23b96 Improve accuracy of opline lineno information
If compile_var() was used instead of compile_expr() we did not
update the current lineno.
2017-04-15 18:15:24 +02:00
Nikita Popov
7f5d47dfd1 Merge branch 'PHP-7.1' 2017-04-15 01:40:59 +02:00
David Matejka
2135b057ec Fixed bug #74444: multiple catch freezes in some cases
zend_emit_jump() may reallocate, so reload the opline.
2017-04-15 01:38:37 +02:00
Sammy Kaye Powers
e92896f735 Remove spurious CG(context).in_finally dingleberry 2017-04-10 22:58:44 +02:00
Nikita Popov
ad8652818a Implement jumptable optimization 2017-04-10 22:23:14 +02:00
Nikita Popov
16861838a5 Merge branch 'PHP-7.1' 2017-03-23 22:50:21 +01:00
Nikita Popov
e3e3547627 Merge branch 'PHP-7.0' into PHP-7.1 2017-03-23 22:49:51 +01:00
Nikita Popov
f5951cc81b Fix lineno for AST_ZVAL nodes 2017-03-23 22:48:41 +01:00
Nikita Popov
fec708f518 Simplify increment_lineno handling 2017-03-22 22:33:05 +01:00
Anatol Belski
c698299550 Interned strings unification for TS/NTS
Hereby, interned strings are supported in thread safe PHP. The patch
implements two types of interned strings

- interning per process, strings are not freed till process end
- interning per request, strings are freed at request end

There is no runtime interning.

With Opcache, all the permanent iterned strings are copied into SHM on
startup, additional copying into SHM might happen on demand.
2017-03-04 10:39:13 +01:00
Sara Golemon
5b52a44860 Merge branch 'PHP-7.1'
* PHP-7.1:
  Fix potential crash when setting invalid declare value
2017-02-28 17:18:08 -08:00
Sara Golemon
c5727a30cf Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix potential crash when setting invalid declare value
2017-02-28 17:17:41 -08:00
Sara Golemon
868930e079 Fix potential crash when setting invalid declare value
Using a non-literal expression in a declare value can cause the
compiler to crash trying to turn that AST node into a usable zval.

There was an existing test for such values using 'encoding',
but that didn't crash because it's handled by the lexer
rather than being compiled.

Trying to use a non-literal with ticks reproduces the crash.
2017-02-28 17:08:23 -08:00
Nikita Popov
7a73c5f6bb Deprecate (unset)
Pecularily, there wasn't a single test for the (unset) cast...
2017-02-03 18:52:57 +01:00
Nikita Popov
162aa1a5fc Deprecate __autoload() 2017-02-03 18:52:57 +01:00
Dmitry Stogov
141d1ba980 Introduced "zend_type" - an abstraction for type-hinting representation. 2017-01-13 11:37:46 +03:00
Sammy Kaye Powers
dac6c639bb Update copyright headers to 2017 2017-01-04 11:23:42 -06:00
Sammy Kaye Powers
478f119ab9 Update copyright headers to 2017 2017-01-04 11:14:55 -06:00
Sammy Kaye Powers
9e29f841ce Update copyright headers to 2017 2017-01-02 09:30:12 -06:00
Nikita Popov
3df43437fe Merge branch 'PHP-7.1' 2016-12-21 22:12:17 +01:00
Nikita Popov
ed0602fe31 Fix string extension in negate_num_string
Forgot to actually assign the reallocated string...
2016-12-21 22:11:17 +01:00
Xinchen Hui
b6553d422d Merge branch 'PHP-7.1'
* PHP-7.1:
  Revert "Reorder the oplines" (Break Zend/tests/return_types/bug71092.phpt)
2016-12-21 14:27:13 +08:00
Xinchen Hui
82988d3e41 Revert "Reorder the oplines" (Break Zend/tests/return_types/bug71092.phpt)
This reverts commit a12f43ee2c.
2016-12-21 14:24:14 +08:00
Xinchen Hui
adf0256c4a Merge branch 'PHP-7.1'
* PHP-7.1:
  Reorder the oplines
2016-12-17 20:09:49 +08:00
Xinchen Hui
a12f43ee2c Reorder the oplines
1. we should only do the return type checking when it is really about to
return
2. for 029.php, actually, the exception threw should be discard while it
jmp into finally(it could be observed by change the return to return an array)
3. after this fix, the test 029.phpt behavior consistently with 7.0
4. good for optimizer too
2016-12-17 20:06:18 +08:00
Nikita Popov
fe98ff94bb Merge branch 'PHP-7.1' 2016-12-11 13:34:28 +01:00
Nikita Popov
2c70581338 Fix T_NUM_STRING negation
T_NUM_STRING follows the rules of symtable numeric string
conversion. If the offset isn't an integer under those rules, it
is treated as a string. This should apply to negated T_NUM_STRINGs
as well.
2016-12-11 13:33:25 +01:00
Xinchen Hui
1113d589dc Merge branch 'PHP-7.1'
* PHP-7.1:
  Update NEWS
  Fixed bug #73663 ("Invalid opcode 65/16/8" occurs with a variable created with list())
2016-12-06 17:33:27 +08:00
Xinchen Hui
d7a759916d Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #73663 ("Invalid opcode 65/16/8" occurs with a variable created with list())
2016-12-06 17:32:48 +08:00
Xinchen Hui
358bd77b23 Fixed bug #73663 ("Invalid opcode 65/16/8" occurs with a variable created with list()) 2016-12-06 17:32:32 +08:00
Dmitry Stogov
9c1920d9e8 Revert "Fix memory leaks with FE_RESET upon empty iterator"
This reverts commit 00e516e575.
2016-12-02 11:58:36 +03:00
Bob Weinand
00e516e575 Fix memory leaks with FE_RESET upon empty iterator
Solved by manually freeing and jumping to the opcode *after* FE_FREE
2016-11-30 17:44:34 +01:00
Xinchen Hui
fd8797298b Merge branch 'PHP-7.1'
* PHP-7.1:
  Update NEWS
  Fixed bug #73585 (Logging of "Internal Zend error - Missing class information" missing class name)
2016-11-24 12:05:07 +08:00
Xinchen Hui
c1c91c95a6 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #73585 (Logging of "Internal Zend error - Missing class information" missing class name)
2016-11-24 12:03:44 +08:00
Xinchen Hui
e19d263d81 Fixed bug #73585 (Logging of "Internal Zend error - Missing class information" missing class name)
Actually, I doubt how thing bug could be triggered
2016-11-24 12:02:02 +08:00
Kalle Sommer Nielsen
2104bea5d7 Remove Netware support
If this does not break the Unix system somehow, I'll be amazed. This should get most of it out, apologies for any errors this may cause on non-Windows ends which I cannot test atm.
2016-11-12 11:20:01 +01:00
Dmitry Stogov
c71ab7260a Merge branch 'PHP-7.1'
* PHP-7.1:
  Intriduced ZEND_ACC_INHERITED class flag. It's going to be helpful for static optimisations, when "parent" is not known yet.
2016-11-01 22:58:59 +03:00
Dmitry Stogov
bdc1ba3e3a Intriduced ZEND_ACC_INHERITED class flag.
It's going to be helpful for static optimisations, when "parent" is not known yet.
2016-11-01 22:56:25 +03:00
Nikita Popov
f8a6df4706 Merge branch 'PHP-7.0' into PHP-7.1 2016-10-08 17:00:56 +02:00
Nikita Popov
2a75f5026a Fix bug #66773, #66862
This a partial backport of 8754b19. It
a) fixes the class/function/constant import table confusion in the
   namespaced case, and
b) restricts conflict checks to a single file based on a filename
   pointer comparison.

It does not fix the issues with filename reuse (e.g. due to eval)
and late-bound classes. This part of the change requires globals
changes.
2016-10-08 17:00:27 +02:00
Nikita Popov
8754b191f7 Fix "already in use" check inconsistencies/bugs
This fixes the following issues:
 * "use function" and "use const" inside namespaced code were checking
   for conflicts against class imports. Now they always check against
   the correct symbol type.
 * Symbol conflicts are now always checked within a single file only.
   Previously class uses inside namespaced code were checked globally.
   This behavior is illegal because symbols from other files are not
   visible if opcache is used, resulting in behavioral discrepancies.
   Additionally this made the presence/absence of symbol errors dependent
   on autoloading order, which is volatile.
 * The "single file" restriction is now enforced by collecting defined
   symbols inside a separate hash table. Previously it was enforced
   (for the non-namespaced case) by comparing the filename of the
   symbol declaration. However this is inaccurate if the same filename
   is used multiple times, such as may happen if eval() is used.
 * Additionally the previous approach relies on symbols being registered
   at compile-time, which is not the case for late-bound classes, which
   makes the behavior dependent on class declaration order, as well as
   opcache (which may cause delayed early-binding).
 * Lastly, conflicts are now consistently checked for conditionally
   defined symbols. Previously only declaration-after-use conflicts were
   checked in this case. Now use-after-declaration conflicts are
   detected as well.
2016-10-07 00:12:55 +02:00
Nikita Popov
56a7646ab2 Merge branch 'PHP-7.0' into PHP-7.1 2016-09-28 23:22:48 +02:00
Nikita Popov
e520b9e127 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-28 23:22:11 +02:00
Nikita Popov
1f5412982c Handle resource keys in constexpr arrays 2016-09-28 23:11:02 +02:00
Nikita Popov
40b8105cca Fix the constant array case as well 2016-09-28 23:05:21 +02:00
Nikita Popov
19f1ff5ad0 Combine code for keyed/unkeyed list() 2016-09-28 21:43:48 +02:00
Nikita Popov
6f9e5684a1 Fix segfault when empty entry in keyed array assignment 2016-09-28 21:43:48 +02:00
Nikita Popov
bd893061d6 Use SEND_USER for CONST|TMP as well
Otherwise we're missing the "expected to be a reference, value
given" warning that appears for ordinary calls to call_user_func().

Also update an UPGRADING note with recent changes wrt
call_user_func().
2016-09-25 12:39:23 +02:00
Nikita Popov
30af80610e Compile intval() etc to casts 2016-09-09 15:45:46 +02:00
Nikita Popov
135f275836 Add ISSET_ISEMPTY_STATIC_PROP to smart branch list 2016-09-06 22:19:34 +02:00