Commit Graph

9651 Commits

Author SHA1 Message Date
Nikita Popov
e7623f470f Fix bug #68133 and bug #68135 2014-10-03 21:06:26 +02:00
Anatol Belski
647ebe6bf2 remove misprint parentheses 2014-10-03 19:23:33 +02:00
Dmitry Stogov
bd9a234645 Replaced EG(This) and EX(object) with EX(This).
Internal functions now recieves zend_execute_data as the first argument.
2014-10-03 19:32:46 +04:00
Xinchen Hui
5e39d0c19c And this one... 2014-10-03 19:07:02 +08:00
Xinchen Hui
aa5f937958 It should be in extern c 2014-10-03 18:35:57 +08:00
Xinchen Hui
f54f5368e4 Merge branch 'master' of https://git.php.net/repository/php-src 2014-10-03 18:35:18 +08:00
Xinchen Hui
54bad8bf57 Remove useless condition 2014-10-03 18:35:05 +08:00
Dmitry Stogov
5c63a4f72b Micro optimization for the most frequency case 2014-10-03 12:18:15 +04:00
Nikita Popov
51c90e999f Fix ZTS build 2014-10-02 21:58:29 +02:00
Anatol Belski
c41fbcfb4c improved file size computation in stat()
On 32 bit it's still overwlowing, so nothing is changed there. But
the usage of LARGE_INTEGER instead of bit shifting is a better way
to go.
2014-10-02 12:18:02 +02:00
Dmitry Stogov
ccb24caa6d Fixed incorrect compilation 2014-10-02 13:37:44 +04:00
Dmitry Stogov
c4419e7a5b Expose zend_throw_exception_internal() 2014-10-01 16:37:21 +04:00
Dmitry Stogov
8857af8494 Use inline finction for OBJ_RELEASE() macro 2014-10-01 16:35:56 +04:00
Dmitry Stogov
9f7564b12b Removed zend_execute_data->prev_nested_call. Reuse prev_execute_data instead. 2014-10-01 10:46:13 +04:00
Dmitry Stogov
63dc9bbc02 Micro optimization 2014-09-30 15:19:51 +04:00
Nikita Popov
67a11b61cd Drop unused INIT_STRING opcode
INIT_STRING has been implemented as an UNUSED op1 to ADD_* for
some time now.
2014-09-29 22:59:57 +02:00
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
142a01db92 Fix a couple compile warnings 2014-09-29 20:57:17 +02:00
Dmitry Stogov
e15be6c8cd Use more readable inline functions 2014-09-29 19:41:00 +04:00
Xinchen Hui
f248b17e07 Fixed segfault 2014-09-29 12:06:56 +08:00
Timm Friebe
e14b7f629b Fix segmentation fault in debug_backtrace() 2014-09-28 20:58:55 +02:00
Anatol Belski
4b3e198023 removed *.dsw and *.dsp files 2014-09-28 19:02:09 +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
vagrant
5c6ca24dc0 Merge branch 'master' into catchable-fatals/methods-on-non-objects 2014-09-27 17:49:54 +00:00
Timm Friebe
0a9e207a77 zend_uint -> uint32_t 2014-09-25 21:42:19 +02:00
Anatol Belski
c1e92d9fed fix C89 compat 2014-09-25 20:28:34 +02:00
Timm Friebe
e83580c1f0 Merge branch 'master' into catchable-fatals/methods-on-non-objects 2014-09-25 19:45:05 +02:00
krakjoe
eabad90acb fix indentation 2014-09-25 16:31:39 +01:00
krakjoe
abdc8c3061 fix zts build 2014-09-25 16:15:02 +01:00
Dmitry Stogov
1833ab0230 Use macro 2014-09-25 17:00:17 +04:00
Dmitry Stogov
8b034ec69a Optimized (PRE|POST)_(INC|DEC) handlers. Moved proxy object handling into helper function. 2014-09-25 13:42:46 +04:00
Dmitry Stogov
6a09bdff6a Fixed C++ incompatibility 2014-09-24 20:31:22 +04:00
Dmitry Stogov
8ea2409e44 Fixed immutable arrays support 2014-09-24 15:39:54 +04:00
Nikita Popov
c45924b954 Remove dead code 2014-09-24 12:06:19 +02:00
Nikita Popov
1664e70ade Test use($this) being an error 2014-09-24 12:06:19 +02: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
73275a55f5 Avoid double checks 2014-09-24 12:20:46 +04:00
Dmitry Stogov
58a41cf795 Make QM_ASSIGN, JMP_SET and CAST return IS_TMP_VAR. 2014-09-24 01:57:40 +04:00
Dmitry Stogov
e8612b72ee Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  Drop unused result argument
  Fix ct binding for cuf/cufa functions
  Fix detection of write to built-in function for references
  Test use of string names with \ prefix
  Add zend_add_literal_string
  Drop dead code
2014-09-23 23:27:20 +04:00
Dmitry Stogov
d429e87d18 Removed useless helper 2014-09-23 23:26:39 +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
Dmitry Stogov
7cef08c5d1 Allocate copies of internal functions inherited in user classes at CG(arena), instead of permanent heap (malloc). 2014-09-23 12:35:42 +04:00
Xinchen Hui
e029042c36 It is not likely a string 2014-09-23 13:50:00 +08:00
Xinchen Hui
22fbfdfb8e Simply make_printable_zval
it's possible to remove make_printable_zval at all
but it will be a API break
2014-09-23 12:56:59 +08: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
c0c431b702 Test some additional cases for constexpr evaluation 2014-09-23 00:31:38 +02:00
Nikita Popov
982f02afe6 Remove zend_dynamic_array
This was introduced back in 2000 to test a new hashtable
implementation and is no longer used.
2014-09-22 23:45:13 +02:00
Nikita Popov
02bb637bb8 Remove static allocator
We didn't even compile this file anymore
2014-09-22 23:45:13 +02:00
Nikita Popov
f30f28ec47 Fix list() destructuring to special variables 2014-09-22 18:34:40 +02:00
Dmitry Stogov
0c0d43bd4e Avoid useless reference counting 2014-09-22 17:52:38 +04:00
Dmitry Stogov
826abe9d62 Specialization (only IS_VAR ad IS_CV operands may be references) 2014-09-22 16:17:35 +04:00
Dmitry Stogov
a057f060e8 Optimized unset() 2014-09-22 14:41:44 +04:00
Dmitry Stogov
9c0fa4106c Make error paths to be UNEXPECTED 2014-09-22 13:18:49 +04:00
Dmitry Stogov
2c8ac3a252 Replace IS_OP?_TMP_FREE() with more clear (OP?_TYPE == IS_TMP_VAR) 2014-09-22 12:47:10 +04:00
Anatol Belski
065edced71 added a comment 2014-09-22 09:41:56 +02:00
Anatol Belski
dc7a66a1c4 fix the REPARSE_DATA_BUFFER struct def 2014-09-22 09:41:54 +02:00
Nikita Popov
7d4c81d8d9 Fix two memory errors by interning earlier 2014-09-21 23:56:09 +02:00
Nikita Popov
a770d29df7 Add smart_str_append for appending zend_strings
Also replaces usages in Zend/ and ext/standard
2014-09-21 20:58:31 +02:00
Nikita Popov
2a7de9fdbb Rename smart_str_append to smart_str_append_smart_str
It's used only rarely and I'm running out of append names...
2014-09-21 20:49:39 +02:00
Nikita Popov
e0df8cc810 Use smart_str for exception stack traces 2014-09-21 20:49:39 +02:00
Nikita Popov
e26a688871 Use smart_str in get_function_declaration
Instead of custom smart string implementation
2014-09-21 20:49:39 +02:00
Nikita Popov
e33f3d3b7c Move smart_str implementation into Zend/
So we can use it there as well...

For now I've retained the zend_smart_str_public.h header, though
it would probably be better to just move that one struct into
zend_types.h.
2014-09-21 20:49:39 +02:00
Andrea Faulds
12b15e5ca4 Merge branch 'master' into integer_semantics 2014-09-21 00:29:48 +01: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
Anatol Belski
2fc1a1dce5 fixed copying of the struct as it's not being modified
in the subsequent function call
2014-09-20 20:58:00 +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
Nikita Popov
1027f0d978 Fix leak in foreach with by-ref iteration of ref array 2014-09-20 12:46:05 +02:00
Xinchen Hui
95836a3504 Avoid strlen usage 2014-09-20 15:27:36 +08:00
Xinchen Hui
7ecc7e6bc2 folder marks 2014-09-20 15:16:09 +08:00
Xinchen Hui
96ccf3ef98 Added missed mod str 2014-09-20 15:12:08 +08:00
Xinchen Hui
3e71f5ff7b Fixed built on OSX 2014-09-20 13:51:58 +08:00
Anatol Belski
ea6da30396 make the return value more logic
as if clz() were returning 32 on empty size
2014-09-20 02:14:35 +02:00
Anatol Belski
7b4e8c64e0 make use of intrinsics available with VS for bitset lookups 2014-09-20 01:43:06 +02:00
Nikita Popov
31e842472f Make number printing functions less generic
Now that zend_ulong is 64bit on 64bit platforms, it should be
sufficient to always use it, rather than supporting multiple
types.

API changes:
 * _zend_print_unsigned_to_buf and _zend_print_signed_to_buf
   no longer exist.
 * smart_str(ing)_print_long and smart_str(ing)_print_unsigned
   no longer exist.
 * Instead of all these, zend_print_ulong_to_buf and
   zend_print_long_to_buf should be used.
 * smart_str_append_generic_ex no longer exists.
 * smart_str(ing)_append_off_t(_ex) no longer exists, use
   smart_str(ing)_append_long(_ex) instead.
2014-09-19 23:39:07 +02: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
Johannes Schlüter
d0cb715373 s/PHP 5/PHP 7/ 2014-09-19 18:33:14 +02:00
Anatol Belski
d1131d4278 reverted some previous IS_ABSOLUTE_PATH related changes
It's fine with strlen usage now, only one call
2014-09-19 16:30:05 +02:00
Anatol Belski
149db936d4 expand IS_ABSOLUTE_PATH on Windows, so then strlen() isn't called twice 2014-09-19 16:30:03 +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
Anatol Belski
3ec7c28084 forgot to replace the strlen call 2014-09-19 13:14:16 +02:00
Anatol Belski
6bbebc60ea avoid multiple strlen calls for the same buffer 2014-09-19 12:39:17 +02:00
Anatol Belski
babcad063f fix length data types 2014-09-19 12:14:46 +02:00
Anatol Belski
c45f4f5461 generalized the case with secure memory zeroing 2014-09-19 01:46:14 +02:00
Dmitry Stogov
21514b0d9a Fix for Clang 2014-09-19 00:38:34 +04:00
Dmitry Stogov
db6306dd0e Split is_numeric_string_ex() into inline and non-inline parts 2014-09-18 22:19:51 +04:00
Anatol Belski
761e347b75 that's not char * but zend_string * 2014-09-18 17:14:57 +02:00
Anatol Belski
fb848ebd00 ups, this is not needed 2014-09-18 17:14:55 +02:00
Anatol Belski
e8b497ad8e fix CG(empty_string) init in ZTS 2014-09-18 17:14:54 +02:00
Dmitry Stogov
1e0e1b4a73 Split big _zend_handle_numeric_str() into small always inlined function that makes initial check and regular big function 2014-09-18 18:50:05 +04:00
Dmitry Stogov
e439349e58 Expose zend_safe_address() and use it in zend_arena_calloc() 2014-09-18 13:31:25 +04:00
Dmitry Stogov
025bc7e80a Clang attributes support 2014-09-18 11:50:00 +04:00
Dmitry Stogov
5185baab3e Changed "inline" into "zend_always_inline" 2014-09-18 04:59:01 +04:00
Dmitry Stogov
61d37e059f Moved some definitions from zend.h into more suitable header files 2014-09-18 04:58:04 +04:00
Dmitry Stogov
e646c6d5b5 Fixed compilation warnings 2014-09-18 04:02:43 +04:00
Andrea Faulds
545c296ef4 Fixed if/else if ordering 2014-09-17 20:41:20 +01:00
Andrea Faulds
7f51d73bb2 Merge branch 'master' into integer_semantics 2014-09-17 20:15:32 +01:00
Dmitry Stogov
e3b3e68127 Optimized enterance into functions 2014-09-17 16:17:58 +04:00
Dmitry Stogov
551ee4165b Use runtime-cache to avoid hash lookups in BIND_GLOBAL instruction 2014-09-17 00:52:45 +04:00
Dmitry Stogov
c2decc6afc optimized colision list traverse 2014-09-17 00:52:03 +04:00
Anatol Belski
65c401672e redo the fix with cast to size_t 2014-09-16 21:17:22 +02:00
Nikita Popov
69e7c9d89c Initial coalesce operator implementation 2014-09-16 19:14:46 +01:00
Nikita Popov
543ae3f029 Drop BC alias HASH_NON_EXISTANT 2014-09-16 18:29:00 +02:00
Nikita Popov
311a67a2ed Remove HASH_NEXT_INSERT flag
We already pass ht->nNextFreeElement and the rest is handled by
ZEND_HASH_ADD.
2014-09-16 18:29:00 +02:00
Nikita Popov
0bf55b65d4 Remove two more always-true conditions 2014-09-16 18:28:59 +02:00
krakjoe
6967f78cc9 Merge branch 'pull-request/808' 2014-09-16 15:40:31 +01:00
Andrea Faulds
db72160e5a Merge branch 'master' into integer_semantics
Conflicts:
	Zend/zend_operators.h
2014-09-16 13:45:06 +01:00
Anatol Belski
3329d54cd9 better error messages in ZMM on Windows 2014-09-16 12:27:25 +02:00
Dmitry Stogov
13be4a5a4b emalloc() must not return NULL 2014-09-16 13:53:26 +04:00
Dmitry Stogov
ca37c02520 code optimization 2014-09-16 13:52:50 +04:00
Andrea Faulds
be88d0e5d4 Use SIZEOF_ZEND_LONG instead of SIZEOF_LONG 2014-09-16 10:24:33 +01:00
Dmitry Stogov
f5517d16d6 ws 2014-09-16 11:56:56 +04:00
Anatol Belski
71cc3991bf cast the other way round, the sign check is already done before 2014-09-16 09:33:02 +02:00
Dmitry Stogov
d17487f827 We don't have to check for undefined CV if we fetch it for isset() operation 2014-09-16 09:15:47 +04: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
Dmitry Stogov
6991780793 Optimized FE_RESET and FE_FETCH 2014-09-16 01:34:27 +04:00
Nikita Popov
a7bfd006bd Remove always-true comparisons 2014-09-15 23:07:31 +02:00
Nikita Popov
ca43b99fc6 Update types in zend_hash
* String lengths are size_t
 * Indexes are uint32_t
 * Flags are uint32_t
 * Booleans are zend_bool
2014-09-15 23:07:31 +02:00
Anatol Belski
e0ff5238c5 fix negating an unsigned 2014-09-15 19:46:30 +02:00
Anatol Belski
383a0773ff fix signed/unsigned mismatch 2014-09-15 19:46:29 +02:00
Anatol Belski
e591c78d09 revamp serialization to work with size_t for Serializable 2014-09-15 19:46:28 +02:00
Anatol Belski
0799459e76 fix signed/unsigned mismatch 2014-09-15 19:46:26 +02:00
Anatol Belski
e940fc268a fix signed/unsigned mismatch 2014-09-15 19:46:25 +02:00
Anatol Belski
ea94210e8c fix most of signed/unsigned warnings in vm def 2014-09-15 19:46:24 +02:00
Anatol Belski
836fd73cce fix signed/unsigned mismatch 2014-09-15 12:58:45 +02:00
Anatol Belski
c8ed0d81e7 fix signed/unsigned mismatch 2014-09-15 12:58:44 +02:00
Anatol Belski
4e09d782ef fix unsigned negation 2014-09-15 12:58:43 +02:00
Anatol Belski
d3622c2445 fix signed/unsigned mismatch 2014-09-15 12:58:42 +02:00
Dmitry Stogov
d10bc5c005 Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  fix initializer struct
  fix signature
  fix type
  fix condition
2014-09-15 14:37:59 +04:00
Dmitry Stogov
f1bf5313a2 Replaced macro with better optimized inline function 2014-09-15 14:36:55 +04:00
Anatol Belski
f595ed4b8c fix initializer struct 2014-09-15 11:30:26 +02:00
Xinchen Hui
dfc99d93d5 Remove redundant codes 2014-09-15 16:52:33 +08:00
Xinchen Hui
ae41536c4d Add test script for the segfault in gc while run phpspec 2014-09-15 14:49:34 +08:00
Nikita Popov
eda5ba1f8f Fix use of stack variable outside its block 2014-09-14 16:18:08 +02:00
Nikita Popov
ebc6da5628 zend_get_property_info takes a zend_string* now 2014-09-14 16:18:08 +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
Nikita Popov
21a5253ea9 Make zend_llist_remove_tail a void function
The returned data is already dtored and freed at this point.
2014-09-13 22:07:51 +02:00
Nikita Popov
345b0f44c3 Use more accurate sizeof
This is allocating an array of zval*s, not zval**s.
2014-09-13 21:57:58 +02:00
Anatol Belski
f91a782973 reduce the struct size by 8 byte on 64 bit
this one looks like debug only, but still useful
2014-09-13 12:52:11 +02:00
Anatol Belski
993d475126 fix condition
A char array like val[1] would always be valid when checking like
!val. Probably better were to check for ->len, but actually ->val[0]
is fine as the actual zend_string should have been initalized
before.
2014-09-13 00:03:42 +02:00
Anatol Belski
8fc0f1a788 reduce size by 8 byte on 64 bit 2014-09-12 22:06:10 +02:00
Anatol Belski
c22458adc5 fix ZTS build 2014-09-12 21:38:39 +02:00
Anatol Belski
83244e5fec better align and reduce size by 8 byte on 64 bit 2014-09-12 21:35:25 +02:00
Anatol Belski
5d5a70205c reduce the struct size by 8 byte on 64 bit 2014-09-12 21:35:20 +02:00
Xinchen Hui
243ec132e6 Forget to commit this part... 2014-09-13 02:00:15 +08:00
Xinchen Hui
78ce2557f5 Finally!!! Fixed segfault in GC
this must not be the final fix, but let's stop the segfault first and
use this to indicate where the problem is.

reproduced by phpspec
2014-09-13 01:55:49 +08:00
Dmitry Stogov
8527657ca6 Fixed refcounting for references 2014-09-11 19:12:12 +04:00
Dmitry Stogov
b8c36e199e Simplify ASSIGN code 2014-09-11 17:00:06 +04:00
Nikita Popov
e2d4d700cf Fix yy_limit computation after encoding switch
The three assignments above this line are still broken - they assume
that byte offsets in one encoding directly map to byte offsets in
another encoding.

I'm fixing the length here because it is the one causing out-of-bounds
reads and is easy to fix. For the others we'd have to actually compute
new offsets.
2014-09-11 14:52:59 +02:00
Nikita Popov
f017843df3 Remove self-contradictory zend multibyte assertion
Code that explicitly exists to handle an incompatible internal
encoding should not assert that the internal encoding is compatible.
2014-09-11 14:52:59 +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
Dmitry Stogov
c07a0dbcb9 Don't miss warning messages 2014-09-10 13:02:01 +04:00
Tjerk Meesters
b192ff155d Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed #67985 - Incorrect last used array index copied to new array after unset

Conflicts:
	Zend/zend_variables.c
2014-09-09 19:32:09 +08:00
Tjerk Meesters
7e9daf60c1 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed #67985 - Incorrect last used array index copied to new array after unset
2014-09-09 18:03:10 +08:00
Tjerk Meesters
aca474fa14 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed #67985 - Incorrect last used array index copied to new array after unset
2014-09-09 18:00:49 +08:00
Tjerk Meesters
99f0760bfb Fixed #67985 - Incorrect last used array index copied to new array after unset
In master zend_array_dup() is used to do this properly; this is a workaround.
2014-09-09 17:58:45 +08:00
Xinchen Hui
b625661248 Remove unnecessary branch/temp variable 2014-09-09 11:52:25 +08:00
Dmitry Stogov
7edd562787 Don't anload zend extensions if ZEND_DONT_UNLOAD_MODULES environment variable is set 2014-09-09 00:50:44 +04:00
Anatol Belski
9ee4a40f27 made Visual Studio to understand that zend_error_noreturn() will not return
- windows only, on linux gcc would cause a warning that the function returns,
  as no noreturn functions are used
- ZEND_NORETURN works on windows as well now, using __declspec(noreturn),
  which is useful for the other cases
- one more function call will be needed, which is not critical for the
  error reporting
- the way is open to enable the same for gcc as soon as it's not causing a warning
2014-09-08 20:34:26 +02:00
Nikita Popov
af84d5737c Fix parser stack destruction with dummy ENCAPSED_AND_WHITESPACE
T_ENCAPSED_AND_WHITESPACE is now specified to always hold a value,
so give it a NULL value in the dummy cases.
2014-09-08 13:57:28 +02:00
Dmitry Stogov
e85545eca5 Removed IS_STR_OFFSET type and corresponding macros. Optimized string offset handling in ASSIGN_DIM opcode. 2014-09-08 15:46:45 +04:00
Dmitry Stogov
be835b2d70 Fixed comments and removed useless code. 2014-09-08 11:08:05 +04:00
Anatol Belski
cfa2b3bf63 fixed string index handling with references 2014-09-07 13:34:18 +02:00
Anatol Belski
acad6f4700 fix 64 bit string index usage 2014-09-07 00:55:36 +02:00
Nikita Popov
f4f9b54983 Revert "Move safe_address into zend_multiply.h"
This reverts commit 43b02e169c.

I'm getting symbol resolution issues for zend_error_noreturn in the
opcache.so, so reverting this for now.
2014-09-06 22:12:37 +02:00
Nikita Popov
43b02e169c Move safe_address into zend_multiply.h
This allows reuse in zend_arena_calloc.

Also renamed the function to zend_safe_address as it's no longer
private to the allocator.
2014-09-06 14:03:59 +02:00
Tjerk Meesters
47ac4612e9 Added test case to complement commit 29397f8 2014-09-06 18:57:03 +08:00
Nikita Popov
29397f8fd2 Fix $x .= $x
Also add a nice comment pointing out that concat runs on magic.
2014-09-06 12:26:41 +02: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
Dmitry Stogov
7d0416f401 Fixed overflow check 2014-09-05 16:13:06 +04:00
Nikita Popov
828fe35381 Fix string increment 2014-09-05 12:45:42 +02:00
Dmitry Stogov
9a420f0361 Fixed support for C++ 2014-09-05 14:18:39 +04:00
Nikita Popov
08ca9e6d11 Fix overflow check for string concatenation
Also do the overflow check for both branches, not just the realloc
one.

And clean up the code a bit - move common parts outside of the
realloc/alloc branches.
2014-09-05 11:58:32 +02:00
Nikita Popov
f915b44070 Remove old zend_string_to_double function 2014-09-05 11:20:06 +02:00
Dmitry Stogov
92164f6b7b Fixed compilation warnings 2014-09-04 14:06:22 +04:00
Nikita Popov
964e1174b4 Fix Z_UL 2014-09-03 16:52:56 +02:00
Dmitry Stogov
5c897aa7da Preallocate hash tables of required size 2014-09-03 18:21:36 +04:00
Nikita Popov
6cceb54c09 Fix a number of format issues 2014-09-03 15:57:28 +02:00
Nikita Popov
979058d4ff Disable format string checking by default
Instead of removing format attributes altogether, disable the checks
by default. This allows you to do a build with format string checks
and filter out the false positives (basically anything mentioning
%p).
2014-09-03 15:38:06 +02: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
Dmitry Stogov
b0f0211b1a Revert "Fixed memory leaks"
This reverts commit 0940e54ffc.
2014-09-03 02:38:04 +04:00
Dmitry Stogov
0940e54ffc Fixed memory leaks 2014-09-03 02:07:38 +04:00
Dmitry Stogov
f0ad7472b0 Avoid memory allocation/deallocation in BEGIN_SILENCE/END_SILENCE opcode handlers. 2014-09-02 22:13:24 +04:00
Anatol Belski
d7700588a9 use portable strtol 2014-09-02 15:56:15 +02:00
Dmitry Stogov
e321170c18 Fixed memory leaks 2014-09-02 14:11:22 +04:00
Dmitry Stogov
f789568707 Fixed destruction on error 2014-09-02 09:46:27 +04:00
Stanislav Malyshev
d5b0606a62 Reintroduce fix from pull #770 in a PHP 7 way 2014-09-01 15:41:27 -07:00
Stanislav Malyshev
a7666a6041 Fix ZTS build 2014-09-01 15:41:00 -07:00
Stanislav Malyshev
1ff1a0dde2 Revert "Merge branch 'PHP-5.6'"
This reverts commit aaf5689f4d, reversing
changes made to 481bf25b6a.
2014-09-01 14:35:04 -07:00
Stanislav Malyshev
aaf5689f4d Merge branch 'PHP-5.6'
* PHP-5.6:
  update NEWS
  Only destruct if EG(active) in zend_shutdown(). (bug #65463, #66036)
  Fix typo from commit 32314f6b6
  Fix destruction order in zend_shutdown (bug #65463, #66036)

Conflicts:
	Zend/zend_compile.h
	Zend/zend_execute_API.c
2014-09-01 12:22:41 -07:00
Stanislav Malyshev
57f82819e9 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  update NEWS
  Only destruct if EG(active) in zend_shutdown(). (bug #65463, #66036)
  Fix typo from commit 32314f6b6
  Fix destruction order in zend_shutdown (bug #65463, #66036)
2014-09-01 12:20:34 -07:00
Stanislav Malyshev
4b9fcc01d4 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  update NEWS
  Only destruct if EG(active) in zend_shutdown(). (bug #65463, #66036)
  Fix typo from commit 32314f6b6
  Fix destruction order in zend_shutdown (bug #65463, #66036)
2014-09-01 12:15:54 -07:00
Stanislav Malyshev
197095c29e Merge branch 'pull-request/770' into PHP-5.4
* pull-request/770:
  Only destruct if EG(active) in zend_shutdown(). (bug #65463, #66036)
  Fix typo from commit 32314f6b6
  Fix destruction order in zend_shutdown (bug #65463, #66036)
2014-09-01 12:11:42 -07:00
Dmitry Stogov
88d7ca44f6 Refactored INI subsystem to use zend_string* instead of char* 2014-09-01 20:57:33 +04:00
Tjerk Meesters
8064b1f4f7 Fixed 'long' -> 'zend_long' for call to 'is_numeric_string_ex()' 2014-09-01 22:49:12 +08:00
Tjerk Meesters
5d5a7b1f7f Merge branch 'PHP-5.6'
* PHP-5.6:
  Updated UPGRADING for #38409
  Updated NEWS for #38409
  Added test case
  Making ini parser typed - Added ZEND_INI_SCANNER_TYPED mode for parse_ini_string() and parse_ini_file() - Added NULL_NULL token to separate it from BOOL_FALSE and BOOL_TRUE - Added zend_ini_copy_typed_value() function for zval initialisation - Updated RETURN_TOKEN() to observe scanner_mode

Conflicts:
	Zend/zend_ini_parser.y
	Zend/zend_ini_scanner.c
2014-09-01 22:43:17 +08:00
Tjerk Meesters
5270ee1aef Making ini parser typed
- Added ZEND_INI_SCANNER_TYPED mode for parse_ini_string() and parse_ini_file()
- Added NULL_NULL token to separate it from BOOL_FALSE and BOOL_TRUE
- Added zend_ini_copy_typed_value() function for zval initialisation
- Updated RETURN_TOKEN() to observe scanner_mode
2014-09-01 22:04:06 +08:00
Anatol Belski
d4a05d1990 fix C89 compat 2014-08-31 21:58:05 +02:00
Nuno Lopes
51ce4bd87c add a few more patterns to .gitignore 2014-08-31 15:19:14 +01: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
Nikita Popov
25d57aace3 Introduce optional_expr 2014-08-29 18:51:58 +02:00
Nikita Popov
c6a5c3c6c5 Remove parenthesis_expr
This was necessary previously to handle yields, now it only clutters
up the grammar.
2014-08-29 18:46:46 +02:00
Nikita Popov
7722d2c584 Simplify argument production 2014-08-29 18:42:05 +02:00
Anatol Belski
d3fb1859f0 restore the old behavior for the assignment to string offset 2014-08-29 17:28:53 +02:00
Anatol Belski
451856420c data type fixes 2014-08-29 12:53:37 +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
898e1570a2 fixed trim() and strtok() to work with big strings 2014-08-28 21:59:00 +02:00
Anatol Belski
d6faac2cb2 make array/object APIs accept large strings as values of elements/props 2014-08-28 19:17:47 +02:00
Anatol Belski
d6930c9a87 replace llabs with imaxabs
both are gcc built-in but imaxabs doesn't require C99 compat (see man)
2014-08-28 18:58:24 +02:00
Anatol Belski
7f6d2b124b fix format 2014-08-28 17:03:40 +02:00
Anatol Belski
d3bfbc079f remove duplicate condition already present a line upper 2014-08-28 17:03:39 +02:00
Anatol Belski
8e4e765f7e better alignment, won 8 byte on 64 bit with default alignment 2014-08-28 12:12:24 +02:00
Anatol Belski
6890830ec0 fix number format 2014-08-28 12:07:39 +02:00
Anatol Belski
bf84517b64 fix dir separator 2014-08-28 11:56:27 +02:00
Xinchen Hui
6a7c60540b Merge branch 'master' of https://git.php.net/repository/php-src 2014-08-28 17:37:00 +08:00
Dmitry Stogov
b4f2588513 Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  fix pg_last_notice()
  Changed 'unsigned size_t' to 'size_t'
  Fixed segfaults after change size_t of "s"
  Fixed zend extensions multipy-times loadable
  Revert "Fixed incompatible pointer type"
  fix hash_pbkdf2()
2014-08-28 13:13:52 +04:00
Xinchen Hui
ff0045ea67 Fixed typo 2014-08-28 17:05:21 +08:00
Xinchen Hui
671caa6255 Fixed zend extensions multipy-times loadable 2014-08-28 15:13:57 +08:00
Dmitry Stogov
319ce224d2 LOAD_REGS() is not used anymore 2014-08-28 10:55:16 +04:00
Tjerk Meesters
6954bd4ff6 Merged PR 785 - Fixed ZEND_INT_(MIN/MAX) constants in signed multiplication
ZEND_INT_MIN and ZEND_INT_MAX should be ZEND_LONG_MIN and ZEND_LONG_MAX respectively.
2014-08-28 08:33:18 +08: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
Andrea Faulds
e622e28972 Fixed constants in Zend/zend_multiply.h
Conflicts:
	Zend/zend_multiply.h
2014-08-27 19:54:02 +01:00
Anatol Belski
3234480827 first show to make 's' work with size_t 2014-08-27 20:49:31 +02: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
Dmitry Stogov
b1f53ca415 Use efree_size() instead of efree() where posible 2014-08-27 20:49:56 +04:00
Dmitry Stogov
8ec40397cd Cleanup IS_VAR handling 2014-08-27 19:10:29 +04:00
Tjerk Meesters
a79b933384 Fixed corruption of execute_data when ZEND_STRLEN has to cast an object to string. 2014-08-27 23:00:11 +08:00
Xinchen Hui
24ab7b53f2 It should be int 2014-08-27 12:14:57 +08:00
Xinchen Hui
8b87534468 Fixed folder mark 2014-08-27 12:13:17 +08:00
Ferenc Kovacs
86b2d7b523 remove the -dev suffix from the Zend version 2014-08-27 03:52:46 +02:00
Andrea Faulds
7379abba8f Fixed Closure::apply() for int64 2014-08-27 02:05:50 +01:00
Andrea Faulds
17c5e82816 Merge branch 'master' into Closure_apply 2014-08-27 01:53:26 +01:00
Nikita Popov
1984a49b71 Fix zend_highlight functionality I broke
Magic consts are not supposed to be highlighted as keywords.
2014-08-27 01:26:57 +02:00
Nikita Popov
f3b629c982 Move =&new deprecation message into compiler 2014-08-26 23:36:53 +02:00
Nikita Popov
f8abb9a462 Handle remaining magic constants in parser as well
As far as I can see the !filename case cannot occur, so I dropped
it.
2014-08-26 23:36:52 +02:00
Dmitry Stogov
219794e1cd Split and optimize loop 2014-08-27 00:52:50 +04:00
Nikita Popov
49b4e12e54 Add backup_doc_comment production
Bison can't detect the type of a mid-rule action, even if it accesses
$<str>$, so need to create a separate rule for this.
2014-08-26 22:31:58 +02:00
Nikita Popov
b7876e734a eval() with parse error uses clean shutdown now 2014-08-26 22:31:58 +02:00
Nikita Popov
6c687e0d9b Add type annotations to parser
Conflicts:

	Zend/zend_language_parser.y
2014-08-26 22:31:58 +02:00
Nikita Popov
c71ab607ff Don't alloc empty jmp opnum list for single-branch if 2014-08-26 22:31:57 +02:00
Anatol Belski
cd8bbfa149 fixed bitset computing on win64 build 2014-08-26 20:43:33 +02:00
Dmitry Stogov
cb37fe1aae Fixed zero-size allocation in debug build 2014-08-26 21:32:20 +04:00
Anatol Belski
d285e346da temporary fix for win64 2014-08-26 16:27:14 +02:00
Dmitry Stogov
661f90d4d1 Replaced Zend Memory Manager 2014-08-26 16:21:58 +04:00
Anatol Belski
b63ab83256 several signature and data type fixes 2014-08-26 13:20:21 +02:00
Dmitry Stogov
d17790b35e Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  fixed several long vs zend_long casts
2014-08-26 14:23:01 +04:00
Dmitry Stogov
055b632e7d Fixed return operand type (Use IS_TMP_VAR instead of IS_VAR in the same way as it was before AST patch) 2014-08-26 14:22:03 +04:00
Anatol Belski
202e8db1dc fixed several long vs zend_long casts 2014-08-26 11:26:53 +02:00
Dmitry Stogov
7cbbb37127 Fixed compile-time constants substitution 2014-08-26 13:06:19 +04:00
Anatol Belski
5d062b6160 renamed macro 2014-08-26 09:55:17 +02:00
Anatol Belski
baee5922c3 edit comment 2014-08-26 09:52:22 +02:00
Anatol Belski
5d030000c1 simplify zend_long defs even more 2014-08-26 09:49:54 +02:00
Anatol Belski
c429c74be9 generalize the zend_long stuff 2014-08-25 23:52:39 +02:00
Nikita Popov
59848e3fbb Remove ZEND_ACC_INTERACTIVE and CG(interactive)
As far as I can discern these are leftovers of the interactive
shell implementation that was used before PHP 5.4. Now the readline
ext makes use of normal eval calls for this.

So, dropping these until there is evidence to the contrary, as they
currently wouldn't work anyway.
2014-08-25 23:46:43 +02:00
Nikita Popov
4ea19a682e make bp type uint32_t everywhere 2014-08-25 23:17:36 +02:00
Nikita Popov
d2a3bf9daf Fix compiler warnings 2014-08-25 23:08:01 +02:00
Nikita Popov
28e7beea66 Fix zend_longo_str 2014-08-25 22:47:04 +02:00
Nikita Popov
46b53e815c Add zend_string_equals and zend_string_equals_literal 2014-08-25 22:40:58 +02:00
Nikita Popov
899a1ed59a Merge branch 'ast'
Conflicts:
	Zend/zend_compile.c
2014-08-25 22:04:33 +02:00
Nikita Popov
6db293d5e0 Merge remote-tracking branch 'php-src/master' into ast
Conflicts:
	Zend/zend_compile.c
	Zend/zend_compile.h
	Zend/zend_globals.h
	Zend/zend_language_parser.y
	Zend/zend_language_scanner.c
	Zend/zend_language_scanner.l
	Zend/zend_types.h
2014-08-25 21:52:18 +02:00
Anatol Belski
af59e92b24 master renames phase 7 2014-08-25 21:51:49 +02:00
Anatol Belski
b9514bb8fd master renames phase 6 2014-08-25 21:26:42 +02:00
Anatol Belski
28b7a03318 master renamings phase 5 2014-08-25 21:20:44 +02:00
Anatol Belski
455741fce3 master renames phase 4 2014-08-25 20:57:25 +02:00
Anatol Belski
4d997f63d9 master renames phase 3 2014-08-25 20:22:49 +02:00
Nikita Popov
7813d85d3d Fix for C89 2014-08-25 19:46:21 +02:00
Anatol Belski
6f9f0bf205 master renames phase 2 2014-08-25 19:28:33 +02:00
Anatol Belski
c3e3c98ec6 master renames phase 1 2014-08-25 19:24:55 +02:00
Anatol Belski
70de6180d5 fixes to %pd format usage 2014-08-24 02:35:34 +02:00
Keyur Govande
437612f656 Only destruct if EG(active) in zend_shutdown(). (bug #65463, #66036) 2014-08-23 14:17:37 +00:00
Tjerk Meesters
d1d0f55e22 Use %d instead of object id 2014-08-23 08:09:08 +08:00
Tjerk Meesters
32e8d0f03e Fixed test case based on var_dump() changes made in c1965f58d4 2014-08-23 08:06:47 +08:00
krakjoe
3f4811c76e fix wrong type causing build error 2014-08-22 18:30:13 +01:00
Anatol Belski
21a45d9aca Merge remote-tracking branch 'php/master' 2014-08-21 15:55:56 +02:00
Dmitry Stogov
b9a5db2b55 Fixed incorrect string length 2014-08-21 17:30:34 +04:00
Anatol Belski
f7c8213741 fix zpp 2014-08-21 15:25:39 +02:00
Anatol Belski
8b2f1ac177 fix zpp 2014-08-21 15:23:05 +02:00