Commit Graph

10011 Commits

Author SHA1 Message Date
Reeze Xia
4d034b1a1e Improve tests for bug 67436
I always use a.php or b.php for local testing,
this diff makes the test more stable
2015-02-07 14:11:09 +08:00
Xinchen Hui
594c220dea Fixed issue #1041 (Fix build in OSX with --enable-dtrace) 2015-02-07 11:27:42 +08:00
Xinchen Hui
3b3308a70a Further fix for bug #68987 2015-02-06 21:13:16 +08:00
Dmitry Stogov
57496c3836 This should fix compilation on OSX (bug #68987 Failed to compile zend.c with gcc-4.9.2) 2015-02-06 13:42:22 +03:00
Xinchen Hui
a3379d6691 Padding 2015-02-05 16:11:44 +08:00
Dmitry Stogov
f5a9cfc33a Merge branch 'internal-function-return-types' of github.com:reeze/php-src into test
* 'internal-function-return-types' of github.com:reeze/php-src:
  Add load time return type checking to match user land logic
  Add test function arguments
  Implemented internal function return types
2015-02-05 11:01:07 +03:00
Reeze Xia
601fcc31af Add load time return type checking to match user land logic 2015-02-05 11:22:11 +08:00
Reeze Xia
2c84006f5a Add test function arguments 2015-02-05 01:21:42 +08:00
Reeze Xia
bff4c47fa7 Implemented internal function return types 2015-02-05 01:04:54 +08:00
Dmitry Stogov
a787719d4f Removed TSRMLS_D 2015-02-04 18:47:30 +03:00
Dmitry Stogov
8b46d45a9d Simplify code and add comments 2015-02-04 17:56:14 +03:00
Dmitry Stogov
9e70d7672d Move zend_object->guards into additional slot of zend_object->properties_table[]. As result size of objects without __get/__set/__unset/__isset magic methods is reduced. 2015-02-04 15:24:13 +03:00
Xinchen Hui
38829b3b4b Merge branch 'master' into resource-api 2015-02-03 23:01:48 +08:00
Dmitry Stogov
6720716682 Optimize class lookup 2015-02-03 17:39:05 +03:00
Dmitry Stogov
e375ba877a Fixed "delayed" compilation 2015-02-02 20:44:16 +03:00
Anatol Belski
79c9dc75de rely on macros from stdint for int constants on 64 bit
32 bit ones are already in use
2015-02-02 09:39:33 +01:00
Xinchen Hui
e98caf27ea found type is unnecessary 2015-02-02 14:45:19 +08:00
Xinchen Hui
942809909e Cleanup resource handling APIs 2015-02-02 13:23:16 +08:00
Stanislav Malyshev
b64cafdb9e Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Added test and possible fix for https://bugs.php.net/bug.php?id=67068
2015-01-31 23:17:24 -08:00
Danack
dbc0a80b23 Added test and possible fix for https://bugs.php.net/bug.php?id=67068 2015-01-31 23:13:55 -08:00
Stanislav Malyshev
e8e0481755 Merge branch 'pull-request/994'
* pull-request/994:
  Added test and possible fix for https://bugs.php.net/bug.php?id=67068
2015-01-31 23:12:00 -08:00
Xinchen Hui
1a60175e25 Fixed Magic getter bug tickled by Moodle 2015-01-31 18:12:31 +08:00
Xinchen Hui
8aab1c619c Fixed unused opline warning 2015-01-31 16:50:17 +08:00
Joshua Rogers
26d5ad6c98 Add check for null pointer, as done in case 5 lines above. 2015-01-30 13:30:17 +11:00
Andrea Faulds
d8b7a4480b Fix associativity to match Perl 2015-01-29 17:56:09 +00:00
Andrea Faulds
797dee59cd Blast off to space. 2015-01-29 17:56:09 +00:00
Xinchen Hui
a1d9ceac7a Fixed annoying warnings 2015-01-29 11:59:37 +08:00
Nikita Popov
d133e68bab Remove support for hex number from is_numeric_string 2015-01-28 22:54:17 +01:00
Dmitry Stogov
638d0cb753 Merge branch 'typed_returns' of github.com:morrisonlevi/php-src into test
* 'typed_returns' of github.com:morrisonlevi/php-src:
  Implement return types
2015-01-28 06:56:19 +03:00
Levi Morrison
c8576c5a46 Implement return types
RFC is documented here: https://wiki.php.net/rfc/return_types
2015-01-27 11:49:56 -07:00
Nikita Popov
4d3e4d3bf9 Remove assignment of new by reference 2015-01-26 21:00:22 +01:00
Dmitry Stogov
371dc9b6a6 Fixed bug #68896 (Changing ArrayObject value cause Segment Fault) 2015-01-26 11:25:05 +03:00
Xinchen Hui
91045c4d74 Fixed ext/standard/tests/general_functions/bug41970.phpt fails 2015-01-26 14:41:45 +08:00
Rasmus Lerdorf
388624d359 These tests all have intentional circular references
and they will leak and cause failures unless gc is enabled
2015-01-24 16:06:18 -08:00
Nikita Popov
6093c9370b Fix resource leak when casting to string 2015-01-24 23:18:26 +01:00
Nikita Popov
05166566db Fix declare encoding tests
Also add a test for bwoebi's last change.
2015-01-24 21:51:45 +01:00
Bob Weinand
c637ba118e Fix segfault when no class ctx is defined 2015-01-24 20:00:46 +01:00
Nikita Popov
8dc1287739 Fix build 2015-01-24 19:53:07 +01:00
Bob Weinand
f3675d950d Inline self-constants if possible at compile time 2015-01-24 19:19:02 +01:00
Adam Harvey
eb6dc9db29 Make gc_collect_cycles hookable. 2015-01-23 19:23:58 +00:00
Dmitry Stogov
be31acc927 Fixed memory leak 2015-01-23 20:35:32 +03:00
Dmitry Stogov
a7f1bf3ec5 Fixed possible double free of class static members 2015-01-23 17:10:05 +03:00
Dmitry Stogov
46e486ff3d It doesn't make sense to colect garbage after fatal errors 2015-01-23 16:40:16 +03:00
Dmitry Stogov
f71e64e53a Revert "Fixed ASSERTION"
This reverts commit 76f438e06f.
2015-01-23 16:37:39 +03:00
Xinchen Hui
76f438e06f Fixed ASSERTION 2015-01-23 14:18:56 +08:00
Xinchen Hui
16732dedfe Fixed refcount handling in get_class_vars() 2015-01-23 13:32:07 +08:00
Sara Golemon
b8e262901e Add missing ZEND_API tag to declaration of int zendparse(); 2015-01-22 14:04:49 -08:00
Dmitry Stogov
b494aa0ba0 Fixed compiler reenterability 2015-01-22 20:39:34 +03:00
Dmitry Stogov
6f0e5aab43 Fixed GC after destruction of object store. 2015-01-22 20:38:42 +03:00
Dmitry Stogov
faf917d94e define() must not modify the source array 2015-01-22 15:49:38 +03:00
Dmitry Stogov
e21fefde38 Fixed destruction of circular garbage 2015-01-22 14:24:27 +03:00
Dmitry Stogov
061c0ed9ee Fixed double free and cleanup 2015-01-22 12:59:53 +03:00
Dmitry Stogov
3e31838d19 zend_read_property() has to provide a holder for return value.
Previously it was possible that zend_read_property() returned pointer to zval allocated on stack.
2015-01-22 11:50:42 +03:00
Bob Weinand
4e0ae4dbbc Forgot to add test... 2015-01-21 23:54:03 +01:00
Bob Weinand
bd629428a6 Removed efree() on arena_alloc()ed memory 2015-01-21 23:52:48 +01:00
Anatol Belski
8fb29d3f63 fix declaration 2015-01-20 11:30:03 +01:00
Dmitry Stogov
d975f63f73 Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  Update remaining octal 32-bit tests
2015-01-20 08:56:09 +03:00
Dmitry Stogov
8dc3c283b8 cleanup 2015-01-20 08:55:36 +03:00
Andrea Faulds
5c88d11243 Update remaining octal 32-bit tests 2015-01-20 05:54:13 +00:00
Xinchen Hui
6f67d5ad6e Unused parse_arg_object_to_string 2015-01-20 12:02:54 +08:00
Xinchen Hui
8d60d37001 Unused var 2015-01-20 11:58:40 +08:00
Sara Golemon
1010b0ea4f Provide compiler hook for altering the AST pre-compilation. 2015-01-19 10:43:57 -08:00
Xinchen Hui
137a251a52 Merge branch 'master' of https://git.php.net/repository/php-src 2015-01-19 09:12:44 -05:00
Nikita Popov
5f0248304e Revert "Remove static calls from incompatible $this context"
This reverts commit dc9991b167.
2015-01-19 15:12:51 +01:00
Xinchen Hui
442efdaaea Optimized is_a 2015-01-19 09:10:01 -05:00
Dmitry Stogov
230bfb1067 Generate better code for comparisons with boolean constants 2015-01-19 17:02:17 +03:00
Dmitry Stogov
eb8d7fe710 old_size is already known 2015-01-19 15:26:04 +03:00
Dmitry Stogov
2efa53649e Optimize code generated for "while" and "for" loops.
Eliminate one JMP opcode for each loop iteration.
2015-01-19 13:27:44 +03:00
Xinchen Hui
b33629f212 Only use explicit ">" in sorting algo 2015-01-19 03:32:28 -05:00
Xinchen Hui
020b51b46e Don't use >= as sorting condition
which could avoid breaking usage like:

usort($a, function($a, $b) { return $a > $b; })
2015-01-19 01:36:56 -05:00
Xinchen Hui
218d83d217 Fixed annoying incompatible pointer type warning 2015-01-18 07:24:57 -05:00
Xinchen Hui
f42d9d6161 Fixed bug #68805 (Double define) 2015-01-17 23:06:37 -05:00
Rasmus Lerdorf
6c9621c937 typo 2015-01-17 11:38:40 -08:00
Andrea Faulds
5f29b98051 Error on invalid octal (fixes PHPSadness #31)
Further error checks
2015-01-17 18:50:28 +00:00
Nikita Popov
83391b5518 Remove for #-style comments in ini files 2015-01-17 18:26:44 +01:00
Nikita Popov
dc9991b167 Remove static calls from incompatible $this context 2015-01-17 18:26:44 +01:00
Dmitry Stogov
b46894d104 Partially revert 3477135cd1 2015-01-16 02:21:27 +03:00
Dmitry Stogov
1c5e914616 Fixed build without alloca() 2015-01-15 21:43:17 +03:00
Dmitry Stogov
12cbb9c156 Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  updated NEWS
  updated NEWS
  PDO_MySQL: Differentiate between linux and win32 when passing unix_socket
  bump year
  bump year
  Bump year
2015-01-15 21:09:20 +03:00
Dmitry Stogov
b476c27135 Fixed double free 2015-01-15 21:08:43 +03:00
Dmitry Stogov
3477135cd1 Avoid usage of uninitialized data 2015-01-15 21:08:21 +03:00
Xinchen Hui
fc33f52d8c bump year 2015-01-15 23:27:30 +08:00
Xinchen Hui
0579e8278d bump year 2015-01-15 23:26:37 +08:00
Xinchen Hui
73c1be2653 Bump year 2015-01-15 23:26:03 +08:00
Dmitry Stogov
34723d1b75 Fixed malloc/emalloc mess 2015-01-15 18:05:58 +03:00
Dmitry Stogov
989daeb5bb Initialize ht->nTableMask 2015-01-15 15:21:38 +03:00
Anatol Belski
1af91d944a optimize offset computation 2015-01-15 11:18:40 +01:00
Anatol Belski
706b7c6e07 don't return value in the void function 2015-01-15 11:18:39 +01:00
Anatol Belski
cdfafd3f38 fix "unknown void * size" err 2015-01-15 11:18:38 +01:00
Xinchen Hui
8a0bc38535 Merge branch 'zend_sort' of https://github.com/laruence/php-src 2015-01-14 22:15:41 -05:00
Dmitry Stogov
90c20b4c24 Fixed typo 2015-01-14 21:09:06 +03:00
Dmitry Stogov
2325758624 Improve "instanceof". Interfaces of the left operand should be checked only if the right operand is interafce itself. 2015-01-14 15:06:26 +03:00
Anatol Belski
d5b5ad72b6 cleanup 2015-01-14 12:32:23 +01:00
Anatol Belski
8e3764e287 fixed zend_hash_init() when the lzcnt instruction isn't supported 2015-01-14 12:32:23 +01:00
Xinchen Hui
2193de0d18 Faster sorting algo 2015-01-14 18:02:41 +08:00
Dmitry Stogov
3e3b006738 Reorder conditions to make "fast paths" shorter 2015-01-13 15:31:42 +03:00
Dmitry Stogov
5a24ac8853 Improved access to object properties (cache property offset instead of pointer to property_info). 2015-01-13 11:33:00 +03:00
Dmitry Stogov
58efbf0a92 Fixed possible double free 2015-01-13 11:32:36 +03:00
Dmitry Stogov
7e93de101f Handle run-time cache for static properties directly in executor.
Removed cache_slot argument in zend_std_get_static_property() and zend_std_unset_static_property().
2015-01-13 09:33:15 +03:00
Dmitry Stogov
d810cf816b Fixed possible crash 2015-01-13 08:30:54 +03:00
Xinchen Hui
2d8fd4b335 Add hinting 2015-01-12 22:06:40 -05:00
Danack
1397790560 Added test and possible fix for https://bugs.php.net/bug.php?id=67068 2015-01-13 01:24:19 +00:00
Dmitry Stogov
dbe66fb2cf Improved access to static property. Now we cache pointers to zval instead of pointers to property_info. 2015-01-13 03:32:51 +03:00
Bob Weinand
0445974cb1 Only backup vm_stack* if generator->stack has not been freed 2015-01-12 22:31:07 +01:00
Dmitry Stogov
916d5ece39 Optimized error_reporting() similar to silence operator (ZEND_BEGIN_SILENCE opcode). 2015-01-12 23:50:03 +03:00
Dmitry Stogov
c5047d1f11 Use FAST_ZPP in few more frequently used functions 2015-01-12 19:26:12 +03:00
Xinchen Hui
2f1ddff2a5 Faster strrpos implementation 2015-01-12 17:24:37 +08:00
Xinchen Hui
31817447cc Faster zend_memnstr for long text 2015-01-12 15:34:46 +08:00
Stanislav Malyshev
b7a7b1a624 trailing whitespace removal 2015-01-10 15:07:38 -08:00
Xinchen Hui
84f2311bc9 Fixed #68779 (Incorrect sizeof) 2015-01-10 10:58:22 -05:00
Nikita Popov
e9068cefb4 Make empty list() check stricter
Now also includes list()s with just commas in it.
2015-01-09 18:27:06 +01:00
Nikita Popov
41a249fef6 Fix bug #68775 2015-01-09 17:59:41 +01:00
Guilherme Blanco
d51fb69c01 Removed parsing support traits to have extends and implements. 2015-01-09 15:45:02 +01:00
Guilherme Blanco
f48c232740 Decoupled class declaration statement into more granular pieces. 2015-01-09 15:45:01 +01:00
Nikita Popov
3e826c9736 Fix the same leak with %= 2015-01-07 23:21:12 +01:00
Nikita Popov
98c2ceacf8 Fix leak for compound shift self-assign error cases 2015-01-07 23:13:45 +01:00
Nikita Popov
1266515e19 Fix uses of zval_add_ref and add comment on usage
zval_add_ref should be used as a copy ctor, after the value was
already copied.

In particular when used with hash insertions, it should be applied
to the return value of the insert function.
2015-01-05 17:02:11 +01:00
Xinchen Hui
faa4171507 Add test script and use efree_size 2015-01-05 22:21:37 +08:00
Xinchen Hui
40230eef81 Revert "Revert "Fix memory leak when dereferencing reference with refcount 1""
This reverts commit 7aab9659ee.
2015-01-05 22:13:22 +08:00
Xinchen Hui
7aab9659ee Revert "Fix memory leak when dereferencing reference with refcount 1"
This reverts commit f4cb5cc09d.

breaks tests Zend/tests/bug27268.phpt and Zend/tests/bug68262.phpt
2015-01-05 00:26:10 -05:00
Bob Weinand
f4cb5cc09d Fix memory leak when dereferencing reference with refcount 1 2015-01-05 00:28:53 +01:00
Nikita Popov
2269b1801d Add missing string cast for non-cv var fetches 2015-01-04 18:07:44 +01:00
Nikita Popov
69a4b135f3 Fix use after free for variables with integer names 2015-01-04 17:57:23 +01:00
Anatol Belski
95e04fed24 cleanup redundand macros 2014-12-31 16:25:42 +01:00
Andrea Faulds
41e3fdba8e Make zend_parse_parameters share fast zpp implementation where possible
Rename shared implementation functions and build them unconditionally

Don't fail on empty path for zend_parse_arg_path

Update type names

Fix behaviour of by-reference "z"

Make 'o' use zend_parse_arg_object

Fix NULL string check in zend_parse_arg_path(_str)
2014-12-29 12:28:28 +00:00
Dmitry Stogov
cd5ea1619e Micro optimization for better register allocation 2014-12-29 14:21:16 +03:00
Dmitry Stogov
0fa50fb95d Reored conditions 2014-12-29 14:20:52 +03:00
Dmitry Stogov
d909a837e2 Cleanup 2014-12-29 13:38:36 +03:00
Kalle Sommer Nielsen
fbf3a6bc1a Fixed bug #68676 (Explicit Double Free) 2014-12-29 11:04:23 +01:00
Kalle Sommer Nielsen
24125f0f26 Fixed bug #68676 (Explicit Double Free) 2014-12-29 10:57:42 +01:00
Kalle Sommer Nielsen
2bcf69d073 Fixed bug #68676 (Explicit Double Free) 2014-12-29 10:55:14 +01:00
Xinchen Hui
3bd96e0735 Use internd string as key 2014-12-29 14:35:08 +08:00
Anatol Belski
68dd8e8bd7 fix invalid free mentioned in bug 68665
thanks honey at internot dot info
2014-12-28 16:36:07 +01:00
Anatol Belski
67c47e7861 added test for bug #68665 2014-12-28 16:29:07 +01:00
Dmitry Stogov
107ae86ca6 Introduce specialized functions to compare with integer and string, to eliminate repeatable checks on each loop iteration in in_array() function. 2014-12-27 11:11:40 +03:00
Dmitry Stogov
37466b0368 Use special flag (HASH_FLAG_INITIALIZED) instead of (nTableMask == 0) to indicate that HashTable is allocated.
Make nTableMask to be 0 for packed arrays.
Remove checks fo HASH_FLAG_PACKED in zend_hash_find/zend_hash_del and family (string keys are resolved through uninitialized_bucket).
Change HashTable layout for better locality.
2014-12-27 11:07:12 +03:00
Nikita Popov
2d212b426a Drop duplicate arg from hash_get_current_key_ex 2014-12-26 21:06:18 +01:00
Nikita Popov
3d12fc796b Small cleanups in hash implementation
* Drop unnecessary checks in non-inlined part of numeric key
   detection
 * Drop zend_hash_apply_deleter in favor of zend_hash_del_el.
   Also move block/unblock interruption macros in there.
2014-12-26 21:06:18 +01:00
Dmitry Stogov
ab0b15b8ff Optimized destruction of extra arguments passed to user functions.
If no refcounted arguments are passed, then destruction code is not triggered at all.
(Full rebuild required)
2014-12-26 22:34:44 +03:00
Anatol Belski
86af370b81 remove unused variable 2014-12-24 14:14:29 +01:00
Anatol Belski
385bda6cdf C89 compat 2014-12-24 14:14:28 +01:00
Dmitry Stogov
f2c2acb9a9 For disabled function, to disable arguments checks, we have to reset num_args and some related flags (in addition to arg_info) 2014-12-24 15:34:52 +03:00
Dmitry Stogov
c42ac09518 Added new API function 'zend_string* zend_string_tolower(zend_string*)'.
It simplifies code and avoids unnecessary allocation and copying if string is already in lower case.
2014-12-24 15:04:51 +03:00
Anatol Belski
e46852d2d5 better fix for script encoding ini 2014-12-23 17:33:30 +01:00
Anatol Belski
e2e5ed06d1 fix NULL deref when the script encoding wasn't previously set 2014-12-23 17:09:13 +01:00
Dmitry Stogov
106b1017d4 API for fast construction of packed arrays 2014-12-23 19:08:28 +03:00
K.
c462ff7ac2 zend_hash_do_resize: fix compacting condition
nNumUsed should always be greater or equal to nNumOfElements so original condition is never true and arrays are always doubled in size and compaction is never triggered
2014-12-23 15:32:15 +01:00
Anatol Belski
e60b7207db cleanup 2014-12-23 13:00:29 +01:00
Xinchen Hui
62e2973602 Revert "Improve Hash foreach macros"
This reverts commit 95bb0a0f7a.
2014-12-23 03:51:06 -05:00
Xinchen Hui
95bb0a0f7a Improve Hash foreach macros 2014-12-23 00:50:39 -05:00