Commit Graph

12366 Commits

Author SHA1 Message Date
Sara Golemon
0fb640c717 Fix bug where yield from is captured too greedily
In the following piece of code:

```php
function from1234($x) {
  return $x;
}
function foo($x) {
  yield from1234($x);
}
```

The statement inside foo is taken as `yield from` `1234($x)`
which is neither the intent, nor even legal syntax for an fcall.

Do a lookahead for breaking non-label characters after the
`yield from` and only accept it if they occur.
2017-03-23 13:31:06 -07:00
Nikita Popov
f2c35fdda8 Merge branch 'PHP-7.0' into PHP-7.1 2017-03-17 20:20:43 +01:00
Nikita Popov
2e83082605 Fix bug #74265 2017-03-17 20:19:40 +01:00
Nikita Popov
893bf7ecdd Merge branch 'PHP-7.0' into PHP-7.1 2017-03-17 13:35:50 +01:00
Nikita Popov
183cd048f1 Fix AST start lineno for list nodes
If the node is initialized with children, check if a child has a
lower start lineno, similar to what we do for fixed-sized nodes
as well.
2017-03-17 13:35:24 +01:00
Nikita Popov
2bba4a0d7f Fix bug #69676 2017-03-15 19:49:02 +01:00
Nikita Popov
280e8dafe4 Merge branch 'PHP-7.0' into PHP-7.1 2017-03-10 18:20:58 +01:00
Nikita Popov
29ee3e3c49 Fixed bug #73960 2017-03-10 18:20:32 +01:00
Nikita Popov
305f3c2b76 Merge branch 'PHP-7.0' into PHP-7.1 2017-03-09 20:48:24 +01:00
Nikita Popov
177f87cf05 Fixed bug #73370
If len=0 malloc() is allowed to return NULL.
2017-03-09 20:47:06 +01:00
Joe Watkins
8599ce4f18
Fix bug #74149 static embed SAPI linkage error 2017-03-09 07:43:58 +00:00
Nikita Popov
8a6281455e Merge branch 'PHP-7.0' into PHP-7.1 2017-03-07 13:17:33 +01:00
Nikita Popov
549a30d2cd Fix out of bounds access in gc_find_additional_buffer() 2017-03-07 13:16:06 +01:00
Anatol Belski
1d4248af42 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  improve signal globals consistency check for TS
2017-03-02 20:34:48 +01:00
Anatol Belski
18f7e26257 improve signal globals consistency check for TS
Seems when we receive TERM, TLS is destroyed completely. In that case,
not only signal globals, but the entire globals array doesn't exist
anymore.
2017-03-02 20:27:27 +01:00
Anatol Belski
494fc16184 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  do not try to handle signals, when globals are inconsistent
2017-03-02 16:41:43 +01:00
Anatol Belski
c7b2c698d0 do not try to handle signals, when globals are inconsistent 2017-03-02 16:40:38 +01: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
Remi Collet
3006d1de5b make test slower again 2017-02-28 11:36:24 +01:00
Xinchen Hui
6a584cf318 Fixed bug #74157 (Segfault with nested generators) 2017-02-26 12:05:56 +08:00
Xinchen Hui
36fcc4cb5d Fixed bug #74164 (PHP hangs when an invalid value is dynamically passed to typehinted by-ref arg) 2017-02-25 12:00:42 +08:00
Anatol Belski
ac64eea9e6 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  initialize valid_symbol_table, important for the main thread
2017-02-18 18:03:55 +01:00
Anatol Belski
1623ef10c9 initialize valid_symbol_table, important for the main thread
to prevent php_errormsg population on invalid symlol_table
2017-02-18 17:58:17 +01:00
Xinchen Hui
aa1d92e3e5 Unused var 2017-02-17 12:22:59 +08:00
Nikita Popov
9ca43b873a Merge branch 'PHP-7.0' into PHP-7.1 2017-02-16 17:36:03 +01:00
Ondřej Surý
61e59db99d Disable RTLD_DEEPBIND when compiling with AddressSanitizer (-fsanitize=address).
The AddressSanitizer doesn't support RTLD_DEEPBIND resulting in
erratic errors when deinitializing phar module and possibly others.

Clang use __has_feature() macro to indicate compilation with
AddressSanitizer while gcc uses __SANITIZE_ADDRESS__ define.

Fixes bug #73677.
2017-02-16 17:35:29 +01:00
Anatol Belski
8ad75bec97 skip test
The code path not available on Windows.
2017-02-15 16:12:34 +01:00
Xinchen Hui
f53ea4cd60 Fixed test in travis 2017-02-15 17:31:27 +08:00
Xinchen Hui
8d94d5d942 Make it slower 2017-02-15 15:27:21 +08:00
Xinchen Hui
dad5281a89 Fixed test 2017-02-15 14:49:02 +08:00
Xinchen Hui
6767ef05a5 Add a test for hard_timeout(bug #74093) 2017-02-15 13:51:45 +08:00
Xinchen Hui
1242f53ddb Workaround to fix bug #74093 (Maximum execution time of n+2 seconds exceed not written in error_log)
Use a different exit code for hard_timeout, 124 is used by linux
timeout:http://man7.org/linux/man-pages/man1/timeout.1.html
"If the command times out, and --preserve-status is not set, then exit with status 124"
2017-02-15 12:27:56 +08:00
Xinchen Hui
9df7cc3e68 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug  #73989 (PHP 7.1 Segfaults within Symfony test suite)
2017-02-13 19:17:09 +08:00
Xinchen Hui
3917350531 Fixed bug #73989 (PHP 7.1 Segfaults within Symfony test suite) 2017-02-13 19:16:17 +08:00
Xinchen Hui
b56114e8fb Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #74084 (Out of bound read - zend_mm_alloc_small)

Conflicts:
	Zend/zend_operators.c
2017-02-12 20:36:18 +08:00
Xinchen Hui
26fdebc63b Fixed bug #74084 (Out of bound read - zend_mm_alloc_small) 2017-02-12 20:34:08 +08:00
Xinchen Hui
808a11041d Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed typo
2017-02-11 00:01:38 +08:00
Xinchen Hui
db7c0badd4 Fixed typo 2017-02-11 00:01:09 +08:00
Nikita Popov
8417a3be38 Merge branch 'PHP-7.0' into PHP-7.1 2017-02-08 01:00:46 +01:00
dreamsxin
7a0adb4cd2 Add #ifndef restrict 2017-02-08 01:00:35 +01:00
Nikita Popov
bb9adc4c52 Merge branch 'PHP-7.0' into PHP-7.1 2017-02-08 00:53:36 +01:00
Christian Schmidt
714d825b62 Fix detection of isnan and isinf
The isnan() and isinf() are C99 macros not functions.

Also fix is_infinite(-INF) in case isinf is not defined.
2017-02-08 00:53:18 +01:00
Anatol Belski
189ea77101 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  use some dynamically generated NAN as well
2017-02-07 13:18:38 +01:00
Anatol Belski
044dd30440 use some dynamically generated NAN as well 2017-02-07 13:16:30 +01:00
Anatol Belski
265c53dbbf Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  switch to smart str conversion routine to hide exact NAN type
2017-02-07 12:03:21 +01:00
Anatol Belski
fd521a22f7 switch to smart str conversion routine to hide exact NAN type
see https://github.com/php/php-src/pull/2356#issuecomment-277564135
2017-02-07 12:01:14 +01:00
Nikita Popov
546af1966e Merge branch 'PHP-7.0' into PHP-7.1 2017-02-06 01:46:01 +01:00
Nikita Popov
8a8aa67844 Revert "Fix detection of isnan and isinf"
This reverts commit 9ea0949f43.
2017-02-06 01:45:53 +01:00
Nikita Popov
70b27b5ad8 Merge branch 'PHP-7.0' into PHP-7.1 2017-02-05 18:10:04 +01:00
Christian Schmidt
9ea0949f43 Fix detection of isnan and isinf
The isnan() and isinf() are C99 macros not functions.

Also fix is_infinite(-INF) in case isinf is not defined.
2017-02-05 18:09:04 +01:00
Andrea Faulds
b87e399393 Merge branch 'PHP-7.0' into PHP-7.1 2017-02-05 01:31:42 +00:00
Andrea Faulds
21d7878690 Fix bug #73954 2017-02-05 01:30:20 +00:00
Nikita Popov
e81f30ad1d Merge branch 'PHP-7.0' into PHP-7.1 2017-02-02 18:33:42 +01:00
Mitch Hagstrand
dd9cf23457 BUG #73998: Numeric properties are not accessible from get_object_vars 2017-02-02 18:33:10 +01:00
Joe Watkins
46de334452
Revert "Inheritance checks should not ignore parents if these implement an interface"
This reverts commit b67eb3440b.
2017-02-01 18:34:14 +00:00
Joe Watkins
648238da5c
Revert "Added tests demonstrating the same effect with abstracts"
This reverts commit c11b2b809d.
2017-02-01 18:33:47 +00:00
Dmitry Stogov
ddf41b505c Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  typo
2017-02-01 17:37:40 +03:00
Dmitry Stogov
3f89b630b4 typo 2017-02-01 17:36:55 +03:00
Dmitry Stogov
8f7f8d3f9b Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fixed macro
2017-02-01 16:05:57 +03:00
Dmitry Stogov
15e9aa1706 fixed macro 2017-02-01 16:05:33 +03:00
Anatol Belski
5b5130c4ff Revert "backport 51e1da6ea1 into 7.0"
This reverts commit 8da8756312.
2017-01-31 14:21:20 +01:00
Pedro Magalhães
c11b2b809d
Added tests demonstrating the same effect with abstracts 2017-01-28 06:28:14 +00:00
Pedro Magalhães
b67eb3440b
Inheritance checks should not ignore parents if these implement an interface 2017-01-28 06:28:10 +00:00
Joe Watkins
2d339fa4d1
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed #73973 - debug_zval_dump() assertion error for resource consts with --enable-debug
2017-01-26 09:04:25 +00:00
andrewnester
f65ae82c55
Fixed #73973 - debug_zval_dump() assertion error for resource consts with --enable-debug 2017-01-26 09:03:47 +00:00
Anatol Belski
403f352482 make length check more robust 2017-01-24 13:24:11 +01:00
Joe Watkins
5589df128c
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  move decl to correct place
2017-01-23 05:34:21 +00:00
Joe Watkins
d636467937
move decl to correct place 2017-01-23 05:33:58 +00:00
Joe Watkins
8bda542064
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed #73969 - Fixed segmentation fault when debug_print_backtrace called
2017-01-22 16:11:57 +00:00
andrewnester
6f912f7c04
Fixed #73969 - Fixed segmentation fault when debug_print_backtrace called 2017-01-22 16:11:25 +00:00
Anatol Belski
8da8756312 backport 51e1da6ea1 into 7.0 2017-01-21 02:56:15 +01:00
Anatol Belski
51e1da6ea1 exclude debug code 2017-01-21 02:17:06 +01:00
Anatol Belski
6b6122a957 ensure the string for conversion is \0 terminated and integrade
additional path length check
2017-01-21 02:11:24 +01:00
Anatol Belski
95406c878a Fixed bug #73962 bug with symlink related to cyrillic directory 2017-01-20 23:45:08 +01:00
Remi Collet
7ea7d3d829 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  NEWS
  Fixed bug #73965 DTrace reported as enabled when disabled
2017-01-20 17:46:24 +01:00
Remi Collet
f81b7df618 Fixed bug #73965 DTrace reported as enabled when disabled 2017-01-20 17:45:15 +01:00
Xinchen Hui
b25be216c1 Remove redundant reference handling 2017-01-13 13:05:22 +08:00
Xinchen Hui
18f4ff4131 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #73916 (zend_print_flat_zval_r doesn't consider reference)
2017-01-13 13:04:53 +08:00
Xinchen Hui
04379bcb1d Fixed bug #73916 (zend_print_flat_zval_r doesn't consider reference) 2017-01-13 13:04:37 +08:00
Rasmus Lerdorf
08c7ff0df4 Ok, maybe Nikita is right. We should default this on. 2017-01-10 12:16:45 -05:00
Rasmus Lerdorf
ffd870f63d Missed one. This needs gc as well 2017-01-10 12:07:47 -05:00
Rasmus Lerdorf
47fcb75a90 These tests expect gc to be enabled 2017-01-10 11:54:49 -05:00
Dmitry Stogov
9a159f37e1 Improved GENERATOR_CREATE opcode handler. 2017-01-09 22:24:21 +03:00
Anatol Belski
1f22daeb0f Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  [ast] Fix exporting **= in expansion of assign op
2017-01-08 18:54:28 +01:00
Sara Golemon
5df97b339e [ast] Fix exporting **= in expansion of assign op
(cherry picked from commit 9c3865eb6a)
2017-01-08 18:43:47 +01:00
Anatol Belski
b716a1fbef fix edge case leak 2017-01-07 01:15:49 +01:00
Anatol Belski
0f410f8087 Fixed bug #73877 readlink() returns garbage for UTF-8 paths 2017-01-07 01:09:17 +01:00
Nikita Popov
49d90dcc4d Add Z_EXTRA macro
For use with u2 values which don't deserve a custom macro...
2017-01-05 00:49:19 +01: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
Joe Watkins
26b7e2e044
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  remove duplicate test
2017-01-04 14:51:21 +00:00
Joe Watkins
0d09b98ac4
remove duplicate test 2017-01-04 14:50:59 +00:00
Joe Watkins
d514f23573
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix test
2017-01-04 14:36:37 +00:00
Joe Watkins
b39310c715
fix test 2017-01-04 14:36:18 +00:00
Joe Watkins
6c9164047e
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  get_defined_functions additional parameter to exclude disabled functions
  news entry for PR #1312
2017-01-04 13:36:04 +00:00
Joe Watkins
63d116e571
Merge branch 'pull-request/1312' into PHP-7.0
* pull-request/1312:
  get_defined_functions extra parameter to exclude disabled functions
  news entry for PR #1312
2017-01-04 13:34:31 +00:00
Stanislav Malyshev
ca72faa2c5 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix #73832 - leave the table in a safe state if the size is too big.
  Fix bug #73831 - NULL Pointer Dereference while unserialize php object
2017-01-02 21:37:06 -08:00
Stanislav Malyshev
4cc0286f2f Fix #73832 - leave the table in a safe state if the size is too big. 2017-01-02 20:14:05 -08:00
Nikita Popov
12922f2a58 Merge branch 'PHP-7.0' into PHP-7.1 2016-12-29 21:41:21 +01:00