Commit Graph

57 Commits

Author SHA1 Message Date
Xinchen Hui
97a9470d97 bump year which is missed in rev 49493a2 2016-01-02 17:56:11 +08:00
Dmitry Stogov
89aa1b7392 Ensure proper data alignment 2015-08-31 13:56:42 +03:00
Dmitry Stogov
4a2e40bb86 Use ZSTR_ API to access zend_string elements (this is just renaming without semantick changes). 2015-06-30 04:05:24 +03:00
Dmitry Stogov
4bd22cf1c1 Improved zend_string API (Francois Laupretre)
Squashed commit of the following:

commit d96eab8d79
Author: Francois Laupretre <francois@tekwire.net>
Date:   Fri Jun 26 01:23:31 2015 +0200

    Use the new 'ZSTR' macros in the rest of the code.

    Does not change anything to the generated code (thanks to compat macros) but cleaner.

commit b352643910
Author: Francois Laupretre <francois@tekwire.net>
Date:   Thu Jun 25 13:45:06 2015 +0200

    Improve zend_string API

    Add missing methods
2015-06-29 16:44:54 +03:00
Dmitry Stogov
a0c07c90f2 Fixed zend_string related inconsistencies 2015-04-21 23:26:34 +03:00
Dmitry Stogov
bdf7fc67d8 We can't stay zend_string->h to be zero, because it may lead to hash value recalculation and update.
But in general zend_string may be put and read-only memory, that would lead to crash.
Always set the high bit of hash_value to prevent recaclulation.
2015-03-24 16:28:26 +03:00
Dmitry Stogov
d146d15003 Optimize zend_string_realloc() add more specialized versions zend_string_extend() and zend_string_truncate() 2015-03-20 02:02:42 +03:00
Bob Weinand
dac2b060e4 Remove bogus ZEND_ASSERT(hash != 0)
There's always a possibility that the has will end up as equal to zero due to overflowing.
See the tests for strings whose hash overflow.
Yes, there's a check for whether the hash already was calculated... and strings with a hash equal to zero always need the hash recalculated, in one of 2^32 respectively 2^64 cases - which should not be a major issue.
2015-03-18 22:25:55 +01:00
Xinchen Hui
63c923e3e1 Forget this change 2015-02-11 16:06:47 +08:00
Xinchen Hui
4f1fc31e16 Expose zend_string_equals_str_ci 2015-02-11 16:05:20 +08:00
Xinchen Hui
fc33f52d8c bump year 2015-01-15 23:27:30 +08:00
Stanislav Malyshev
b7a7b1a624 trailing whitespace removal 2015-01-10 15:07:38 -08:00
Anatol Belski
4acc56d5b2 Merge remote-tracking branch 'origin/master' into native-tls
* origin/master:
  fix unserializer patch
  move this entry to the correct version
  add missing NEWS entry
  add missing NEWS entry
  Updated or skipped certain 32-bit tests
  add NEWS entry for #68594
  5.4.37
  add more BC breaks
  update news
  add CVE
  add missing test file
  Fix bug #68594 - Use after free vulnerability in unserialize()
  Fix typo
  Hash value must not zero?
2014-12-17 05:29:36 +01:00
Anatol Belski
bdeb220f48 first shot remove TSRMLS_* things 2014-12-13 23:06:14 +01:00
Xinchen Hui
3753e6d978 Hash value must not zero? 2014-12-13 11:42:53 +08:00
Anatol Belski
741bf0ee96 fix the empty_strings SAPI shutdown leak in TS build
still the NTS variant is somewhat different as it needs
zend_new_interned_string_int because the normal callbacks might
be not initialized, but at least no leaks anymore and some more
structure
2014-10-06 15:48:55 +02:00
Dmitry Stogov
3bc8a958c5 Fixed useless or duplicated IS_INTERNED() checks 2014-09-19 15:41:01 +04:00
Dmitry Stogov
5185baab3e Changed "inline" into "zend_always_inline" 2014-09-18 04:59:01 +04:00
Xinchen Hui
0763d6b98d use zend_string_equals_ci 2014-08-29 13:19:14 +08:00
Nikita Popov
46b53e815c Add zend_string_equals and zend_string_equals_literal 2014-08-25 22:40:58 +02:00
Anatol Belski
455741fce3 master renames phase 4 2014-08-25 20:57:25 +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
8ee2a4a9b5 first shot on merging the core fro the int64 branch 2014-08-16 11:16:11 +02:00
Dmitry Stogov
8217e20ddb Fixed compilation warnings 2014-07-15 15:51:40 +04:00
Xinchen Hui
b7ff8f28b2 Temporary fixed the invalid read warning 2014-07-14 14:01:53 +08:00
Dmitry Stogov
9d6e45a0ee Changed zend_make_printable_zval() to return "use_copy" instead of additional reference argument.
Improved branch prediction.
2014-07-09 16:05:55 +04:00
Xinchen Hui
7614fe810e C++ doesn't allow implicitly convert void * to other pointer type 2014-06-28 11:19:38 +08:00
Xinchen Hui
f609d8c1c6 C++ compiler doesn't allow cast a void * to other pointer type 2014-06-27 12:35:34 +08:00
Nikita Popov
65f488ece3 Add STR_ALLOCA_* API, use in get_method and verify_arg
This avoid unnecessary allocations when using dynamic method
dispatch and class typehints.

Probably there are other places where this should be done as well,
those just stood out for my usage.
2014-05-03 10:43:45 +02:00
Nikita Popov
08ae88157b Allocate zend_strings with correct size
For me (32bit) sizeof(zend_string) is 20, which means that the
char[1] array at the end is padded with three bytes. Thus allocating
based on sizeof(zend_string)-1 overallocates by those 3 padding bytes.

This commit fixes the allocation size, by using XtOffsetOf.
2014-04-23 19:34:51 +02:00
Dmitry Stogov
f9b26bc39a Cleanup (2-nd round) 2014-04-15 21:56:30 +04:00
Nikita Popov
a6be32f59a IS_INTERNED is not always 0 in ZTS
The current implementation chooses to intern "" in ZTS. Either that
should be removed or IS_INTERNED needs to actually check the flag.
2014-04-09 23:54:03 +02:00
Dmitry Stogov
76cc99fe60 Refactored ZVAL flags usage to simplify various checks (e.g. Z_REFCOUNTED(), candidate for GC, etc) 2014-04-03 15:26:23 +04:00
Dmitry Stogov
d8099d0468 Changed data layout to allow more efficient operations 2014-04-02 14:34:44 +04:00
Dmitry Stogov
a25a1ba0ef STR_DUP() doesn't duplicate interned strings anymore. In case new string is required STR_INIT() or STR_ALLOC() should be used. 2014-04-01 16:31:03 +04:00
Dmitry Stogov
b7938ab1bd Refactored GC (incomplete) 2014-03-19 17:00:28 +04:00
Dmitry Stogov
51494f252f Don't include trailing zero into hash caclculation 2014-03-14 15:35:57 +04:00
Dmitry Stogov
557994d50d Use better data structures (incomplete) 2014-02-19 01:12:05 +04:00
Dmitry Stogov
a0fe8e5a91 Use better data structures (incomplete) 2014-02-18 01:41:23 +04:00
Dmitry Stogov
2b9b9afa7a Use better data structures (incomplete) 2014-02-17 17:59:18 +04:00
Dmitry Stogov
e2ea9a7319 Use better data structures (incomplete) 2014-02-12 11:42:27 +04:00
Xinchen Hui
3f4c877bf7 Use better data structures (incomplete) 2014-02-11 19:33:18 +08:00
Dmitry Stogov
f4cfaf36e2 Use better data structures (incomplete) 2014-02-10 10:04:30 +04:00
Xinchen Hui
c081ce628f Bump year 2014-01-03 11:08:10 +08:00
Nikita Popov
8748e146b9 Fix intl build 2013-09-14 01:37:09 +02:00
Nikita Popov
96b1c2145c Provide more macros for handling of interned strings
* str_erealloc behaves like erealloc for normal strings, but will
   use emalloc+memcpy for interned strings.
 * str_estrndup behaves like estrndup for normal strings, but will
   not copy interned strings.
 * str_strndup behaves like zend_strndup for normal strings, but
   will not copy interned strings.
 * str_efree_rel behaves like efree_rel for normal strings, but
   will not free interned strings.
 * str_hash will return INTERNED_HASH for interned strings and
   compute it using zend_hash_func for normal strings.
2013-09-13 19:42:10 +02:00
Xinchen Hui
a666285bc2 Happy New Year 2013-01-01 16:37:09 +08:00
Gustavo André dos Santos Lopes
594397993d Fix bug #62651: source level BC break
Break for C++ extensions that don't wrap the includes of PHP libraries
in extern "C" {.
2012-07-27 01:39:06 +02:00
Felipe Pena
8775a37559 - Year++ 2012-01-01 13:15:04 +00:00