Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 84 lines (68 sloc) 2.271 kB
e50a6fd @andigutmans - Commit new VM
andigutmans authored
1 {%DEFINES%}
2
3 ZEND_API void {%EXECUTOR_NAME%}(zend_op_array *op_array TSRMLS_DC)
4 {
0b68251 Changed EG(argument_stack) implementation.
Dmitry Stogov authored
5 zend_execute_data *execute_data;
76a9a42 - Removed direct executor recursion.
Dmitry Stogov authored
6 zend_bool nested = 0;
7 zend_bool original_in_execution = EG(in_execution);
e50a6fd @andigutmans - Commit new VM
andigutmans authored
8 {%HELPER_VARS%}
9
72558f2 @andigutmans - Fix typo
andigutmans authored
10 {%INTERNAL_LABELS%}
e50a6fd @andigutmans - Commit new VM
andigutmans authored
11
916ad6c Fixed bug #35437 (Segfault or Invalid Opcode 137/1/4)
Dmitry Stogov authored
12 if (EG(exception)) {
13 return;
14 }
15
76a9a42 - Removed direct executor recursion.
Dmitry Stogov authored
16 EG(in_execution) = 1;
17
18 zend_vm_enter:
e50a6fd @andigutmans - Commit new VM
andigutmans authored
19 /* Initialize execute_data */
0b68251 Changed EG(argument_stack) implementation.
Dmitry Stogov authored
20 execute_data = (zend_execute_data *)zend_vm_stack_alloc(
4016bfc Fixed bug #46074 (Bus error during running PHP CLI under IRIX 6.5.30)
Dmitry Stogov authored
21 ZEND_MM_ALIGNED_SIZE(sizeof(zend_execute_data)) +
22 ZEND_MM_ALIGNED_SIZE(sizeof(zval**) * op_array->last_var * (EG(active_symbol_table) ? 1 : 2)) +
23 ZEND_MM_ALIGNED_SIZE(sizeof(temp_variable)) * op_array->T TSRMLS_CC);
0b68251 Changed EG(argument_stack) implementation.
Dmitry Stogov authored
24
4016bfc Fixed bug #46074 (Bus error during running PHP CLI under IRIX 6.5.30)
Dmitry Stogov authored
25 EX(CVs) = (zval***)((char*)execute_data + ZEND_MM_ALIGNED_SIZE(sizeof(zend_execute_data)));
0b68251 Changed EG(argument_stack) implementation.
Dmitry Stogov authored
26 memset(EX(CVs), 0, sizeof(zval**) * op_array->last_var);
4016bfc Fixed bug #46074 (Bus error during running PHP CLI under IRIX 6.5.30)
Dmitry Stogov authored
27 EX(Ts) = (temp_variable *)(((char*)EX(CVs)) + ZEND_MM_ALIGNED_SIZE(sizeof(zval**) * op_array->last_var * (EG(active_symbol_table) ? 1 : 2)));
e50a6fd @andigutmans - Commit new VM
andigutmans authored
28 EX(fbc) = NULL;
166266d Added support for Late Static Binding. (Dmitry, Etienne Kneuss)
Dmitry Stogov authored
29 EX(called_scope) = NULL;
e50a6fd @andigutmans - Commit new VM
andigutmans authored
30 EX(object) = NULL;
f8e8c55 @tony2001 MFH: fix #33771 (error_reporting falls to 0 when @ was used inside tr…
tony2001 authored
31 EX(old_error_reporting) = NULL;
e50a6fd @andigutmans - Commit new VM
andigutmans authored
32 EX(op_array) = op_array;
33 EX(symbol_table) = EG(active_symbol_table);
34 EX(prev_execute_data) = EG(current_execute_data);
0b68251 Changed EG(argument_stack) implementation.
Dmitry Stogov authored
35 EG(current_execute_data) = execute_data;
76a9a42 - Removed direct executor recursion.
Dmitry Stogov authored
36 EX(nested) = nested;
37 nested = 1;
e50a6fd @andigutmans - Commit new VM
andigutmans authored
38
39 if (op_array->start_op) {
40 ZEND_VM_SET_OPCODE(op_array->start_op);
41 } else {
42 ZEND_VM_SET_OPCODE(op_array->opcodes);
43 }
44
5521912 Use IS_CV for dirrent access to $this variable
Dmitry Stogov authored
45 if (op_array->this_var != -1 && EG(This)) {
46 Z_ADDREF_P(EG(This)); /* For $this pointer */
47 if (!EG(active_symbol_table)) {
48 EX(CVs)[op_array->this_var] = (zval**)EX(CVs) + (op_array->last_var + op_array->this_var);
49 *EX(CVs)[op_array->this_var] = EG(This);
50 } else {
51 if (zend_hash_add(EG(active_symbol_table), "this", sizeof("this"), &EG(This), sizeof(zval *), (void**)&EX(CVs)[op_array->this_var])==FAILURE) {
52 Z_DELREF_P(EG(This));
53 }
e50a6fd @andigutmans - Commit new VM
andigutmans authored
54 }
55 }
56
57 EG(opline_ptr) = &EX(opline);
58
59 EX(function_state).function = (zend_function *) op_array;
0b68251 Changed EG(argument_stack) implementation.
Dmitry Stogov authored
60 EX(function_state).arguments = NULL;
e50a6fd @andigutmans - Commit new VM
andigutmans authored
61
62 while (1) {
63 {%ZEND_VM_CONTINUE_LABEL%}
64 #ifdef ZEND_WIN32
65 if (EG(timed_out)) {
66 zend_timeout(0);
67 }
68 #endif
69
70 {%ZEND_VM_DISPATCH%} {
c3ab6bd Fixed bug #43136 (possible crash on script execution timeout. The EG(…
Dmitry Stogov authored
71 {%INTERNAL_EXECUTOR%}
e50a6fd @andigutmans - Commit new VM
andigutmans authored
72 }
73
74 }
75 zend_error_noreturn(E_ERROR, "Arrived at end of main loop which shouldn't happen");
76 }
77
78 {%EXTERNAL_EXECUTOR%}
79
226c56f MFH: Fixed compiler warnings
Jani Taskinen authored
80 void {%INITIALIZER_NAME%}(void)
e50a6fd @andigutmans - Commit new VM
andigutmans authored
81 {
82 {%EXTERNAL_LABELS%}
83 }
Something went wrong with that request. Please try again.