Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 84 lines (68 sloc) 2.137 kB
313b08d - Commit new VM
andi authored
1 {%DEFINES%}
2
3 ZEND_API void {%EXECUTOR_NAME%}(zend_op_array *op_array TSRMLS_DC)
4 {
1c7b18a Changed EG(argument_stack) implementation.
dmitry authored
5 zend_execute_data *execute_data;
945c74f - Removed direct executor recursion.
dmitry authored
6 zend_bool nested = 0;
7 zend_bool original_in_execution = EG(in_execution);
313b08d - Commit new VM
andi authored
8 {%HELPER_VARS%}
9
82e7f50 - Fix typo
andi authored
10 {%INTERNAL_LABELS%}
313b08d - Commit new VM
andi authored
11
c982c39 Fixed bug #35437 (Segfault or Invalid Opcode 137/1/4)
dmitry authored
12 if (EG(exception)) {
13 return;
14 }
15
945c74f - Removed direct executor recursion.
dmitry authored
16 EG(in_execution) = 1;
17
18 zend_vm_enter:
313b08d - Commit new VM
andi authored
19 /* Initialize execute_data */
1c7b18a Changed EG(argument_stack) implementation.
dmitry authored
20 execute_data = (zend_execute_data *)zend_vm_stack_alloc(
21 sizeof(zend_execute_data) +
44b8367 Lazy EG(active_symbol_table) initialization
dmitry authored
22 sizeof(zval**) * op_array->last_var * (EG(active_symbol_table) ? 1 : 2) +
1c7b18a Changed EG(argument_stack) implementation.
dmitry authored
23 sizeof(temp_variable) * op_array->T TSRMLS_CC);
24
25 EX(CVs) = (zval***)((char*)execute_data + sizeof(zend_execute_data));
26 memset(EX(CVs), 0, sizeof(zval**) * op_array->last_var);
44b8367 Lazy EG(active_symbol_table) initialization
dmitry authored
27 EX(Ts) = (temp_variable *)(EX(CVs) + op_array->last_var * (EG(active_symbol_table) ? 1 : 2));
313b08d - Commit new VM
andi authored
28 EX(fbc) = NULL;
0d0338d Late Static Binding (Dmitry, Etienne Kneuss)
dmitry authored
29 EX(called_scope) = NULL;
313b08d - Commit new VM
andi authored
30 EX(object) = NULL;
76abc4f fix #33771 (error_reporting falls to 0 when @ was used inside try/catch
tony2001 authored
31 EX(old_error_reporting) = NULL;
313b08d - Commit new VM
andi authored
32 EX(op_array) = op_array;
33 EX(symbol_table) = EG(active_symbol_table);
34 EX(prev_execute_data) = EG(current_execute_data);
1c7b18a Changed EG(argument_stack) implementation.
dmitry authored
35 EG(current_execute_data) = execute_data;
945c74f - Removed direct executor recursion.
dmitry authored
36 EX(nested) = nested;
37 nested = 1;
313b08d - Commit new VM
andi 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
451a604 Use IS_CV for dirrent access to $this variable
dmitry 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_ascii_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 }
313b08d - Commit new VM
andi authored
54 }
55 }
56
57 EG(opline_ptr) = &EX(opline);
58
59 EX(function_state).function = (zend_function *) op_array;
1c7b18a Changed EG(argument_stack) implementation.
dmitry authored
60 EX(function_state).arguments = NULL;
1d374f1 WS
dmitry authored
61
313b08d - Commit new VM
andi authored
62 while (1) {
1c7b18a Changed EG(argument_stack) implementation.
dmitry authored
63 {%ZEND_VM_CONTINUE_LABEL%}
313b08d - Commit new VM
andi authored
64 #ifdef ZEND_WIN32
65 if (EG(timed_out)) {
66 zend_timeout(0);
67 }
68 #endif
69
70 {%ZEND_VM_DISPATCH%} {
c9e63a8 Fixed bug #43136 (possible crash on script execution timeout. The
dmitry authored
71 {%INTERNAL_EXECUTOR%}
313b08d - Commit new VM
andi 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
b0d25eb - Fix compile warnings
jani authored
80 void {%INITIALIZER_NAME%}(void)
313b08d - Commit new VM
andi authored
81 {
82 {%EXTERNAL_LABELS%}
83 }
Something went wrong with that request. Please try again.