Commit Graph

2134 Commits

Author SHA1 Message Date
Dmitry Stogov
f00d1c72b4 Added ZEND_GET_CLASS, ZEMD_GET_CALLED_CLASS, ZEND_GET_TYPE instructions, to implement corresponding builtin functions. 2017-05-25 18:41:28 +03:00
Dmitry Stogov
cd953269d3 Added ZEND_COUNT instruction, to implement corresponding builtin. 2017-05-25 12:52:34 +03:00
Dmitry Stogov
44ec732752 Fixed ZEND_IN_ARRAY related issues 2017-05-25 10:26:42 +03:00
Dmitry Stogov
7c7383067f Added ZEND_IN_ARRAY instruction, implementing optimized in_array() builtin function, through hash lookup in flipped array 2017-05-24 23:00:48 +03:00
Dmitry Stogov
8203a175b1 Remove unused opcode handlers 2017-05-18 13:18:08 +03:00
Anatol Belski
d5bc862470 avoid strlen in common case 2017-05-16 12:52:16 +02:00
Anatol Belski
de9124a2e7 Merge branch 'PHP-7.1'
* PHP-7.1:
  Fixed bug #74589 __DIR__ wrong for unicode character
  fixing run-tests.php for variables_order="GPCS"
2017-05-15 16:36:40 +02:00
Anatol Belski
ae3f975c5d Fixed bug #74589 __DIR__ wrong for unicode character 2017-05-15 16:35:22 +02:00
Xinchen Hui
8daef7e423 Merge branch 'PHP-7.1'
* PHP-7.1:
  Fixed another potential dangling pointer
2017-05-08 11:36:35 +08:00
Xinchen Hui
2d30bc96a1 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed another potential dangling pointer
2017-05-08 11:36:29 +08:00
Xinchen Hui
b966a8b5fa Fixed another potential dangling pointer 2017-05-08 11:36:07 +08:00
Xinchen Hui
1466925cb0 Merge branch 'PHP-7.1'
* PHP-7.1:
  Update NEWS
  Fixed bug #74546 (SIGILL in ZEND_FETCH_CLASS_CONSTANT_SPEC_CONST_CONST_HANDLER())
2017-05-08 11:33:01 +08:00
Xinchen Hui
2c070847e7 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #74546 (SIGILL in ZEND_FETCH_CLASS_CONSTANT_SPEC_CONST_CONST_HANDLER())
2017-05-08 11:32:27 +08:00
Xinchen Hui
87d56a3d07 Fixed bug #74546 (SIGILL in ZEND_FETCH_CLASS_CONSTANT_SPEC_CONST_CONST_HANDLER()) 2017-05-08 11:32:08 +08:00
Andrea Faulds
44156b3114 Drop ZEND_API from zend_assert_valid_class_name
This is a convenience function for internal use and shouldn't have been
exported.
2017-04-29 16:09:08 +01:00
Nikita Popov
b6a4aad820 Remove the ZEND_ACC_CLONE flag
This one is completely unused
2017-04-22 15:47:53 +02:00
Nikita Popov
28218b4acc Merge branch 'PHP-7.1' 2017-04-15 18:15:45 +02:00
Nikita Popov
2719b8e91c Merge branch 'PHP-7.0' into PHP-7.1 2017-04-15 18:15:33 +02:00
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