Commit Graph

70405 Commits

Author SHA1 Message Date
Nikita Popov
fafce58683 Add YIELD opcode implementation 2012-05-26 22:44:53 +02:00
Nikita Popov
1a99d1c887 Add way to pass generator object to opcode handlers
The generator zval is put into the return_value_ptr_ptr.
2012-05-26 19:40:29 +02:00
Nikita Popov
f627be5254 Add support for executing a zend_execute_data
This adds another function execute_ex(), which accepts a zend_execute_data
struct to run (contrary to execute(), which accepts a zend_op_array from
which it initialized the execute_data).

This needs a bit more cleanup.
2012-05-26 17:53:13 +02:00
Nikita Popov
ececcbce0e Allow calling zend_vm_gen from everywhere
Before one could only call it with cwd=Zend.
2012-05-23 20:40:21 +02:00
Nikita Popov
2c5ecb4fea Add dummy Iterator implementation
This simply adds dummy rewind/valid/current/key/next methods to Generator.
2012-05-23 16:44:58 +02:00
Nikita Popov
9ce9a7e639 Add initial code for suspending execution
This is just some initial code, which is still quite broken (and needs to be
moved so it can be reused.)
2012-05-23 14:20:25 +02:00
Nikita Popov
5e763d9420 Allocate execute_data using malloc for generators
Generators need to switch the execute_data very often. If the execute_data
is allocated on the VM stack this operation would require to always copy
the structure (which is quite large). That's why the execution context is
allocated on the heap instead (only for generators obviously).
2012-05-22 23:17:59 +02:00
Nikita Popov
46fa26ab85 Make generator functions return a Generator object
Right now generator functions simply immediately return a new Generator
object (no suspension yet).
2012-05-20 14:45:01 +02:00
Nikita Popov
40b7533576 Add some boilerplate code for Generator class
The Generator class now uses a zend_generator struct, so it'll be able to
store additional info.

This commit also ensures that Generator cannot be directly instantiated
and extended. The error tests are now in a separate folder from the
(yet-to-come) functional tests.
2012-05-20 14:19:16 +02:00
Nikita Popov
ca59e5464d Add empty Generator class 2012-05-20 00:03:27 +02:00
Nikita Popov
1cec3f12cc Add ZEND_SUSPEND_AND_RETURN_GENERATOR opcode
If the function is a generator this opcode will be invoked right after
receiving the function arguments.

The current implementation is just a dummy.
2012-05-19 23:19:21 +02:00
Nikita Popov
e14cfafcbf Add zend_do_suspend_if_generator calls
The execution of generator functions will be suspended right after the
arguments were RECVed. This will be done in zend_do_suspend_if_generator.
2012-05-19 20:19:45 +02:00
Nikita Popov
fd2a109f86 Add error if yield is used outside a generator
The yield statement can only be used in generator functions, which are
marked with an asterix.
2012-05-19 18:49:27 +02:00
Nikita Popov
9b51a3b96d Minor code cleanup
The block for the foreach separator was nested unnecessary. This commit
simply removes that nesting.
2012-05-19 14:21:49 +02:00
Nikita Popov
252f623464 Add flag for generator functions
Generator functions have to specify the * (asterix) modifier after the
function keyword. If they do so the ZEND_ACC_GENERATOR flag is added to
the fn_flags.
2012-05-19 14:18:20 +02:00
Nikita Popov
9b101ac8b3 Add T_YIELD "yield" keyword 2012-05-15 18:30:48 +02:00
Anatoliy Belsky
d0d7340d50 Merge branch 'PHP-5.4'
* PHP-5.4:
  Fix bug #61992 ext\standard\tests\general_functions\bug44295.phpt fails
2012-05-10 17:35:09 +02:00
Anatoliy Belsky
b43d6c8522 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fix bug #61992 ext\standard\tests\general_functions\bug44295.phpt fails
2012-05-10 17:32:21 +02:00
Anatoliy Belsky
266578f584 Fix bug #61992 ext\standard\tests\general_functions\bug44295.phpt fails
Exception text differ on windows
2012-05-10 17:07:38 +02:00
Anatoliy Belsky
27685b7bb5 Merge branch 'PHP-5.4'
* PHP-5.4:
  updated NEWS
2012-05-10 15:58:30 +02:00
Anatoliy Belsky
fc0c9054e6 updated NEWS 2012-05-10 15:56:50 +02:00
Anatoliy Belsky
4184551b94 Merge branch 'PHP-5.4'
* PHP-5.4:
  updated NEWS
2012-05-10 15:53:08 +02:00
Anatoliy Belsky
19f85f8676 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  updated NEWS
2012-05-10 15:52:37 +02:00
Anatoliy Belsky
652632a89b updated NEWS 2012-05-10 15:48:56 +02:00
Anatoliy Belsky
f6558a295d Merge branch 'PHP-5.4'
* PHP-5.4:
  Fix bug ext\standard\tests\file\realpath_cache_win32.phpt fails
2012-05-10 15:40:17 +02:00
Anatoliy Belsky
10d5f2301a Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fix bug ext\standard\tests\file\realpath_cache_win32.phpt fails
2012-05-10 15:36:47 +02:00
Anatoliy Belsky
f7d8b274c7 Fix bug ext\standard\tests\file\realpath_cache_win32.phpt fails
What happens here is trivial long overflow. Despite the bug attracted
attention on windows, the same story is on linux. Just wait for a big
anough bucket->key . The linux test had %i to check the key value
which should be %d all the way.
2012-05-10 15:27:44 +02:00
Anatoliy Belsky
e3f2c76989 Merge branch 'PHP-5.4'
* PHP-5.4:
  Fix bug 61901 ext\phar\tests\phar_buildfromdirectory2.phpt fails
2012-05-09 13:06:47 +02:00
Anatoliy Belsky
f76d7be876 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fix bug 61901 ext\phar\tests\phar_buildfromdirectory2.phpt fails
2012-05-09 13:04:32 +02:00
Anatoliy Belsky
7fb16d5bd9 Fix bug 61901 ext\phar\tests\phar_buildfromdirectory2.phpt fails
Another error message is produced by win specific code
2012-05-09 13:02:33 +02:00
Xinchen Hui
134da93fbd Merge branch 'PHP-5.4'
* PHP-5.4:
  Correct test title
2012-05-09 11:29:19 +08:00
Xinchen Hui
d394c17293 Correct test title 2012-05-09 11:28:57 +08:00
Xinchen Hui
67075609d3 Merge branch 'PHP-5.4'
* PHP-5.4:
  Implemented FR #61977 (Need CLI web-server support for files with .htm & svg extensions)
2012-05-09 11:28:09 +08:00
Xinchen Hui
1e60d0c105 Implemented FR #61977 (Need CLI web-server support for files with .htm & svg extensions) 2012-05-09 11:27:39 +08:00
Xinchen Hui
c4d0b796c2 Merge branch 'PHP-5.4'
* PHP-5.4:
  Fix test failed,  the fsockopen will be refused immediately if the server is not set up.
  - BFN
2012-05-09 11:23:37 +08:00
Xinchen Hui
7b2ab56997 Fix test failed, the fsockopen will be refused immediately if the server is not set up. 2012-05-09 11:21:24 +08:00
Felipe Pena
f46a064760 - BFN 2012-05-08 21:07:29 -03:00
Felipe Pena
4dc9545aaa Merge branch 'PHP-5.4'
* PHP-5.4:
  - Fixed bug #61978 (Object recursion not detected for classes that implement JsonSerializable)
2012-05-08 21:06:15 -03:00
Felipe Pena
92bc49b2b0 - Fixed bug #61978 (Object recursion not detected for classes that implement JsonSerializable) 2012-05-08 21:05:51 -03:00
David Soria Parra
e67567088e Merge branch 'PHP-5.4'
* PHP-5.4:
  Typo
2012-05-08 22:09:13 +02:00
David Soria Parra
2cb0ed1328 Typo 2012-05-08 22:08:54 +02:00
Anatoliy Belsky
5fce7fe885 Merge branch 'PHP-5.4'
* PHP-5.4:
  Fix bug 61746 Failing tests in ext/standard/tests/file/windows_links/*
2012-05-08 19:36:15 +02:00
Anatoliy Belsky
87fa84abde Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fix bug 61746 Failing tests in ext/standard/tests/file/windows_links/*
2012-05-08 19:35:13 +02:00
Matt Ficken
c12fdbde5f Fix bug 61746 Failing tests in ext/standard/tests/file/windows_links/*
Fixed that again for systems having their %SYSTEMROOT% not in
c:\windows
2012-05-08 19:31:41 +02:00
Stanislav Malyshev
08779069e8 Merge branch 'PHP-5.4'
* PHP-5.4:
  c++ comments
  restore BC
  ws + restore BC to apache_request_headers
  fix bug #61807 - Buffer Overflow in apache_request_headers
2012-05-08 10:21:10 -07:00
Stanislav Malyshev
057f4719d3 c++ comments 2012-05-08 10:19:24 -07:00
Stanislav Malyshev
1919ec5a55 restore BC 2012-05-08 10:19:24 -07:00
Stanislav Malyshev
bd8912e47c ws + restore BC to apache_request_headers 2012-05-08 10:19:23 -07:00
Stanislav Malyshev
20364bcff9 fix bug #61807 - Buffer Overflow in apache_request_headers 2012-05-08 10:19:23 -07:00
Anatoliy Belsky
eafc567213 Merge branch 'PHP-5.4'
* PHP-5.4:
  updated NEWS
2012-05-08 18:53:36 +02:00