Annotation of embedaddon/php/Zend/zend_vm_execute.h, revision 1.1.1.4
1.1 misho 1: /*
2: +----------------------------------------------------------------------+
3: | Zend Engine |
4: +----------------------------------------------------------------------+
1.1.1.3 misho 5: | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
1.1 misho 6: +----------------------------------------------------------------------+
7: | This source file is subject to version 2.00 of the Zend license, |
8: | that is bundled with this package in the file LICENSE, and is |
9: | available through the world-wide-web at the following url: |
10: | http://www.zend.com/license/2_00.txt. |
11: | If you did not receive a copy of the Zend license and are unable to |
12: | obtain it through the world-wide-web, please send a note to |
13: | license@zend.com so we can mail you a copy immediately. |
14: +----------------------------------------------------------------------+
15: | Authors: Andi Gutmans <andi@zend.com> |
16: | Zeev Suraski <zeev@zend.com> |
17: | Dmitry Stogov <dmitry@zend.com> |
18: +----------------------------------------------------------------------+
19: */
20:
21: #ifdef ZEND_WIN32
22: # pragma warning(once : 4101)
23: #endif
1.1.1.2 misho 24: static user_opcode_handler_t zend_user_opcode_handlers[256] = {
25: (user_opcode_handler_t)NULL,
26: (user_opcode_handler_t)NULL,
27: (user_opcode_handler_t)NULL,
28: (user_opcode_handler_t)NULL,
29: (user_opcode_handler_t)NULL,
30: (user_opcode_handler_t)NULL,
31: (user_opcode_handler_t)NULL,
32: (user_opcode_handler_t)NULL,
33: (user_opcode_handler_t)NULL,
34: (user_opcode_handler_t)NULL,
35: (user_opcode_handler_t)NULL,
36: (user_opcode_handler_t)NULL,
37: (user_opcode_handler_t)NULL,
38: (user_opcode_handler_t)NULL,
39: (user_opcode_handler_t)NULL,
40: (user_opcode_handler_t)NULL,
41: (user_opcode_handler_t)NULL,
42: (user_opcode_handler_t)NULL,
43: (user_opcode_handler_t)NULL,
44: (user_opcode_handler_t)NULL,
45: (user_opcode_handler_t)NULL,
46: (user_opcode_handler_t)NULL,
47: (user_opcode_handler_t)NULL,
48: (user_opcode_handler_t)NULL,
49: (user_opcode_handler_t)NULL,
50: (user_opcode_handler_t)NULL,
51: (user_opcode_handler_t)NULL,
52: (user_opcode_handler_t)NULL,
53: (user_opcode_handler_t)NULL,
54: (user_opcode_handler_t)NULL,
55: (user_opcode_handler_t)NULL,
56: (user_opcode_handler_t)NULL,
57: (user_opcode_handler_t)NULL,
58: (user_opcode_handler_t)NULL,
59: (user_opcode_handler_t)NULL,
60: (user_opcode_handler_t)NULL,
61: (user_opcode_handler_t)NULL,
62: (user_opcode_handler_t)NULL,
63: (user_opcode_handler_t)NULL,
64: (user_opcode_handler_t)NULL,
65: (user_opcode_handler_t)NULL,
66: (user_opcode_handler_t)NULL,
67: (user_opcode_handler_t)NULL,
68: (user_opcode_handler_t)NULL,
69: (user_opcode_handler_t)NULL,
70: (user_opcode_handler_t)NULL,
71: (user_opcode_handler_t)NULL,
72: (user_opcode_handler_t)NULL,
73: (user_opcode_handler_t)NULL,
74: (user_opcode_handler_t)NULL,
75: (user_opcode_handler_t)NULL,
76: (user_opcode_handler_t)NULL,
77: (user_opcode_handler_t)NULL,
78: (user_opcode_handler_t)NULL,
79: (user_opcode_handler_t)NULL,
80: (user_opcode_handler_t)NULL,
81: (user_opcode_handler_t)NULL,
82: (user_opcode_handler_t)NULL,
83: (user_opcode_handler_t)NULL,
84: (user_opcode_handler_t)NULL,
85: (user_opcode_handler_t)NULL,
86: (user_opcode_handler_t)NULL,
87: (user_opcode_handler_t)NULL,
88: (user_opcode_handler_t)NULL,
89: (user_opcode_handler_t)NULL,
90: (user_opcode_handler_t)NULL,
91: (user_opcode_handler_t)NULL,
92: (user_opcode_handler_t)NULL,
93: (user_opcode_handler_t)NULL,
94: (user_opcode_handler_t)NULL,
95: (user_opcode_handler_t)NULL,
96: (user_opcode_handler_t)NULL,
97: (user_opcode_handler_t)NULL,
98: (user_opcode_handler_t)NULL,
99: (user_opcode_handler_t)NULL,
100: (user_opcode_handler_t)NULL,
101: (user_opcode_handler_t)NULL,
102: (user_opcode_handler_t)NULL,
103: (user_opcode_handler_t)NULL,
104: (user_opcode_handler_t)NULL,
105: (user_opcode_handler_t)NULL,
106: (user_opcode_handler_t)NULL,
107: (user_opcode_handler_t)NULL,
108: (user_opcode_handler_t)NULL,
109: (user_opcode_handler_t)NULL,
110: (user_opcode_handler_t)NULL,
111: (user_opcode_handler_t)NULL,
112: (user_opcode_handler_t)NULL,
113: (user_opcode_handler_t)NULL,
114: (user_opcode_handler_t)NULL,
115: (user_opcode_handler_t)NULL,
116: (user_opcode_handler_t)NULL,
117: (user_opcode_handler_t)NULL,
118: (user_opcode_handler_t)NULL,
119: (user_opcode_handler_t)NULL,
120: (user_opcode_handler_t)NULL,
121: (user_opcode_handler_t)NULL,
122: (user_opcode_handler_t)NULL,
123: (user_opcode_handler_t)NULL,
124: (user_opcode_handler_t)NULL,
125: (user_opcode_handler_t)NULL,
126: (user_opcode_handler_t)NULL,
127: (user_opcode_handler_t)NULL,
128: (user_opcode_handler_t)NULL,
129: (user_opcode_handler_t)NULL,
130: (user_opcode_handler_t)NULL,
131: (user_opcode_handler_t)NULL,
132: (user_opcode_handler_t)NULL,
133: (user_opcode_handler_t)NULL,
134: (user_opcode_handler_t)NULL,
135: (user_opcode_handler_t)NULL,
136: (user_opcode_handler_t)NULL,
137: (user_opcode_handler_t)NULL,
138: (user_opcode_handler_t)NULL,
139: (user_opcode_handler_t)NULL,
140: (user_opcode_handler_t)NULL,
141: (user_opcode_handler_t)NULL,
142: (user_opcode_handler_t)NULL,
143: (user_opcode_handler_t)NULL,
144: (user_opcode_handler_t)NULL,
145: (user_opcode_handler_t)NULL,
146: (user_opcode_handler_t)NULL,
147: (user_opcode_handler_t)NULL,
148: (user_opcode_handler_t)NULL,
149: (user_opcode_handler_t)NULL,
150: (user_opcode_handler_t)NULL,
151: (user_opcode_handler_t)NULL,
152: (user_opcode_handler_t)NULL,
153: (user_opcode_handler_t)NULL,
154: (user_opcode_handler_t)NULL,
155: (user_opcode_handler_t)NULL,
156: (user_opcode_handler_t)NULL,
157: (user_opcode_handler_t)NULL,
158: (user_opcode_handler_t)NULL,
159: (user_opcode_handler_t)NULL,
160: (user_opcode_handler_t)NULL,
161: (user_opcode_handler_t)NULL,
162: (user_opcode_handler_t)NULL,
163: (user_opcode_handler_t)NULL,
164: (user_opcode_handler_t)NULL,
165: (user_opcode_handler_t)NULL,
166: (user_opcode_handler_t)NULL,
167: (user_opcode_handler_t)NULL,
168: (user_opcode_handler_t)NULL,
169: (user_opcode_handler_t)NULL,
170: (user_opcode_handler_t)NULL,
171: (user_opcode_handler_t)NULL,
172: (user_opcode_handler_t)NULL,
173: (user_opcode_handler_t)NULL,
174: (user_opcode_handler_t)NULL,
175: (user_opcode_handler_t)NULL,
176: (user_opcode_handler_t)NULL,
177: (user_opcode_handler_t)NULL,
178: (user_opcode_handler_t)NULL,
179: (user_opcode_handler_t)NULL,
180: (user_opcode_handler_t)NULL,
181: (user_opcode_handler_t)NULL,
182: (user_opcode_handler_t)NULL,
183: (user_opcode_handler_t)NULL,
184: (user_opcode_handler_t)NULL,
185: (user_opcode_handler_t)NULL,
186: (user_opcode_handler_t)NULL,
187: (user_opcode_handler_t)NULL,
188: (user_opcode_handler_t)NULL,
189: (user_opcode_handler_t)NULL,
190: (user_opcode_handler_t)NULL,
191: (user_opcode_handler_t)NULL,
192: (user_opcode_handler_t)NULL,
193: (user_opcode_handler_t)NULL,
194: (user_opcode_handler_t)NULL,
195: (user_opcode_handler_t)NULL,
196: (user_opcode_handler_t)NULL,
197: (user_opcode_handler_t)NULL,
198: (user_opcode_handler_t)NULL,
199: (user_opcode_handler_t)NULL,
200: (user_opcode_handler_t)NULL,
201: (user_opcode_handler_t)NULL,
202: (user_opcode_handler_t)NULL,
203: (user_opcode_handler_t)NULL,
204: (user_opcode_handler_t)NULL,
205: (user_opcode_handler_t)NULL,
206: (user_opcode_handler_t)NULL,
207: (user_opcode_handler_t)NULL,
208: (user_opcode_handler_t)NULL,
209: (user_opcode_handler_t)NULL,
210: (user_opcode_handler_t)NULL,
211: (user_opcode_handler_t)NULL,
212: (user_opcode_handler_t)NULL,
213: (user_opcode_handler_t)NULL,
214: (user_opcode_handler_t)NULL,
215: (user_opcode_handler_t)NULL,
216: (user_opcode_handler_t)NULL,
217: (user_opcode_handler_t)NULL,
218: (user_opcode_handler_t)NULL,
219: (user_opcode_handler_t)NULL,
220: (user_opcode_handler_t)NULL,
221: (user_opcode_handler_t)NULL,
222: (user_opcode_handler_t)NULL,
223: (user_opcode_handler_t)NULL,
224: (user_opcode_handler_t)NULL,
225: (user_opcode_handler_t)NULL,
226: (user_opcode_handler_t)NULL,
227: (user_opcode_handler_t)NULL,
228: (user_opcode_handler_t)NULL,
229: (user_opcode_handler_t)NULL,
230: (user_opcode_handler_t)NULL,
231: (user_opcode_handler_t)NULL,
232: (user_opcode_handler_t)NULL,
233: (user_opcode_handler_t)NULL,
234: (user_opcode_handler_t)NULL,
235: (user_opcode_handler_t)NULL,
236: (user_opcode_handler_t)NULL,
237: (user_opcode_handler_t)NULL,
238: (user_opcode_handler_t)NULL,
239: (user_opcode_handler_t)NULL,
240: (user_opcode_handler_t)NULL,
241: (user_opcode_handler_t)NULL,
242: (user_opcode_handler_t)NULL,
243: (user_opcode_handler_t)NULL,
244: (user_opcode_handler_t)NULL,
245: (user_opcode_handler_t)NULL,
246: (user_opcode_handler_t)NULL,
247: (user_opcode_handler_t)NULL,
248: (user_opcode_handler_t)NULL,
249: (user_opcode_handler_t)NULL,
250: (user_opcode_handler_t)NULL,
251: (user_opcode_handler_t)NULL,
252: (user_opcode_handler_t)NULL,
253: (user_opcode_handler_t)NULL,
254: (user_opcode_handler_t)NULL,
255: (user_opcode_handler_t)NULL,
256: (user_opcode_handler_t)NULL,
257: (user_opcode_handler_t)NULL,
258: (user_opcode_handler_t)NULL,
259: (user_opcode_handler_t)NULL,
260: (user_opcode_handler_t)NULL,
261: (user_opcode_handler_t)NULL,
262: (user_opcode_handler_t)NULL,
263: (user_opcode_handler_t)NULL,
264: (user_opcode_handler_t)NULL,
265: (user_opcode_handler_t)NULL,
266: (user_opcode_handler_t)NULL,
267: (user_opcode_handler_t)NULL,
268: (user_opcode_handler_t)NULL,
269: (user_opcode_handler_t)NULL,
270: (user_opcode_handler_t)NULL,
271: (user_opcode_handler_t)NULL,
272: (user_opcode_handler_t)NULL,
273: (user_opcode_handler_t)NULL,
274: (user_opcode_handler_t)NULL,
275: (user_opcode_handler_t)NULL,
276: (user_opcode_handler_t)NULL,
277: (user_opcode_handler_t)NULL,
278: (user_opcode_handler_t)NULL,
279: (user_opcode_handler_t)NULL,
280: (user_opcode_handler_t)NULL
281: };
282:
283: static zend_uchar zend_user_opcodes[256] = {0,
284: 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,
285: 17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,
286: 33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,
287: 49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,
288: 65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,
289: 81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,
290: 97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,
291: 113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,
292: 129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,
293: 145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,
294: 161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,
295: 177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,
296: 193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,
297: 209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,
298: 225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,
299: 241,242,243,244,245,246,247,248,249,250,251,252,253,254,255
300: };
1.1 misho 301:
302: static opcode_handler_t zend_vm_get_opcode_handler(zend_uchar opcode, zend_op* op);
303:
304:
1.1.1.2 misho 305: #undef OPLINE
306: #undef DCL_OPLINE
307: #undef USE_OPLINE
308: #undef LOAD_OPLINE
309: #undef SAVE_OPLINE
310: #define OPLINE EX(opline)
311: #define DCL_OPLINE
312: #define USE_OPLINE zend_op *opline = EX(opline);
313: #define LOAD_OPLINE()
314: #define SAVE_OPLINE()
315: #undef CHECK_EXCEPTION
316: #undef HANDLE_EXCEPTION
317: #undef HANDLE_EXCEPTION_LEAVE
318: #define CHECK_EXCEPTION() LOAD_OPLINE()
319: #define HANDLE_EXCEPTION() LOAD_OPLINE(); ZEND_VM_CONTINUE()
320: #define HANDLE_EXCEPTION_LEAVE() LOAD_OPLINE(); ZEND_VM_LEAVE()
321: #define LOAD_REGS()
322: #define ZEND_VM_CONTINUE() return 0
323: #define ZEND_VM_RETURN() return 1
324: #define ZEND_VM_ENTER() return 2
325: #define ZEND_VM_LEAVE() return 3
1.1 misho 326: #define ZEND_VM_DISPATCH(opcode, opline) return zend_vm_get_opcode_handler(opcode, opline)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
327:
328: #define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_INTERNAL execute_data TSRMLS_CC
329: #undef EX
330: #define EX(element) execute_data->element
331:
1.1.1.2 misho 332: #undef EX_CV
333: #define EX_CV(var) EX(CVs)[var]
334: #undef EX_CVs
335: #define EX_CVs() EX(CVs)
336: #undef EX_T
337: #define EX_T(offset) (*(temp_variable *)((char *) EX(Ts) + offset))
338: #undef EX_Ts
339: #define EX_Ts() EX(Ts)
340:
1.1 misho 341:
342: ZEND_API void execute(zend_op_array *op_array TSRMLS_DC)
343: {
1.1.1.2 misho 344: DCL_OPLINE
1.1 misho 345: zend_execute_data *execute_data;
346: zend_bool nested = 0;
347: zend_bool original_in_execution = EG(in_execution);
348:
349:
350: if (EG(exception)) {
351: return;
352: }
353:
354: EG(in_execution) = 1;
355:
356: zend_vm_enter:
357: /* Initialize execute_data */
358: execute_data = (zend_execute_data *)zend_vm_stack_alloc(
359: ZEND_MM_ALIGNED_SIZE(sizeof(zend_execute_data)) +
360: ZEND_MM_ALIGNED_SIZE(sizeof(zval**) * op_array->last_var * (EG(active_symbol_table) ? 1 : 2)) +
361: ZEND_MM_ALIGNED_SIZE(sizeof(temp_variable)) * op_array->T TSRMLS_CC);
362:
363: EX(CVs) = (zval***)((char*)execute_data + ZEND_MM_ALIGNED_SIZE(sizeof(zend_execute_data)));
364: memset(EX(CVs), 0, sizeof(zval**) * op_array->last_var);
365: EX(Ts) = (temp_variable *)(((char*)EX(CVs)) + ZEND_MM_ALIGNED_SIZE(sizeof(zval**) * op_array->last_var * (EG(active_symbol_table) ? 1 : 2)));
366: EX(fbc) = NULL;
367: EX(called_scope) = NULL;
368: EX(object) = NULL;
369: EX(old_error_reporting) = NULL;
370: EX(op_array) = op_array;
371: EX(symbol_table) = EG(active_symbol_table);
372: EX(prev_execute_data) = EG(current_execute_data);
373: EG(current_execute_data) = execute_data;
374: EX(nested) = nested;
375: nested = 1;
376:
1.1.1.2 misho 377: LOAD_REGS();
378:
379: if (!op_array->run_time_cache && op_array->last_cache_slot) {
380: op_array->run_time_cache = ecalloc(op_array->last_cache_slot, sizeof(void*));
1.1 misho 381: }
382:
383: if (op_array->this_var != -1 && EG(This)) {
384: Z_ADDREF_P(EG(This)); /* For $this pointer */
385: if (!EG(active_symbol_table)) {
1.1.1.2 misho 386: EX_CV(op_array->this_var) = (zval**)EX_CVs() + (op_array->last_var + op_array->this_var);
387: *EX_CV(op_array->this_var) = EG(This);
1.1 misho 388: } else {
1.1.1.2 misho 389: if (zend_hash_add(EG(active_symbol_table), "this", sizeof("this"), &EG(This), sizeof(zval *), (void**)&EX_CV(op_array->this_var))==FAILURE) {
1.1 misho 390: Z_DELREF_P(EG(This));
391: }
392: }
393: }
394:
1.1.1.2 misho 395: EX(opline) = UNEXPECTED((op_array->fn_flags & ZEND_ACC_INTERACTIVE) != 0) && EG(start_op) ? EG(start_op) : op_array->opcodes;
1.1 misho 396: EG(opline_ptr) = &EX(opline);
1.1.1.2 misho 397: LOAD_OPLINE();
1.1 misho 398:
399: EX(function_state).function = (zend_function *) op_array;
400: EX(function_state).arguments = NULL;
1.1.1.2 misho 401:
1.1 misho 402: while (1) {
403: int ret;
404: #ifdef ZEND_WIN32
405: if (EG(timed_out)) {
406: zend_timeout(0);
407: }
408: #endif
409:
1.1.1.2 misho 410: if ((ret = OPLINE->handler(execute_data TSRMLS_CC)) > 0) {
1.1 misho 411: switch (ret) {
412: case 1:
413: EG(in_execution) = original_in_execution;
414: return;
415: case 2:
416: op_array = EG(active_op_array);
417: goto zend_vm_enter;
418: case 3:
419: execute_data = EG(current_execute_data);
420: default:
421: break;
422: }
423: }
424:
425: }
426: zend_error_noreturn(E_ERROR, "Arrived at end of main loop which shouldn't happen");
427: }
428:
429: static int ZEND_FASTCALL ZEND_JMP_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
430: {
1.1.1.2 misho 431: USE_OPLINE
432:
1.1 misho 433: #if DEBUG_ZEND>=2
1.1.1.2 misho 434: printf("Jumping to %d\n", opline->op1.opline_num);
1.1 misho 435: #endif
1.1.1.2 misho 436: ZEND_VM_SET_OPCODE(opline->op1.jmp_addr);
1.1 misho 437: ZEND_VM_CONTINUE(); /* CHECK_ME */
438: }
439:
440: static int ZEND_FASTCALL ZEND_INIT_STRING_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
441: {
1.1.1.2 misho 442: USE_OPLINE
443: zval *tmp = &EX_T(opline->result.var).tmp_var;
1.1 misho 444:
1.1.1.2 misho 445: SAVE_OPLINE();
1.1 misho 446: tmp->value.str.val = emalloc(1);
447: tmp->value.str.val[0] = 0;
448: tmp->value.str.len = 0;
449: Z_SET_REFCOUNT_P(tmp, 1);
450: tmp->type = IS_STRING;
451: Z_UNSET_ISREF_P(tmp);
1.1.1.2 misho 452: /*CHECK_EXCEPTION();*/
1.1 misho 453: ZEND_VM_NEXT_OPCODE();
454: }
455:
456: static int ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS)
457: {
458: zend_bool nested;
459: zend_op_array *op_array = EX(op_array);
460:
461: EG(current_execute_data) = EX(prev_execute_data);
462: EG(opline_ptr) = NULL;
463: if (!EG(active_symbol_table)) {
1.1.1.2 misho 464: zval ***cv = EX_CVs();
465: zval ***end = cv + op_array->last_var;
1.1 misho 466: while (cv != end) {
467: if (*cv) {
468: zval_ptr_dtor(*cv);
469: }
470: cv++;
471: }
472: }
473:
474: if ((op_array->fn_flags & ZEND_ACC_CLOSURE) && op_array->prototype) {
475: zval_ptr_dtor((zval**)&op_array->prototype);
476: }
477:
478: nested = EX(nested);
479:
480: zend_vm_stack_free(execute_data TSRMLS_CC);
481:
482: if (nested) {
483: execute_data = EG(current_execute_data);
1.1.1.2 misho 484: }
485: if (nested) {
486: USE_OPLINE
1.1 misho 487:
1.1.1.2 misho 488: LOAD_REGS();
489: LOAD_OPLINE();
490: if (UNEXPECTED(opline->opcode == ZEND_INCLUDE_OR_EVAL)) {
1.1 misho 491:
492: EX(function_state).function = (zend_function *) EX(op_array);
493: EX(function_state).arguments = NULL;
494: EX(object) = EX(current_object);
495:
496: EG(opline_ptr) = &EX(opline);
497: EG(active_op_array) = EX(op_array);
498: EG(return_value_ptr_ptr) = EX(original_return_value);
499: destroy_op_array(op_array TSRMLS_CC);
500: efree(op_array);
1.1.1.2 misho 501: if (UNEXPECTED(EG(exception) != NULL)) {
1.1 misho 502: zend_throw_exception_internal(NULL TSRMLS_CC);
1.1.1.2 misho 503: HANDLE_EXCEPTION_LEAVE();
504: } else if (RETURN_VALUE_USED(opline)) {
505: if (!EX_T(opline->result.var).var.ptr) { /* there was no return statement */
506: zval *retval;
507:
508: ALLOC_ZVAL(retval);
509: ZVAL_BOOL(retval, 1);
510: INIT_PZVAL(retval);
511: EX_T(opline->result.var).var.ptr = retval;
512: }
1.1 misho 513: }
514:
1.1.1.2 misho 515: ZEND_VM_INC_OPCODE();
1.1 misho 516: ZEND_VM_LEAVE();
517: } else {
518:
519: EG(opline_ptr) = &EX(opline);
520: EG(active_op_array) = EX(op_array);
521: EG(return_value_ptr_ptr) = EX(original_return_value);
522: if (EG(active_symbol_table)) {
523: if (EG(symtable_cache_ptr)>=EG(symtable_cache_limit)) {
524: zend_hash_destroy(EG(active_symbol_table));
525: FREE_HASHTABLE(EG(active_symbol_table));
526: } else {
527: /* clean before putting into the cache, since clean
528: could call dtors, which could use cached hash */
529: zend_hash_clean(EG(active_symbol_table));
530: *(++EG(symtable_cache_ptr)) = EG(active_symbol_table);
531: }
532: }
533: EG(active_symbol_table) = EX(symbol_table);
534:
535: EX(function_state).function = (zend_function *) EX(op_array);
536: EX(function_state).arguments = NULL;
537:
538: if (EG(This)) {
1.1.1.2 misho 539: if (UNEXPECTED(EG(exception) != NULL) && IS_CTOR_CALL(EX(called_scope))) {
1.1 misho 540: if (IS_CTOR_USED(EX(called_scope))) {
541: Z_DELREF_P(EG(This));
542: }
543: if (Z_REFCOUNT_P(EG(This)) == 1) {
544: zend_object_store_ctor_failed(EG(This) TSRMLS_CC);
545: }
546: }
547: zval_ptr_dtor(&EG(This));
548: }
549: EG(This) = EX(current_this);
550: EG(scope) = EX(current_scope);
551: EG(called_scope) = EX(current_called_scope);
552:
553: EX(object) = EX(current_object);
554: EX(called_scope) = DECODE_CTOR(EX(called_scope));
555:
556: zend_vm_stack_clear_multiple(TSRMLS_C);
557:
1.1.1.2 misho 558: if (UNEXPECTED(EG(exception) != NULL)) {
1.1 misho 559: zend_throw_exception_internal(NULL TSRMLS_CC);
1.1.1.2 misho 560: if (RETURN_VALUE_USED(opline) && EX_T(opline->result.var).var.ptr) {
561: zval_ptr_dtor(&EX_T(opline->result.var).var.ptr);
1.1 misho 562: }
1.1.1.2 misho 563: HANDLE_EXCEPTION_LEAVE();
1.1 misho 564: }
565:
1.1.1.2 misho 566: ZEND_VM_INC_OPCODE();
1.1 misho 567: ZEND_VM_LEAVE();
568: }
569: }
570: ZEND_VM_RETURN();
571: }
572:
573: static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS)
574: {
1.1.1.2 misho 575: USE_OPLINE
1.1 misho 576: zend_bool should_change_scope = 0;
1.1.1.2 misho 577: zend_function *fbc = EX(function_state).function;
1.1 misho 578:
1.1.1.2 misho 579: SAVE_OPLINE();
580: if (UNEXPECTED((fbc->common.fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_DEPRECATED)) != 0)) {
581: if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_ABSTRACT) != 0)) {
582: zend_error_noreturn(E_ERROR, "Cannot call abstract method %s::%s()", fbc->common.scope->name, fbc->common.function_name);
583: CHECK_EXCEPTION();
1.1 misho 584: ZEND_VM_NEXT_OPCODE(); /* Never reached */
585: }
1.1.1.2 misho 586: if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_DEPRECATED) != 0)) {
1.1 misho 587: zend_error(E_DEPRECATED, "Function %s%s%s() is deprecated",
1.1.1.2 misho 588: fbc->common.scope ? fbc->common.scope->name : "",
589: fbc->common.scope ? "::" : "",
590: fbc->common.function_name);
1.1 misho 591: }
592: }
1.1.1.2 misho 593: if (fbc->common.scope &&
594: !(fbc->common.fn_flags & ZEND_ACC_STATIC) &&
1.1 misho 595: !EX(object)) {
596:
1.1.1.2 misho 597: if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
1.1 misho 598: /* FIXME: output identifiers properly */
1.1.1.2 misho 599: zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically", fbc->common.scope->name, fbc->common.function_name);
1.1 misho 600: } else {
601: /* FIXME: output identifiers properly */
602: /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
1.1.1.2 misho 603: zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically", fbc->common.scope->name, fbc->common.function_name);
1.1 misho 604: }
605: }
606:
1.1.1.2 misho 607: if (fbc->type == ZEND_USER_FUNCTION || fbc->common.scope) {
1.1 misho 608: should_change_scope = 1;
609: EX(current_this) = EG(This);
610: EX(current_scope) = EG(scope);
611: EX(current_called_scope) = EG(called_scope);
612: EG(This) = EX(object);
1.1.1.2 misho 613: EG(scope) = (fbc->type == ZEND_USER_FUNCTION || !EX(object)) ? fbc->common.scope : NULL;
1.1 misho 614: EG(called_scope) = EX(called_scope);
615: }
616:
617: zend_arg_types_stack_3_pop(&EG(arg_types_stack), &EX(called_scope), &EX(current_object), &EX(fbc));
618: EX(function_state).arguments = zend_vm_stack_push_args(opline->extended_value TSRMLS_CC);
1.1.1.2 misho 619: LOAD_OPLINE();
620:
621: if (fbc->type == ZEND_INTERNAL_FUNCTION) {
622: temp_variable *ret = &EX_T(opline->result.var);
1.1 misho 623:
1.1.1.2 misho 624: if (fbc->common.arg_info) {
1.1 misho 625: zend_uint i=0;
626: zval **p = (zval**)EX(function_state).arguments;
627: ulong arg_count = opline->extended_value;
628:
629: while (arg_count>0) {
1.1.1.2 misho 630: zend_verify_arg_type(fbc, ++i, *(p-arg_count), 0 TSRMLS_CC);
1.1 misho 631: arg_count--;
632: }
633: }
1.1.1.2 misho 634:
1.1.1.3 misho 635: if (EXPECTED(EG(exception) == NULL)) {
636: MAKE_STD_ZVAL(ret->var.ptr);
637: ZVAL_NULL(ret->var.ptr);
638: ret->var.ptr_ptr = &ret->var.ptr;
639: ret->var.fcall_returned_reference = (fbc->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) != 0;
1.1 misho 640:
1.1.1.3 misho 641: if (!zend_execute_internal) {
642: /* saves one function call if zend_execute_internal is not used */
643: fbc->internal_function.handler(opline->extended_value, ret->var.ptr, (fbc->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? &ret->var.ptr : NULL, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC);
644: } else {
645: zend_execute_internal(execute_data, RETURN_VALUE_USED(opline) TSRMLS_CC);
646: }
647:
648: if (!RETURN_VALUE_USED(opline)) {
649: zval_ptr_dtor(&ret->var.ptr);
650: }
651: } else if (RETURN_VALUE_USED(opline)) {
652: EX_T(opline->result.var).var.ptr = NULL;
1.1 misho 653: }
1.1.1.2 misho 654: } else if (fbc->type == ZEND_USER_FUNCTION) {
1.1 misho 655: EX(original_return_value) = EG(return_value_ptr_ptr);
656: EG(active_symbol_table) = NULL;
1.1.1.2 misho 657: EG(active_op_array) = &fbc->op_array;
1.1 misho 658: EG(return_value_ptr_ptr) = NULL;
659: if (RETURN_VALUE_USED(opline)) {
1.1.1.2 misho 660: temp_variable *ret = &EX_T(opline->result.var);
661:
662: ret->var.ptr = NULL;
663: EG(return_value_ptr_ptr) = &ret->var.ptr;
664: ret->var.ptr_ptr = &ret->var.ptr;
665: ret->var.fcall_returned_reference = (fbc->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) != 0;
1.1 misho 666: }
667:
1.1.1.2 misho 668: if (EXPECTED(zend_execute == execute)) {
669: if (EXPECTED(EG(exception) == NULL)) {
670: ZEND_VM_ENTER();
671: }
1.1 misho 672: } else {
673: zend_execute(EG(active_op_array) TSRMLS_CC);
674: }
675:
676: EG(opline_ptr) = &EX(opline);
677: EG(active_op_array) = EX(op_array);
678: EG(return_value_ptr_ptr) = EX(original_return_value);
679: if (EG(active_symbol_table)) {
680: if (EG(symtable_cache_ptr)>=EG(symtable_cache_limit)) {
681: zend_hash_destroy(EG(active_symbol_table));
682: FREE_HASHTABLE(EG(active_symbol_table));
683: } else {
684: /* clean before putting into the cache, since clean
685: could call dtors, which could use cached hash */
686: zend_hash_clean(EG(active_symbol_table));
687: *(++EG(symtable_cache_ptr)) = EG(active_symbol_table);
688: }
689: }
690: EG(active_symbol_table) = EX(symbol_table);
691: } else { /* ZEND_OVERLOADED_FUNCTION */
1.1.1.2 misho 692: MAKE_STD_ZVAL(EX_T(opline->result.var).var.ptr);
693: ZVAL_NULL(EX_T(opline->result.var).var.ptr);
1.1 misho 694:
695: /* Not sure what should be done here if it's a static method */
1.1.1.2 misho 696: if (EXPECTED(EX(object) != NULL)) {
697: Z_OBJ_HT_P(EX(object))->call_method(fbc->common.function_name, opline->extended_value, EX_T(opline->result.var).var.ptr, &EX_T(opline->result.var).var.ptr, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC);
1.1 misho 698: } else {
699: zend_error_noreturn(E_ERROR, "Cannot call overloaded function for non-object");
700: }
701:
1.1.1.2 misho 702: if (fbc->type == ZEND_OVERLOADED_FUNCTION_TEMPORARY) {
703: efree((char*)fbc->common.function_name);
1.1 misho 704: }
1.1.1.2 misho 705: efree(fbc);
1.1 misho 706:
707: if (!RETURN_VALUE_USED(opline)) {
1.1.1.2 misho 708: zval_ptr_dtor(&EX_T(opline->result.var).var.ptr);
1.1 misho 709: } else {
1.1.1.2 misho 710: Z_UNSET_ISREF_P(EX_T(opline->result.var).var.ptr);
711: Z_SET_REFCOUNT_P(EX_T(opline->result.var).var.ptr, 1);
712: EX_T(opline->result.var).var.fcall_returned_reference = 0;
713: EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
1.1 misho 714: }
715: }
716:
717: EX(function_state).function = (zend_function *) EX(op_array);
718: EX(function_state).arguments = NULL;
719:
720: if (should_change_scope) {
721: if (EG(This)) {
1.1.1.2 misho 722: if (UNEXPECTED(EG(exception) != NULL) && IS_CTOR_CALL(EX(called_scope))) {
1.1 misho 723: if (IS_CTOR_USED(EX(called_scope))) {
724: Z_DELREF_P(EG(This));
725: }
726: if (Z_REFCOUNT_P(EG(This)) == 1) {
727: zend_object_store_ctor_failed(EG(This) TSRMLS_CC);
728: }
729: }
730: zval_ptr_dtor(&EG(This));
731: }
732: EG(This) = EX(current_this);
733: EG(scope) = EX(current_scope);
734: EG(called_scope) = EX(current_called_scope);
735: }
736:
737: EX(object) = EX(current_object);
738: EX(called_scope) = DECODE_CTOR(EX(called_scope));
739:
740: zend_vm_stack_clear_multiple(TSRMLS_C);
741:
1.1.1.2 misho 742: if (UNEXPECTED(EG(exception) != NULL)) {
1.1 misho 743: zend_throw_exception_internal(NULL TSRMLS_CC);
1.1.1.2 misho 744: if (RETURN_VALUE_USED(opline) && EX_T(opline->result.var).var.ptr) {
745: zval_ptr_dtor(&EX_T(opline->result.var).var.ptr);
1.1 misho 746: }
1.1.1.2 misho 747: HANDLE_EXCEPTION();
1.1 misho 748: }
749:
750: ZEND_VM_NEXT_OPCODE();
751: }
752:
753: static int ZEND_FASTCALL ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
754: {
755: EX(function_state).function = EX(fbc);
756: return zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
757: }
758:
759: static int ZEND_FASTCALL ZEND_RECV_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
760: {
1.1.1.2 misho 761: USE_OPLINE
762: zend_uint arg_num = opline->op1.num;
1.1 misho 763: zval **param = zend_vm_stack_get_arg(arg_num TSRMLS_CC);
764:
1.1.1.2 misho 765: SAVE_OPLINE();
766: if (UNEXPECTED(param == NULL)) {
1.1 misho 767: if (zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, NULL, opline->extended_value TSRMLS_CC)) {
1.1.1.2 misho 768: const char *space;
769: const char *class_name;
770: zend_execute_data *ptr;
771:
772: if (EG(active_op_array)->scope) {
773: class_name = EG(active_op_array)->scope->name;
774: space = "::";
775: } else {
776: class_name = space = "";
777: }
778: ptr = EX(prev_execute_data);
779:
1.1 misho 780: if(ptr && ptr->op_array) {
1.1.1.2 misho 781: zend_error(E_WARNING, "Missing argument %u for %s%s%s(), called in %s on line %d and defined", opline->op1.num, class_name, space, get_active_function_name(TSRMLS_C), ptr->op_array->filename, ptr->opline->lineno);
1.1 misho 782: } else {
1.1.1.2 misho 783: zend_error(E_WARNING, "Missing argument %u for %s%s%s()", opline->op1.num, class_name, space, get_active_function_name(TSRMLS_C));
1.1 misho 784: }
785: }
786: } else {
787: zval **var_ptr;
788:
789: zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, *param, opline->extended_value TSRMLS_CC);
1.1.1.2 misho 790: var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->result.var TSRMLS_CC);
1.1 misho 791: Z_DELREF_PP(var_ptr);
792: *var_ptr = *param;
793: Z_ADDREF_PP(var_ptr);
794: }
795:
1.1.1.2 misho 796: CHECK_EXCEPTION();
1.1 misho 797: ZEND_VM_NEXT_OPCODE();
798: }
799:
800: static int ZEND_FASTCALL ZEND_NEW_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
801: {
1.1.1.2 misho 802: USE_OPLINE
1.1 misho 803: zval *object_zval;
804: zend_function *constructor;
805:
1.1.1.2 misho 806: SAVE_OPLINE();
807: if (UNEXPECTED((EX_T(opline->op1.var).class_entry->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_IMPLICIT_ABSTRACT_CLASS|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS)) != 0)) {
808: if (EX_T(opline->op1.var).class_entry->ce_flags & ZEND_ACC_INTERFACE) {
809: zend_error_noreturn(E_ERROR, "Cannot instantiate interface %s", EX_T(opline->op1.var).class_entry->name);
810: } else if ((EX_T(opline->op1.var).class_entry->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) {
811: zend_error_noreturn(E_ERROR, "Cannot instantiate trait %s", EX_T(opline->op1.var).class_entry->name);
1.1 misho 812: } else {
1.1.1.2 misho 813: zend_error_noreturn(E_ERROR, "Cannot instantiate abstract class %s", EX_T(opline->op1.var).class_entry->name);
1.1 misho 814: }
815: }
816: ALLOC_ZVAL(object_zval);
1.1.1.2 misho 817: object_init_ex(object_zval, EX_T(opline->op1.var).class_entry);
1.1 misho 818: INIT_PZVAL(object_zval);
819:
820: constructor = Z_OBJ_HT_P(object_zval)->get_constructor(object_zval TSRMLS_CC);
821:
822: if (constructor == NULL) {
823: if (RETURN_VALUE_USED(opline)) {
1.1.1.2 misho 824: AI_SET_PTR(&EX_T(opline->result.var), object_zval);
1.1 misho 825: } else {
826: zval_ptr_dtor(&object_zval);
827: }
1.1.1.2 misho 828: ZEND_VM_JMP(EX(op_array)->opcodes + opline->op2.opline_num);
1.1 misho 829: } else {
830: if (RETURN_VALUE_USED(opline)) {
831: PZVAL_LOCK(object_zval);
1.1.1.2 misho 832: AI_SET_PTR(&EX_T(opline->result.var), object_zval);
1.1 misho 833: }
834:
835: zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), ENCODE_CTOR(EX(called_scope), RETURN_VALUE_USED(opline)));
836:
837: /* We are not handling overloaded classes right now */
838: EX(object) = object_zval;
839: EX(fbc) = constructor;
1.1.1.2 misho 840: EX(called_scope) = EX_T(opline->op1.var).class_entry;
1.1 misho 841:
1.1.1.2 misho 842: CHECK_EXCEPTION();
1.1 misho 843: ZEND_VM_NEXT_OPCODE();
844: }
845: }
846:
847: static int ZEND_FASTCALL ZEND_BEGIN_SILENCE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
848: {
1.1.1.2 misho 849: USE_OPLINE
1.1 misho 850:
1.1.1.2 misho 851: SAVE_OPLINE();
852: Z_LVAL(EX_T(opline->result.var).tmp_var) = EG(error_reporting);
853: Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_LONG; /* shouldn't be necessary */
1.1 misho 854: if (EX(old_error_reporting) == NULL) {
1.1.1.2 misho 855: EX(old_error_reporting) = &EX_T(opline->result.var).tmp_var;
1.1 misho 856: }
857:
858: if (EG(error_reporting)) {
1.1.1.2 misho 859: do {
860: EG(error_reporting) = 0;
861: if (!EG(error_reporting_ini_entry)) {
862: if (UNEXPECTED(zend_hash_find(EG(ini_directives), "error_reporting", sizeof("error_reporting"), (void **) &EG(error_reporting_ini_entry)) == FAILURE)) {
863: break;
864: }
865: }
866: if (!EG(error_reporting_ini_entry)->modified) {
867: if (!EG(modified_ini_directives)) {
868: ALLOC_HASHTABLE(EG(modified_ini_directives));
869: zend_hash_init(EG(modified_ini_directives), 8, NULL, NULL, 0);
870: }
871: if (EXPECTED(zend_hash_add(EG(modified_ini_directives), "error_reporting", sizeof("error_reporting"), &EG(error_reporting_ini_entry), sizeof(zend_ini_entry*), NULL) == SUCCESS)) {
872: EG(error_reporting_ini_entry)->orig_value = EG(error_reporting_ini_entry)->value;
873: EG(error_reporting_ini_entry)->orig_value_length = EG(error_reporting_ini_entry)->value_length;
874: EG(error_reporting_ini_entry)->orig_modifiable = EG(error_reporting_ini_entry)->modifiable;
875: EG(error_reporting_ini_entry)->modified = 1;
876: }
877: } else if (EG(error_reporting_ini_entry)->value != EG(error_reporting_ini_entry)->orig_value) {
878: efree(EG(error_reporting_ini_entry)->value);
879: }
880: EG(error_reporting_ini_entry)->value = estrndup("0", sizeof("0")-1);
881: EG(error_reporting_ini_entry)->value_length = sizeof("0")-1;
882: } while (0);
1.1 misho 883: }
1.1.1.2 misho 884: CHECK_EXCEPTION();
1.1 misho 885: ZEND_VM_NEXT_OPCODE();
886: }
887:
888: static int ZEND_FASTCALL ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
889: {
1.1.1.2 misho 890: SAVE_OPLINE();
1.1 misho 891: zend_error_noreturn(E_ERROR, "Cannot call abstract method %s::%s()", EG(scope)->name, EX(op_array)->function_name);
892: ZEND_VM_NEXT_OPCODE(); /* Never reached */
893: }
894:
895: static int ZEND_FASTCALL ZEND_EXT_STMT_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
896: {
1.1.1.2 misho 897: SAVE_OPLINE();
1.1 misho 898: if (!EG(no_extensions)) {
899: zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_statement_handler, EX(op_array) TSRMLS_CC);
900: }
1.1.1.2 misho 901: CHECK_EXCEPTION();
1.1 misho 902: ZEND_VM_NEXT_OPCODE();
903: }
904:
905: static int ZEND_FASTCALL ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
906: {
1.1.1.2 misho 907: SAVE_OPLINE();
1.1 misho 908: if (!EG(no_extensions)) {
909: zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_fcall_begin_handler, EX(op_array) TSRMLS_CC);
910: }
1.1.1.2 misho 911: CHECK_EXCEPTION();
1.1 misho 912: ZEND_VM_NEXT_OPCODE();
913: }
914:
915: static int ZEND_FASTCALL ZEND_EXT_FCALL_END_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
916: {
1.1.1.2 misho 917: SAVE_OPLINE();
1.1 misho 918: if (!EG(no_extensions)) {
919: zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_fcall_end_handler, EX(op_array) TSRMLS_CC);
920: }
1.1.1.2 misho 921: CHECK_EXCEPTION();
1.1 misho 922: ZEND_VM_NEXT_OPCODE();
923: }
924:
925: static int ZEND_FASTCALL ZEND_DECLARE_CLASS_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
926: {
1.1.1.2 misho 927: USE_OPLINE
1.1 misho 928:
1.1.1.2 misho 929: SAVE_OPLINE();
930: EX_T(opline->result.var).class_entry = do_bind_class(EX(op_array), opline, EG(class_table), 0 TSRMLS_CC);
931: CHECK_EXCEPTION();
1.1 misho 932: ZEND_VM_NEXT_OPCODE();
933: }
934:
935: static int ZEND_FASTCALL ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
936: {
1.1.1.2 misho 937: USE_OPLINE
1.1 misho 938:
1.1.1.2 misho 939: SAVE_OPLINE();
940: EX_T(opline->result.var).class_entry = do_bind_inherited_class(EX(op_array), opline, EG(class_table), EX_T(opline->extended_value).class_entry, 0 TSRMLS_CC);
941: CHECK_EXCEPTION();
1.1 misho 942: ZEND_VM_NEXT_OPCODE();
943: }
944:
945: static int ZEND_FASTCALL ZEND_DECLARE_INHERITED_CLASS_DELAYED_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
946: {
1.1.1.2 misho 947: USE_OPLINE
1.1 misho 948: zend_class_entry **pce, **pce_orig;
949:
1.1.1.2 misho 950: SAVE_OPLINE();
951: if (zend_hash_quick_find(EG(class_table), Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv)+1, Z_HASH_P(opline->op2.zv), (void**)&pce) == FAILURE ||
952: (zend_hash_quick_find(EG(class_table), Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), Z_HASH_P(opline->op1.zv), (void**)&pce_orig) == SUCCESS &&
1.1 misho 953: *pce != *pce_orig)) {
1.1.1.2 misho 954: do_bind_inherited_class(EX(op_array), opline, EG(class_table), EX_T(opline->extended_value).class_entry, 0 TSRMLS_CC);
1.1 misho 955: }
1.1.1.2 misho 956: CHECK_EXCEPTION();
1.1 misho 957: ZEND_VM_NEXT_OPCODE();
958: }
959:
960: static int ZEND_FASTCALL ZEND_DECLARE_FUNCTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
961: {
1.1.1.2 misho 962: USE_OPLINE
963:
964: SAVE_OPLINE();
965: do_bind_function(EX(op_array), opline, EG(function_table), 0);
966: CHECK_EXCEPTION();
967: ZEND_VM_NEXT_OPCODE();
968: }
969:
970: static int ZEND_FASTCALL ZEND_TICKS_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
971: {
972: USE_OPLINE
973:
974: SAVE_OPLINE();
975: if (++EG(ticks_count)>=opline->extended_value) {
976: EG(ticks_count)=0;
977: if (zend_ticks_function) {
978: zend_ticks_function(opline->extended_value);
979: }
980: }
981: CHECK_EXCEPTION();
1.1 misho 982: ZEND_VM_NEXT_OPCODE();
983: }
984:
985: static int ZEND_FASTCALL ZEND_EXT_NOP_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
986: {
987: ZEND_VM_NEXT_OPCODE();
988: }
989:
990: static int ZEND_FASTCALL ZEND_NOP_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
991: {
992: ZEND_VM_NEXT_OPCODE();
993: }
994:
1.1.1.2 misho 995: static int ZEND_FASTCALL ZEND_ADD_TRAIT_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
996: {
997: USE_OPLINE
998: zend_class_entry *ce = EX_T(opline->op1.var).class_entry;
999: zend_class_entry *trait;
1000:
1001: SAVE_OPLINE();
1002: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
1003: trait = CACHED_PTR(opline->op2.literal->cache_slot);
1004: } else {
1005: trait = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv),
1006: Z_STRLEN_P(opline->op2.zv),
1007: opline->op2.literal + 1,
1008: opline->extended_value TSRMLS_CC);
1009: if (UNEXPECTED(trait == NULL)) {
1010: CHECK_EXCEPTION();
1011: ZEND_VM_NEXT_OPCODE();
1012: }
1013: if (!((trait->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT)) {
1014: zend_error_noreturn(E_ERROR, "%s cannot use %s - it is not a trait", ce->name, trait->name);
1015: }
1016: CACHE_PTR(opline->op2.literal->cache_slot, trait);
1017: }
1018:
1019: zend_do_implement_trait(ce, trait TSRMLS_CC);
1020:
1021: CHECK_EXCEPTION();
1022: ZEND_VM_NEXT_OPCODE();
1023: }
1024:
1025: static int ZEND_FASTCALL ZEND_BIND_TRAITS_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1026: {
1027: USE_OPLINE
1028: zend_class_entry *ce = EX_T(opline->op1.var).class_entry;
1029:
1030: SAVE_OPLINE();
1031: zend_do_bind_traits(ce TSRMLS_CC);
1032: CHECK_EXCEPTION();
1033: ZEND_VM_NEXT_OPCODE();
1034: }
1035:
1.1 misho 1036: static int ZEND_FASTCALL ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1037: {
1038: zend_uint op_num = EG(opline_before_exception)-EG(active_op_array)->opcodes;
1039: int i;
1.1.1.2 misho 1040: zend_uint catch_op_num = 0;
1.1 misho 1041: int catched = 0;
1042: zval restored_error_reporting;
1043:
1.1.1.2 misho 1044: void **stack_frame = (void**)(((char*)EX_Ts()) +
1.1 misho 1045: (ZEND_MM_ALIGNED_SIZE(sizeof(temp_variable)) * EX(op_array)->T));
1046:
1047: while (zend_vm_stack_top(TSRMLS_C) != stack_frame) {
1048: zval *stack_zval_p = zend_vm_stack_pop(TSRMLS_C);
1049: zval_ptr_dtor(&stack_zval_p);
1050: }
1051:
1052: for (i=0; i<EG(active_op_array)->last_try_catch; i++) {
1053: if (EG(active_op_array)->try_catch_array[i].try_op > op_num) {
1054: /* further blocks will not be relevant... */
1055: break;
1.1.1.2 misho 1056: } else if (op_num < EG(active_op_array)->try_catch_array[i].catch_op) {
1.1 misho 1057: catch_op_num = EX(op_array)->try_catch_array[i].catch_op;
1058: catched = 1;
1059: }
1060: }
1061:
1062: while (EX(fbc)) {
1063: EX(called_scope) = (zend_class_entry*)zend_ptr_stack_pop(&EG(arg_types_stack));
1064: if (EX(object)) {
1065: if (IS_CTOR_CALL(EX(called_scope))) {
1066: if (IS_CTOR_USED(EX(called_scope))) {
1067: Z_DELREF_P(EX(object));
1068: }
1069: if (Z_REFCOUNT_P(EX(object)) == 1) {
1070: zend_object_store_ctor_failed(EX(object) TSRMLS_CC);
1071: }
1072: }
1073: zval_ptr_dtor(&EX(object));
1074: }
1075: EX(called_scope) = DECODE_CTOR(EX(called_scope));
1076: zend_arg_types_stack_2_pop(&EG(arg_types_stack), &EX(object), &EX(fbc));
1077: }
1078:
1079: for (i=0; i<EX(op_array)->last_brk_cont; i++) {
1080: if (EX(op_array)->brk_cont_array[i].start < 0) {
1081: continue;
1082: } else if (EX(op_array)->brk_cont_array[i].start > op_num) {
1083: /* further blocks will not be relevant... */
1084: break;
1085: } else if (op_num < EX(op_array)->brk_cont_array[i].brk) {
1086: if (!catched ||
1087: catch_op_num >= EX(op_array)->brk_cont_array[i].brk) {
1088: zend_op *brk_opline = &EX(op_array)->opcodes[EX(op_array)->brk_cont_array[i].brk];
1089:
1090: switch (brk_opline->opcode) {
1091: case ZEND_SWITCH_FREE:
1.1.1.2 misho 1092: if (!(brk_opline->extended_value & EXT_TYPE_FREE_ON_RETURN)) {
1093: zval_ptr_dtor(&EX_T(brk_opline->op1.var).var.ptr);
1.1 misho 1094: }
1095: break;
1096: case ZEND_FREE:
1.1.1.2 misho 1097: if (!(brk_opline->extended_value & EXT_TYPE_FREE_ON_RETURN)) {
1098: zendi_zval_dtor(EX_T(brk_opline->op1.var).tmp_var);
1.1 misho 1099: }
1100: break;
1101: }
1102: }
1103: }
1104: }
1105:
1106: /* restore previous error_reporting value */
1107: if (!EG(error_reporting) && EX(old_error_reporting) != NULL && Z_LVAL_P(EX(old_error_reporting)) != 0) {
1108: Z_TYPE(restored_error_reporting) = IS_LONG;
1109: Z_LVAL(restored_error_reporting) = Z_LVAL_P(EX(old_error_reporting));
1110: convert_to_string(&restored_error_reporting);
1111: zend_alter_ini_entry_ex("error_reporting", sizeof("error_reporting"), Z_STRVAL(restored_error_reporting), Z_STRLEN(restored_error_reporting), ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME, 1 TSRMLS_CC);
1112: zendi_zval_dtor(restored_error_reporting);
1113: }
1114: EX(old_error_reporting) = NULL;
1115:
1116: if (!catched) {
1117: return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
1118: } else {
1119: ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[catch_op_num]);
1120: ZEND_VM_CONTINUE();
1121: }
1122: }
1123:
1124: static int ZEND_FASTCALL ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1125: {
1.1.1.2 misho 1126: USE_OPLINE
1127:
1128: SAVE_OPLINE();
1129: zend_verify_abstract_class(EX_T(opline->op1.var).class_entry TSRMLS_CC);
1130: CHECK_EXCEPTION();
1.1 misho 1131: ZEND_VM_NEXT_OPCODE();
1132: }
1133:
1134: static int ZEND_FASTCALL ZEND_USER_OPCODE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1135: {
1.1.1.2 misho 1136: USE_OPLINE
1137: int ret;
1138:
1139: SAVE_OPLINE();
1140: ret = zend_user_opcode_handlers[opline->opcode](ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_INTERNAL);
1141: LOAD_OPLINE();
1.1 misho 1142:
1143: switch (ret) {
1144: case ZEND_USER_OPCODE_CONTINUE:
1145: ZEND_VM_CONTINUE();
1146: case ZEND_USER_OPCODE_RETURN:
1147: return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
1148: case ZEND_USER_OPCODE_ENTER:
1149: ZEND_VM_ENTER();
1150: case ZEND_USER_OPCODE_LEAVE:
1151: ZEND_VM_LEAVE();
1152: case ZEND_USER_OPCODE_DISPATCH:
1.1.1.2 misho 1153: ZEND_VM_DISPATCH(opline->opcode, opline);
1.1 misho 1154: default:
1.1.1.2 misho 1155: ZEND_VM_DISPATCH((zend_uchar)(ret & 0xff), opline);
1.1 misho 1156: }
1157: }
1158:
1159: static int ZEND_FASTCALL ZEND_FETCH_CLASS_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1160: {
1.1.1.2 misho 1161: USE_OPLINE
1.1 misho 1162:
1.1.1.2 misho 1163: SAVE_OPLINE();
1164: EG(exception) = NULL;
1.1 misho 1165: if (IS_CONST == IS_UNUSED) {
1.1.1.2 misho 1166: EX_T(opline->result.var).class_entry = zend_fetch_class(NULL, 0, opline->extended_value TSRMLS_CC);
1167: CHECK_EXCEPTION();
1.1 misho 1168: ZEND_VM_NEXT_OPCODE();
1169: } else {
1170:
1.1.1.2 misho 1171: zval *class_name = opline->op2.zv;
1.1 misho 1172:
1.1.1.2 misho 1173: if (IS_CONST == IS_CONST) {
1174: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
1175: EX_T(opline->result.var).class_entry = CACHED_PTR(opline->op2.literal->cache_slot);
1176: } else {
1177: EX_T(opline->result.var).class_entry = zend_fetch_class_by_name(Z_STRVAL_P(class_name), Z_STRLEN_P(class_name), opline->op2.literal + 1, opline->extended_value TSRMLS_CC);
1178: CACHE_PTR(opline->op2.literal->cache_slot, EX_T(opline->result.var).class_entry);
1179: }
1180: } else if (Z_TYPE_P(class_name) == IS_OBJECT) {
1181: EX_T(opline->result.var).class_entry = Z_OBJCE_P(class_name);
1.1 misho 1182: } else if (Z_TYPE_P(class_name) == IS_STRING) {
1.1.1.2 misho 1183: EX_T(opline->result.var).class_entry = zend_fetch_class(Z_STRVAL_P(class_name), Z_STRLEN_P(class_name), opline->extended_value TSRMLS_CC);
1.1 misho 1184: } else {
1185: zend_error_noreturn(E_ERROR, "Class name must be a valid object or a string");
1186: }
1187:
1.1.1.2 misho 1188: CHECK_EXCEPTION();
1.1 misho 1189: ZEND_VM_NEXT_OPCODE();
1190: }
1191: }
1192:
1193: static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1194: {
1.1.1.2 misho 1195: USE_OPLINE
1.1 misho 1196: zval *function_name;
1197: zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
1198:
1199: if (IS_CONST == IS_CONST) {
1.1.1.2 misho 1200: function_name = (zval*)(opline->op2.literal+1);
1201: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
1202: EX(fbc) = CACHED_PTR(opline->op2.literal->cache_slot);
1203: } else if (UNEXPECTED(zend_hash_quick_find(EG(function_table), Z_STRVAL_P(function_name), Z_STRLEN_P(function_name)+1, Z_HASH_P(function_name), (void **) &EX(fbc)) == FAILURE)) {
1204: SAVE_OPLINE();
1205: zend_error_noreturn(E_ERROR, "Call to undefined function %s()", Z_STRVAL_P(opline->op2.zv));
1206: } else {
1207: CACHE_PTR(opline->op2.literal->cache_slot, EX(fbc));
1.1 misho 1208: }
1.1.1.2 misho 1209: EX(object) = NULL;
1210: /*CHECK_EXCEPTION();*/
1211: ZEND_VM_NEXT_OPCODE();
1.1 misho 1212: } else {
1.1.1.2 misho 1213: char *function_name_strval, *lcname;
1214: int function_name_strlen;
1215:
1216:
1217: SAVE_OPLINE();
1218: function_name = opline->op2.zv;
1219:
1220: if (EXPECTED(Z_TYPE_P(function_name) == IS_STRING)) {
1221: function_name_strval = Z_STRVAL_P(function_name);
1222: function_name_strlen = Z_STRLEN_P(function_name);
1223: if (function_name_strval[0] == '\\') {
1224: function_name_strlen -= 1;
1225: lcname = zend_str_tolower_dup(function_name_strval + 1, function_name_strlen);
1226: } else {
1227: lcname = zend_str_tolower_dup(function_name_strval, function_name_strlen);
1228: }
1229: if (UNEXPECTED(zend_hash_find(EG(function_table), lcname, function_name_strlen+1, (void **) &EX(fbc)) == FAILURE)) {
1230: zend_error_noreturn(E_ERROR, "Call to undefined function %s()", function_name_strval);
1231: }
1232: efree(lcname);
1.1 misho 1233:
1.1.1.2 misho 1234: EX(object) = NULL;
1235: CHECK_EXCEPTION();
1236: ZEND_VM_NEXT_OPCODE();
1237: } else if (IS_CONST != IS_CONST && IS_CONST != IS_TMP_VAR &&
1238: EXPECTED(Z_TYPE_P(function_name) == IS_OBJECT) &&
1.1 misho 1239: Z_OBJ_HANDLER_P(function_name, get_closure) &&
1240: Z_OBJ_HANDLER_P(function_name, get_closure)(function_name, &EX(called_scope), &EX(fbc), &EX(object) TSRMLS_CC) == SUCCESS) {
1241: if (EX(object)) {
1242: Z_ADDREF_P(EX(object));
1243: }
1244: if (IS_CONST == IS_VAR && 0 &&
1245: EX(fbc)->common.fn_flags & ZEND_ACC_CLOSURE) {
1246: /* Delay closure destruction until its invocation */
1247: EX(fbc)->common.prototype = (zend_function*)function_name;
1248: } else {
1249:
1250: }
1.1.1.2 misho 1251: CHECK_EXCEPTION();
1.1 misho 1252: ZEND_VM_NEXT_OPCODE();
1.1.1.2 misho 1253: } else if (IS_CONST != IS_CONST &&
1254: EXPECTED(Z_TYPE_P(function_name) == IS_ARRAY) &&
1255: zend_hash_num_elements(Z_ARRVAL_P(function_name)) == 2) {
1256: zend_class_entry *ce;
1257: zval **method = NULL;
1258: zval **obj = NULL;
1.1 misho 1259:
1.1.1.2 misho 1260: zend_hash_index_find(Z_ARRVAL_P(function_name), 0, (void **) &obj);
1261: zend_hash_index_find(Z_ARRVAL_P(function_name), 1, (void **) &method);
1262:
1.1.1.3 misho 1263: if (!obj || !method) {
1264: zend_error_noreturn(E_ERROR, "Array callback has to contain indices 0 and 1");
1265: }
1266:
1.1.1.2 misho 1267: if (Z_TYPE_PP(obj) != IS_STRING && Z_TYPE_PP(obj) != IS_OBJECT) {
1268: zend_error_noreturn(E_ERROR, "First array member is not a valid class name or object");
1269: }
1270:
1271: if (Z_TYPE_PP(method) != IS_STRING) {
1272: zend_error_noreturn(E_ERROR, "Second array member is not a valid method");
1273: }
1274:
1275: if (Z_TYPE_PP(obj) == IS_STRING) {
1276: ce = zend_fetch_class_by_name(Z_STRVAL_PP(obj), Z_STRLEN_PP(obj), NULL, 0 TSRMLS_CC);
1.1.1.4 ! misho 1277: if (UNEXPECTED(EG(exception) != NULL)) {
! 1278: HANDLE_EXCEPTION();
! 1279: }
1.1.1.2 misho 1280: if (UNEXPECTED(ce == NULL)) {
1.1.1.4 ! misho 1281: zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_PP(obj));
1.1.1.2 misho 1282: }
1283: EX(called_scope) = ce;
1284: EX(object) = NULL;
1285:
1286: if (ce->get_static_method) {
1287: EX(fbc) = ce->get_static_method(ce, Z_STRVAL_PP(method), Z_STRLEN_PP(method) TSRMLS_CC);
1288: } else {
1289: EX(fbc) = zend_std_get_static_method(ce, Z_STRVAL_PP(method), Z_STRLEN_PP(method), NULL TSRMLS_CC);
1290: }
1291: } else {
1292: EX(object) = *obj;
1293: ce = EX(called_scope) = Z_OBJCE_PP(obj);
1.1 misho 1294:
1.1.1.2 misho 1295: EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), Z_STRVAL_PP(method), Z_STRLEN_PP(method), NULL TSRMLS_CC);
1296: if (UNEXPECTED(EX(fbc) == NULL)) {
1297: zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), Z_STRVAL_PP(method));
1298: }
1299:
1300: if ((EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) != 0) {
1301: EX(object) = NULL;
1302: } else {
1303: if (!PZVAL_IS_REF(EX(object))) {
1304: Z_ADDREF_P(EX(object)); /* For $this pointer */
1305: } else {
1306: zval *this_ptr;
1307: ALLOC_ZVAL(this_ptr);
1308: INIT_PZVAL_COPY(this_ptr, EX(object));
1309: zval_copy_ctor(this_ptr);
1310: EX(object) = this_ptr;
1311: }
1312: }
1313: }
1314:
1315: if (UNEXPECTED(EX(fbc) == NULL)) {
1316: zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name, Z_STRVAL_PP(method));
1317: }
1318:
1319: CHECK_EXCEPTION();
1320: ZEND_VM_NEXT_OPCODE();
1.1 misho 1321: } else {
1.1.1.2 misho 1322: zend_error_noreturn(E_ERROR, "Function name must be a string");
1.1 misho 1323: }
1324: }
1325: }
1326:
1327:
1328: static int ZEND_FASTCALL ZEND_INIT_NS_FCALL_BY_NAME_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1329: {
1.1.1.2 misho 1330: USE_OPLINE
1331: zend_literal *func_name;
1.1 misho 1332:
1333: zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
1334:
1.1.1.2 misho 1335: func_name = opline->op2.literal + 1;
1336: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
1337: EX(fbc) = CACHED_PTR(opline->op2.literal->cache_slot);
1338: } else if (zend_hash_quick_find(EG(function_table), Z_STRVAL(func_name->constant), Z_STRLEN(func_name->constant)+1, func_name->hash_value, (void **) &EX(fbc))==FAILURE) {
1339: func_name++;
1340: if (UNEXPECTED(zend_hash_quick_find(EG(function_table), Z_STRVAL(func_name->constant), Z_STRLEN(func_name->constant)+1, func_name->hash_value, (void **) &EX(fbc))==FAILURE)) {
1341: SAVE_OPLINE();
1342: zend_error_noreturn(E_ERROR, "Call to undefined function %s()", Z_STRVAL_P(opline->op2.zv));
1343: } else {
1344: CACHE_PTR(opline->op2.literal->cache_slot, EX(fbc));
1.1 misho 1345: }
1.1.1.2 misho 1346: } else {
1347: CACHE_PTR(opline->op2.literal->cache_slot, EX(fbc));
1.1 misho 1348: }
1349:
1350: EX(object) = NULL;
1351: ZEND_VM_NEXT_OPCODE();
1352: }
1353:
1354: static int ZEND_FASTCALL ZEND_RECV_INIT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1355: {
1.1.1.2 misho 1356: USE_OPLINE
1.1 misho 1357: zval *assignment_value;
1.1.1.2 misho 1358: zend_uint arg_num = opline->op1.num;
1.1 misho 1359: zval **param = zend_vm_stack_get_arg(arg_num TSRMLS_CC);
1360: zval **var_ptr;
1361:
1.1.1.2 misho 1362: SAVE_OPLINE();
1.1 misho 1363: if (param == NULL) {
1364: ALLOC_ZVAL(assignment_value);
1.1.1.2 misho 1365: *assignment_value = *opline->op2.zv;
1366: if ((Z_TYPE_P(assignment_value) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT ||
1367: Z_TYPE_P(assignment_value)==IS_CONSTANT_ARRAY) {
1.1 misho 1368: Z_SET_REFCOUNT_P(assignment_value, 1);
1369: zval_update_constant(&assignment_value, 0 TSRMLS_CC);
1370: } else {
1371: zval_copy_ctor(assignment_value);
1372: }
1373: INIT_PZVAL(assignment_value);
1374: } else {
1375: assignment_value = *param;
1376: Z_ADDREF_P(assignment_value);
1377: }
1378:
1379: zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, assignment_value, opline->extended_value TSRMLS_CC);
1.1.1.2 misho 1380: var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->result.var TSRMLS_CC);
1.1.1.3 misho 1381: zval_ptr_dtor(var_ptr);
1.1 misho 1382: *var_ptr = assignment_value;
1383:
1.1.1.2 misho 1384: CHECK_EXCEPTION();
1.1 misho 1385: ZEND_VM_NEXT_OPCODE();
1386: }
1387:
1388: static int ZEND_FASTCALL ZEND_BRK_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1389: {
1.1.1.2 misho 1390: USE_OPLINE
1.1 misho 1391: zend_brk_cont_element *el;
1392:
1.1.1.2 misho 1393: SAVE_OPLINE();
1394: el = zend_brk_cont(Z_LVAL_P(opline->op2.zv), opline->op1.opline_num,
1395: EX(op_array), EX_Ts() TSRMLS_CC);
1.1 misho 1396: ZEND_VM_JMP(EX(op_array)->opcodes + el->brk);
1397: }
1398:
1399: static int ZEND_FASTCALL ZEND_CONT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1400: {
1.1.1.2 misho 1401: USE_OPLINE
1.1 misho 1402: zend_brk_cont_element *el;
1403:
1.1.1.2 misho 1404: SAVE_OPLINE();
1405: el = zend_brk_cont(Z_LVAL_P(opline->op2.zv), opline->op1.opline_num,
1406: EX(op_array), EX_Ts() TSRMLS_CC);
1.1 misho 1407: ZEND_VM_JMP(EX(op_array)->opcodes + el->cont);
1408: }
1409:
1410: static int ZEND_FASTCALL ZEND_GOTO_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1411: {
1412: zend_op *brk_opline;
1.1.1.2 misho 1413: USE_OPLINE
1.1 misho 1414: zend_brk_cont_element *el;
1415:
1.1.1.2 misho 1416: SAVE_OPLINE();
1417: el = zend_brk_cont(Z_LVAL_P(opline->op2.zv), opline->extended_value,
1418: EX(op_array), EX_Ts() TSRMLS_CC);
1.1 misho 1419:
1420: brk_opline = EX(op_array)->opcodes + el->brk;
1421:
1422: switch (brk_opline->opcode) {
1423: case ZEND_SWITCH_FREE:
1.1.1.2 misho 1424: if (!(brk_opline->extended_value & EXT_TYPE_FREE_ON_RETURN)) {
1425: zval_ptr_dtor(&EX_T(brk_opline->op1.var).var.ptr);
1.1 misho 1426: }
1427: break;
1428: case ZEND_FREE:
1.1.1.2 misho 1429: if (!(brk_opline->extended_value & EXT_TYPE_FREE_ON_RETURN)) {
1430: zendi_zval_dtor(EX_T(brk_opline->op1.var).tmp_var);
1.1 misho 1431: }
1432: break;
1433: }
1.1.1.2 misho 1434: ZEND_VM_JMP(opline->op1.jmp_addr);
1.1 misho 1435: }
1436:
1437: static int ZEND_FASTCALL ZEND_ADD_INTERFACE_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1438: {
1.1.1.2 misho 1439: USE_OPLINE
1440: zend_class_entry *ce = EX_T(opline->op1.var).class_entry;
1441: zend_class_entry *iface;
1442:
1443: SAVE_OPLINE();
1444: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
1445: iface = CACHED_PTR(opline->op2.literal->cache_slot);
1446: } else {
1447: iface = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, opline->extended_value TSRMLS_CC);
1448: if (UNEXPECTED(iface == NULL)) {
1449: CHECK_EXCEPTION();
1450: ZEND_VM_NEXT_OPCODE();
1.1 misho 1451: }
1.1.1.3 misho 1452: CACHE_PTR(opline->op2.literal->cache_slot, iface);
1.1.1.2 misho 1453: }
1454:
1455: if (UNEXPECTED((iface->ce_flags & ZEND_ACC_INTERFACE) == 0)) {
1456: zend_error_noreturn(E_ERROR, "%s cannot implement %s - it is not an interface", ce->name, iface->name);
1.1 misho 1457: }
1.1.1.2 misho 1458: zend_do_implement_interface(ce, iface TSRMLS_CC);
1.1 misho 1459:
1.1.1.2 misho 1460: CHECK_EXCEPTION();
1.1 misho 1461: ZEND_VM_NEXT_OPCODE();
1462: }
1463:
1464: static int ZEND_FASTCALL ZEND_FETCH_CLASS_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1465: {
1.1.1.2 misho 1466: USE_OPLINE
1.1 misho 1467:
1.1.1.2 misho 1468: SAVE_OPLINE();
1469: EG(exception) = NULL;
1.1 misho 1470: if (IS_TMP_VAR == IS_UNUSED) {
1.1.1.2 misho 1471: EX_T(opline->result.var).class_entry = zend_fetch_class(NULL, 0, opline->extended_value TSRMLS_CC);
1472: CHECK_EXCEPTION();
1.1 misho 1473: ZEND_VM_NEXT_OPCODE();
1474: } else {
1475: zend_free_op free_op2;
1.1.1.2 misho 1476: zval *class_name = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 1477:
1.1.1.2 misho 1478: if (IS_TMP_VAR == IS_CONST) {
1479: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
1480: EX_T(opline->result.var).class_entry = CACHED_PTR(opline->op2.literal->cache_slot);
1481: } else {
1482: EX_T(opline->result.var).class_entry = zend_fetch_class_by_name(Z_STRVAL_P(class_name), Z_STRLEN_P(class_name), opline->op2.literal + 1, opline->extended_value TSRMLS_CC);
1483: CACHE_PTR(opline->op2.literal->cache_slot, EX_T(opline->result.var).class_entry);
1484: }
1485: } else if (Z_TYPE_P(class_name) == IS_OBJECT) {
1486: EX_T(opline->result.var).class_entry = Z_OBJCE_P(class_name);
1.1 misho 1487: } else if (Z_TYPE_P(class_name) == IS_STRING) {
1.1.1.2 misho 1488: EX_T(opline->result.var).class_entry = zend_fetch_class(Z_STRVAL_P(class_name), Z_STRLEN_P(class_name), opline->extended_value TSRMLS_CC);
1.1 misho 1489: } else {
1490: zend_error_noreturn(E_ERROR, "Class name must be a valid object or a string");
1491: }
1492:
1493: zval_dtor(free_op2.var);
1.1.1.2 misho 1494: CHECK_EXCEPTION();
1.1 misho 1495: ZEND_VM_NEXT_OPCODE();
1496: }
1497: }
1498:
1499: static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1500: {
1.1.1.2 misho 1501: USE_OPLINE
1.1 misho 1502: zval *function_name;
1503: zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
1504:
1505: if (IS_TMP_VAR == IS_CONST) {
1.1.1.2 misho 1506: function_name = (zval*)(opline->op2.literal+1);
1507: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
1508: EX(fbc) = CACHED_PTR(opline->op2.literal->cache_slot);
1509: } else if (UNEXPECTED(zend_hash_quick_find(EG(function_table), Z_STRVAL_P(function_name), Z_STRLEN_P(function_name)+1, Z_HASH_P(function_name), (void **) &EX(fbc)) == FAILURE)) {
1510: SAVE_OPLINE();
1511: zend_error_noreturn(E_ERROR, "Call to undefined function %s()", Z_STRVAL_P(opline->op2.zv));
1512: } else {
1513: CACHE_PTR(opline->op2.literal->cache_slot, EX(fbc));
1.1 misho 1514: }
1.1.1.2 misho 1515: EX(object) = NULL;
1516: /*CHECK_EXCEPTION();*/
1517: ZEND_VM_NEXT_OPCODE();
1.1 misho 1518: } else {
1.1.1.2 misho 1519: char *function_name_strval, *lcname;
1520: int function_name_strlen;
1521: zend_free_op free_op2;
1522:
1523: SAVE_OPLINE();
1524: function_name = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 1525:
1.1.1.2 misho 1526: if (EXPECTED(Z_TYPE_P(function_name) == IS_STRING)) {
1527: function_name_strval = Z_STRVAL_P(function_name);
1528: function_name_strlen = Z_STRLEN_P(function_name);
1529: if (function_name_strval[0] == '\\') {
1530: function_name_strlen -= 1;
1531: lcname = zend_str_tolower_dup(function_name_strval + 1, function_name_strlen);
1532: } else {
1533: lcname = zend_str_tolower_dup(function_name_strval, function_name_strlen);
1534: }
1535: if (UNEXPECTED(zend_hash_find(EG(function_table), lcname, function_name_strlen+1, (void **) &EX(fbc)) == FAILURE)) {
1536: zend_error_noreturn(E_ERROR, "Call to undefined function %s()", function_name_strval);
1537: }
1538: efree(lcname);
1539: zval_dtor(free_op2.var);
1540: EX(object) = NULL;
1541: CHECK_EXCEPTION();
1542: ZEND_VM_NEXT_OPCODE();
1543: } else if (IS_TMP_VAR != IS_CONST && IS_TMP_VAR != IS_TMP_VAR &&
1544: EXPECTED(Z_TYPE_P(function_name) == IS_OBJECT) &&
1.1 misho 1545: Z_OBJ_HANDLER_P(function_name, get_closure) &&
1546: Z_OBJ_HANDLER_P(function_name, get_closure)(function_name, &EX(called_scope), &EX(fbc), &EX(object) TSRMLS_CC) == SUCCESS) {
1547: if (EX(object)) {
1548: Z_ADDREF_P(EX(object));
1549: }
1550: if (IS_TMP_VAR == IS_VAR && 1 &&
1551: EX(fbc)->common.fn_flags & ZEND_ACC_CLOSURE) {
1552: /* Delay closure destruction until its invocation */
1553: EX(fbc)->common.prototype = (zend_function*)function_name;
1554: } else {
1555: zval_dtor(free_op2.var);
1556: }
1.1.1.2 misho 1557: CHECK_EXCEPTION();
1.1 misho 1558: ZEND_VM_NEXT_OPCODE();
1.1.1.2 misho 1559: } else if (IS_TMP_VAR != IS_CONST &&
1560: EXPECTED(Z_TYPE_P(function_name) == IS_ARRAY) &&
1561: zend_hash_num_elements(Z_ARRVAL_P(function_name)) == 2) {
1562: zend_class_entry *ce;
1563: zval **method = NULL;
1564: zval **obj = NULL;
1.1 misho 1565:
1.1.1.2 misho 1566: zend_hash_index_find(Z_ARRVAL_P(function_name), 0, (void **) &obj);
1567: zend_hash_index_find(Z_ARRVAL_P(function_name), 1, (void **) &method);
1.1 misho 1568:
1.1.1.3 misho 1569: if (!obj || !method) {
1570: zend_error_noreturn(E_ERROR, "Array callback has to contain indices 0 and 1");
1571: }
1572:
1.1.1.2 misho 1573: if (Z_TYPE_PP(obj) != IS_STRING && Z_TYPE_PP(obj) != IS_OBJECT) {
1574: zend_error_noreturn(E_ERROR, "First array member is not a valid class name or object");
1575: }
1.1 misho 1576:
1.1.1.2 misho 1577: if (Z_TYPE_PP(method) != IS_STRING) {
1578: zend_error_noreturn(E_ERROR, "Second array member is not a valid method");
1579: }
1.1 misho 1580:
1.1.1.2 misho 1581: if (Z_TYPE_PP(obj) == IS_STRING) {
1582: ce = zend_fetch_class_by_name(Z_STRVAL_PP(obj), Z_STRLEN_PP(obj), NULL, 0 TSRMLS_CC);
1.1.1.4 ! misho 1583: if (UNEXPECTED(EG(exception) != NULL)) {
! 1584: HANDLE_EXCEPTION();
! 1585: }
1.1.1.2 misho 1586: if (UNEXPECTED(ce == NULL)) {
1.1.1.4 ! misho 1587: zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_PP(obj));
1.1.1.2 misho 1588: }
1589: EX(called_scope) = ce;
1590: EX(object) = NULL;
1.1 misho 1591:
1.1.1.2 misho 1592: if (ce->get_static_method) {
1593: EX(fbc) = ce->get_static_method(ce, Z_STRVAL_PP(method), Z_STRLEN_PP(method) TSRMLS_CC);
1594: } else {
1595: EX(fbc) = zend_std_get_static_method(ce, Z_STRVAL_PP(method), Z_STRLEN_PP(method), NULL TSRMLS_CC);
1596: }
1597: } else {
1598: EX(object) = *obj;
1599: ce = EX(called_scope) = Z_OBJCE_PP(obj);
1.1 misho 1600:
1.1.1.2 misho 1601: EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), Z_STRVAL_PP(method), Z_STRLEN_PP(method), NULL TSRMLS_CC);
1602: if (UNEXPECTED(EX(fbc) == NULL)) {
1603: zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), Z_STRVAL_PP(method));
1604: }
1.1 misho 1605:
1.1.1.2 misho 1606: if ((EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) != 0) {
1607: EX(object) = NULL;
1608: } else {
1609: if (!PZVAL_IS_REF(EX(object))) {
1610: Z_ADDREF_P(EX(object)); /* For $this pointer */
1611: } else {
1612: zval *this_ptr;
1613: ALLOC_ZVAL(this_ptr);
1614: INIT_PZVAL_COPY(this_ptr, EX(object));
1615: zval_copy_ctor(this_ptr);
1616: EX(object) = this_ptr;
1617: }
1618: }
1619: }
1.1 misho 1620:
1.1.1.2 misho 1621: if (UNEXPECTED(EX(fbc) == NULL)) {
1622: zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name, Z_STRVAL_PP(method));
1623: }
1624: zval_dtor(free_op2.var);
1625: CHECK_EXCEPTION();
1626: ZEND_VM_NEXT_OPCODE();
1627: } else {
1628: zend_error_noreturn(E_ERROR, "Function name must be a string");
1629: }
1630: }
1.1 misho 1631: }
1632:
1.1.1.2 misho 1633:
1.1 misho 1634: static int ZEND_FASTCALL ZEND_FETCH_CLASS_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1635: {
1.1.1.2 misho 1636: USE_OPLINE
1.1 misho 1637:
1.1.1.2 misho 1638: SAVE_OPLINE();
1639: EG(exception) = NULL;
1.1 misho 1640: if (IS_VAR == IS_UNUSED) {
1.1.1.2 misho 1641: EX_T(opline->result.var).class_entry = zend_fetch_class(NULL, 0, opline->extended_value TSRMLS_CC);
1642: CHECK_EXCEPTION();
1.1 misho 1643: ZEND_VM_NEXT_OPCODE();
1644: } else {
1645: zend_free_op free_op2;
1.1.1.2 misho 1646: zval *class_name = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 1647:
1.1.1.2 misho 1648: if (IS_VAR == IS_CONST) {
1649: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
1650: EX_T(opline->result.var).class_entry = CACHED_PTR(opline->op2.literal->cache_slot);
1651: } else {
1652: EX_T(opline->result.var).class_entry = zend_fetch_class_by_name(Z_STRVAL_P(class_name), Z_STRLEN_P(class_name), opline->op2.literal + 1, opline->extended_value TSRMLS_CC);
1653: CACHE_PTR(opline->op2.literal->cache_slot, EX_T(opline->result.var).class_entry);
1654: }
1655: } else if (Z_TYPE_P(class_name) == IS_OBJECT) {
1656: EX_T(opline->result.var).class_entry = Z_OBJCE_P(class_name);
1.1 misho 1657: } else if (Z_TYPE_P(class_name) == IS_STRING) {
1.1.1.2 misho 1658: EX_T(opline->result.var).class_entry = zend_fetch_class(Z_STRVAL_P(class_name), Z_STRLEN_P(class_name), opline->extended_value TSRMLS_CC);
1.1 misho 1659: } else {
1660: zend_error_noreturn(E_ERROR, "Class name must be a valid object or a string");
1661: }
1662:
1663: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 1664: CHECK_EXCEPTION();
1.1 misho 1665: ZEND_VM_NEXT_OPCODE();
1666: }
1667: }
1668:
1669: static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1670: {
1.1.1.2 misho 1671: USE_OPLINE
1.1 misho 1672: zval *function_name;
1673: zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
1674:
1675: if (IS_VAR == IS_CONST) {
1.1.1.2 misho 1676: function_name = (zval*)(opline->op2.literal+1);
1677: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
1678: EX(fbc) = CACHED_PTR(opline->op2.literal->cache_slot);
1679: } else if (UNEXPECTED(zend_hash_quick_find(EG(function_table), Z_STRVAL_P(function_name), Z_STRLEN_P(function_name)+1, Z_HASH_P(function_name), (void **) &EX(fbc)) == FAILURE)) {
1680: SAVE_OPLINE();
1681: zend_error_noreturn(E_ERROR, "Call to undefined function %s()", Z_STRVAL_P(opline->op2.zv));
1682: } else {
1683: CACHE_PTR(opline->op2.literal->cache_slot, EX(fbc));
1.1 misho 1684: }
1.1.1.2 misho 1685: EX(object) = NULL;
1686: /*CHECK_EXCEPTION();*/
1687: ZEND_VM_NEXT_OPCODE();
1.1 misho 1688: } else {
1.1.1.2 misho 1689: char *function_name_strval, *lcname;
1690: int function_name_strlen;
1691: zend_free_op free_op2;
1.1 misho 1692:
1.1.1.2 misho 1693: SAVE_OPLINE();
1694: function_name = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1695:
1696: if (EXPECTED(Z_TYPE_P(function_name) == IS_STRING)) {
1697: function_name_strval = Z_STRVAL_P(function_name);
1698: function_name_strlen = Z_STRLEN_P(function_name);
1699: if (function_name_strval[0] == '\\') {
1700: function_name_strlen -= 1;
1701: lcname = zend_str_tolower_dup(function_name_strval + 1, function_name_strlen);
1702: } else {
1703: lcname = zend_str_tolower_dup(function_name_strval, function_name_strlen);
1704: }
1705: if (UNEXPECTED(zend_hash_find(EG(function_table), lcname, function_name_strlen+1, (void **) &EX(fbc)) == FAILURE)) {
1706: zend_error_noreturn(E_ERROR, "Call to undefined function %s()", function_name_strval);
1707: }
1708: efree(lcname);
1709: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1710: EX(object) = NULL;
1711: CHECK_EXCEPTION();
1712: ZEND_VM_NEXT_OPCODE();
1713: } else if (IS_VAR != IS_CONST && IS_VAR != IS_TMP_VAR &&
1714: EXPECTED(Z_TYPE_P(function_name) == IS_OBJECT) &&
1.1 misho 1715: Z_OBJ_HANDLER_P(function_name, get_closure) &&
1716: Z_OBJ_HANDLER_P(function_name, get_closure)(function_name, &EX(called_scope), &EX(fbc), &EX(object) TSRMLS_CC) == SUCCESS) {
1717: if (EX(object)) {
1718: Z_ADDREF_P(EX(object));
1719: }
1720: if (IS_VAR == IS_VAR && (free_op2.var != NULL) &&
1721: EX(fbc)->common.fn_flags & ZEND_ACC_CLOSURE) {
1722: /* Delay closure destruction until its invocation */
1723: EX(fbc)->common.prototype = (zend_function*)function_name;
1724: } else {
1725: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1726: }
1.1.1.2 misho 1727: CHECK_EXCEPTION();
1.1 misho 1728: ZEND_VM_NEXT_OPCODE();
1.1.1.2 misho 1729: } else if (IS_VAR != IS_CONST &&
1730: EXPECTED(Z_TYPE_P(function_name) == IS_ARRAY) &&
1731: zend_hash_num_elements(Z_ARRVAL_P(function_name)) == 2) {
1732: zend_class_entry *ce;
1733: zval **method = NULL;
1734: zval **obj = NULL;
1.1 misho 1735:
1.1.1.2 misho 1736: zend_hash_index_find(Z_ARRVAL_P(function_name), 0, (void **) &obj);
1737: zend_hash_index_find(Z_ARRVAL_P(function_name), 1, (void **) &method);
1.1 misho 1738:
1.1.1.3 misho 1739: if (!obj || !method) {
1740: zend_error_noreturn(E_ERROR, "Array callback has to contain indices 0 and 1");
1741: }
1742:
1.1.1.2 misho 1743: if (Z_TYPE_PP(obj) != IS_STRING && Z_TYPE_PP(obj) != IS_OBJECT) {
1744: zend_error_noreturn(E_ERROR, "First array member is not a valid class name or object");
1745: }
1.1 misho 1746:
1.1.1.2 misho 1747: if (Z_TYPE_PP(method) != IS_STRING) {
1748: zend_error_noreturn(E_ERROR, "Second array member is not a valid method");
1749: }
1.1 misho 1750:
1.1.1.2 misho 1751: if (Z_TYPE_PP(obj) == IS_STRING) {
1752: ce = zend_fetch_class_by_name(Z_STRVAL_PP(obj), Z_STRLEN_PP(obj), NULL, 0 TSRMLS_CC);
1.1.1.4 ! misho 1753: if (UNEXPECTED(EG(exception) != NULL)) {
! 1754: HANDLE_EXCEPTION();
! 1755: }
1.1.1.2 misho 1756: if (UNEXPECTED(ce == NULL)) {
1.1.1.4 ! misho 1757: zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_PP(obj));
1.1.1.2 misho 1758: }
1759: EX(called_scope) = ce;
1760: EX(object) = NULL;
1.1 misho 1761:
1.1.1.2 misho 1762: if (ce->get_static_method) {
1763: EX(fbc) = ce->get_static_method(ce, Z_STRVAL_PP(method), Z_STRLEN_PP(method) TSRMLS_CC);
1764: } else {
1765: EX(fbc) = zend_std_get_static_method(ce, Z_STRVAL_PP(method), Z_STRLEN_PP(method), NULL TSRMLS_CC);
1766: }
1767: } else {
1768: EX(object) = *obj;
1769: ce = EX(called_scope) = Z_OBJCE_PP(obj);
1.1 misho 1770:
1.1.1.2 misho 1771: EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), Z_STRVAL_PP(method), Z_STRLEN_PP(method), NULL TSRMLS_CC);
1772: if (UNEXPECTED(EX(fbc) == NULL)) {
1773: zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), Z_STRVAL_PP(method));
1774: }
1.1 misho 1775:
1.1.1.2 misho 1776: if ((EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) != 0) {
1777: EX(object) = NULL;
1778: } else {
1779: if (!PZVAL_IS_REF(EX(object))) {
1780: Z_ADDREF_P(EX(object)); /* For $this pointer */
1781: } else {
1782: zval *this_ptr;
1783: ALLOC_ZVAL(this_ptr);
1784: INIT_PZVAL_COPY(this_ptr, EX(object));
1785: zval_copy_ctor(this_ptr);
1786: EX(object) = this_ptr;
1787: }
1788: }
1789: }
1.1 misho 1790:
1.1.1.2 misho 1791: if (UNEXPECTED(EX(fbc) == NULL)) {
1792: zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name, Z_STRVAL_PP(method));
1793: }
1794: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1795: CHECK_EXCEPTION();
1796: ZEND_VM_NEXT_OPCODE();
1797: } else {
1798: zend_error_noreturn(E_ERROR, "Function name must be a string");
1799: }
1800: }
1.1 misho 1801: }
1802:
1.1.1.2 misho 1803:
1.1 misho 1804: static int ZEND_FASTCALL ZEND_FETCH_CLASS_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1805: {
1.1.1.2 misho 1806: USE_OPLINE
1.1 misho 1807:
1.1.1.2 misho 1808: SAVE_OPLINE();
1809: EG(exception) = NULL;
1.1 misho 1810: if (IS_UNUSED == IS_UNUSED) {
1.1.1.2 misho 1811: EX_T(opline->result.var).class_entry = zend_fetch_class(NULL, 0, opline->extended_value TSRMLS_CC);
1812: CHECK_EXCEPTION();
1.1 misho 1813: ZEND_VM_NEXT_OPCODE();
1814: } else {
1815:
1816: zval *class_name = NULL;
1817:
1.1.1.2 misho 1818: if (IS_UNUSED == IS_CONST) {
1819: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
1820: EX_T(opline->result.var).class_entry = CACHED_PTR(opline->op2.literal->cache_slot);
1821: } else {
1822: EX_T(opline->result.var).class_entry = zend_fetch_class_by_name(Z_STRVAL_P(class_name), Z_STRLEN_P(class_name), opline->op2.literal + 1, opline->extended_value TSRMLS_CC);
1823: CACHE_PTR(opline->op2.literal->cache_slot, EX_T(opline->result.var).class_entry);
1824: }
1825: } else if (Z_TYPE_P(class_name) == IS_OBJECT) {
1826: EX_T(opline->result.var).class_entry = Z_OBJCE_P(class_name);
1.1 misho 1827: } else if (Z_TYPE_P(class_name) == IS_STRING) {
1.1.1.2 misho 1828: EX_T(opline->result.var).class_entry = zend_fetch_class(Z_STRVAL_P(class_name), Z_STRLEN_P(class_name), opline->extended_value TSRMLS_CC);
1.1 misho 1829: } else {
1830: zend_error_noreturn(E_ERROR, "Class name must be a valid object or a string");
1831: }
1832:
1.1.1.2 misho 1833: CHECK_EXCEPTION();
1.1 misho 1834: ZEND_VM_NEXT_OPCODE();
1835: }
1836: }
1837:
1838: static int ZEND_FASTCALL ZEND_FETCH_CLASS_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1839: {
1.1.1.2 misho 1840: USE_OPLINE
1.1 misho 1841:
1.1.1.2 misho 1842: SAVE_OPLINE();
1843: EG(exception) = NULL;
1.1 misho 1844: if (IS_CV == IS_UNUSED) {
1.1.1.2 misho 1845: EX_T(opline->result.var).class_entry = zend_fetch_class(NULL, 0, opline->extended_value TSRMLS_CC);
1846: CHECK_EXCEPTION();
1.1 misho 1847: ZEND_VM_NEXT_OPCODE();
1848: } else {
1849:
1.1.1.2 misho 1850: zval *class_name = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
1.1 misho 1851:
1.1.1.2 misho 1852: if (IS_CV == IS_CONST) {
1853: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
1854: EX_T(opline->result.var).class_entry = CACHED_PTR(opline->op2.literal->cache_slot);
1855: } else {
1856: EX_T(opline->result.var).class_entry = zend_fetch_class_by_name(Z_STRVAL_P(class_name), Z_STRLEN_P(class_name), opline->op2.literal + 1, opline->extended_value TSRMLS_CC);
1857: CACHE_PTR(opline->op2.literal->cache_slot, EX_T(opline->result.var).class_entry);
1858: }
1859: } else if (Z_TYPE_P(class_name) == IS_OBJECT) {
1860: EX_T(opline->result.var).class_entry = Z_OBJCE_P(class_name);
1.1 misho 1861: } else if (Z_TYPE_P(class_name) == IS_STRING) {
1.1.1.2 misho 1862: EX_T(opline->result.var).class_entry = zend_fetch_class(Z_STRVAL_P(class_name), Z_STRLEN_P(class_name), opline->extended_value TSRMLS_CC);
1.1 misho 1863: } else {
1864: zend_error_noreturn(E_ERROR, "Class name must be a valid object or a string");
1865: }
1866:
1.1.1.2 misho 1867: CHECK_EXCEPTION();
1.1 misho 1868: ZEND_VM_NEXT_OPCODE();
1869: }
1870: }
1871:
1872: static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1873: {
1.1.1.2 misho 1874: USE_OPLINE
1.1 misho 1875: zval *function_name;
1876: zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
1877:
1878: if (IS_CV == IS_CONST) {
1.1.1.2 misho 1879: function_name = (zval*)(opline->op2.literal+1);
1880: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
1881: EX(fbc) = CACHED_PTR(opline->op2.literal->cache_slot);
1882: } else if (UNEXPECTED(zend_hash_quick_find(EG(function_table), Z_STRVAL_P(function_name), Z_STRLEN_P(function_name)+1, Z_HASH_P(function_name), (void **) &EX(fbc)) == FAILURE)) {
1883: SAVE_OPLINE();
1884: zend_error_noreturn(E_ERROR, "Call to undefined function %s()", Z_STRVAL_P(opline->op2.zv));
1885: } else {
1886: CACHE_PTR(opline->op2.literal->cache_slot, EX(fbc));
1.1 misho 1887: }
1.1.1.2 misho 1888: EX(object) = NULL;
1889: /*CHECK_EXCEPTION();*/
1890: ZEND_VM_NEXT_OPCODE();
1.1 misho 1891: } else {
1.1.1.2 misho 1892: char *function_name_strval, *lcname;
1893: int function_name_strlen;
1894:
1895:
1896: SAVE_OPLINE();
1897: function_name = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
1898:
1899: if (EXPECTED(Z_TYPE_P(function_name) == IS_STRING)) {
1900: function_name_strval = Z_STRVAL_P(function_name);
1901: function_name_strlen = Z_STRLEN_P(function_name);
1902: if (function_name_strval[0] == '\\') {
1903: function_name_strlen -= 1;
1904: lcname = zend_str_tolower_dup(function_name_strval + 1, function_name_strlen);
1905: } else {
1906: lcname = zend_str_tolower_dup(function_name_strval, function_name_strlen);
1907: }
1908: if (UNEXPECTED(zend_hash_find(EG(function_table), lcname, function_name_strlen+1, (void **) &EX(fbc)) == FAILURE)) {
1909: zend_error_noreturn(E_ERROR, "Call to undefined function %s()", function_name_strval);
1910: }
1911: efree(lcname);
1.1 misho 1912:
1.1.1.2 misho 1913: EX(object) = NULL;
1914: CHECK_EXCEPTION();
1915: ZEND_VM_NEXT_OPCODE();
1916: } else if (IS_CV != IS_CONST && IS_CV != IS_TMP_VAR &&
1917: EXPECTED(Z_TYPE_P(function_name) == IS_OBJECT) &&
1.1 misho 1918: Z_OBJ_HANDLER_P(function_name, get_closure) &&
1919: Z_OBJ_HANDLER_P(function_name, get_closure)(function_name, &EX(called_scope), &EX(fbc), &EX(object) TSRMLS_CC) == SUCCESS) {
1920: if (EX(object)) {
1921: Z_ADDREF_P(EX(object));
1922: }
1923: if (IS_CV == IS_VAR && 0 &&
1924: EX(fbc)->common.fn_flags & ZEND_ACC_CLOSURE) {
1925: /* Delay closure destruction until its invocation */
1926: EX(fbc)->common.prototype = (zend_function*)function_name;
1927: } else {
1928:
1929: }
1.1.1.2 misho 1930: CHECK_EXCEPTION();
1.1 misho 1931: ZEND_VM_NEXT_OPCODE();
1.1.1.2 misho 1932: } else if (IS_CV != IS_CONST &&
1933: EXPECTED(Z_TYPE_P(function_name) == IS_ARRAY) &&
1934: zend_hash_num_elements(Z_ARRVAL_P(function_name)) == 2) {
1935: zend_class_entry *ce;
1936: zval **method = NULL;
1937: zval **obj = NULL;
1.1 misho 1938:
1.1.1.2 misho 1939: zend_hash_index_find(Z_ARRVAL_P(function_name), 0, (void **) &obj);
1940: zend_hash_index_find(Z_ARRVAL_P(function_name), 1, (void **) &method);
1.1 misho 1941:
1.1.1.3 misho 1942: if (!obj || !method) {
1943: zend_error_noreturn(E_ERROR, "Array callback has to contain indices 0 and 1");
1944: }
1945:
1.1.1.2 misho 1946: if (Z_TYPE_PP(obj) != IS_STRING && Z_TYPE_PP(obj) != IS_OBJECT) {
1947: zend_error_noreturn(E_ERROR, "First array member is not a valid class name or object");
1948: }
1.1 misho 1949:
1.1.1.2 misho 1950: if (Z_TYPE_PP(method) != IS_STRING) {
1951: zend_error_noreturn(E_ERROR, "Second array member is not a valid method");
1952: }
1.1 misho 1953:
1.1.1.2 misho 1954: if (Z_TYPE_PP(obj) == IS_STRING) {
1955: ce = zend_fetch_class_by_name(Z_STRVAL_PP(obj), Z_STRLEN_PP(obj), NULL, 0 TSRMLS_CC);
1.1.1.4 ! misho 1956: if (UNEXPECTED(EG(exception) != NULL)) {
! 1957: HANDLE_EXCEPTION();
! 1958: }
1.1.1.2 misho 1959: if (UNEXPECTED(ce == NULL)) {
1.1.1.4 ! misho 1960: zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_PP(obj));
1.1.1.2 misho 1961: }
1962: EX(called_scope) = ce;
1963: EX(object) = NULL;
1.1 misho 1964:
1.1.1.2 misho 1965: if (ce->get_static_method) {
1966: EX(fbc) = ce->get_static_method(ce, Z_STRVAL_PP(method), Z_STRLEN_PP(method) TSRMLS_CC);
1967: } else {
1968: EX(fbc) = zend_std_get_static_method(ce, Z_STRVAL_PP(method), Z_STRLEN_PP(method), NULL TSRMLS_CC);
1969: }
1970: } else {
1971: EX(object) = *obj;
1972: ce = EX(called_scope) = Z_OBJCE_PP(obj);
1.1 misho 1973:
1.1.1.2 misho 1974: EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), Z_STRVAL_PP(method), Z_STRLEN_PP(method), NULL TSRMLS_CC);
1975: if (UNEXPECTED(EX(fbc) == NULL)) {
1976: zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), Z_STRVAL_PP(method));
1977: }
1.1 misho 1978:
1.1.1.2 misho 1979: if ((EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) != 0) {
1980: EX(object) = NULL;
1981: } else {
1982: if (!PZVAL_IS_REF(EX(object))) {
1983: Z_ADDREF_P(EX(object)); /* For $this pointer */
1984: } else {
1985: zval *this_ptr;
1986: ALLOC_ZVAL(this_ptr);
1987: INIT_PZVAL_COPY(this_ptr, EX(object));
1988: zval_copy_ctor(this_ptr);
1989: EX(object) = this_ptr;
1990: }
1991: }
1.1 misho 1992: }
1993:
1.1.1.2 misho 1994: if (UNEXPECTED(EX(fbc) == NULL)) {
1995: zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name, Z_STRVAL_PP(method));
1996: }
1997:
1998: CHECK_EXCEPTION();
1999: ZEND_VM_NEXT_OPCODE();
2000: } else {
2001: zend_error_noreturn(E_ERROR, "Function name must be a string");
1.1 misho 2002: }
2003: }
2004: }
2005:
2006:
2007: static int ZEND_FASTCALL ZEND_BW_NOT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
2008: {
1.1.1.2 misho 2009: USE_OPLINE
1.1 misho 2010:
2011:
1.1.1.2 misho 2012: SAVE_OPLINE();
2013: bitwise_not_function(&EX_T(opline->result.var).tmp_var,
2014: opline->op1.zv TSRMLS_CC);
1.1 misho 2015:
1.1.1.2 misho 2016: CHECK_EXCEPTION();
1.1 misho 2017: ZEND_VM_NEXT_OPCODE();
2018: }
2019:
2020: static int ZEND_FASTCALL ZEND_BOOL_NOT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
2021: {
1.1.1.2 misho 2022: USE_OPLINE
1.1 misho 2023:
2024:
1.1.1.2 misho 2025: SAVE_OPLINE();
2026: boolean_not_function(&EX_T(opline->result.var).tmp_var,
2027: opline->op1.zv TSRMLS_CC);
1.1 misho 2028:
1.1.1.2 misho 2029: CHECK_EXCEPTION();
1.1 misho 2030: ZEND_VM_NEXT_OPCODE();
2031: }
2032:
2033: static int ZEND_FASTCALL ZEND_ECHO_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
2034: {
1.1.1.2 misho 2035: USE_OPLINE
1.1 misho 2036:
1.1.1.2 misho 2037: zval *z;
2038:
2039: SAVE_OPLINE();
2040: z = opline->op1.zv;
1.1 misho 2041:
1.1.1.3 misho 2042: if (IS_CONST == IS_TMP_VAR && Z_TYPE_P(z) == IS_OBJECT) {
2043: INIT_PZVAL(z);
1.1 misho 2044: }
1.1.1.3 misho 2045: zend_print_variable(z);
1.1 misho 2046:
1.1.1.2 misho 2047: CHECK_EXCEPTION();
1.1 misho 2048: ZEND_VM_NEXT_OPCODE();
2049: }
2050:
2051: static int ZEND_FASTCALL ZEND_PRINT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
2052: {
1.1.1.2 misho 2053: USE_OPLINE
1.1 misho 2054:
1.1.1.2 misho 2055: ZVAL_LONG(&EX_T(opline->result.var).tmp_var, 1);
1.1 misho 2056: return ZEND_ECHO_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
2057: }
2058:
2059: static int ZEND_FASTCALL ZEND_JMPZ_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
2060: {
1.1.1.2 misho 2061: USE_OPLINE
1.1 misho 2062:
1.1.1.2 misho 2063: zval *val;
1.1 misho 2064: int ret;
2065:
1.1.1.2 misho 2066: SAVE_OPLINE();
2067: val = opline->op1.zv;
2068:
2069: if (IS_CONST == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) {
1.1 misho 2070: ret = Z_LVAL_P(val);
2071: } else {
2072: ret = i_zend_is_true(val);
2073:
2074: if (UNEXPECTED(EG(exception) != NULL)) {
1.1.1.2 misho 2075: HANDLE_EXCEPTION();
1.1 misho 2076: }
2077: }
2078: if (!ret) {
2079: #if DEBUG_ZEND>=2
1.1.1.2 misho 2080: printf("Conditional jmp to %d\n", opline->op2.opline_num);
1.1 misho 2081: #endif
1.1.1.2 misho 2082: ZEND_VM_SET_OPCODE(opline->op2.jmp_addr);
1.1 misho 2083: ZEND_VM_CONTINUE();
2084: }
2085:
2086: ZEND_VM_NEXT_OPCODE();
2087: }
2088:
2089: static int ZEND_FASTCALL ZEND_JMPNZ_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
2090: {
1.1.1.2 misho 2091: USE_OPLINE
1.1 misho 2092:
1.1.1.2 misho 2093: zval *val;
1.1 misho 2094: int ret;
2095:
1.1.1.2 misho 2096: SAVE_OPLINE();
2097: val = opline->op1.zv;
2098:
2099: if (IS_CONST == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) {
1.1 misho 2100: ret = Z_LVAL_P(val);
2101: } else {
2102: ret = i_zend_is_true(val);
2103:
2104: if (UNEXPECTED(EG(exception) != NULL)) {
1.1.1.2 misho 2105: HANDLE_EXCEPTION();
1.1 misho 2106: }
2107: }
2108: if (ret) {
2109: #if DEBUG_ZEND>=2
1.1.1.2 misho 2110: printf("Conditional jmp to %d\n", opline->op2.opline_num);
1.1 misho 2111: #endif
1.1.1.2 misho 2112: ZEND_VM_SET_OPCODE(opline->op2.jmp_addr);
1.1 misho 2113: ZEND_VM_CONTINUE();
2114: }
2115:
2116: ZEND_VM_NEXT_OPCODE();
2117: }
2118:
2119: static int ZEND_FASTCALL ZEND_JMPZNZ_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
2120: {
1.1.1.2 misho 2121: USE_OPLINE
1.1 misho 2122:
1.1.1.2 misho 2123: zval *val;
1.1 misho 2124: int retval;
2125:
1.1.1.2 misho 2126: SAVE_OPLINE();
2127: val = opline->op1.zv;
2128:
2129: if (IS_CONST == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) {
1.1 misho 2130: retval = Z_LVAL_P(val);
2131: } else {
2132: retval = i_zend_is_true(val);
2133:
2134: if (UNEXPECTED(EG(exception) != NULL)) {
1.1.1.2 misho 2135: HANDLE_EXCEPTION();
1.1 misho 2136: }
2137: }
2138: if (EXPECTED(retval != 0)) {
2139: #if DEBUG_ZEND>=2
2140: printf("Conditional jmp on true to %d\n", opline->extended_value);
2141: #endif
2142: ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->extended_value]);
2143: ZEND_VM_CONTINUE(); /* CHECK_ME */
2144: } else {
2145: #if DEBUG_ZEND>=2
1.1.1.2 misho 2146: printf("Conditional jmp on false to %d\n", opline->op2.opline_num);
1.1 misho 2147: #endif
1.1.1.2 misho 2148: ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->op2.opline_num]);
1.1 misho 2149: ZEND_VM_CONTINUE(); /* CHECK_ME */
2150: }
2151: }
2152:
2153: static int ZEND_FASTCALL ZEND_JMPZ_EX_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
2154: {
1.1.1.2 misho 2155: USE_OPLINE
1.1 misho 2156:
1.1.1.2 misho 2157: zval *val;
1.1 misho 2158: int retval;
2159:
1.1.1.2 misho 2160: SAVE_OPLINE();
2161: val = opline->op1.zv;
2162:
2163: if (IS_CONST == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) {
1.1 misho 2164: retval = Z_LVAL_P(val);
2165: } else {
2166: retval = i_zend_is_true(val);
2167:
2168: if (UNEXPECTED(EG(exception) != NULL)) {
1.1.1.2 misho 2169: HANDLE_EXCEPTION();
1.1 misho 2170: }
2171: }
1.1.1.2 misho 2172: Z_LVAL(EX_T(opline->result.var).tmp_var) = retval;
2173: Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
1.1 misho 2174: if (!retval) {
2175: #if DEBUG_ZEND>=2
1.1.1.2 misho 2176: printf("Conditional jmp to %d\n", opline->op2.opline_num);
1.1 misho 2177: #endif
1.1.1.2 misho 2178: ZEND_VM_SET_OPCODE(opline->op2.jmp_addr);
1.1 misho 2179: ZEND_VM_CONTINUE();
2180: }
2181: ZEND_VM_NEXT_OPCODE();
2182: }
2183:
2184: static int ZEND_FASTCALL ZEND_JMPNZ_EX_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
2185: {
1.1.1.2 misho 2186: USE_OPLINE
1.1 misho 2187:
1.1.1.2 misho 2188: zval *val;
1.1 misho 2189: int retval;
2190:
1.1.1.2 misho 2191: SAVE_OPLINE();
2192: val = opline->op1.zv;
2193:
2194: if (IS_CONST == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) {
1.1 misho 2195: retval = Z_LVAL_P(val);
2196: } else {
2197: retval = i_zend_is_true(val);
2198:
2199: if (UNEXPECTED(EG(exception) != NULL)) {
1.1.1.2 misho 2200: HANDLE_EXCEPTION();
1.1 misho 2201: }
2202: }
1.1.1.2 misho 2203: Z_LVAL(EX_T(opline->result.var).tmp_var) = retval;
2204: Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
1.1 misho 2205: if (retval) {
2206: #if DEBUG_ZEND>=2
1.1.1.2 misho 2207: printf("Conditional jmp to %d\n", opline->op2.opline_num);
1.1 misho 2208: #endif
1.1.1.2 misho 2209: ZEND_VM_SET_OPCODE(opline->op2.jmp_addr);
1.1 misho 2210: ZEND_VM_CONTINUE();
2211: }
2212: ZEND_VM_NEXT_OPCODE();
2213: }
2214:
2215: static int ZEND_FASTCALL ZEND_DO_FCALL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
2216: {
1.1.1.2 misho 2217: USE_OPLINE
1.1 misho 2218:
1.1.1.2 misho 2219: zval *fname = opline->op1.zv;
1.1 misho 2220:
2221: zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
2222:
1.1.1.2 misho 2223: if (CACHED_PTR(opline->op1.literal->cache_slot)) {
2224: EX(function_state).function = CACHED_PTR(opline->op1.literal->cache_slot);
2225: } else if (UNEXPECTED(zend_hash_quick_find(EG(function_table), Z_STRVAL_P(fname), Z_STRLEN_P(fname)+1, Z_HASH_P(fname), (void **) &EX(function_state).function)==FAILURE)) {
2226: SAVE_OPLINE();
1.1 misho 2227: zend_error_noreturn(E_ERROR, "Call to undefined function %s()", fname->value.str.val);
1.1.1.2 misho 2228: } else {
2229: CACHE_PTR(opline->op1.literal->cache_slot, EX(function_state).function);
1.1 misho 2230: }
2231: EX(object) = NULL;
2232:
2233: return zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
2234: }
2235:
2236: static int ZEND_FASTCALL ZEND_RETURN_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
2237: {
1.1.1.2 misho 2238: USE_OPLINE
1.1 misho 2239: zval *retval_ptr;
2240:
2241:
1.1.1.2 misho 2242: SAVE_OPLINE();
2243: retval_ptr = opline->op1.zv;
2244:
2245: if (!EG(return_value_ptr_ptr)) {
2246: if (IS_CONST == IS_TMP_VAR) {
1.1 misho 2247:
2248: }
1.1.1.2 misho 2249: } else if (!0) { /* Not a temp var */
2250: if (IS_CONST == IS_CONST ||
2251: (PZVAL_IS_REF(retval_ptr) && Z_REFCOUNT_P(retval_ptr) > 0)) {
2252: zval *ret;
1.1 misho 2253:
1.1.1.2 misho 2254: ALLOC_ZVAL(ret);
2255: INIT_PZVAL_COPY(ret, retval_ptr);
2256: zval_copy_ctor(ret);
2257: *EG(return_value_ptr_ptr) = ret;
2258: } else if ((IS_CONST == IS_CV || IS_CONST == IS_VAR) &&
2259: retval_ptr == &EG(uninitialized_zval)) {
2260: zval *ret;
1.1 misho 2261:
1.1.1.2 misho 2262: ALLOC_INIT_ZVAL(ret);
2263: *EG(return_value_ptr_ptr) = ret;
2264: } else {
2265: *EG(return_value_ptr_ptr) = retval_ptr;
2266: Z_ADDREF_P(retval_ptr);
1.1 misho 2267: }
1.1.1.2 misho 2268: } else {
2269: zval *ret;
1.1 misho 2270:
1.1.1.2 misho 2271: ALLOC_ZVAL(ret);
2272: INIT_PZVAL_COPY(ret, retval_ptr);
2273: *EG(return_value_ptr_ptr) = ret;
2274: }
1.1 misho 2275:
1.1.1.2 misho 2276: return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
2277: }
1.1 misho 2278:
1.1.1.2 misho 2279: static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
2280: {
2281: USE_OPLINE
2282: zval *retval_ptr;
2283: zval **retval_ptr_ptr;
1.1 misho 2284:
2285:
1.1.1.2 misho 2286: SAVE_OPLINE();
1.1 misho 2287:
1.1.1.2 misho 2288: do {
2289: if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR) {
2290: /* Not supposed to happen, but we'll allow it */
2291: zend_error(E_NOTICE, "Only variable references should be returned by reference");
2292:
2293: retval_ptr = opline->op1.zv;
2294: if (!EG(return_value_ptr_ptr)) {
2295: if (IS_CONST == IS_TMP_VAR) {
2296:
2297: }
2298: } else if (!0) { /* Not a temp var */
1.1 misho 2299: zval *ret;
2300:
2301: ALLOC_ZVAL(ret);
2302: INIT_PZVAL_COPY(ret, retval_ptr);
2303: zval_copy_ctor(ret);
2304: *EG(return_value_ptr_ptr) = ret;
1.1.1.2 misho 2305: } else {
1.1 misho 2306: zval *ret;
2307:
1.1.1.2 misho 2308: ALLOC_ZVAL(ret);
2309: INIT_PZVAL_COPY(ret, retval_ptr);
1.1 misho 2310: *EG(return_value_ptr_ptr) = ret;
2311: }
1.1.1.2 misho 2312: break;
2313: }
1.1 misho 2314:
1.1.1.2 misho 2315: retval_ptr_ptr = NULL;
2316:
2317: if (IS_CONST == IS_VAR && UNEXPECTED(retval_ptr_ptr == NULL)) {
2318: zend_error_noreturn(E_ERROR, "Cannot return string offsets by reference");
1.1 misho 2319: }
1.1.1.2 misho 2320:
2321: if (IS_CONST == IS_VAR && !Z_ISREF_PP(retval_ptr_ptr)) {
2322: if (opline->extended_value == ZEND_RETURNS_FUNCTION &&
2323: EX_T(opline->op1.var).var.fcall_returned_reference) {
2324: } else if (EX_T(opline->op1.var).var.ptr_ptr == &EX_T(opline->op1.var).var.ptr) {
2325: zend_error(E_NOTICE, "Only variable references should be returned by reference");
2326: if (EG(return_value_ptr_ptr)) {
1.1.1.4 ! misho 2327: zval *ret;
! 2328:
! 2329: ALLOC_ZVAL(ret);
! 2330: INIT_PZVAL_COPY(ret, *retval_ptr_ptr);
! 2331: zval_copy_ctor(ret);
! 2332: *EG(return_value_ptr_ptr) = ret;
1.1.1.2 misho 2333: }
2334: break;
2335: }
2336: }
2337:
2338: if (EG(return_value_ptr_ptr)) {
2339: SEPARATE_ZVAL_TO_MAKE_IS_REF(retval_ptr_ptr);
2340: Z_ADDREF_PP(retval_ptr_ptr);
2341:
2342: *EG(return_value_ptr_ptr) = *retval_ptr_ptr;
2343: }
2344: } while (0);
1.1 misho 2345:
2346: return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
2347: }
2348:
2349: static int ZEND_FASTCALL ZEND_THROW_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
2350: {
1.1.1.2 misho 2351: USE_OPLINE
1.1 misho 2352: zval *value;
2353: zval *exception;
2354:
2355:
1.1.1.2 misho 2356: SAVE_OPLINE();
2357: value = opline->op1.zv;
1.1 misho 2358:
1.1.1.2 misho 2359: if (IS_CONST == IS_CONST || UNEXPECTED(Z_TYPE_P(value) != IS_OBJECT)) {
1.1 misho 2360: zend_error_noreturn(E_ERROR, "Can only throw objects");
2361: }
2362: zend_exception_save(TSRMLS_C);
2363: /* Not sure if a complete copy is what we want here */
2364: ALLOC_ZVAL(exception);
2365: INIT_PZVAL_COPY(exception, value);
2366: if (!0) {
2367: zval_copy_ctor(exception);
2368: }
2369:
2370: zend_throw_exception_object(exception TSRMLS_CC);
2371: zend_exception_restore(TSRMLS_C);
2372:
1.1.1.2 misho 2373: HANDLE_EXCEPTION();
1.1 misho 2374: }
2375:
2376: static int ZEND_FASTCALL ZEND_SEND_VAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
2377: {
1.1.1.2 misho 2378: USE_OPLINE
2379:
2380: SAVE_OPLINE();
1.1 misho 2381: if (opline->extended_value==ZEND_DO_FCALL_BY_NAME
1.1.1.2 misho 2382: && ARG_MUST_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) {
2383: zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", opline->op2.opline_num);
1.1 misho 2384: }
2385: {
2386: zval *valptr;
2387: zval *value;
2388:
2389:
1.1.1.2 misho 2390: value = opline->op1.zv;
1.1 misho 2391:
2392: ALLOC_ZVAL(valptr);
2393: INIT_PZVAL_COPY(valptr, value);
2394: if (!0) {
2395: zval_copy_ctor(valptr);
2396: }
2397: zend_vm_stack_push(valptr TSRMLS_CC);
2398:
2399: }
1.1.1.2 misho 2400: CHECK_EXCEPTION();
1.1 misho 2401: ZEND_VM_NEXT_OPCODE();
2402: }
2403:
2404: static int ZEND_FASTCALL ZEND_BOOL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
2405: {
1.1.1.2 misho 2406: USE_OPLINE
1.1 misho 2407:
1.1.1.2 misho 2408: zval *retval = &EX_T(opline->result.var).tmp_var;
1.1 misho 2409:
1.1.1.2 misho 2410: SAVE_OPLINE();
1.1 misho 2411: /* PHP 3.0 returned "" for false and 1 for true, here we use 0 and 1 for now */
1.1.1.2 misho 2412: ZVAL_BOOL(retval, i_zend_is_true(opline->op1.zv));
1.1 misho 2413:
1.1.1.2 misho 2414: CHECK_EXCEPTION();
1.1 misho 2415: ZEND_VM_NEXT_OPCODE();
2416: }
2417:
2418: static int ZEND_FASTCALL ZEND_CLONE_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
2419: {
1.1.1.2 misho 2420: USE_OPLINE
1.1 misho 2421:
1.1.1.2 misho 2422: zval *obj;
1.1 misho 2423: zend_class_entry *ce;
2424: zend_function *clone;
2425: zend_object_clone_obj_t clone_call;
2426:
1.1.1.2 misho 2427: SAVE_OPLINE();
2428: obj = opline->op1.zv;
2429:
1.1 misho 2430: if (IS_CONST == IS_CONST ||
1.1.1.2 misho 2431: UNEXPECTED(Z_TYPE_P(obj) != IS_OBJECT)) {
1.1 misho 2432: zend_error_noreturn(E_ERROR, "__clone method called on non-object");
2433: }
2434:
2435: ce = Z_OBJCE_P(obj);
2436: clone = ce ? ce->clone : NULL;
2437: clone_call = Z_OBJ_HT_P(obj)->clone_obj;
1.1.1.2 misho 2438: if (UNEXPECTED(clone_call == NULL)) {
1.1 misho 2439: if (ce) {
2440: zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s", ce->name);
2441: } else {
2442: zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object");
2443: }
2444: }
2445:
2446: if (ce && clone) {
2447: if (clone->op_array.fn_flags & ZEND_ACC_PRIVATE) {
2448: /* Ensure that if we're calling a private function, we're allowed to do so.
2449: */
1.1.1.2 misho 2450: if (UNEXPECTED(ce != EG(scope))) {
1.1 misho 2451: zend_error_noreturn(E_ERROR, "Call to private %s::__clone() from context '%s'", ce->name, EG(scope) ? EG(scope)->name : "");
2452: }
2453: } else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) {
2454: /* Ensure that if we're calling a protected function, we're allowed to do so.
2455: */
1.1.1.3 misho 2456: if (UNEXPECTED(!zend_check_protected(zend_get_function_root_class(clone), EG(scope)))) {
1.1 misho 2457: zend_error_noreturn(E_ERROR, "Call to protected %s::__clone() from context '%s'", ce->name, EG(scope) ? EG(scope)->name : "");
2458: }
2459: }
2460: }
2461:
1.1.1.2 misho 2462: if (EXPECTED(EG(exception) == NULL)) {
2463: zval *retval;
2464:
2465: ALLOC_ZVAL(retval);
2466: Z_OBJVAL_P(retval) = clone_call(obj TSRMLS_CC);
2467: Z_TYPE_P(retval) = IS_OBJECT;
2468: Z_SET_REFCOUNT_P(retval, 1);
2469: Z_SET_ISREF_P(retval);
2470: if (!RETURN_VALUE_USED(opline) || UNEXPECTED(EG(exception) != NULL)) {
2471: zval_ptr_dtor(&retval);
2472: } else {
2473: AI_SET_PTR(&EX_T(opline->result.var), retval);
1.1 misho 2474: }
2475: }
2476:
1.1.1.2 misho 2477: CHECK_EXCEPTION();
1.1 misho 2478: ZEND_VM_NEXT_OPCODE();
2479: }
2480:
2481: static int ZEND_FASTCALL ZEND_CAST_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
2482: {
1.1.1.2 misho 2483: USE_OPLINE
2484:
2485: zval *expr;
2486: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 2487:
1.1.1.2 misho 2488: SAVE_OPLINE();
2489: expr = opline->op1.zv;
1.1 misho 2490:
2491: if (opline->extended_value != IS_STRING) {
1.1.1.2 misho 2492: ZVAL_COPY_VALUE(result, expr);
1.1 misho 2493: if (!0) {
2494: zendi_zval_copy_ctor(*result);
2495: }
2496: }
2497: switch (opline->extended_value) {
2498: case IS_NULL:
2499: convert_to_null(result);
2500: break;
2501: case IS_BOOL:
2502: convert_to_boolean(result);
2503: break;
2504: case IS_LONG:
2505: convert_to_long(result);
2506: break;
2507: case IS_DOUBLE:
2508: convert_to_double(result);
2509: break;
2510: case IS_STRING: {
2511: zval var_copy;
2512: int use_copy;
2513:
2514: zend_make_printable_zval(expr, &var_copy, &use_copy);
2515: if (use_copy) {
1.1.1.2 misho 2516: ZVAL_COPY_VALUE(result, &var_copy);
1.1 misho 2517: if (0) {
2518:
2519: }
2520: } else {
1.1.1.2 misho 2521: ZVAL_COPY_VALUE(result, expr);
1.1 misho 2522: if (!0) {
2523: zendi_zval_copy_ctor(*result);
2524: }
2525: }
2526: break;
2527: }
2528: case IS_ARRAY:
2529: convert_to_array(result);
2530: break;
2531: case IS_OBJECT:
2532: convert_to_object(result);
2533: break;
2534: }
2535:
1.1.1.2 misho 2536: CHECK_EXCEPTION();
1.1 misho 2537: ZEND_VM_NEXT_OPCODE();
2538: }
2539:
2540: static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
2541: {
1.1.1.2 misho 2542: USE_OPLINE
1.1 misho 2543: zend_op_array *new_op_array=NULL;
2544:
1.1.1.2 misho 2545: zval *inc_filename;
2546: zval *tmp_inc_filename = NULL;
1.1 misho 2547: zend_bool failure_retval=0;
2548:
1.1.1.2 misho 2549: SAVE_OPLINE();
2550: inc_filename = opline->op1.zv;
2551:
1.1 misho 2552: if (inc_filename->type!=IS_STRING) {
1.1.1.2 misho 2553: MAKE_STD_ZVAL(tmp_inc_filename);
2554: ZVAL_COPY_VALUE(tmp_inc_filename, inc_filename);
2555: zval_copy_ctor(tmp_inc_filename);
2556: convert_to_string(tmp_inc_filename);
2557: inc_filename = tmp_inc_filename;
1.1 misho 2558: }
2559:
1.1.1.2 misho 2560: if (opline->extended_value != ZEND_EVAL && strlen(Z_STRVAL_P(inc_filename)) != Z_STRLEN_P(inc_filename)) {
2561: if (opline->extended_value == ZEND_INCLUDE_ONCE || opline->extended_value == ZEND_INCLUDE) {
1.1 misho 2562: zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
2563: } else {
2564: zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
2565: }
2566: } else {
1.1.1.2 misho 2567: switch (opline->extended_value) {
1.1 misho 2568: case ZEND_INCLUDE_ONCE:
2569: case ZEND_REQUIRE_ONCE: {
2570: zend_file_handle file_handle;
2571: char *resolved_path;
2572:
2573: resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename) TSRMLS_CC);
2574: if (resolved_path) {
2575: failure_retval = zend_hash_exists(&EG(included_files), resolved_path, strlen(resolved_path)+1);
2576: } else {
2577: resolved_path = Z_STRVAL_P(inc_filename);
2578: }
2579:
2580: if (failure_retval) {
2581: /* do nothing, file already included */
2582: } else if (SUCCESS == zend_stream_open(resolved_path, &file_handle TSRMLS_CC)) {
2583:
2584: if (!file_handle.opened_path) {
2585: file_handle.opened_path = estrdup(resolved_path);
2586: }
2587:
2588: if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) {
1.1.1.2 misho 2589: new_op_array = zend_compile_file(&file_handle, (opline->extended_value==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
1.1 misho 2590: zend_destroy_file_handle(&file_handle TSRMLS_CC);
2591: } else {
2592: zend_file_handle_dtor(&file_handle TSRMLS_CC);
2593: failure_retval=1;
2594: }
2595: } else {
1.1.1.2 misho 2596: if (opline->extended_value == ZEND_INCLUDE_ONCE) {
1.1 misho 2597: zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
2598: } else {
2599: zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
2600: }
2601: }
2602: if (resolved_path != Z_STRVAL_P(inc_filename)) {
2603: efree(resolved_path);
2604: }
2605: }
2606: break;
2607: case ZEND_INCLUDE:
2608: case ZEND_REQUIRE:
1.1.1.2 misho 2609: new_op_array = compile_filename(opline->extended_value, inc_filename TSRMLS_CC);
1.1 misho 2610: break;
2611: case ZEND_EVAL: {
2612: char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);
2613:
2614: new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
2615: efree(eval_desc);
2616: }
2617: break;
2618: EMPTY_SWITCH_DEFAULT_CASE()
2619: }
2620: }
1.1.1.2 misho 2621: if (tmp_inc_filename) {
2622: zval_ptr_dtor(&tmp_inc_filename);
1.1 misho 2623: }
2624:
1.1.1.2 misho 2625: if (UNEXPECTED(EG(exception) != NULL)) {
2626: HANDLE_EXCEPTION();
2627: } else if (EXPECTED(new_op_array != NULL)) {
1.1 misho 2628: EX(original_return_value) = EG(return_value_ptr_ptr);
2629: EG(active_op_array) = new_op_array;
1.1.1.2 misho 2630: if (RETURN_VALUE_USED(opline)) {
2631: EX_T(opline->result.var).var.ptr = NULL;
2632: EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
2633: EG(return_value_ptr_ptr) = EX_T(opline->result.var).var.ptr_ptr;
2634: } else {
2635: EG(return_value_ptr_ptr) = NULL;
2636: }
1.1 misho 2637:
2638: EX(current_object) = EX(object);
2639:
2640: EX(function_state).function = (zend_function *) new_op_array;
2641: EX(object) = NULL;
2642:
2643: if (!EG(active_symbol_table)) {
2644: zend_rebuild_symbol_table(TSRMLS_C);
2645: }
2646:
1.1.1.2 misho 2647: if (EXPECTED(zend_execute == execute)) {
1.1 misho 2648: ZEND_VM_ENTER();
2649: } else {
2650: zend_execute(new_op_array TSRMLS_CC);
2651: }
2652:
2653: EX(function_state).function = (zend_function *) EX(op_array);
2654: EX(object) = EX(current_object);
2655:
2656: EG(opline_ptr) = &EX(opline);
2657: EG(active_op_array) = EX(op_array);
2658: EG(return_value_ptr_ptr) = EX(original_return_value);
2659: destroy_op_array(new_op_array TSRMLS_CC);
2660: efree(new_op_array);
1.1.1.2 misho 2661: if (UNEXPECTED(EG(exception) != NULL)) {
1.1 misho 2662: zend_throw_exception_internal(NULL TSRMLS_CC);
1.1.1.2 misho 2663: HANDLE_EXCEPTION();
2664: } else if (RETURN_VALUE_USED(opline)) {
2665: if (!EX_T(opline->result.var).var.ptr) { /* there was no return statement */
2666: zval *retval;
2667:
2668: ALLOC_ZVAL(retval);
2669: ZVAL_BOOL(retval, 1);
2670: INIT_PZVAL(retval);
2671: EX_T(opline->result.var).var.ptr = retval;
2672: }
1.1 misho 2673: }
2674:
1.1.1.2 misho 2675: } else if (RETURN_VALUE_USED(opline)) {
2676: zval *retval;
1.1 misho 2677:
1.1.1.2 misho 2678: ALLOC_ZVAL(retval);
2679: ZVAL_BOOL(retval, failure_retval);
2680: INIT_PZVAL(retval);
2681: AI_SET_PTR(&EX_T(opline->result.var), retval);
1.1 misho 2682: }
2683: ZEND_VM_NEXT_OPCODE();
2684: }
2685:
2686: static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
2687: {
1.1.1.2 misho 2688: USE_OPLINE
1.1 misho 2689:
2690: zval *array_ptr, **array_ptr_ptr;
2691: HashTable *fe_ht;
2692: zend_object_iterator *iter = NULL;
2693: zend_class_entry *ce = NULL;
2694: zend_bool is_empty = 0;
2695:
1.1.1.2 misho 2696: SAVE_OPLINE();
2697:
2698: if ((IS_CONST == IS_CV || IS_CONST == IS_VAR) &&
2699: (opline->extended_value & ZEND_FE_RESET_VARIABLE)) {
1.1 misho 2700: array_ptr_ptr = NULL;
2701: if (array_ptr_ptr == NULL || array_ptr_ptr == &EG(uninitialized_zval_ptr)) {
1.1.1.2 misho 2702: MAKE_STD_ZVAL(array_ptr);
2703: ZVAL_NULL(array_ptr);
1.1 misho 2704: } else if (Z_TYPE_PP(array_ptr_ptr) == IS_OBJECT) {
2705: if(Z_OBJ_HT_PP(array_ptr_ptr)->get_class_entry == NULL) {
2706: zend_error(E_WARNING, "foreach() cannot iterate over objects without PHP class");
1.1.1.2 misho 2707: ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num);
1.1 misho 2708: }
2709:
2710: ce = Z_OBJCE_PP(array_ptr_ptr);
2711: if (!ce || ce->get_iterator == NULL) {
2712: SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr);
2713: Z_ADDREF_PP(array_ptr_ptr);
2714: }
2715: array_ptr = *array_ptr_ptr;
2716: } else {
2717: if (Z_TYPE_PP(array_ptr_ptr) == IS_ARRAY) {
2718: SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr);
2719: if (opline->extended_value & ZEND_FE_FETCH_BYREF) {
2720: Z_SET_ISREF_PP(array_ptr_ptr);
2721: }
2722: }
2723: array_ptr = *array_ptr_ptr;
2724: Z_ADDREF_P(array_ptr);
2725: }
2726: } else {
1.1.1.2 misho 2727: array_ptr = opline->op1.zv;
1.1 misho 2728: if (0) { /* IS_TMP_VAR */
2729: zval *tmp;
2730:
2731: ALLOC_ZVAL(tmp);
2732: INIT_PZVAL_COPY(tmp, array_ptr);
2733: array_ptr = tmp;
2734: if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
2735: ce = Z_OBJCE_P(array_ptr);
2736: if (ce && ce->get_iterator) {
2737: Z_DELREF_P(array_ptr);
2738: }
2739: }
2740: } else if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
2741: ce = Z_OBJCE_P(array_ptr);
2742: if (!ce || !ce->get_iterator) {
2743: Z_ADDREF_P(array_ptr);
2744: }
2745: } else if (IS_CONST == IS_CONST ||
2746: ((IS_CONST == IS_CV || IS_CONST == IS_VAR) &&
2747: !Z_ISREF_P(array_ptr) &&
2748: Z_REFCOUNT_P(array_ptr) > 1)) {
2749: zval *tmp;
2750:
2751: ALLOC_ZVAL(tmp);
2752: INIT_PZVAL_COPY(tmp, array_ptr);
2753: zval_copy_ctor(tmp);
2754: array_ptr = tmp;
2755: } else {
2756: Z_ADDREF_P(array_ptr);
2757: }
2758: }
2759:
2760: if (ce && ce->get_iterator) {
2761: iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC);
2762:
1.1.1.2 misho 2763: if (iter && EXPECTED(EG(exception) == NULL)) {
1.1 misho 2764: array_ptr = zend_iterator_wrap(iter TSRMLS_CC);
2765: } else {
2766:
2767: if (!EG(exception)) {
2768: zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Object of type %s did not create an Iterator", ce->name);
2769: }
2770: zend_throw_exception_internal(NULL TSRMLS_CC);
1.1.1.2 misho 2771: HANDLE_EXCEPTION();
1.1 misho 2772: }
2773: }
2774:
1.1.1.2 misho 2775: EX_T(opline->result.var).fe.ptr = array_ptr;
1.1 misho 2776:
2777: if (iter) {
2778: iter->index = 0;
2779: if (iter->funcs->rewind) {
2780: iter->funcs->rewind(iter TSRMLS_CC);
1.1.1.2 misho 2781: if (UNEXPECTED(EG(exception) != NULL)) {
1.1 misho 2782: zval_ptr_dtor(&array_ptr);
2783:
1.1.1.2 misho 2784: HANDLE_EXCEPTION();
1.1 misho 2785: }
2786: }
2787: is_empty = iter->funcs->valid(iter TSRMLS_CC) != SUCCESS;
1.1.1.2 misho 2788: if (UNEXPECTED(EG(exception) != NULL)) {
1.1 misho 2789: zval_ptr_dtor(&array_ptr);
2790:
1.1.1.2 misho 2791: HANDLE_EXCEPTION();
1.1 misho 2792: }
2793: iter->index = -1; /* will be set to 0 before using next handler */
2794: } else if ((fe_ht = HASH_OF(array_ptr)) != NULL) {
2795: zend_hash_internal_pointer_reset(fe_ht);
2796: if (ce) {
2797: zend_object *zobj = zend_objects_get_address(array_ptr TSRMLS_CC);
2798: while (zend_hash_has_more_elements(fe_ht) == SUCCESS) {
2799: char *str_key;
2800: uint str_key_len;
2801: ulong int_key;
2802: zend_uchar key_type;
2803:
2804: key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL);
2805: if (key_type != HASH_KEY_NON_EXISTANT &&
2806: (key_type == HASH_KEY_IS_LONG ||
2807: zend_check_property_access(zobj, str_key, str_key_len-1 TSRMLS_CC) == SUCCESS)) {
2808: break;
2809: }
2810: zend_hash_move_forward(fe_ht);
2811: }
2812: }
2813: is_empty = zend_hash_has_more_elements(fe_ht) != SUCCESS;
1.1.1.2 misho 2814: zend_hash_get_pointer(fe_ht, &EX_T(opline->result.var).fe.fe_pos);
1.1 misho 2815: } else {
2816: zend_error(E_WARNING, "Invalid argument supplied for foreach()");
2817: is_empty = 1;
2818: }
2819:
2820: if (is_empty) {
1.1.1.2 misho 2821: ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num);
1.1 misho 2822: } else {
1.1.1.2 misho 2823: CHECK_EXCEPTION();
1.1 misho 2824: ZEND_VM_NEXT_OPCODE();
2825: }
2826: }
2827:
1.1.1.2 misho 2828: static int ZEND_FASTCALL ZEND_EXIT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 2829: {
1.1.1.2 misho 2830: #if 0 || (IS_CONST != IS_UNUSED)
2831: USE_OPLINE
1.1 misho 2832:
1.1.1.2 misho 2833: SAVE_OPLINE();
2834: if (IS_CONST != IS_UNUSED) {
1.1 misho 2835:
1.1.1.2 misho 2836: zval *ptr = opline->op1.zv;
1.1 misho 2837:
1.1.1.2 misho 2838: if (Z_TYPE_P(ptr) == IS_LONG) {
2839: EG(exit_status) = Z_LVAL_P(ptr);
1.1 misho 2840: } else {
1.1.1.2 misho 2841: zend_print_variable(ptr);
1.1 misho 2842: }
2843:
2844: }
1.1.1.2 misho 2845: #endif
2846: zend_bailout();
2847: ZEND_VM_NEXT_OPCODE(); /* Never reached */
1.1 misho 2848: }
2849:
1.1.1.2 misho 2850: static int ZEND_FASTCALL ZEND_JMP_SET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 2851: {
1.1.1.2 misho 2852: USE_OPLINE
1.1 misho 2853:
1.1.1.2 misho 2854: zval *value;
1.1 misho 2855:
1.1.1.2 misho 2856: SAVE_OPLINE();
2857: value = opline->op1.zv;
2858:
2859: if (i_zend_is_true(value)) {
2860: ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, value);
2861: if (!0) {
2862: zendi_zval_copy_ctor(EX_T(opline->result.var).tmp_var);
1.1 misho 2863: }
2864:
1.1.1.2 misho 2865: #if DEBUG_ZEND>=2
2866: printf("Conditional jmp to %d\n", opline->op2.opline_num);
1.1 misho 2867: #endif
1.1.1.2 misho 2868: ZEND_VM_JMP(opline->op2.jmp_addr);
2869: }
2870:
2871: CHECK_EXCEPTION();
1.1 misho 2872: ZEND_VM_NEXT_OPCODE();
2873: }
2874:
1.1.1.2 misho 2875: static int ZEND_FASTCALL ZEND_JMP_SET_VAR_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 2876: {
1.1.1.2 misho 2877: USE_OPLINE
1.1 misho 2878:
1.1.1.2 misho 2879: zval *value, *ret;
2880:
2881: SAVE_OPLINE();
2882: value = opline->op1.zv;
1.1 misho 2883:
2884: if (i_zend_is_true(value)) {
1.1.1.2 misho 2885: if (IS_CONST == IS_VAR || IS_CONST == IS_CV) {
2886: Z_ADDREF_P(value);
2887: EX_T(opline->result.var).var.ptr = value;
2888: EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
2889: } else {
2890: ALLOC_ZVAL(ret);
2891: INIT_PZVAL_COPY(ret, value);
2892: EX_T(opline->result.var).var.ptr = ret;
2893: EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
2894: if (!0) {
2895: zval_copy_ctor(EX_T(opline->result.var).var.ptr);
2896: }
2897: }
1.1 misho 2898:
2899: #if DEBUG_ZEND>=2
1.1.1.2 misho 2900: printf("Conditional jmp to %d\n", opline->op2.opline_num);
1.1 misho 2901: #endif
1.1.1.2 misho 2902: ZEND_VM_JMP(opline->op2.jmp_addr);
1.1 misho 2903: }
2904:
1.1.1.2 misho 2905: CHECK_EXCEPTION();
1.1 misho 2906: ZEND_VM_NEXT_OPCODE();
2907: }
2908:
2909: static int ZEND_FASTCALL ZEND_QM_ASSIGN_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
2910: {
1.1.1.2 misho 2911: USE_OPLINE
2912:
2913: zval *value;
1.1 misho 2914:
1.1.1.2 misho 2915: SAVE_OPLINE();
2916: value = opline->op1.zv;
1.1 misho 2917:
1.1.1.2 misho 2918: ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, value);
1.1 misho 2919: if (!0) {
1.1.1.2 misho 2920: zval_copy_ctor(&EX_T(opline->result.var).tmp_var);
1.1 misho 2921: }
2922:
1.1.1.2 misho 2923: CHECK_EXCEPTION();
1.1 misho 2924: ZEND_VM_NEXT_OPCODE();
2925: }
2926:
1.1.1.2 misho 2927: static int ZEND_FASTCALL ZEND_QM_ASSIGN_VAR_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 2928: {
1.1.1.2 misho 2929: USE_OPLINE
1.1 misho 2930:
1.1.1.2 misho 2931: zval *value, *ret;
2932:
2933: SAVE_OPLINE();
2934: value = opline->op1.zv;
2935:
2936: if (IS_CONST == IS_VAR || IS_CONST == IS_CV) {
2937: Z_ADDREF_P(value);
2938: EX_T(opline->result.var).var.ptr = value;
2939: EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
2940: } else {
2941: ALLOC_ZVAL(ret);
2942: INIT_PZVAL_COPY(ret, value);
2943: EX_T(opline->result.var).var.ptr = ret;
2944: EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
2945: if (!0) {
2946: zval_copy_ctor(EX_T(opline->result.var).var.ptr);
1.1 misho 2947: }
2948: }
1.1.1.2 misho 2949:
2950: CHECK_EXCEPTION();
1.1 misho 2951: ZEND_VM_NEXT_OPCODE();
2952: }
2953:
2954: static int ZEND_FASTCALL ZEND_ADD_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
2955: {
1.1.1.2 misho 2956: USE_OPLINE
1.1 misho 2957:
2958:
1.1.1.2 misho 2959: SAVE_OPLINE();
2960: fast_add_function(&EX_T(opline->result.var).tmp_var,
2961: opline->op1.zv,
2962: opline->op2.zv TSRMLS_CC);
1.1 misho 2963:
2964:
1.1.1.2 misho 2965: CHECK_EXCEPTION();
1.1 misho 2966: ZEND_VM_NEXT_OPCODE();
2967: }
2968:
2969: static int ZEND_FASTCALL ZEND_SUB_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
2970: {
1.1.1.2 misho 2971: USE_OPLINE
1.1 misho 2972:
2973:
1.1.1.2 misho 2974: SAVE_OPLINE();
2975: fast_sub_function(&EX_T(opline->result.var).tmp_var,
2976: opline->op1.zv,
2977: opline->op2.zv TSRMLS_CC);
1.1 misho 2978:
2979:
1.1.1.2 misho 2980: CHECK_EXCEPTION();
1.1 misho 2981: ZEND_VM_NEXT_OPCODE();
2982: }
2983:
2984: static int ZEND_FASTCALL ZEND_MUL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
2985: {
1.1.1.2 misho 2986: USE_OPLINE
1.1 misho 2987:
2988:
1.1.1.2 misho 2989: SAVE_OPLINE();
2990: fast_mul_function(&EX_T(opline->result.var).tmp_var,
2991: opline->op1.zv,
2992: opline->op2.zv TSRMLS_CC);
1.1 misho 2993:
2994:
1.1.1.2 misho 2995: CHECK_EXCEPTION();
1.1 misho 2996: ZEND_VM_NEXT_OPCODE();
2997: }
2998:
2999: static int ZEND_FASTCALL ZEND_DIV_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
3000: {
1.1.1.2 misho 3001: USE_OPLINE
1.1 misho 3002:
3003:
1.1.1.2 misho 3004: SAVE_OPLINE();
3005: fast_div_function(&EX_T(opline->result.var).tmp_var,
3006: opline->op1.zv,
3007: opline->op2.zv TSRMLS_CC);
1.1 misho 3008:
3009:
1.1.1.2 misho 3010: CHECK_EXCEPTION();
1.1 misho 3011: ZEND_VM_NEXT_OPCODE();
3012: }
3013:
3014: static int ZEND_FASTCALL ZEND_MOD_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
3015: {
1.1.1.2 misho 3016: USE_OPLINE
1.1 misho 3017:
3018:
1.1.1.2 misho 3019: SAVE_OPLINE();
3020: fast_mod_function(&EX_T(opline->result.var).tmp_var,
3021: opline->op1.zv,
3022: opline->op2.zv TSRMLS_CC);
1.1 misho 3023:
3024:
1.1.1.2 misho 3025: CHECK_EXCEPTION();
1.1 misho 3026: ZEND_VM_NEXT_OPCODE();
3027: }
3028:
3029: static int ZEND_FASTCALL ZEND_SL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
3030: {
1.1.1.2 misho 3031: USE_OPLINE
1.1 misho 3032:
3033:
1.1.1.2 misho 3034: SAVE_OPLINE();
3035: shift_left_function(&EX_T(opline->result.var).tmp_var,
3036: opline->op1.zv,
3037: opline->op2.zv TSRMLS_CC);
1.1 misho 3038:
3039:
1.1.1.2 misho 3040: CHECK_EXCEPTION();
1.1 misho 3041: ZEND_VM_NEXT_OPCODE();
3042: }
3043:
3044: static int ZEND_FASTCALL ZEND_SR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
3045: {
1.1.1.2 misho 3046: USE_OPLINE
1.1 misho 3047:
3048:
1.1.1.2 misho 3049: SAVE_OPLINE();
3050: shift_right_function(&EX_T(opline->result.var).tmp_var,
3051: opline->op1.zv,
3052: opline->op2.zv TSRMLS_CC);
1.1 misho 3053:
3054:
1.1.1.2 misho 3055: CHECK_EXCEPTION();
1.1 misho 3056: ZEND_VM_NEXT_OPCODE();
3057: }
3058:
3059: static int ZEND_FASTCALL ZEND_CONCAT_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
3060: {
1.1.1.2 misho 3061: USE_OPLINE
1.1 misho 3062:
3063:
1.1.1.2 misho 3064: SAVE_OPLINE();
3065: concat_function(&EX_T(opline->result.var).tmp_var,
3066: opline->op1.zv,
3067: opline->op2.zv TSRMLS_CC);
1.1 misho 3068:
3069:
1.1.1.2 misho 3070: CHECK_EXCEPTION();
1.1 misho 3071: ZEND_VM_NEXT_OPCODE();
3072: }
3073:
3074: static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
3075: {
1.1.1.2 misho 3076: USE_OPLINE
1.1 misho 3077:
3078:
1.1.1.2 misho 3079: SAVE_OPLINE();
3080: is_identical_function(&EX_T(opline->result.var).tmp_var,
3081: opline->op1.zv,
3082: opline->op2.zv TSRMLS_CC);
1.1 misho 3083:
3084:
1.1.1.2 misho 3085: CHECK_EXCEPTION();
1.1 misho 3086: ZEND_VM_NEXT_OPCODE();
3087: }
3088:
3089: static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
3090: {
1.1.1.2 misho 3091: USE_OPLINE
1.1 misho 3092:
1.1.1.2 misho 3093: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 3094:
1.1.1.2 misho 3095: SAVE_OPLINE();
1.1 misho 3096: is_identical_function(result,
1.1.1.2 misho 3097: opline->op1.zv,
3098: opline->op2.zv TSRMLS_CC);
1.1 misho 3099: Z_LVAL_P(result) = !Z_LVAL_P(result);
3100:
3101:
1.1.1.2 misho 3102: CHECK_EXCEPTION();
1.1 misho 3103: ZEND_VM_NEXT_OPCODE();
3104: }
3105:
3106: static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
3107: {
1.1.1.2 misho 3108: USE_OPLINE
1.1 misho 3109:
1.1.1.2 misho 3110: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 3111:
1.1.1.2 misho 3112: SAVE_OPLINE();
3113: ZVAL_BOOL(result, fast_equal_function(result,
3114: opline->op1.zv,
3115: opline->op2.zv TSRMLS_CC));
1.1 misho 3116:
3117:
1.1.1.2 misho 3118: CHECK_EXCEPTION();
1.1 misho 3119: ZEND_VM_NEXT_OPCODE();
3120: }
3121:
3122: static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
3123: {
1.1.1.2 misho 3124: USE_OPLINE
1.1 misho 3125:
1.1.1.2 misho 3126: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 3127:
1.1.1.2 misho 3128: SAVE_OPLINE();
3129: ZVAL_BOOL(result, fast_not_equal_function(result,
3130: opline->op1.zv,
3131: opline->op2.zv TSRMLS_CC));
1.1 misho 3132:
3133:
1.1.1.2 misho 3134: CHECK_EXCEPTION();
1.1 misho 3135: ZEND_VM_NEXT_OPCODE();
3136: }
3137:
3138: static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
3139: {
1.1.1.2 misho 3140: USE_OPLINE
1.1 misho 3141:
1.1.1.2 misho 3142: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 3143:
1.1.1.2 misho 3144: SAVE_OPLINE();
3145: ZVAL_BOOL(result, fast_is_smaller_function(result,
3146: opline->op1.zv,
3147: opline->op2.zv TSRMLS_CC));
1.1 misho 3148:
3149:
1.1.1.2 misho 3150: CHECK_EXCEPTION();
1.1 misho 3151: ZEND_VM_NEXT_OPCODE();
3152: }
3153:
3154: static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
3155: {
1.1.1.2 misho 3156: USE_OPLINE
1.1 misho 3157:
1.1.1.2 misho 3158: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 3159:
1.1.1.2 misho 3160: SAVE_OPLINE();
3161: ZVAL_BOOL(result, fast_is_smaller_or_equal_function(result,
3162: opline->op1.zv,
3163: opline->op2.zv TSRMLS_CC));
1.1 misho 3164:
3165:
1.1.1.2 misho 3166: CHECK_EXCEPTION();
1.1 misho 3167: ZEND_VM_NEXT_OPCODE();
3168: }
3169:
3170: static int ZEND_FASTCALL ZEND_BW_OR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
3171: {
1.1.1.2 misho 3172: USE_OPLINE
1.1 misho 3173:
3174:
1.1.1.2 misho 3175: SAVE_OPLINE();
3176: bitwise_or_function(&EX_T(opline->result.var).tmp_var,
3177: opline->op1.zv,
3178: opline->op2.zv TSRMLS_CC);
1.1 misho 3179:
3180:
1.1.1.2 misho 3181: CHECK_EXCEPTION();
1.1 misho 3182: ZEND_VM_NEXT_OPCODE();
3183: }
3184:
3185: static int ZEND_FASTCALL ZEND_BW_AND_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
3186: {
1.1.1.2 misho 3187: USE_OPLINE
1.1 misho 3188:
3189:
1.1.1.2 misho 3190: SAVE_OPLINE();
3191: bitwise_and_function(&EX_T(opline->result.var).tmp_var,
3192: opline->op1.zv,
3193: opline->op2.zv TSRMLS_CC);
1.1 misho 3194:
3195:
1.1.1.2 misho 3196: CHECK_EXCEPTION();
1.1 misho 3197: ZEND_VM_NEXT_OPCODE();
3198: }
3199:
3200: static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
3201: {
1.1.1.2 misho 3202: USE_OPLINE
1.1 misho 3203:
3204:
1.1.1.2 misho 3205: SAVE_OPLINE();
3206: bitwise_xor_function(&EX_T(opline->result.var).tmp_var,
3207: opline->op1.zv,
3208: opline->op2.zv TSRMLS_CC);
1.1 misho 3209:
3210:
1.1.1.2 misho 3211: CHECK_EXCEPTION();
1.1 misho 3212: ZEND_VM_NEXT_OPCODE();
3213: }
3214:
3215: static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
3216: {
1.1.1.2 misho 3217: USE_OPLINE
1.1 misho 3218:
3219:
1.1.1.2 misho 3220: SAVE_OPLINE();
3221: boolean_xor_function(&EX_T(opline->result.var).tmp_var,
3222: opline->op1.zv,
3223: opline->op2.zv TSRMLS_CC);
1.1 misho 3224:
3225:
1.1.1.2 misho 3226: CHECK_EXCEPTION();
1.1 misho 3227: ZEND_VM_NEXT_OPCODE();
3228: }
3229:
1.1.1.2 misho 3230: static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_CONST(int type, ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 3231: {
1.1.1.2 misho 3232: USE_OPLINE
3233: zend_free_op free_op1;
3234: zval *varname;
3235: zval **retval;
3236: zval tmp_varname;
3237: HashTable *target_symbol_table;
3238: ulong hash_value;
3239:
3240: SAVE_OPLINE();
3241: varname = opline->op1.zv;
3242:
3243: if (IS_CONST != IS_CONST && UNEXPECTED(Z_TYPE_P(varname) != IS_STRING)) {
3244: ZVAL_COPY_VALUE(&tmp_varname, varname);
3245: zval_copy_ctor(&tmp_varname);
3246: Z_SET_REFCOUNT(tmp_varname, 1);
3247: Z_UNSET_ISREF(tmp_varname);
3248: convert_to_string(&tmp_varname);
3249: varname = &tmp_varname;
3250: }
3251:
3252: if (IS_CONST != IS_UNUSED) {
3253: zend_class_entry *ce;
3254:
3255: if (IS_CONST == IS_CONST) {
3256: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
3257: ce = CACHED_PTR(opline->op2.literal->cache_slot);
3258: } else {
3259: ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
3260: if (UNEXPECTED(ce == NULL)) {
3261: if (IS_CONST != IS_CONST && varname == &tmp_varname) {
3262: zval_dtor(&tmp_varname);
3263: }
3264:
3265: CHECK_EXCEPTION();
3266: ZEND_VM_NEXT_OPCODE();
3267: }
3268: CACHE_PTR(opline->op2.literal->cache_slot, ce);
3269: }
3270: } else {
3271: ce = EX_T(opline->op2.var).class_entry;
3272: }
3273: retval = zend_std_get_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 0, ((IS_CONST == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
3274:
3275: } else {
3276: target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
3277: /*
3278: if (!target_symbol_table) {
3279: CHECK_EXCEPTION();
3280: ZEND_VM_NEXT_OPCODE();
3281: }
3282: */
3283: if (IS_CONST == IS_CONST) {
3284: hash_value = Z_HASH_P(varname);
3285: } else if (IS_INTERNED(Z_STRVAL_P(varname))) {
3286: hash_value = INTERNED_HASH(Z_STRVAL_P(varname));
3287: } else {
3288: hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1);
3289: }
3290:
3291: if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) {
3292: switch (type) {
3293: case BP_VAR_R:
3294: case BP_VAR_UNSET:
3295: zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_P(varname));
3296: /* break missing intentionally */
3297: case BP_VAR_IS:
3298: retval = &EG(uninitialized_zval_ptr);
3299: break;
3300: case BP_VAR_RW:
3301: zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_P(varname));
3302: /* break missing intentionally */
3303: case BP_VAR_W:
3304: Z_ADDREF_P(&EG(uninitialized_zval));
3305: zend_hash_quick_update(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, &EG(uninitialized_zval_ptr), sizeof(zval *), (void **) &retval);
3306: break;
3307: EMPTY_SWITCH_DEFAULT_CASE()
3308: }
3309: }
3310: switch (opline->extended_value & ZEND_FETCH_TYPE_MASK) {
3311: case ZEND_FETCH_GLOBAL:
3312: if (IS_CONST != IS_TMP_VAR) {
3313:
3314: }
3315: break;
3316: case ZEND_FETCH_LOCAL:
3317:
3318: break;
3319: case ZEND_FETCH_STATIC:
3320: zval_update_constant(retval, (void*) 1 TSRMLS_CC);
3321: break;
3322: case ZEND_FETCH_GLOBAL_LOCK:
3323: if (IS_CONST == IS_VAR && !free_op1.var) {
3324: PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
3325: }
3326: break;
3327: }
3328: }
1.1 misho 3329:
3330:
1.1.1.2 misho 3331: if (IS_CONST != IS_CONST && varname == &tmp_varname) {
3332: zval_dtor(&tmp_varname);
3333: }
3334: if (opline->extended_value & ZEND_FETCH_MAKE_REF) {
3335: SEPARATE_ZVAL_TO_MAKE_IS_REF(retval);
3336: }
3337: PZVAL_LOCK(*retval);
3338: switch (type) {
3339: case BP_VAR_R:
3340: case BP_VAR_IS:
3341: AI_SET_PTR(&EX_T(opline->result.var), *retval);
3342: break;
3343: case BP_VAR_UNSET: {
3344: zend_free_op free_res;
3345:
3346: PZVAL_UNLOCK(*retval, &free_res);
3347: if (retval != &EG(uninitialized_zval_ptr)) {
3348: SEPARATE_ZVAL_IF_NOT_REF(retval);
3349: }
3350: PZVAL_LOCK(*retval);
3351: FREE_OP_VAR_PTR(free_res);
1.1 misho 3352: }
1.1.1.2 misho 3353: /* break missing intentionally */
3354: default:
3355: EX_T(opline->result.var).var.ptr_ptr = retval;
3356: break;
3357: }
3358: CHECK_EXCEPTION();
3359: ZEND_VM_NEXT_OPCODE();
3360: }
3361:
3362: static int ZEND_FASTCALL ZEND_FETCH_R_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
3363: {
3364: return zend_fetch_var_address_helper_SPEC_CONST_CONST(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
3365: }
3366:
3367: static int ZEND_FASTCALL ZEND_FETCH_W_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
3368: {
3369: return zend_fetch_var_address_helper_SPEC_CONST_CONST(BP_VAR_W, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
3370: }
3371:
3372: static int ZEND_FASTCALL ZEND_FETCH_RW_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
3373: {
3374: return zend_fetch_var_address_helper_SPEC_CONST_CONST(BP_VAR_RW, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
3375: }
3376:
3377: static int ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
3378: {
3379: USE_OPLINE
3380:
3381: return zend_fetch_var_address_helper_SPEC_CONST_CONST(ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
3382: }
3383:
3384: static int ZEND_FASTCALL ZEND_FETCH_UNSET_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
3385: {
3386: return zend_fetch_var_address_helper_SPEC_CONST_CONST(BP_VAR_UNSET, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
3387: }
3388:
3389: static int ZEND_FASTCALL ZEND_FETCH_IS_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
3390: {
3391: return zend_fetch_var_address_helper_SPEC_CONST_CONST(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
3392: }
3393:
3394: static int ZEND_FASTCALL ZEND_FETCH_DIM_TMP_VAR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
3395: {
3396: USE_OPLINE
3397:
3398: zval *container;
3399:
3400: SAVE_OPLINE();
3401: container = opline->op1.zv;
3402:
3403: if (UNEXPECTED(Z_TYPE_P(container) != IS_ARRAY)) {
3404: PZVAL_LOCK(&EG(uninitialized_zval));
3405: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
1.1 misho 3406: } else {
3407:
1.1.1.2 misho 3408: zval *value = *zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), opline->op2.zv, IS_CONST, BP_VAR_R TSRMLS_CC);
1.1 misho 3409:
1.1.1.2 misho 3410: PZVAL_LOCK(value);
3411: AI_SET_PTR(&EX_T(opline->result.var), value);
1.1 misho 3412:
3413: }
1.1.1.2 misho 3414: CHECK_EXCEPTION();
1.1 misho 3415: ZEND_VM_NEXT_OPCODE();
3416: }
3417:
3418: static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
3419: {
1.1.1.2 misho 3420: USE_OPLINE
1.1 misho 3421: zval *function_name;
3422: zend_class_entry *ce;
3423:
1.1.1.2 misho 3424: SAVE_OPLINE();
1.1 misho 3425: zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
3426:
3427: if (IS_CONST == IS_CONST) {
3428: /* no function found. try a static method in class */
1.1.1.2 misho 3429: if (CACHED_PTR(opline->op1.literal->cache_slot)) {
3430: ce = CACHED_PTR(opline->op1.literal->cache_slot);
3431: } else {
3432: ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
1.1.1.4 ! misho 3433: if (UNEXPECTED(EG(exception) != NULL)) {
! 3434: HANDLE_EXCEPTION();
! 3435: }
1.1.1.2 misho 3436: if (UNEXPECTED(ce == NULL)) {
1.1.1.4 ! misho 3437: zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv));
1.1.1.2 misho 3438: }
3439: CACHE_PTR(opline->op1.literal->cache_slot, ce);
1.1 misho 3440: }
3441: EX(called_scope) = ce;
3442: } else {
1.1.1.2 misho 3443: ce = EX_T(opline->op1.var).class_entry;
1.1 misho 3444:
1.1.1.2 misho 3445: if (opline->extended_value == ZEND_FETCH_CLASS_PARENT || opline->extended_value == ZEND_FETCH_CLASS_SELF) {
1.1 misho 3446: EX(called_scope) = EG(called_scope);
3447: } else {
3448: EX(called_scope) = ce;
3449: }
3450: }
1.1.1.2 misho 3451:
3452: if (IS_CONST == IS_CONST &&
3453: IS_CONST == IS_CONST &&
3454: CACHED_PTR(opline->op2.literal->cache_slot)) {
3455: EX(fbc) = CACHED_PTR(opline->op2.literal->cache_slot);
3456: } else if (IS_CONST != IS_CONST &&
3457: IS_CONST == IS_CONST &&
3458: (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce))) {
3459: /* do nothing */
3460: } else if (IS_CONST != IS_UNUSED) {
1.1 misho 3461: char *function_name_strval = NULL;
3462: int function_name_strlen = 0;
3463:
3464:
3465: if (IS_CONST == IS_CONST) {
1.1.1.2 misho 3466: function_name_strval = Z_STRVAL_P(opline->op2.zv);
3467: function_name_strlen = Z_STRLEN_P(opline->op2.zv);
1.1 misho 3468: } else {
1.1.1.2 misho 3469: function_name = opline->op2.zv;
1.1 misho 3470:
1.1.1.2 misho 3471: if (UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
1.1 misho 3472: zend_error_noreturn(E_ERROR, "Function name must be a string");
3473: } else {
3474: function_name_strval = Z_STRVAL_P(function_name);
3475: function_name_strlen = Z_STRLEN_P(function_name);
3476: }
3477: }
3478:
3479: if (function_name_strval) {
3480: if (ce->get_static_method) {
3481: EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
3482: } else {
1.1.1.2 misho 3483: EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen, ((IS_CONST == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC);
1.1 misho 3484: }
1.1.1.2 misho 3485: if (UNEXPECTED(EX(fbc) == NULL)) {
1.1 misho 3486: zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name, function_name_strval);
3487: }
1.1.1.2 misho 3488: if (IS_CONST == IS_CONST &&
3489: EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) &&
3490: EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0)) {
3491: if (IS_CONST == IS_CONST) {
3492: CACHE_PTR(opline->op2.literal->cache_slot, EX(fbc));
3493: } else {
3494: CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce, EX(fbc));
3495: }
3496: }
1.1 misho 3497: }
3498: if (IS_CONST != IS_CONST) {
3499:
3500: }
3501: } else {
1.1.1.2 misho 3502: if (UNEXPECTED(ce->constructor == NULL)) {
1.1 misho 3503: zend_error_noreturn(E_ERROR, "Cannot call constructor");
3504: }
3505: if (EG(This) && Z_OBJCE_P(EG(This)) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) {
1.1.1.2 misho 3506: zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name);
1.1 misho 3507: }
3508: EX(fbc) = ce->constructor;
3509: }
3510:
3511: if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) {
3512: EX(object) = NULL;
3513: } else {
3514: if (EG(This) &&
3515: Z_OBJ_HT_P(EG(This))->get_class_entry &&
3516: !instanceof_function(Z_OBJCE_P(EG(This)), ce TSRMLS_CC)) {
3517: /* We are calling method of the other (incompatible) class,
3518: but passing $this. This is done for compatibility with php-4. */
3519: if (EX(fbc)->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
1.1.1.2 misho 3520: zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", EX(fbc)->common.scope->name, EX(fbc)->common.function_name);
1.1 misho 3521: } else {
3522: /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
1.1.1.2 misho 3523: zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", EX(fbc)->common.scope->name, EX(fbc)->common.function_name);
1.1 misho 3524: }
3525: }
3526: if ((EX(object) = EG(This))) {
3527: Z_ADDREF_P(EX(object));
3528: EX(called_scope) = Z_OBJCE_P(EX(object));
3529: }
3530: }
3531:
1.1.1.2 misho 3532: CHECK_EXCEPTION();
1.1 misho 3533: ZEND_VM_NEXT_OPCODE();
3534: }
3535:
3536: static int ZEND_FASTCALL ZEND_CASE_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
3537: {
1.1.1.2 misho 3538: USE_OPLINE
1.1 misho 3539:
3540:
1.1.1.2 misho 3541: SAVE_OPLINE();
1.1 misho 3542: if (IS_CONST==IS_VAR) {
1.1.1.2 misho 3543: PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
1.1 misho 3544: }
1.1.1.2 misho 3545: is_equal_function(&EX_T(opline->result.var).tmp_var,
3546: opline->op1.zv,
3547: opline->op2.zv TSRMLS_CC);
1.1 misho 3548:
1.1.1.2 misho 3549: CHECK_EXCEPTION();
1.1 misho 3550: ZEND_VM_NEXT_OPCODE();
3551: }
3552:
3553: static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
3554: {
1.1.1.2 misho 3555: USE_OPLINE
1.1 misho 3556:
1.1.1.2 misho 3557: SAVE_OPLINE();
1.1 misho 3558: if (IS_CONST == IS_UNUSED) {
1.1.1.2 misho 3559: zend_constant *c;
3560: zval *retval;
3561:
3562: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
3563: c = CACHED_PTR(opline->op2.literal->cache_slot);
3564: } else if ((c = zend_quick_get_constant(opline->op2.literal + 1, opline->extended_value TSRMLS_CC)) == NULL) {
1.1 misho 3565: if ((opline->extended_value & IS_CONSTANT_UNQUALIFIED) != 0) {
1.1.1.2 misho 3566: char *actual = (char *)zend_memrchr(Z_STRVAL_P(opline->op2.zv), '\\', Z_STRLEN_P(opline->op2.zv));
1.1 misho 3567: if(!actual) {
1.1.1.2 misho 3568: actual = Z_STRVAL_P(opline->op2.zv);
1.1 misho 3569: } else {
3570: actual++;
3571: }
3572: /* non-qualified constant - allow text substitution */
3573: zend_error(E_NOTICE, "Use of undefined constant %s - assumed '%s'", actual, actual);
1.1.1.2 misho 3574: ZVAL_STRINGL(&EX_T(opline->result.var).tmp_var, actual, Z_STRLEN_P(opline->op2.zv)-(actual - Z_STRVAL_P(opline->op2.zv)), 1);
3575: CHECK_EXCEPTION();
3576: ZEND_VM_NEXT_OPCODE();
1.1 misho 3577: } else {
1.1.1.2 misho 3578: zend_error_noreturn(E_ERROR, "Undefined constant '%s'", Z_STRVAL_P(opline->op2.zv));
1.1 misho 3579: }
1.1.1.2 misho 3580: } else {
3581: CACHE_PTR(opline->op2.literal->cache_slot, c);
1.1 misho 3582: }
1.1.1.2 misho 3583: retval = &EX_T(opline->result.var).tmp_var;
3584: ZVAL_COPY_VALUE(retval, &c->value);
3585: zval_copy_ctor(retval);
3586: CHECK_EXCEPTION();
1.1 misho 3587: ZEND_VM_NEXT_OPCODE();
3588: } else {
3589: /* class constant */
3590: zend_class_entry *ce;
3591: zval **value;
3592:
3593: if (IS_CONST == IS_CONST) {
1.1.1.2 misho 3594: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
3595: value = CACHED_PTR(opline->op2.literal->cache_slot);
3596: ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, *value);
3597: zval_copy_ctor(&EX_T(opline->result.var).tmp_var);
3598: CHECK_EXCEPTION();
3599: ZEND_VM_NEXT_OPCODE();
3600: } else if (CACHED_PTR(opline->op1.literal->cache_slot)) {
3601: ce = CACHED_PTR(opline->op1.literal->cache_slot);
3602: } else {
3603: ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
1.1.1.4 ! misho 3604: if (UNEXPECTED(EG(exception) != NULL)) {
! 3605: HANDLE_EXCEPTION();
! 3606: }
1.1.1.2 misho 3607: if (UNEXPECTED(ce == NULL)) {
1.1.1.4 ! misho 3608: zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv));
1.1.1.2 misho 3609: }
3610: CACHE_PTR(opline->op1.literal->cache_slot, ce);
1.1 misho 3611: }
3612: } else {
1.1.1.2 misho 3613: ce = EX_T(opline->op1.var).class_entry;
3614: if ((value = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce)) != NULL) {
3615: ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, *value);
3616: zval_copy_ctor(&EX_T(opline->result.var).tmp_var);
3617: CHECK_EXCEPTION();
3618: ZEND_VM_NEXT_OPCODE();
3619: }
1.1 misho 3620: }
3621:
1.1.1.2 misho 3622: if (EXPECTED(zend_hash_quick_find(&ce->constants_table, Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv)+1, Z_HASH_P(opline->op2.zv), (void **) &value) == SUCCESS)) {
1.1 misho 3623: if (Z_TYPE_PP(value) == IS_CONSTANT_ARRAY ||
3624: (Z_TYPE_PP(value) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT) {
3625: zend_class_entry *old_scope = EG(scope);
3626:
3627: EG(scope) = ce;
3628: zval_update_constant(value, (void *) 1 TSRMLS_CC);
3629: EG(scope) = old_scope;
3630: }
1.1.1.2 misho 3631: if (IS_CONST == IS_CONST) {
3632: CACHE_PTR(opline->op2.literal->cache_slot, value);
3633: } else {
3634: CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce, value);
3635: }
3636: ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, *value);
3637: zval_copy_ctor(&EX_T(opline->result.var).tmp_var);
1.1 misho 3638: } else {
1.1.1.2 misho 3639: zend_error_noreturn(E_ERROR, "Undefined class constant '%s'", Z_STRVAL_P(opline->op2.zv));
1.1 misho 3640: }
3641:
1.1.1.2 misho 3642: CHECK_EXCEPTION();
1.1 misho 3643: ZEND_VM_NEXT_OPCODE();
3644: }
3645: }
3646:
3647: static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
3648: {
1.1.1.2 misho 3649: USE_OPLINE
1.1 misho 3650:
3651: zval *expr_ptr;
3652:
1.1.1.2 misho 3653: SAVE_OPLINE();
3654: if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && opline->extended_value) {
3655: zval **expr_ptr_ptr = NULL;
1.1 misho 3656:
1.1.1.2 misho 3657: if (IS_CONST == IS_VAR && UNEXPECTED(expr_ptr_ptr == NULL)) {
3658: zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
3659: }
3660: SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr);
1.1 misho 3661: expr_ptr = *expr_ptr_ptr;
1.1.1.2 misho 3662: Z_ADDREF_P(expr_ptr);
1.1 misho 3663: } else {
1.1.1.2 misho 3664: expr_ptr=opline->op1.zv;
3665: if (0) { /* temporary variable */
3666: zval *new_expr;
1.1 misho 3667:
1.1.1.2 misho 3668: ALLOC_ZVAL(new_expr);
3669: INIT_PZVAL_COPY(new_expr, expr_ptr);
3670: expr_ptr = new_expr;
3671: } else if (IS_CONST == IS_CONST || PZVAL_IS_REF(expr_ptr)) {
1.1 misho 3672: zval *new_expr;
3673:
3674: ALLOC_ZVAL(new_expr);
3675: INIT_PZVAL_COPY(new_expr, expr_ptr);
3676: expr_ptr = new_expr;
3677: zendi_zval_copy_ctor(*expr_ptr);
3678: } else {
3679: Z_ADDREF_P(expr_ptr);
3680: }
3681: }
1.1.1.2 misho 3682:
3683: if (IS_CONST != IS_UNUSED) {
3684:
3685: zval *offset = opline->op2.zv;
3686: ulong hval;
3687:
1.1 misho 3688: switch (Z_TYPE_P(offset)) {
3689: case IS_DOUBLE:
1.1.1.2 misho 3690: hval = zend_dval_to_lval(Z_DVAL_P(offset));
3691: goto num_index;
1.1 misho 3692: case IS_LONG:
3693: case IS_BOOL:
1.1.1.2 misho 3694: hval = Z_LVAL_P(offset);
3695: num_index:
3696: zend_hash_index_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), hval, &expr_ptr, sizeof(zval *), NULL);
1.1 misho 3697: break;
3698: case IS_STRING:
1.1.1.2 misho 3699: if (IS_CONST == IS_CONST) {
3700: hval = Z_HASH_P(offset);
3701: } else {
3702: ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
3703: if (IS_INTERNED(Z_STRVAL_P(offset))) {
3704: hval = INTERNED_HASH(Z_STRVAL_P(offset));
3705: } else {
3706: hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
3707: }
3708: }
3709: zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
1.1 misho 3710: break;
3711: case IS_NULL:
1.1.1.2 misho 3712: zend_hash_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
1.1 misho 3713: break;
3714: default:
3715: zend_error(E_WARNING, "Illegal offset type");
3716: zval_ptr_dtor(&expr_ptr);
3717: /* do nothing */
3718: break;
3719: }
3720:
3721: } else {
1.1.1.2 misho 3722: zend_hash_next_index_insert(Z_ARRVAL(EX_T(opline->result.var).tmp_var), &expr_ptr, sizeof(zval *), NULL);
1.1 misho 3723: }
1.1.1.2 misho 3724: if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && opline->extended_value) {
1.1 misho 3725:
3726: } else {
3727:
3728: }
1.1.1.2 misho 3729: CHECK_EXCEPTION();
1.1 misho 3730: ZEND_VM_NEXT_OPCODE();
3731: }
3732:
3733: static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
3734: {
1.1.1.2 misho 3735: USE_OPLINE
1.1 misho 3736:
1.1.1.2 misho 3737: array_init(&EX_T(opline->result.var).tmp_var);
1.1 misho 3738: if (IS_CONST == IS_UNUSED) {
3739: ZEND_VM_NEXT_OPCODE();
3740: #if 0 || IS_CONST != IS_UNUSED
3741: } else {
3742: return ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
3743: #endif
3744: }
3745: }
3746:
1.1.1.2 misho 3747: static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
3748: {
3749: USE_OPLINE
3750: zval tmp, *varname;
3751: HashTable *target_symbol_table;
3752:
3753:
3754: SAVE_OPLINE();
3755: if (IS_CONST == IS_CV &&
3756: IS_CONST == IS_UNUSED &&
3757: (opline->extended_value & ZEND_QUICK_SET)) {
3758: if (EG(active_symbol_table)) {
3759: zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.var);
3760:
3761: zend_delete_variable(EX(prev_execute_data), EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value TSRMLS_CC);
3762: EX_CV(opline->op1.var) = NULL;
3763: } else if (EX_CV(opline->op1.var)) {
3764: zval_ptr_dtor(EX_CV(opline->op1.var));
3765: EX_CV(opline->op1.var) = NULL;
3766: }
3767: CHECK_EXCEPTION();
3768: ZEND_VM_NEXT_OPCODE();
3769: }
3770:
3771: varname = opline->op1.zv;
3772:
3773: if (IS_CONST != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
3774: ZVAL_COPY_VALUE(&tmp, varname);
3775: zval_copy_ctor(&tmp);
3776: convert_to_string(&tmp);
3777: varname = &tmp;
3778: } else if (IS_CONST == IS_VAR || IS_CONST == IS_CV) {
3779: Z_ADDREF_P(varname);
3780: }
3781:
3782: if (IS_CONST != IS_UNUSED) {
3783: zend_class_entry *ce;
3784:
3785: if (IS_CONST == IS_CONST) {
3786: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
3787: ce = CACHED_PTR(opline->op2.literal->cache_slot);
3788: } else {
3789: ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
1.1.1.4 ! misho 3790: if (UNEXPECTED(EG(exception) != NULL)) {
1.1.1.2 misho 3791: if (IS_CONST != IS_CONST && varname == &tmp) {
3792: zval_dtor(&tmp);
3793: } else if (IS_CONST == IS_VAR || IS_CONST == IS_CV) {
3794: zval_ptr_dtor(&varname);
3795: }
3796:
1.1.1.4 ! misho 3797: HANDLE_EXCEPTION();
! 3798: }
! 3799: if (UNEXPECTED(ce == NULL)) {
! 3800: zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op2.zv));
1.1.1.2 misho 3801: }
3802: CACHE_PTR(opline->op2.literal->cache_slot, ce);
3803: }
3804: } else {
3805: ce = EX_T(opline->op2.var).class_entry;
3806: }
3807: zend_std_unset_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), ((IS_CONST == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
3808: } else {
3809: ulong hash_value = zend_inline_hash_func(varname->value.str.val, varname->value.str.len+1);
3810:
3811: target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
3812: zend_delete_variable(execute_data, target_symbol_table, varname->value.str.val, varname->value.str.len+1, hash_value TSRMLS_CC);
3813: }
3814:
3815: if (IS_CONST != IS_CONST && varname == &tmp) {
3816: zval_dtor(&tmp);
3817: } else if (IS_CONST == IS_VAR || IS_CONST == IS_CV) {
3818: zval_ptr_dtor(&varname);
3819: }
3820:
3821: CHECK_EXCEPTION();
3822: ZEND_VM_NEXT_OPCODE();
3823: }
3824:
3825: static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
3826: {
3827: USE_OPLINE
3828: zval **value;
3829: zend_bool isset = 1;
3830:
3831: SAVE_OPLINE();
3832: if (IS_CONST == IS_CV &&
3833: IS_CONST == IS_UNUSED &&
3834: (opline->extended_value & ZEND_QUICK_SET)) {
3835: if (EX_CV(opline->op1.var)) {
3836: value = EX_CV(opline->op1.var);
3837: } else if (EG(active_symbol_table)) {
3838: zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.var);
3839:
3840: if (zend_hash_quick_find(EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value, (void **) &value) == FAILURE) {
3841: isset = 0;
3842: }
3843: } else {
3844: isset = 0;
3845: }
3846: } else {
3847: HashTable *target_symbol_table;
3848:
3849: zval tmp, *varname = opline->op1.zv;
3850:
3851: if (IS_CONST != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
3852: ZVAL_COPY_VALUE(&tmp, varname);
3853: zval_copy_ctor(&tmp);
3854: convert_to_string(&tmp);
3855: varname = &tmp;
3856: }
3857:
3858: if (IS_CONST != IS_UNUSED) {
3859: zend_class_entry *ce;
3860:
3861: if (IS_CONST == IS_CONST) {
3862: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
3863: ce = CACHED_PTR(opline->op2.literal->cache_slot);
3864: } else {
3865: ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
3866: if (UNEXPECTED(ce == NULL)) {
3867: CHECK_EXCEPTION();
3868: ZEND_VM_NEXT_OPCODE();
3869: }
3870: CACHE_PTR(opline->op2.literal->cache_slot, ce);
3871: }
3872: } else {
3873: ce = EX_T(opline->op2.var).class_entry;
3874: }
3875: value = zend_std_get_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 1, ((IS_CONST == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
3876: if (!value) {
3877: isset = 0;
3878: }
3879: } else {
3880: target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
3881: if (zend_hash_find(target_symbol_table, varname->value.str.val, varname->value.str.len+1, (void **) &value) == FAILURE) {
3882: isset = 0;
3883: }
3884: }
3885:
3886: if (IS_CONST != IS_CONST && varname == &tmp) {
3887: zval_dtor(&tmp);
3888: }
3889:
3890: }
3891:
3892: if (opline->extended_value & ZEND_ISSET) {
3893: if (isset && Z_TYPE_PP(value) != IS_NULL) {
3894: ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 1);
3895: } else {
3896: ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
3897: }
3898: } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
3899: if (!isset || !i_zend_is_true(*value)) {
3900: ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 1);
3901: } else {
3902: ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
3903: }
3904: }
3905:
3906: CHECK_EXCEPTION();
3907: ZEND_VM_NEXT_OPCODE();
3908: }
3909:
1.1 misho 3910: static int ZEND_FASTCALL ZEND_DECLARE_CONST_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
3911: {
1.1.1.2 misho 3912: USE_OPLINE
1.1 misho 3913:
1.1.1.2 misho 3914: zval *name;
3915: zval *val;
1.1 misho 3916: zend_constant c;
3917:
1.1.1.2 misho 3918: SAVE_OPLINE();
3919: name = opline->op1.zv;
3920: val = opline->op2.zv;
3921:
1.1 misho 3922: if ((Z_TYPE_P(val) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT || Z_TYPE_P(val) == IS_CONSTANT_ARRAY) {
1.1.1.2 misho 3923: zval tmp;
1.1 misho 3924: zval *tmp_ptr = &tmp;
3925:
1.1.1.2 misho 3926: ZVAL_COPY_VALUE(&tmp, val);
1.1 misho 3927: if (Z_TYPE_P(val) == IS_CONSTANT_ARRAY) {
3928: zval_copy_ctor(&tmp);
3929: }
3930: INIT_PZVAL(&tmp);
3931: zval_update_constant(&tmp_ptr, NULL TSRMLS_CC);
3932: c.value = *tmp_ptr;
3933: } else {
1.1.1.2 misho 3934: INIT_PZVAL_COPY(&c.value, val);
1.1 misho 3935: zval_copy_ctor(&c.value);
3936: }
3937: c.flags = CONST_CS; /* non persistent, case sensetive */
1.1.1.2 misho 3938: c.name = IS_INTERNED(Z_STRVAL_P(name)) ? Z_STRVAL_P(name) : zend_strndup(Z_STRVAL_P(name), Z_STRLEN_P(name));
1.1 misho 3939: c.name_len = Z_STRLEN_P(name)+1;
3940: c.module_number = PHP_USER_CONSTANT;
3941:
3942: if (zend_register_constant(&c TSRMLS_CC) == FAILURE) {
3943: }
3944:
3945:
1.1.1.2 misho 3946: CHECK_EXCEPTION();
1.1 misho 3947: ZEND_VM_NEXT_OPCODE();
3948: }
3949:
3950: static int ZEND_FASTCALL ZEND_ADD_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
3951: {
1.1.1.2 misho 3952: USE_OPLINE
1.1 misho 3953: zend_free_op free_op2;
3954:
1.1.1.2 misho 3955: SAVE_OPLINE();
3956: fast_add_function(&EX_T(opline->result.var).tmp_var,
3957: opline->op1.zv,
3958: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 3959:
3960: zval_dtor(free_op2.var);
1.1.1.2 misho 3961: CHECK_EXCEPTION();
1.1 misho 3962: ZEND_VM_NEXT_OPCODE();
3963: }
3964:
3965: static int ZEND_FASTCALL ZEND_SUB_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
3966: {
1.1.1.2 misho 3967: USE_OPLINE
1.1 misho 3968: zend_free_op free_op2;
3969:
1.1.1.2 misho 3970: SAVE_OPLINE();
3971: fast_sub_function(&EX_T(opline->result.var).tmp_var,
3972: opline->op1.zv,
3973: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 3974:
3975: zval_dtor(free_op2.var);
1.1.1.2 misho 3976: CHECK_EXCEPTION();
1.1 misho 3977: ZEND_VM_NEXT_OPCODE();
3978: }
3979:
3980: static int ZEND_FASTCALL ZEND_MUL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
3981: {
1.1.1.2 misho 3982: USE_OPLINE
1.1 misho 3983: zend_free_op free_op2;
3984:
1.1.1.2 misho 3985: SAVE_OPLINE();
3986: fast_mul_function(&EX_T(opline->result.var).tmp_var,
3987: opline->op1.zv,
3988: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 3989:
3990: zval_dtor(free_op2.var);
1.1.1.2 misho 3991: CHECK_EXCEPTION();
1.1 misho 3992: ZEND_VM_NEXT_OPCODE();
3993: }
3994:
3995: static int ZEND_FASTCALL ZEND_DIV_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
3996: {
1.1.1.2 misho 3997: USE_OPLINE
1.1 misho 3998: zend_free_op free_op2;
3999:
1.1.1.2 misho 4000: SAVE_OPLINE();
4001: fast_div_function(&EX_T(opline->result.var).tmp_var,
4002: opline->op1.zv,
4003: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 4004:
4005: zval_dtor(free_op2.var);
1.1.1.2 misho 4006: CHECK_EXCEPTION();
1.1 misho 4007: ZEND_VM_NEXT_OPCODE();
4008: }
4009:
4010: static int ZEND_FASTCALL ZEND_MOD_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
4011: {
1.1.1.2 misho 4012: USE_OPLINE
1.1 misho 4013: zend_free_op free_op2;
4014:
1.1.1.2 misho 4015: SAVE_OPLINE();
4016: fast_mod_function(&EX_T(opline->result.var).tmp_var,
4017: opline->op1.zv,
4018: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 4019:
4020: zval_dtor(free_op2.var);
1.1.1.2 misho 4021: CHECK_EXCEPTION();
1.1 misho 4022: ZEND_VM_NEXT_OPCODE();
4023: }
4024:
4025: static int ZEND_FASTCALL ZEND_SL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
4026: {
1.1.1.2 misho 4027: USE_OPLINE
1.1 misho 4028: zend_free_op free_op2;
4029:
1.1.1.2 misho 4030: SAVE_OPLINE();
4031: shift_left_function(&EX_T(opline->result.var).tmp_var,
4032: opline->op1.zv,
4033: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 4034:
4035: zval_dtor(free_op2.var);
1.1.1.2 misho 4036: CHECK_EXCEPTION();
1.1 misho 4037: ZEND_VM_NEXT_OPCODE();
4038: }
4039:
4040: static int ZEND_FASTCALL ZEND_SR_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
4041: {
1.1.1.2 misho 4042: USE_OPLINE
1.1 misho 4043: zend_free_op free_op2;
4044:
1.1.1.2 misho 4045: SAVE_OPLINE();
4046: shift_right_function(&EX_T(opline->result.var).tmp_var,
4047: opline->op1.zv,
4048: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 4049:
4050: zval_dtor(free_op2.var);
1.1.1.2 misho 4051: CHECK_EXCEPTION();
1.1 misho 4052: ZEND_VM_NEXT_OPCODE();
4053: }
4054:
4055: static int ZEND_FASTCALL ZEND_CONCAT_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
4056: {
1.1.1.2 misho 4057: USE_OPLINE
1.1 misho 4058: zend_free_op free_op2;
4059:
1.1.1.2 misho 4060: SAVE_OPLINE();
4061: concat_function(&EX_T(opline->result.var).tmp_var,
4062: opline->op1.zv,
4063: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 4064:
4065: zval_dtor(free_op2.var);
1.1.1.2 misho 4066: CHECK_EXCEPTION();
1.1 misho 4067: ZEND_VM_NEXT_OPCODE();
4068: }
4069:
4070: static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
4071: {
1.1.1.2 misho 4072: USE_OPLINE
1.1 misho 4073: zend_free_op free_op2;
4074:
1.1.1.2 misho 4075: SAVE_OPLINE();
4076: is_identical_function(&EX_T(opline->result.var).tmp_var,
4077: opline->op1.zv,
4078: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 4079:
4080: zval_dtor(free_op2.var);
1.1.1.2 misho 4081: CHECK_EXCEPTION();
1.1 misho 4082: ZEND_VM_NEXT_OPCODE();
4083: }
4084:
4085: static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
4086: {
1.1.1.2 misho 4087: USE_OPLINE
1.1 misho 4088: zend_free_op free_op2;
1.1.1.2 misho 4089: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 4090:
1.1.1.2 misho 4091: SAVE_OPLINE();
1.1 misho 4092: is_identical_function(result,
1.1.1.2 misho 4093: opline->op1.zv,
4094: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 4095: Z_LVAL_P(result) = !Z_LVAL_P(result);
4096:
4097: zval_dtor(free_op2.var);
1.1.1.2 misho 4098: CHECK_EXCEPTION();
1.1 misho 4099: ZEND_VM_NEXT_OPCODE();
4100: }
4101:
4102: static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
4103: {
1.1.1.2 misho 4104: USE_OPLINE
1.1 misho 4105: zend_free_op free_op2;
1.1.1.2 misho 4106: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 4107:
1.1.1.2 misho 4108: SAVE_OPLINE();
4109: ZVAL_BOOL(result, fast_equal_function(result,
4110: opline->op1.zv,
4111: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC));
1.1 misho 4112:
4113: zval_dtor(free_op2.var);
1.1.1.2 misho 4114: CHECK_EXCEPTION();
1.1 misho 4115: ZEND_VM_NEXT_OPCODE();
4116: }
4117:
4118: static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
4119: {
1.1.1.2 misho 4120: USE_OPLINE
1.1 misho 4121: zend_free_op free_op2;
1.1.1.2 misho 4122: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 4123:
1.1.1.2 misho 4124: SAVE_OPLINE();
4125: ZVAL_BOOL(result, fast_not_equal_function(result,
4126: opline->op1.zv,
4127: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC));
1.1 misho 4128:
4129: zval_dtor(free_op2.var);
1.1.1.2 misho 4130: CHECK_EXCEPTION();
1.1 misho 4131: ZEND_VM_NEXT_OPCODE();
4132: }
4133:
4134: static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
4135: {
1.1.1.2 misho 4136: USE_OPLINE
1.1 misho 4137: zend_free_op free_op2;
1.1.1.2 misho 4138: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 4139:
1.1.1.2 misho 4140: SAVE_OPLINE();
4141: ZVAL_BOOL(result, fast_is_smaller_function(result,
4142: opline->op1.zv,
4143: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC));
1.1 misho 4144:
4145: zval_dtor(free_op2.var);
1.1.1.2 misho 4146: CHECK_EXCEPTION();
1.1 misho 4147: ZEND_VM_NEXT_OPCODE();
4148: }
4149:
4150: static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
4151: {
1.1.1.2 misho 4152: USE_OPLINE
1.1 misho 4153: zend_free_op free_op2;
1.1.1.2 misho 4154: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 4155:
1.1.1.2 misho 4156: SAVE_OPLINE();
4157: ZVAL_BOOL(result, fast_is_smaller_or_equal_function(result,
4158: opline->op1.zv,
4159: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC));
1.1 misho 4160:
4161: zval_dtor(free_op2.var);
1.1.1.2 misho 4162: CHECK_EXCEPTION();
1.1 misho 4163: ZEND_VM_NEXT_OPCODE();
4164: }
4165:
4166: static int ZEND_FASTCALL ZEND_BW_OR_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
4167: {
1.1.1.2 misho 4168: USE_OPLINE
1.1 misho 4169: zend_free_op free_op2;
4170:
1.1.1.2 misho 4171: SAVE_OPLINE();
4172: bitwise_or_function(&EX_T(opline->result.var).tmp_var,
4173: opline->op1.zv,
4174: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 4175:
4176: zval_dtor(free_op2.var);
1.1.1.2 misho 4177: CHECK_EXCEPTION();
1.1 misho 4178: ZEND_VM_NEXT_OPCODE();
4179: }
4180:
4181: static int ZEND_FASTCALL ZEND_BW_AND_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
4182: {
1.1.1.2 misho 4183: USE_OPLINE
1.1 misho 4184: zend_free_op free_op2;
4185:
1.1.1.2 misho 4186: SAVE_OPLINE();
4187: bitwise_and_function(&EX_T(opline->result.var).tmp_var,
4188: opline->op1.zv,
4189: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 4190:
4191: zval_dtor(free_op2.var);
1.1.1.2 misho 4192: CHECK_EXCEPTION();
1.1 misho 4193: ZEND_VM_NEXT_OPCODE();
4194: }
4195:
4196: static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
4197: {
1.1.1.2 misho 4198: USE_OPLINE
1.1 misho 4199: zend_free_op free_op2;
4200:
1.1.1.2 misho 4201: SAVE_OPLINE();
4202: bitwise_xor_function(&EX_T(opline->result.var).tmp_var,
4203: opline->op1.zv,
4204: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 4205:
4206: zval_dtor(free_op2.var);
1.1.1.2 misho 4207: CHECK_EXCEPTION();
1.1 misho 4208: ZEND_VM_NEXT_OPCODE();
4209: }
4210:
4211: static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
4212: {
1.1.1.2 misho 4213: USE_OPLINE
1.1 misho 4214: zend_free_op free_op2;
4215:
1.1.1.2 misho 4216: SAVE_OPLINE();
4217: boolean_xor_function(&EX_T(opline->result.var).tmp_var,
4218: opline->op1.zv,
4219: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 4220:
4221: zval_dtor(free_op2.var);
1.1.1.2 misho 4222: CHECK_EXCEPTION();
1.1 misho 4223: ZEND_VM_NEXT_OPCODE();
4224: }
4225:
4226: static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
4227: {
1.1.1.2 misho 4228: USE_OPLINE
1.1 misho 4229: zval *function_name;
4230: zend_class_entry *ce;
4231:
1.1.1.2 misho 4232: SAVE_OPLINE();
1.1 misho 4233: zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
4234:
4235: if (IS_CONST == IS_CONST) {
4236: /* no function found. try a static method in class */
1.1.1.2 misho 4237: if (CACHED_PTR(opline->op1.literal->cache_slot)) {
4238: ce = CACHED_PTR(opline->op1.literal->cache_slot);
4239: } else {
4240: ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
1.1.1.4 ! misho 4241: if (UNEXPECTED(EG(exception) != NULL)) {
! 4242: HANDLE_EXCEPTION();
! 4243: }
1.1.1.2 misho 4244: if (UNEXPECTED(ce == NULL)) {
1.1.1.4 ! misho 4245: zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv));
1.1.1.2 misho 4246: }
4247: CACHE_PTR(opline->op1.literal->cache_slot, ce);
1.1 misho 4248: }
4249: EX(called_scope) = ce;
4250: } else {
1.1.1.2 misho 4251: ce = EX_T(opline->op1.var).class_entry;
1.1 misho 4252:
1.1.1.2 misho 4253: if (opline->extended_value == ZEND_FETCH_CLASS_PARENT || opline->extended_value == ZEND_FETCH_CLASS_SELF) {
1.1 misho 4254: EX(called_scope) = EG(called_scope);
4255: } else {
4256: EX(called_scope) = ce;
4257: }
4258: }
1.1.1.2 misho 4259:
4260: if (IS_CONST == IS_CONST &&
4261: IS_TMP_VAR == IS_CONST &&
4262: CACHED_PTR(opline->op2.literal->cache_slot)) {
4263: EX(fbc) = CACHED_PTR(opline->op2.literal->cache_slot);
4264: } else if (IS_CONST != IS_CONST &&
4265: IS_TMP_VAR == IS_CONST &&
4266: (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce))) {
4267: /* do nothing */
4268: } else if (IS_TMP_VAR != IS_UNUSED) {
1.1 misho 4269: char *function_name_strval = NULL;
4270: int function_name_strlen = 0;
4271: zend_free_op free_op2;
4272:
4273: if (IS_TMP_VAR == IS_CONST) {
1.1.1.2 misho 4274: function_name_strval = Z_STRVAL_P(opline->op2.zv);
4275: function_name_strlen = Z_STRLEN_P(opline->op2.zv);
1.1 misho 4276: } else {
1.1.1.2 misho 4277: function_name = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 4278:
1.1.1.2 misho 4279: if (UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
1.1 misho 4280: zend_error_noreturn(E_ERROR, "Function name must be a string");
4281: } else {
4282: function_name_strval = Z_STRVAL_P(function_name);
4283: function_name_strlen = Z_STRLEN_P(function_name);
4284: }
4285: }
4286:
4287: if (function_name_strval) {
4288: if (ce->get_static_method) {
4289: EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
4290: } else {
1.1.1.2 misho 4291: EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen, ((IS_TMP_VAR == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC);
1.1 misho 4292: }
1.1.1.2 misho 4293: if (UNEXPECTED(EX(fbc) == NULL)) {
1.1 misho 4294: zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name, function_name_strval);
4295: }
1.1.1.2 misho 4296: if (IS_TMP_VAR == IS_CONST &&
4297: EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) &&
4298: EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0)) {
4299: if (IS_CONST == IS_CONST) {
4300: CACHE_PTR(opline->op2.literal->cache_slot, EX(fbc));
4301: } else {
4302: CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce, EX(fbc));
4303: }
4304: }
1.1 misho 4305: }
4306: if (IS_TMP_VAR != IS_CONST) {
4307: zval_dtor(free_op2.var);
4308: }
4309: } else {
1.1.1.2 misho 4310: if (UNEXPECTED(ce->constructor == NULL)) {
1.1 misho 4311: zend_error_noreturn(E_ERROR, "Cannot call constructor");
4312: }
4313: if (EG(This) && Z_OBJCE_P(EG(This)) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) {
1.1.1.2 misho 4314: zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name);
1.1 misho 4315: }
4316: EX(fbc) = ce->constructor;
4317: }
4318:
4319: if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) {
4320: EX(object) = NULL;
4321: } else {
4322: if (EG(This) &&
4323: Z_OBJ_HT_P(EG(This))->get_class_entry &&
4324: !instanceof_function(Z_OBJCE_P(EG(This)), ce TSRMLS_CC)) {
4325: /* We are calling method of the other (incompatible) class,
4326: but passing $this. This is done for compatibility with php-4. */
4327: if (EX(fbc)->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
1.1.1.2 misho 4328: zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", EX(fbc)->common.scope->name, EX(fbc)->common.function_name);
1.1 misho 4329: } else {
4330: /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
1.1.1.2 misho 4331: zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", EX(fbc)->common.scope->name, EX(fbc)->common.function_name);
1.1 misho 4332: }
4333: }
4334: if ((EX(object) = EG(This))) {
4335: Z_ADDREF_P(EX(object));
4336: EX(called_scope) = Z_OBJCE_P(EX(object));
4337: }
4338: }
4339:
1.1.1.2 misho 4340: CHECK_EXCEPTION();
1.1 misho 4341: ZEND_VM_NEXT_OPCODE();
4342: }
4343:
4344: static int ZEND_FASTCALL ZEND_CASE_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
4345: {
1.1.1.2 misho 4346: USE_OPLINE
1.1 misho 4347: zend_free_op free_op2;
4348:
1.1.1.2 misho 4349: SAVE_OPLINE();
1.1 misho 4350: if (IS_CONST==IS_VAR) {
1.1.1.2 misho 4351: PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
1.1 misho 4352: }
1.1.1.2 misho 4353: is_equal_function(&EX_T(opline->result.var).tmp_var,
4354: opline->op1.zv,
4355: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 4356:
4357: zval_dtor(free_op2.var);
1.1.1.2 misho 4358: CHECK_EXCEPTION();
1.1 misho 4359: ZEND_VM_NEXT_OPCODE();
4360: }
4361:
4362: static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
4363: {
1.1.1.2 misho 4364: USE_OPLINE
4365:
1.1 misho 4366: zval *expr_ptr;
4367:
1.1.1.2 misho 4368: SAVE_OPLINE();
4369: if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && opline->extended_value) {
4370: zval **expr_ptr_ptr = NULL;
1.1 misho 4371:
1.1.1.2 misho 4372: if (IS_CONST == IS_VAR && UNEXPECTED(expr_ptr_ptr == NULL)) {
4373: zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
4374: }
4375: SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr);
1.1 misho 4376: expr_ptr = *expr_ptr_ptr;
1.1.1.2 misho 4377: Z_ADDREF_P(expr_ptr);
1.1 misho 4378: } else {
1.1.1.2 misho 4379: expr_ptr=opline->op1.zv;
4380: if (0) { /* temporary variable */
4381: zval *new_expr;
1.1 misho 4382:
1.1.1.2 misho 4383: ALLOC_ZVAL(new_expr);
4384: INIT_PZVAL_COPY(new_expr, expr_ptr);
4385: expr_ptr = new_expr;
4386: } else if (IS_CONST == IS_CONST || PZVAL_IS_REF(expr_ptr)) {
1.1 misho 4387: zval *new_expr;
4388:
4389: ALLOC_ZVAL(new_expr);
4390: INIT_PZVAL_COPY(new_expr, expr_ptr);
4391: expr_ptr = new_expr;
4392: zendi_zval_copy_ctor(*expr_ptr);
4393: } else {
4394: Z_ADDREF_P(expr_ptr);
4395: }
4396: }
1.1.1.2 misho 4397:
4398: if (IS_TMP_VAR != IS_UNUSED) {
4399: zend_free_op free_op2;
4400: zval *offset = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
4401: ulong hval;
4402:
1.1 misho 4403: switch (Z_TYPE_P(offset)) {
4404: case IS_DOUBLE:
1.1.1.2 misho 4405: hval = zend_dval_to_lval(Z_DVAL_P(offset));
4406: goto num_index;
1.1 misho 4407: case IS_LONG:
4408: case IS_BOOL:
1.1.1.2 misho 4409: hval = Z_LVAL_P(offset);
4410: num_index:
4411: zend_hash_index_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), hval, &expr_ptr, sizeof(zval *), NULL);
1.1 misho 4412: break;
4413: case IS_STRING:
1.1.1.2 misho 4414: if (IS_TMP_VAR == IS_CONST) {
4415: hval = Z_HASH_P(offset);
4416: } else {
4417: ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
4418: if (IS_INTERNED(Z_STRVAL_P(offset))) {
4419: hval = INTERNED_HASH(Z_STRVAL_P(offset));
4420: } else {
4421: hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
4422: }
4423: }
4424: zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
1.1 misho 4425: break;
4426: case IS_NULL:
1.1.1.2 misho 4427: zend_hash_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
1.1 misho 4428: break;
4429: default:
4430: zend_error(E_WARNING, "Illegal offset type");
4431: zval_ptr_dtor(&expr_ptr);
4432: /* do nothing */
4433: break;
4434: }
4435: zval_dtor(free_op2.var);
4436: } else {
1.1.1.2 misho 4437: zend_hash_next_index_insert(Z_ARRVAL(EX_T(opline->result.var).tmp_var), &expr_ptr, sizeof(zval *), NULL);
1.1 misho 4438: }
1.1.1.2 misho 4439: if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && opline->extended_value) {
1.1 misho 4440:
4441: } else {
4442:
4443: }
1.1.1.2 misho 4444: CHECK_EXCEPTION();
1.1 misho 4445: ZEND_VM_NEXT_OPCODE();
4446: }
4447:
4448: static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
4449: {
1.1.1.2 misho 4450: USE_OPLINE
1.1 misho 4451:
1.1.1.2 misho 4452: array_init(&EX_T(opline->result.var).tmp_var);
1.1 misho 4453: if (IS_CONST == IS_UNUSED) {
4454: ZEND_VM_NEXT_OPCODE();
4455: #if 0 || IS_CONST != IS_UNUSED
4456: } else {
4457: return ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
4458: #endif
4459: }
4460: }
4461:
4462: static int ZEND_FASTCALL ZEND_ADD_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
4463: {
1.1.1.2 misho 4464: USE_OPLINE
1.1 misho 4465: zend_free_op free_op2;
4466:
1.1.1.2 misho 4467: SAVE_OPLINE();
4468: fast_add_function(&EX_T(opline->result.var).tmp_var,
4469: opline->op1.zv,
4470: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 4471:
4472: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 4473: CHECK_EXCEPTION();
1.1 misho 4474: ZEND_VM_NEXT_OPCODE();
4475: }
4476:
4477: static int ZEND_FASTCALL ZEND_SUB_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
4478: {
1.1.1.2 misho 4479: USE_OPLINE
1.1 misho 4480: zend_free_op free_op2;
4481:
1.1.1.2 misho 4482: SAVE_OPLINE();
4483: fast_sub_function(&EX_T(opline->result.var).tmp_var,
4484: opline->op1.zv,
4485: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 4486:
4487: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 4488: CHECK_EXCEPTION();
1.1 misho 4489: ZEND_VM_NEXT_OPCODE();
4490: }
4491:
4492: static int ZEND_FASTCALL ZEND_MUL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
4493: {
1.1.1.2 misho 4494: USE_OPLINE
1.1 misho 4495: zend_free_op free_op2;
4496:
1.1.1.2 misho 4497: SAVE_OPLINE();
4498: fast_mul_function(&EX_T(opline->result.var).tmp_var,
4499: opline->op1.zv,
4500: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 4501:
4502: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 4503: CHECK_EXCEPTION();
1.1 misho 4504: ZEND_VM_NEXT_OPCODE();
4505: }
4506:
4507: static int ZEND_FASTCALL ZEND_DIV_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
4508: {
1.1.1.2 misho 4509: USE_OPLINE
1.1 misho 4510: zend_free_op free_op2;
4511:
1.1.1.2 misho 4512: SAVE_OPLINE();
4513: fast_div_function(&EX_T(opline->result.var).tmp_var,
4514: opline->op1.zv,
4515: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 4516:
4517: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 4518: CHECK_EXCEPTION();
1.1 misho 4519: ZEND_VM_NEXT_OPCODE();
4520: }
4521:
4522: static int ZEND_FASTCALL ZEND_MOD_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
4523: {
1.1.1.2 misho 4524: USE_OPLINE
1.1 misho 4525: zend_free_op free_op2;
4526:
1.1.1.2 misho 4527: SAVE_OPLINE();
4528: fast_mod_function(&EX_T(opline->result.var).tmp_var,
4529: opline->op1.zv,
4530: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 4531:
4532: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 4533: CHECK_EXCEPTION();
1.1 misho 4534: ZEND_VM_NEXT_OPCODE();
4535: }
4536:
4537: static int ZEND_FASTCALL ZEND_SL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
4538: {
1.1.1.2 misho 4539: USE_OPLINE
1.1 misho 4540: zend_free_op free_op2;
4541:
1.1.1.2 misho 4542: SAVE_OPLINE();
4543: shift_left_function(&EX_T(opline->result.var).tmp_var,
4544: opline->op1.zv,
4545: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 4546:
4547: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 4548: CHECK_EXCEPTION();
1.1 misho 4549: ZEND_VM_NEXT_OPCODE();
4550: }
4551:
4552: static int ZEND_FASTCALL ZEND_SR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
4553: {
1.1.1.2 misho 4554: USE_OPLINE
1.1 misho 4555: zend_free_op free_op2;
4556:
1.1.1.2 misho 4557: SAVE_OPLINE();
4558: shift_right_function(&EX_T(opline->result.var).tmp_var,
4559: opline->op1.zv,
4560: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 4561:
4562: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 4563: CHECK_EXCEPTION();
1.1 misho 4564: ZEND_VM_NEXT_OPCODE();
4565: }
4566:
4567: static int ZEND_FASTCALL ZEND_CONCAT_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
4568: {
1.1.1.2 misho 4569: USE_OPLINE
1.1 misho 4570: zend_free_op free_op2;
4571:
1.1.1.2 misho 4572: SAVE_OPLINE();
4573: concat_function(&EX_T(opline->result.var).tmp_var,
4574: opline->op1.zv,
4575: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 4576:
4577: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 4578: CHECK_EXCEPTION();
1.1 misho 4579: ZEND_VM_NEXT_OPCODE();
4580: }
4581:
4582: static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
4583: {
1.1.1.2 misho 4584: USE_OPLINE
1.1 misho 4585: zend_free_op free_op2;
4586:
1.1.1.2 misho 4587: SAVE_OPLINE();
4588: is_identical_function(&EX_T(opline->result.var).tmp_var,
4589: opline->op1.zv,
4590: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 4591:
4592: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 4593: CHECK_EXCEPTION();
1.1 misho 4594: ZEND_VM_NEXT_OPCODE();
4595: }
4596:
4597: static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
4598: {
1.1.1.2 misho 4599: USE_OPLINE
1.1 misho 4600: zend_free_op free_op2;
1.1.1.2 misho 4601: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 4602:
1.1.1.2 misho 4603: SAVE_OPLINE();
1.1 misho 4604: is_identical_function(result,
1.1.1.2 misho 4605: opline->op1.zv,
4606: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 4607: Z_LVAL_P(result) = !Z_LVAL_P(result);
4608:
4609: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 4610: CHECK_EXCEPTION();
1.1 misho 4611: ZEND_VM_NEXT_OPCODE();
4612: }
4613:
4614: static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
4615: {
1.1.1.2 misho 4616: USE_OPLINE
1.1 misho 4617: zend_free_op free_op2;
1.1.1.2 misho 4618: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 4619:
1.1.1.2 misho 4620: SAVE_OPLINE();
4621: ZVAL_BOOL(result, fast_equal_function(result,
4622: opline->op1.zv,
4623: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC));
1.1 misho 4624:
4625: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 4626: CHECK_EXCEPTION();
1.1 misho 4627: ZEND_VM_NEXT_OPCODE();
4628: }
4629:
4630: static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
4631: {
1.1.1.2 misho 4632: USE_OPLINE
1.1 misho 4633: zend_free_op free_op2;
1.1.1.2 misho 4634: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 4635:
1.1.1.2 misho 4636: SAVE_OPLINE();
4637: ZVAL_BOOL(result, fast_not_equal_function(result,
4638: opline->op1.zv,
4639: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC));
1.1 misho 4640:
4641: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 4642: CHECK_EXCEPTION();
1.1 misho 4643: ZEND_VM_NEXT_OPCODE();
4644: }
4645:
4646: static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
4647: {
1.1.1.2 misho 4648: USE_OPLINE
1.1 misho 4649: zend_free_op free_op2;
1.1.1.2 misho 4650: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 4651:
1.1.1.2 misho 4652: SAVE_OPLINE();
4653: ZVAL_BOOL(result, fast_is_smaller_function(result,
4654: opline->op1.zv,
4655: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC));
1.1 misho 4656:
4657: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 4658: CHECK_EXCEPTION();
1.1 misho 4659: ZEND_VM_NEXT_OPCODE();
4660: }
4661:
4662: static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
4663: {
1.1.1.2 misho 4664: USE_OPLINE
1.1 misho 4665: zend_free_op free_op2;
1.1.1.2 misho 4666: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 4667:
1.1.1.2 misho 4668: SAVE_OPLINE();
4669: ZVAL_BOOL(result, fast_is_smaller_or_equal_function(result,
4670: opline->op1.zv,
4671: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC));
1.1 misho 4672:
4673: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 4674: CHECK_EXCEPTION();
1.1 misho 4675: ZEND_VM_NEXT_OPCODE();
4676: }
4677:
4678: static int ZEND_FASTCALL ZEND_BW_OR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
4679: {
1.1.1.2 misho 4680: USE_OPLINE
1.1 misho 4681: zend_free_op free_op2;
4682:
1.1.1.2 misho 4683: SAVE_OPLINE();
4684: bitwise_or_function(&EX_T(opline->result.var).tmp_var,
4685: opline->op1.zv,
4686: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 4687:
4688: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 4689: CHECK_EXCEPTION();
1.1 misho 4690: ZEND_VM_NEXT_OPCODE();
4691: }
4692:
4693: static int ZEND_FASTCALL ZEND_BW_AND_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
4694: {
1.1.1.2 misho 4695: USE_OPLINE
1.1 misho 4696: zend_free_op free_op2;
4697:
1.1.1.2 misho 4698: SAVE_OPLINE();
4699: bitwise_and_function(&EX_T(opline->result.var).tmp_var,
4700: opline->op1.zv,
4701: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 4702:
4703: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 4704: CHECK_EXCEPTION();
1.1 misho 4705: ZEND_VM_NEXT_OPCODE();
4706: }
4707:
4708: static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
4709: {
1.1.1.2 misho 4710: USE_OPLINE
1.1 misho 4711: zend_free_op free_op2;
4712:
1.1.1.2 misho 4713: SAVE_OPLINE();
4714: bitwise_xor_function(&EX_T(opline->result.var).tmp_var,
4715: opline->op1.zv,
4716: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 4717:
4718: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 4719: CHECK_EXCEPTION();
1.1 misho 4720: ZEND_VM_NEXT_OPCODE();
4721: }
4722:
4723: static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
4724: {
1.1.1.2 misho 4725: USE_OPLINE
1.1 misho 4726: zend_free_op free_op2;
4727:
1.1.1.2 misho 4728: SAVE_OPLINE();
4729: boolean_xor_function(&EX_T(opline->result.var).tmp_var,
4730: opline->op1.zv,
4731: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 4732:
4733: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 4734: CHECK_EXCEPTION();
1.1 misho 4735: ZEND_VM_NEXT_OPCODE();
4736: }
4737:
1.1.1.2 misho 4738: static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_VAR(int type, ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 4739: {
1.1.1.2 misho 4740: USE_OPLINE
4741: zend_free_op free_op1;
4742: zval *varname;
4743: zval **retval;
4744: zval tmp_varname;
4745: HashTable *target_symbol_table;
4746: ulong hash_value;
1.1 misho 4747:
1.1.1.2 misho 4748: SAVE_OPLINE();
4749: varname = opline->op1.zv;
1.1 misho 4750:
1.1.1.2 misho 4751: if (IS_CONST != IS_CONST && UNEXPECTED(Z_TYPE_P(varname) != IS_STRING)) {
4752: ZVAL_COPY_VALUE(&tmp_varname, varname);
4753: zval_copy_ctor(&tmp_varname);
4754: Z_SET_REFCOUNT(tmp_varname, 1);
4755: Z_UNSET_ISREF(tmp_varname);
4756: convert_to_string(&tmp_varname);
4757: varname = &tmp_varname;
1.1 misho 4758: }
4759:
1.1.1.2 misho 4760: if (IS_VAR != IS_UNUSED) {
4761: zend_class_entry *ce;
1.1 misho 4762:
1.1.1.2 misho 4763: if (IS_VAR == IS_CONST) {
4764: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
4765: ce = CACHED_PTR(opline->op2.literal->cache_slot);
1.1 misho 4766: } else {
1.1.1.2 misho 4767: ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
4768: if (UNEXPECTED(ce == NULL)) {
4769: if (IS_CONST != IS_CONST && varname == &tmp_varname) {
4770: zval_dtor(&tmp_varname);
4771: }
1.1 misho 4772:
1.1.1.2 misho 4773: CHECK_EXCEPTION();
4774: ZEND_VM_NEXT_OPCODE();
4775: }
4776: CACHE_PTR(opline->op2.literal->cache_slot, ce);
1.1 misho 4777: }
1.1.1.2 misho 4778: } else {
4779: ce = EX_T(opline->op2.var).class_entry;
1.1 misho 4780: }
1.1.1.2 misho 4781: retval = zend_std_get_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 0, ((IS_CONST == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
1.1 misho 4782:
4783: } else {
1.1.1.2 misho 4784: target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
4785: /*
4786: if (!target_symbol_table) {
4787: CHECK_EXCEPTION();
4788: ZEND_VM_NEXT_OPCODE();
1.1 misho 4789: }
1.1.1.2 misho 4790: */
4791: if (IS_CONST == IS_CONST) {
4792: hash_value = Z_HASH_P(varname);
4793: } else if (IS_INTERNED(Z_STRVAL_P(varname))) {
4794: hash_value = INTERNED_HASH(Z_STRVAL_P(varname));
4795: } else {
4796: hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1);
1.1 misho 4797: }
4798:
1.1.1.2 misho 4799: if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) {
4800: switch (type) {
4801: case BP_VAR_R:
4802: case BP_VAR_UNSET:
4803: zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_P(varname));
4804: /* break missing intentionally */
4805: case BP_VAR_IS:
4806: retval = &EG(uninitialized_zval_ptr);
4807: break;
4808: case BP_VAR_RW:
4809: zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_P(varname));
4810: /* break missing intentionally */
4811: case BP_VAR_W:
4812: Z_ADDREF_P(&EG(uninitialized_zval));
4813: zend_hash_quick_update(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, &EG(uninitialized_zval_ptr), sizeof(zval *), (void **) &retval);
4814: break;
4815: EMPTY_SWITCH_DEFAULT_CASE()
1.1 misho 4816: }
4817: }
1.1.1.2 misho 4818: switch (opline->extended_value & ZEND_FETCH_TYPE_MASK) {
4819: case ZEND_FETCH_GLOBAL:
4820: if (IS_CONST != IS_TMP_VAR) {
1.1 misho 4821:
1.1.1.2 misho 4822: }
4823: break;
4824: case ZEND_FETCH_LOCAL:
1.1 misho 4825:
1.1.1.2 misho 4826: break;
4827: case ZEND_FETCH_STATIC:
4828: zval_update_constant(retval, (void*) 1 TSRMLS_CC);
4829: break;
4830: case ZEND_FETCH_GLOBAL_LOCK:
4831: if (IS_CONST == IS_VAR && !free_op1.var) {
4832: PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
4833: }
4834: break;
1.1 misho 4835: }
4836: }
4837:
4838:
1.1.1.2 misho 4839: if (IS_CONST != IS_CONST && varname == &tmp_varname) {
4840: zval_dtor(&tmp_varname);
4841: }
4842: if (opline->extended_value & ZEND_FETCH_MAKE_REF) {
4843: SEPARATE_ZVAL_TO_MAKE_IS_REF(retval);
4844: }
4845: PZVAL_LOCK(*retval);
4846: switch (type) {
4847: case BP_VAR_R:
4848: case BP_VAR_IS:
4849: AI_SET_PTR(&EX_T(opline->result.var), *retval);
4850: break;
4851: case BP_VAR_UNSET: {
4852: zend_free_op free_res;
4853:
4854: PZVAL_UNLOCK(*retval, &free_res);
4855: if (retval != &EG(uninitialized_zval_ptr)) {
4856: SEPARATE_ZVAL_IF_NOT_REF(retval);
4857: }
4858: PZVAL_LOCK(*retval);
4859: FREE_OP_VAR_PTR(free_res);
4860: }
4861: /* break missing intentionally */
4862: default:
4863: EX_T(opline->result.var).var.ptr_ptr = retval;
4864: break;
1.1 misho 4865: }
1.1.1.2 misho 4866: CHECK_EXCEPTION();
1.1 misho 4867: ZEND_VM_NEXT_OPCODE();
4868: }
4869:
1.1.1.2 misho 4870: static int ZEND_FASTCALL ZEND_FETCH_R_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 4871: {
1.1.1.2 misho 4872: return zend_fetch_var_address_helper_SPEC_CONST_VAR(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
4873: }
1.1 misho 4874:
1.1.1.2 misho 4875: static int ZEND_FASTCALL ZEND_FETCH_W_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
4876: {
4877: return zend_fetch_var_address_helper_SPEC_CONST_VAR(BP_VAR_W, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
4878: }
1.1 misho 4879:
1.1.1.2 misho 4880: static int ZEND_FASTCALL ZEND_FETCH_RW_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
4881: {
4882: return zend_fetch_var_address_helper_SPEC_CONST_VAR(BP_VAR_RW, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
4883: }
1.1 misho 4884:
1.1.1.2 misho 4885: static int ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
4886: {
4887: USE_OPLINE
1.1 misho 4888:
1.1.1.2 misho 4889: return zend_fetch_var_address_helper_SPEC_CONST_VAR(ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
1.1 misho 4890: }
4891:
1.1.1.2 misho 4892: static int ZEND_FASTCALL ZEND_FETCH_UNSET_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 4893: {
1.1.1.2 misho 4894: return zend_fetch_var_address_helper_SPEC_CONST_VAR(BP_VAR_UNSET, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
4895: }
1.1 misho 4896:
1.1.1.2 misho 4897: static int ZEND_FASTCALL ZEND_FETCH_IS_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
4898: {
4899: return zend_fetch_var_address_helper_SPEC_CONST_VAR(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
1.1 misho 4900: }
4901:
1.1.1.2 misho 4902: static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 4903: {
1.1.1.2 misho 4904: USE_OPLINE
1.1 misho 4905: zval *function_name;
4906: zend_class_entry *ce;
4907:
1.1.1.2 misho 4908: SAVE_OPLINE();
1.1 misho 4909: zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
4910:
4911: if (IS_CONST == IS_CONST) {
4912: /* no function found. try a static method in class */
1.1.1.2 misho 4913: if (CACHED_PTR(opline->op1.literal->cache_slot)) {
4914: ce = CACHED_PTR(opline->op1.literal->cache_slot);
4915: } else {
4916: ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
1.1.1.4 ! misho 4917: if (UNEXPECTED(EG(exception) != NULL)) {
! 4918: HANDLE_EXCEPTION();
! 4919: }
1.1.1.2 misho 4920: if (UNEXPECTED(ce == NULL)) {
1.1.1.4 ! misho 4921: zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv));
1.1.1.2 misho 4922: }
4923: CACHE_PTR(opline->op1.literal->cache_slot, ce);
1.1 misho 4924: }
4925: EX(called_scope) = ce;
4926: } else {
1.1.1.2 misho 4927: ce = EX_T(opline->op1.var).class_entry;
1.1 misho 4928:
1.1.1.2 misho 4929: if (opline->extended_value == ZEND_FETCH_CLASS_PARENT || opline->extended_value == ZEND_FETCH_CLASS_SELF) {
1.1 misho 4930: EX(called_scope) = EG(called_scope);
4931: } else {
4932: EX(called_scope) = ce;
4933: }
4934: }
1.1.1.2 misho 4935:
4936: if (IS_CONST == IS_CONST &&
4937: IS_VAR == IS_CONST &&
4938: CACHED_PTR(opline->op2.literal->cache_slot)) {
4939: EX(fbc) = CACHED_PTR(opline->op2.literal->cache_slot);
4940: } else if (IS_CONST != IS_CONST &&
4941: IS_VAR == IS_CONST &&
4942: (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce))) {
4943: /* do nothing */
4944: } else if (IS_VAR != IS_UNUSED) {
1.1 misho 4945: char *function_name_strval = NULL;
4946: int function_name_strlen = 0;
1.1.1.2 misho 4947: zend_free_op free_op2;
1.1 misho 4948:
1.1.1.2 misho 4949: if (IS_VAR == IS_CONST) {
4950: function_name_strval = Z_STRVAL_P(opline->op2.zv);
4951: function_name_strlen = Z_STRLEN_P(opline->op2.zv);
1.1 misho 4952: } else {
1.1.1.2 misho 4953: function_name = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 4954:
1.1.1.2 misho 4955: if (UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
1.1 misho 4956: zend_error_noreturn(E_ERROR, "Function name must be a string");
4957: } else {
4958: function_name_strval = Z_STRVAL_P(function_name);
4959: function_name_strlen = Z_STRLEN_P(function_name);
4960: }
4961: }
4962:
4963: if (function_name_strval) {
4964: if (ce->get_static_method) {
4965: EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
4966: } else {
1.1.1.2 misho 4967: EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen, ((IS_VAR == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC);
1.1 misho 4968: }
1.1.1.2 misho 4969: if (UNEXPECTED(EX(fbc) == NULL)) {
1.1 misho 4970: zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name, function_name_strval);
4971: }
1.1.1.2 misho 4972: if (IS_VAR == IS_CONST &&
4973: EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) &&
4974: EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0)) {
4975: if (IS_CONST == IS_CONST) {
4976: CACHE_PTR(opline->op2.literal->cache_slot, EX(fbc));
4977: } else {
4978: CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce, EX(fbc));
4979: }
4980: }
1.1 misho 4981: }
1.1.1.2 misho 4982: if (IS_VAR != IS_CONST) {
4983: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1 misho 4984: }
4985: } else {
1.1.1.2 misho 4986: if (UNEXPECTED(ce->constructor == NULL)) {
1.1 misho 4987: zend_error_noreturn(E_ERROR, "Cannot call constructor");
4988: }
4989: if (EG(This) && Z_OBJCE_P(EG(This)) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) {
1.1.1.2 misho 4990: zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name);
1.1 misho 4991: }
4992: EX(fbc) = ce->constructor;
4993: }
4994:
4995: if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) {
4996: EX(object) = NULL;
4997: } else {
4998: if (EG(This) &&
4999: Z_OBJ_HT_P(EG(This))->get_class_entry &&
5000: !instanceof_function(Z_OBJCE_P(EG(This)), ce TSRMLS_CC)) {
5001: /* We are calling method of the other (incompatible) class,
5002: but passing $this. This is done for compatibility with php-4. */
5003: if (EX(fbc)->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
1.1.1.2 misho 5004: zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", EX(fbc)->common.scope->name, EX(fbc)->common.function_name);
1.1 misho 5005: } else {
5006: /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
1.1.1.2 misho 5007: zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", EX(fbc)->common.scope->name, EX(fbc)->common.function_name);
1.1 misho 5008: }
5009: }
5010: if ((EX(object) = EG(This))) {
5011: Z_ADDREF_P(EX(object));
5012: EX(called_scope) = Z_OBJCE_P(EX(object));
5013: }
5014: }
5015:
1.1.1.2 misho 5016: CHECK_EXCEPTION();
1.1 misho 5017: ZEND_VM_NEXT_OPCODE();
5018: }
5019:
1.1.1.2 misho 5020: static int ZEND_FASTCALL ZEND_CASE_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
5021: {
5022: USE_OPLINE
5023: zend_free_op free_op2;
5024:
5025: SAVE_OPLINE();
5026: if (IS_CONST==IS_VAR) {
5027: PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
5028: }
5029: is_equal_function(&EX_T(opline->result.var).tmp_var,
5030: opline->op1.zv,
5031: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
5032:
5033: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
5034: CHECK_EXCEPTION();
5035: ZEND_VM_NEXT_OPCODE();
5036: }
5037:
5038: static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 5039: {
1.1.1.2 misho 5040: USE_OPLINE
1.1 misho 5041:
5042: zval *expr_ptr;
5043:
1.1.1.2 misho 5044: SAVE_OPLINE();
5045: if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && opline->extended_value) {
5046: zval **expr_ptr_ptr = NULL;
1.1 misho 5047:
1.1.1.2 misho 5048: if (IS_CONST == IS_VAR && UNEXPECTED(expr_ptr_ptr == NULL)) {
5049: zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
5050: }
5051: SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr);
1.1 misho 5052: expr_ptr = *expr_ptr_ptr;
1.1.1.2 misho 5053: Z_ADDREF_P(expr_ptr);
1.1 misho 5054: } else {
1.1.1.2 misho 5055: expr_ptr=opline->op1.zv;
5056: if (0) { /* temporary variable */
5057: zval *new_expr;
1.1 misho 5058:
1.1.1.2 misho 5059: ALLOC_ZVAL(new_expr);
5060: INIT_PZVAL_COPY(new_expr, expr_ptr);
5061: expr_ptr = new_expr;
5062: } else if (IS_CONST == IS_CONST || PZVAL_IS_REF(expr_ptr)) {
1.1 misho 5063: zval *new_expr;
5064:
5065: ALLOC_ZVAL(new_expr);
5066: INIT_PZVAL_COPY(new_expr, expr_ptr);
5067: expr_ptr = new_expr;
5068: zendi_zval_copy_ctor(*expr_ptr);
5069: } else {
5070: Z_ADDREF_P(expr_ptr);
5071: }
5072: }
1.1.1.2 misho 5073:
5074: if (IS_VAR != IS_UNUSED) {
5075: zend_free_op free_op2;
5076: zval *offset = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
5077: ulong hval;
5078:
1.1 misho 5079: switch (Z_TYPE_P(offset)) {
5080: case IS_DOUBLE:
1.1.1.2 misho 5081: hval = zend_dval_to_lval(Z_DVAL_P(offset));
5082: goto num_index;
1.1 misho 5083: case IS_LONG:
5084: case IS_BOOL:
1.1.1.2 misho 5085: hval = Z_LVAL_P(offset);
5086: num_index:
5087: zend_hash_index_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), hval, &expr_ptr, sizeof(zval *), NULL);
1.1 misho 5088: break;
5089: case IS_STRING:
1.1.1.2 misho 5090: if (IS_VAR == IS_CONST) {
5091: hval = Z_HASH_P(offset);
5092: } else {
5093: ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
5094: if (IS_INTERNED(Z_STRVAL_P(offset))) {
5095: hval = INTERNED_HASH(Z_STRVAL_P(offset));
5096: } else {
5097: hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
5098: }
5099: }
5100: zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
1.1 misho 5101: break;
5102: case IS_NULL:
1.1.1.2 misho 5103: zend_hash_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
1.1 misho 5104: break;
5105: default:
5106: zend_error(E_WARNING, "Illegal offset type");
5107: zval_ptr_dtor(&expr_ptr);
5108: /* do nothing */
5109: break;
5110: }
1.1.1.2 misho 5111: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1 misho 5112: } else {
1.1.1.2 misho 5113: zend_hash_next_index_insert(Z_ARRVAL(EX_T(opline->result.var).tmp_var), &expr_ptr, sizeof(zval *), NULL);
1.1 misho 5114: }
1.1.1.2 misho 5115: if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && opline->extended_value) {
1.1 misho 5116:
5117: } else {
5118:
5119: }
1.1.1.2 misho 5120: CHECK_EXCEPTION();
1.1 misho 5121: ZEND_VM_NEXT_OPCODE();
5122: }
5123:
1.1.1.2 misho 5124: static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 5125: {
1.1.1.2 misho 5126: USE_OPLINE
1.1 misho 5127:
1.1.1.2 misho 5128: array_init(&EX_T(opline->result.var).tmp_var);
1.1 misho 5129: if (IS_CONST == IS_UNUSED) {
5130: ZEND_VM_NEXT_OPCODE();
5131: #if 0 || IS_CONST != IS_UNUSED
5132: } else {
1.1.1.2 misho 5133: return ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
1.1 misho 5134: #endif
5135: }
5136: }
5137:
1.1.1.2 misho 5138: static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 5139: {
1.1.1.2 misho 5140: USE_OPLINE
5141: zval tmp, *varname;
5142: HashTable *target_symbol_table;
1.1 misho 5143:
5144:
1.1.1.2 misho 5145: SAVE_OPLINE();
5146: if (IS_CONST == IS_CV &&
5147: IS_VAR == IS_UNUSED &&
5148: (opline->extended_value & ZEND_QUICK_SET)) {
5149: if (EG(active_symbol_table)) {
5150: zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.var);
1.1 misho 5151:
1.1.1.2 misho 5152: zend_delete_variable(EX(prev_execute_data), EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value TSRMLS_CC);
5153: EX_CV(opline->op1.var) = NULL;
5154: } else if (EX_CV(opline->op1.var)) {
5155: zval_ptr_dtor(EX_CV(opline->op1.var));
5156: EX_CV(opline->op1.var) = NULL;
5157: }
5158: CHECK_EXCEPTION();
5159: ZEND_VM_NEXT_OPCODE();
5160: }
1.1 misho 5161:
1.1.1.2 misho 5162: varname = opline->op1.zv;
1.1 misho 5163:
1.1.1.2 misho 5164: if (IS_CONST != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
5165: ZVAL_COPY_VALUE(&tmp, varname);
5166: zval_copy_ctor(&tmp);
5167: convert_to_string(&tmp);
5168: varname = &tmp;
5169: } else if (IS_CONST == IS_VAR || IS_CONST == IS_CV) {
5170: Z_ADDREF_P(varname);
5171: }
1.1 misho 5172:
1.1.1.2 misho 5173: if (IS_VAR != IS_UNUSED) {
5174: zend_class_entry *ce;
1.1 misho 5175:
1.1.1.2 misho 5176: if (IS_VAR == IS_CONST) {
5177: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
5178: ce = CACHED_PTR(opline->op2.literal->cache_slot);
5179: } else {
5180: ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
1.1.1.4 ! misho 5181: if (UNEXPECTED(EG(exception) != NULL)) {
1.1.1.2 misho 5182: if (IS_CONST != IS_CONST && varname == &tmp) {
5183: zval_dtor(&tmp);
5184: } else if (IS_CONST == IS_VAR || IS_CONST == IS_CV) {
5185: zval_ptr_dtor(&varname);
5186: }
1.1 misho 5187:
1.1.1.4 ! misho 5188: HANDLE_EXCEPTION();
! 5189: }
! 5190: if (UNEXPECTED(ce == NULL)) {
! 5191: zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op2.zv));
1.1.1.2 misho 5192: }
5193: CACHE_PTR(opline->op2.literal->cache_slot, ce);
5194: }
5195: } else {
5196: ce = EX_T(opline->op2.var).class_entry;
5197: }
5198: zend_std_unset_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), ((IS_CONST == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
5199: } else {
5200: ulong hash_value = zend_inline_hash_func(varname->value.str.val, varname->value.str.len+1);
1.1 misho 5201:
1.1.1.2 misho 5202: target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
5203: zend_delete_variable(execute_data, target_symbol_table, varname->value.str.val, varname->value.str.len+1, hash_value TSRMLS_CC);
5204: }
1.1 misho 5205:
1.1.1.2 misho 5206: if (IS_CONST != IS_CONST && varname == &tmp) {
5207: zval_dtor(&tmp);
5208: } else if (IS_CONST == IS_VAR || IS_CONST == IS_CV) {
5209: zval_ptr_dtor(&varname);
5210: }
1.1 misho 5211:
1.1.1.2 misho 5212: CHECK_EXCEPTION();
1.1 misho 5213: ZEND_VM_NEXT_OPCODE();
5214: }
5215:
1.1.1.2 misho 5216: static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 5217: {
1.1.1.2 misho 5218: USE_OPLINE
5219: zval **value;
5220: zend_bool isset = 1;
1.1 misho 5221:
1.1.1.2 misho 5222: SAVE_OPLINE();
5223: if (IS_CONST == IS_CV &&
5224: IS_VAR == IS_UNUSED &&
5225: (opline->extended_value & ZEND_QUICK_SET)) {
5226: if (EX_CV(opline->op1.var)) {
5227: value = EX_CV(opline->op1.var);
5228: } else if (EG(active_symbol_table)) {
5229: zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.var);
1.1 misho 5230:
1.1.1.2 misho 5231: if (zend_hash_quick_find(EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value, (void **) &value) == FAILURE) {
5232: isset = 0;
5233: }
5234: } else {
5235: isset = 0;
5236: }
5237: } else {
5238: HashTable *target_symbol_table;
1.1 misho 5239:
1.1.1.2 misho 5240: zval tmp, *varname = opline->op1.zv;
1.1 misho 5241:
1.1.1.2 misho 5242: if (IS_CONST != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
5243: ZVAL_COPY_VALUE(&tmp, varname);
5244: zval_copy_ctor(&tmp);
5245: convert_to_string(&tmp);
5246: varname = &tmp;
5247: }
1.1 misho 5248:
1.1.1.2 misho 5249: if (IS_VAR != IS_UNUSED) {
5250: zend_class_entry *ce;
1.1 misho 5251:
1.1.1.2 misho 5252: if (IS_VAR == IS_CONST) {
5253: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
5254: ce = CACHED_PTR(opline->op2.literal->cache_slot);
5255: } else {
5256: ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
5257: if (UNEXPECTED(ce == NULL)) {
5258: CHECK_EXCEPTION();
5259: ZEND_VM_NEXT_OPCODE();
5260: }
5261: CACHE_PTR(opline->op2.literal->cache_slot, ce);
5262: }
5263: } else {
5264: ce = EX_T(opline->op2.var).class_entry;
5265: }
5266: value = zend_std_get_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 1, ((IS_CONST == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
5267: if (!value) {
5268: isset = 0;
5269: }
5270: } else {
5271: target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
5272: if (zend_hash_find(target_symbol_table, varname->value.str.val, varname->value.str.len+1, (void **) &value) == FAILURE) {
5273: isset = 0;
5274: }
5275: }
1.1 misho 5276:
1.1.1.2 misho 5277: if (IS_CONST != IS_CONST && varname == &tmp) {
5278: zval_dtor(&tmp);
5279: }
1.1 misho 5280:
1.1.1.2 misho 5281: }
1.1 misho 5282:
1.1.1.2 misho 5283: if (opline->extended_value & ZEND_ISSET) {
5284: if (isset && Z_TYPE_PP(value) != IS_NULL) {
5285: ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 1);
5286: } else {
5287: ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
5288: }
5289: } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
5290: if (!isset || !i_zend_is_true(*value)) {
5291: ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 1);
5292: } else {
5293: ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
5294: }
5295: }
1.1 misho 5296:
1.1.1.2 misho 5297: CHECK_EXCEPTION();
1.1 misho 5298: ZEND_VM_NEXT_OPCODE();
5299: }
5300:
1.1.1.2 misho 5301: static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_UNUSED(int type, ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 5302: {
1.1.1.2 misho 5303: USE_OPLINE
5304: zend_free_op free_op1;
5305: zval *varname;
5306: zval **retval;
5307: zval tmp_varname;
5308: HashTable *target_symbol_table;
5309: ulong hash_value;
1.1 misho 5310:
1.1.1.2 misho 5311: SAVE_OPLINE();
5312: varname = opline->op1.zv;
1.1 misho 5313:
1.1.1.2 misho 5314: if (IS_CONST != IS_CONST && UNEXPECTED(Z_TYPE_P(varname) != IS_STRING)) {
5315: ZVAL_COPY_VALUE(&tmp_varname, varname);
5316: zval_copy_ctor(&tmp_varname);
5317: Z_SET_REFCOUNT(tmp_varname, 1);
5318: Z_UNSET_ISREF(tmp_varname);
5319: convert_to_string(&tmp_varname);
5320: varname = &tmp_varname;
5321: }
1.1 misho 5322:
1.1.1.2 misho 5323: if (IS_UNUSED != IS_UNUSED) {
5324: zend_class_entry *ce;
1.1 misho 5325:
1.1.1.2 misho 5326: if (IS_UNUSED == IS_CONST) {
5327: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
5328: ce = CACHED_PTR(opline->op2.literal->cache_slot);
5329: } else {
5330: ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
5331: if (UNEXPECTED(ce == NULL)) {
5332: if (IS_CONST != IS_CONST && varname == &tmp_varname) {
5333: zval_dtor(&tmp_varname);
5334: }
1.1 misho 5335:
1.1.1.2 misho 5336: CHECK_EXCEPTION();
5337: ZEND_VM_NEXT_OPCODE();
5338: }
5339: CACHE_PTR(opline->op2.literal->cache_slot, ce);
5340: }
5341: } else {
5342: ce = EX_T(opline->op2.var).class_entry;
5343: }
5344: retval = zend_std_get_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 0, ((IS_CONST == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
1.1 misho 5345:
1.1.1.2 misho 5346: } else {
5347: target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
5348: /*
5349: if (!target_symbol_table) {
5350: CHECK_EXCEPTION();
5351: ZEND_VM_NEXT_OPCODE();
5352: }
5353: */
5354: if (IS_CONST == IS_CONST) {
5355: hash_value = Z_HASH_P(varname);
5356: } else if (IS_INTERNED(Z_STRVAL_P(varname))) {
5357: hash_value = INTERNED_HASH(Z_STRVAL_P(varname));
5358: } else {
5359: hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1);
5360: }
1.1 misho 5361:
1.1.1.2 misho 5362: if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) {
5363: switch (type) {
5364: case BP_VAR_R:
5365: case BP_VAR_UNSET:
5366: zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_P(varname));
5367: /* break missing intentionally */
5368: case BP_VAR_IS:
5369: retval = &EG(uninitialized_zval_ptr);
5370: break;
5371: case BP_VAR_RW:
5372: zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_P(varname));
5373: /* break missing intentionally */
5374: case BP_VAR_W:
5375: Z_ADDREF_P(&EG(uninitialized_zval));
5376: zend_hash_quick_update(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, &EG(uninitialized_zval_ptr), sizeof(zval *), (void **) &retval);
5377: break;
5378: EMPTY_SWITCH_DEFAULT_CASE()
5379: }
5380: }
5381: switch (opline->extended_value & ZEND_FETCH_TYPE_MASK) {
5382: case ZEND_FETCH_GLOBAL:
5383: if (IS_CONST != IS_TMP_VAR) {
1.1 misho 5384:
1.1.1.2 misho 5385: }
5386: break;
5387: case ZEND_FETCH_LOCAL:
1.1 misho 5388:
1.1.1.2 misho 5389: break;
5390: case ZEND_FETCH_STATIC:
5391: zval_update_constant(retval, (void*) 1 TSRMLS_CC);
5392: break;
5393: case ZEND_FETCH_GLOBAL_LOCK:
5394: if (IS_CONST == IS_VAR && !free_op1.var) {
5395: PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
5396: }
5397: break;
5398: }
5399: }
1.1 misho 5400:
5401:
1.1.1.2 misho 5402: if (IS_CONST != IS_CONST && varname == &tmp_varname) {
5403: zval_dtor(&tmp_varname);
5404: }
5405: if (opline->extended_value & ZEND_FETCH_MAKE_REF) {
5406: SEPARATE_ZVAL_TO_MAKE_IS_REF(retval);
5407: }
5408: PZVAL_LOCK(*retval);
5409: switch (type) {
5410: case BP_VAR_R:
5411: case BP_VAR_IS:
5412: AI_SET_PTR(&EX_T(opline->result.var), *retval);
5413: break;
5414: case BP_VAR_UNSET: {
5415: zend_free_op free_res;
5416:
5417: PZVAL_UNLOCK(*retval, &free_res);
5418: if (retval != &EG(uninitialized_zval_ptr)) {
5419: SEPARATE_ZVAL_IF_NOT_REF(retval);
5420: }
5421: PZVAL_LOCK(*retval);
5422: FREE_OP_VAR_PTR(free_res);
5423: }
5424: /* break missing intentionally */
5425: default:
5426: EX_T(opline->result.var).var.ptr_ptr = retval;
5427: break;
5428: }
5429: CHECK_EXCEPTION();
1.1 misho 5430: ZEND_VM_NEXT_OPCODE();
5431: }
5432:
1.1.1.2 misho 5433: static int ZEND_FASTCALL ZEND_FETCH_R_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 5434: {
1.1.1.2 misho 5435: return zend_fetch_var_address_helper_SPEC_CONST_UNUSED(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
1.1 misho 5436: }
5437:
1.1.1.2 misho 5438: static int ZEND_FASTCALL ZEND_FETCH_W_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 5439: {
1.1.1.2 misho 5440: return zend_fetch_var_address_helper_SPEC_CONST_UNUSED(BP_VAR_W, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
1.1 misho 5441: }
5442:
1.1.1.2 misho 5443: static int ZEND_FASTCALL ZEND_FETCH_RW_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 5444: {
1.1.1.2 misho 5445: return zend_fetch_var_address_helper_SPEC_CONST_UNUSED(BP_VAR_RW, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
1.1 misho 5446: }
5447:
1.1.1.2 misho 5448: static int ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 5449: {
1.1.1.2 misho 5450: USE_OPLINE
1.1 misho 5451:
1.1.1.2 misho 5452: return zend_fetch_var_address_helper_SPEC_CONST_UNUSED(ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
1.1 misho 5453: }
5454:
1.1.1.2 misho 5455: static int ZEND_FASTCALL ZEND_FETCH_UNSET_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 5456: {
1.1.1.2 misho 5457: return zend_fetch_var_address_helper_SPEC_CONST_UNUSED(BP_VAR_UNSET, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
1.1 misho 5458: }
5459:
1.1.1.2 misho 5460: static int ZEND_FASTCALL ZEND_FETCH_IS_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 5461: {
1.1.1.2 misho 5462: return zend_fetch_var_address_helper_SPEC_CONST_UNUSED(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
1.1 misho 5463: }
5464:
1.1.1.2 misho 5465: static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 5466: {
1.1.1.2 misho 5467: USE_OPLINE
1.1 misho 5468: zval *function_name;
5469: zend_class_entry *ce;
5470:
1.1.1.2 misho 5471: SAVE_OPLINE();
1.1 misho 5472: zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
5473:
5474: if (IS_CONST == IS_CONST) {
5475: /* no function found. try a static method in class */
1.1.1.2 misho 5476: if (CACHED_PTR(opline->op1.literal->cache_slot)) {
5477: ce = CACHED_PTR(opline->op1.literal->cache_slot);
5478: } else {
5479: ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
1.1.1.4 ! misho 5480: if (UNEXPECTED(EG(exception) != NULL)) {
! 5481: HANDLE_EXCEPTION();
! 5482: }
1.1.1.2 misho 5483: if (UNEXPECTED(ce == NULL)) {
1.1.1.4 ! misho 5484: zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv));
1.1.1.2 misho 5485: }
5486: CACHE_PTR(opline->op1.literal->cache_slot, ce);
1.1 misho 5487: }
5488: EX(called_scope) = ce;
5489: } else {
1.1.1.2 misho 5490: ce = EX_T(opline->op1.var).class_entry;
1.1 misho 5491:
1.1.1.2 misho 5492: if (opline->extended_value == ZEND_FETCH_CLASS_PARENT || opline->extended_value == ZEND_FETCH_CLASS_SELF) {
1.1 misho 5493: EX(called_scope) = EG(called_scope);
5494: } else {
5495: EX(called_scope) = ce;
5496: }
5497: }
1.1.1.2 misho 5498:
5499: if (IS_CONST == IS_CONST &&
5500: IS_UNUSED == IS_CONST &&
5501: CACHED_PTR(opline->op2.literal->cache_slot)) {
5502: EX(fbc) = CACHED_PTR(opline->op2.literal->cache_slot);
5503: } else if (IS_CONST != IS_CONST &&
5504: IS_UNUSED == IS_CONST &&
5505: (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce))) {
5506: /* do nothing */
5507: } else if (IS_UNUSED != IS_UNUSED) {
1.1 misho 5508: char *function_name_strval = NULL;
5509: int function_name_strlen = 0;
5510:
5511:
1.1.1.2 misho 5512: if (IS_UNUSED == IS_CONST) {
5513: function_name_strval = Z_STRVAL_P(opline->op2.zv);
5514: function_name_strlen = Z_STRLEN_P(opline->op2.zv);
1.1 misho 5515: } else {
1.1.1.2 misho 5516: function_name = NULL;
1.1 misho 5517:
1.1.1.2 misho 5518: if (UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
1.1 misho 5519: zend_error_noreturn(E_ERROR, "Function name must be a string");
5520: } else {
5521: function_name_strval = Z_STRVAL_P(function_name);
5522: function_name_strlen = Z_STRLEN_P(function_name);
5523: }
5524: }
5525:
5526: if (function_name_strval) {
5527: if (ce->get_static_method) {
5528: EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
5529: } else {
1.1.1.2 misho 5530: EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen, ((IS_UNUSED == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC);
1.1 misho 5531: }
1.1.1.2 misho 5532: if (UNEXPECTED(EX(fbc) == NULL)) {
1.1 misho 5533: zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name, function_name_strval);
5534: }
1.1.1.2 misho 5535: if (IS_UNUSED == IS_CONST &&
5536: EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) &&
5537: EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0)) {
5538: if (IS_CONST == IS_CONST) {
5539: CACHE_PTR(opline->op2.literal->cache_slot, EX(fbc));
5540: } else {
5541: CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce, EX(fbc));
5542: }
5543: }
1.1 misho 5544: }
1.1.1.2 misho 5545: if (IS_UNUSED != IS_CONST) {
1.1 misho 5546:
5547: }
5548: } else {
1.1.1.2 misho 5549: if (UNEXPECTED(ce->constructor == NULL)) {
1.1 misho 5550: zend_error_noreturn(E_ERROR, "Cannot call constructor");
5551: }
5552: if (EG(This) && Z_OBJCE_P(EG(This)) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) {
1.1.1.2 misho 5553: zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name);
1.1 misho 5554: }
5555: EX(fbc) = ce->constructor;
5556: }
5557:
5558: if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) {
5559: EX(object) = NULL;
5560: } else {
5561: if (EG(This) &&
5562: Z_OBJ_HT_P(EG(This))->get_class_entry &&
5563: !instanceof_function(Z_OBJCE_P(EG(This)), ce TSRMLS_CC)) {
5564: /* We are calling method of the other (incompatible) class,
5565: but passing $this. This is done for compatibility with php-4. */
5566: if (EX(fbc)->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
1.1.1.2 misho 5567: zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", EX(fbc)->common.scope->name, EX(fbc)->common.function_name);
1.1 misho 5568: } else {
5569: /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
1.1.1.2 misho 5570: zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", EX(fbc)->common.scope->name, EX(fbc)->common.function_name);
1.1 misho 5571: }
5572: }
5573: if ((EX(object) = EG(This))) {
5574: Z_ADDREF_P(EX(object));
5575: EX(called_scope) = Z_OBJCE_P(EX(object));
5576: }
5577: }
5578:
1.1.1.2 misho 5579: CHECK_EXCEPTION();
1.1 misho 5580: ZEND_VM_NEXT_OPCODE();
5581: }
5582:
1.1.1.2 misho 5583: static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 5584: {
1.1.1.2 misho 5585: USE_OPLINE
1.1 misho 5586:
5587: zval *expr_ptr;
5588:
1.1.1.2 misho 5589: SAVE_OPLINE();
5590: if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && opline->extended_value) {
5591: zval **expr_ptr_ptr = NULL;
1.1 misho 5592:
1.1.1.2 misho 5593: if (IS_CONST == IS_VAR && UNEXPECTED(expr_ptr_ptr == NULL)) {
5594: zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
5595: }
5596: SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr);
1.1 misho 5597: expr_ptr = *expr_ptr_ptr;
1.1.1.2 misho 5598: Z_ADDREF_P(expr_ptr);
1.1 misho 5599: } else {
1.1.1.2 misho 5600: expr_ptr=opline->op1.zv;
5601: if (0) { /* temporary variable */
5602: zval *new_expr;
1.1 misho 5603:
1.1.1.2 misho 5604: ALLOC_ZVAL(new_expr);
5605: INIT_PZVAL_COPY(new_expr, expr_ptr);
5606: expr_ptr = new_expr;
5607: } else if (IS_CONST == IS_CONST || PZVAL_IS_REF(expr_ptr)) {
1.1 misho 5608: zval *new_expr;
5609:
5610: ALLOC_ZVAL(new_expr);
5611: INIT_PZVAL_COPY(new_expr, expr_ptr);
5612: expr_ptr = new_expr;
5613: zendi_zval_copy_ctor(*expr_ptr);
5614: } else {
5615: Z_ADDREF_P(expr_ptr);
5616: }
5617: }
1.1.1.2 misho 5618:
5619: if (IS_UNUSED != IS_UNUSED) {
5620:
5621: zval *offset = NULL;
5622: ulong hval;
5623:
1.1 misho 5624: switch (Z_TYPE_P(offset)) {
5625: case IS_DOUBLE:
1.1.1.2 misho 5626: hval = zend_dval_to_lval(Z_DVAL_P(offset));
5627: goto num_index;
1.1 misho 5628: case IS_LONG:
5629: case IS_BOOL:
1.1.1.2 misho 5630: hval = Z_LVAL_P(offset);
5631: num_index:
5632: zend_hash_index_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), hval, &expr_ptr, sizeof(zval *), NULL);
1.1 misho 5633: break;
5634: case IS_STRING:
1.1.1.2 misho 5635: if (IS_UNUSED == IS_CONST) {
5636: hval = Z_HASH_P(offset);
5637: } else {
5638: ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
5639: if (IS_INTERNED(Z_STRVAL_P(offset))) {
5640: hval = INTERNED_HASH(Z_STRVAL_P(offset));
5641: } else {
5642: hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
5643: }
5644: }
5645: zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
1.1 misho 5646: break;
5647: case IS_NULL:
1.1.1.2 misho 5648: zend_hash_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
1.1 misho 5649: break;
5650: default:
5651: zend_error(E_WARNING, "Illegal offset type");
5652: zval_ptr_dtor(&expr_ptr);
5653: /* do nothing */
5654: break;
5655: }
5656:
5657: } else {
1.1.1.2 misho 5658: zend_hash_next_index_insert(Z_ARRVAL(EX_T(opline->result.var).tmp_var), &expr_ptr, sizeof(zval *), NULL);
1.1 misho 5659: }
1.1.1.2 misho 5660: if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && opline->extended_value) {
1.1 misho 5661:
5662: } else {
5663:
5664: }
1.1.1.2 misho 5665: CHECK_EXCEPTION();
1.1 misho 5666: ZEND_VM_NEXT_OPCODE();
5667: }
5668:
1.1.1.2 misho 5669: static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 5670: {
1.1.1.2 misho 5671: USE_OPLINE
1.1 misho 5672:
1.1.1.2 misho 5673: array_init(&EX_T(opline->result.var).tmp_var);
1.1 misho 5674: if (IS_CONST == IS_UNUSED) {
5675: ZEND_VM_NEXT_OPCODE();
5676: #if 0 || IS_CONST != IS_UNUSED
5677: } else {
1.1.1.2 misho 5678: return ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
1.1 misho 5679: #endif
5680: }
5681: }
5682:
1.1.1.2 misho 5683: static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 5684: {
1.1.1.2 misho 5685: USE_OPLINE
5686: zval tmp, *varname;
5687: HashTable *target_symbol_table;
1.1 misho 5688:
5689:
1.1.1.2 misho 5690: SAVE_OPLINE();
5691: if (IS_CONST == IS_CV &&
5692: IS_UNUSED == IS_UNUSED &&
5693: (opline->extended_value & ZEND_QUICK_SET)) {
5694: if (EG(active_symbol_table)) {
5695: zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.var);
1.1 misho 5696:
1.1.1.2 misho 5697: zend_delete_variable(EX(prev_execute_data), EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value TSRMLS_CC);
5698: EX_CV(opline->op1.var) = NULL;
5699: } else if (EX_CV(opline->op1.var)) {
5700: zval_ptr_dtor(EX_CV(opline->op1.var));
5701: EX_CV(opline->op1.var) = NULL;
5702: }
5703: CHECK_EXCEPTION();
5704: ZEND_VM_NEXT_OPCODE();
5705: }
1.1 misho 5706:
1.1.1.2 misho 5707: varname = opline->op1.zv;
1.1 misho 5708:
1.1.1.2 misho 5709: if (IS_CONST != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
5710: ZVAL_COPY_VALUE(&tmp, varname);
5711: zval_copy_ctor(&tmp);
5712: convert_to_string(&tmp);
5713: varname = &tmp;
5714: } else if (IS_CONST == IS_VAR || IS_CONST == IS_CV) {
5715: Z_ADDREF_P(varname);
5716: }
5717:
5718: if (IS_UNUSED != IS_UNUSED) {
5719: zend_class_entry *ce;
5720:
5721: if (IS_UNUSED == IS_CONST) {
5722: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
5723: ce = CACHED_PTR(opline->op2.literal->cache_slot);
5724: } else {
5725: ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
1.1.1.4 ! misho 5726: if (UNEXPECTED(EG(exception) != NULL)) {
1.1.1.2 misho 5727: if (IS_CONST != IS_CONST && varname == &tmp) {
5728: zval_dtor(&tmp);
5729: } else if (IS_CONST == IS_VAR || IS_CONST == IS_CV) {
5730: zval_ptr_dtor(&varname);
5731: }
5732:
1.1.1.4 ! misho 5733: HANDLE_EXCEPTION();
! 5734: }
! 5735: if (UNEXPECTED(ce == NULL)) {
! 5736: zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op2.zv));
1.1.1.2 misho 5737: }
5738: CACHE_PTR(opline->op2.literal->cache_slot, ce);
5739: }
1.1 misho 5740: } else {
1.1.1.2 misho 5741: ce = EX_T(opline->op2.var).class_entry;
1.1 misho 5742: }
1.1.1.2 misho 5743: zend_std_unset_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), ((IS_CONST == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
1.1 misho 5744: } else {
1.1.1.2 misho 5745: ulong hash_value = zend_inline_hash_func(varname->value.str.val, varname->value.str.len+1);
5746:
5747: target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
5748: zend_delete_variable(execute_data, target_symbol_table, varname->value.str.val, varname->value.str.len+1, hash_value TSRMLS_CC);
1.1 misho 5749: }
5750:
1.1.1.2 misho 5751: if (IS_CONST != IS_CONST && varname == &tmp) {
5752: zval_dtor(&tmp);
5753: } else if (IS_CONST == IS_VAR || IS_CONST == IS_CV) {
5754: zval_ptr_dtor(&varname);
5755: }
5756:
5757: CHECK_EXCEPTION();
1.1 misho 5758: ZEND_VM_NEXT_OPCODE();
5759: }
5760:
1.1.1.2 misho 5761: static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 5762: {
1.1.1.2 misho 5763: USE_OPLINE
5764: zval **value;
5765: zend_bool isset = 1;
1.1 misho 5766:
1.1.1.2 misho 5767: SAVE_OPLINE();
5768: if (IS_CONST == IS_CV &&
5769: IS_UNUSED == IS_UNUSED &&
5770: (opline->extended_value & ZEND_QUICK_SET)) {
5771: if (EX_CV(opline->op1.var)) {
5772: value = EX_CV(opline->op1.var);
5773: } else if (EG(active_symbol_table)) {
5774: zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.var);
1.1 misho 5775:
1.1.1.2 misho 5776: if (zend_hash_quick_find(EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value, (void **) &value) == FAILURE) {
5777: isset = 0;
5778: }
5779: } else {
5780: isset = 0;
5781: }
5782: } else {
5783: HashTable *target_symbol_table;
1.1 misho 5784:
1.1.1.2 misho 5785: zval tmp, *varname = opline->op1.zv;
1.1 misho 5786:
1.1.1.2 misho 5787: if (IS_CONST != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
5788: ZVAL_COPY_VALUE(&tmp, varname);
5789: zval_copy_ctor(&tmp);
5790: convert_to_string(&tmp);
5791: varname = &tmp;
1.1 misho 5792: }
5793:
1.1.1.2 misho 5794: if (IS_UNUSED != IS_UNUSED) {
5795: zend_class_entry *ce;
5796:
5797: if (IS_UNUSED == IS_CONST) {
5798: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
5799: ce = CACHED_PTR(opline->op2.literal->cache_slot);
5800: } else {
5801: ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
5802: if (UNEXPECTED(ce == NULL)) {
5803: CHECK_EXCEPTION();
5804: ZEND_VM_NEXT_OPCODE();
1.1 misho 5805: }
1.1.1.2 misho 5806: CACHE_PTR(opline->op2.literal->cache_slot, ce);
1.1 misho 5807: }
1.1.1.2 misho 5808: } else {
5809: ce = EX_T(opline->op2.var).class_entry;
5810: }
5811: value = zend_std_get_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 1, ((IS_CONST == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
5812: if (!value) {
5813: isset = 0;
5814: }
5815: } else {
5816: target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
5817: if (zend_hash_find(target_symbol_table, varname->value.str.val, varname->value.str.len+1, (void **) &value) == FAILURE) {
5818: isset = 0;
5819: }
1.1 misho 5820: }
5821:
1.1.1.2 misho 5822: if (IS_CONST != IS_CONST && varname == &tmp) {
5823: zval_dtor(&tmp);
5824: }
1.1 misho 5825:
5826: }
1.1.1.2 misho 5827:
5828: if (opline->extended_value & ZEND_ISSET) {
5829: if (isset && Z_TYPE_PP(value) != IS_NULL) {
5830: ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 1);
5831: } else {
5832: ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
5833: }
5834: } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
5835: if (!isset || !i_zend_is_true(*value)) {
5836: ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 1);
5837: } else {
5838: ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
1.1 misho 5839: }
5840: }
1.1.1.2 misho 5841:
5842: CHECK_EXCEPTION();
1.1 misho 5843: ZEND_VM_NEXT_OPCODE();
5844: }
5845:
1.1.1.2 misho 5846: static int ZEND_FASTCALL ZEND_DECLARE_LAMBDA_FUNCTION_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 5847: {
1.1.1.2 misho 5848: USE_OPLINE
5849: zend_function *op_array;
5850:
5851: SAVE_OPLINE();
5852:
5853: if (UNEXPECTED(zend_hash_quick_find(EG(function_table), Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), Z_HASH_P(opline->op1.zv), (void *) &op_array) == FAILURE) ||
5854: UNEXPECTED(op_array->type != ZEND_USER_FUNCTION)) {
5855: zend_error_noreturn(E_ERROR, "Base lambda function for closure not found");
5856: }
5857:
5858: zend_create_closure(&EX_T(opline->result.var).tmp_var, op_array, EG(scope), EG(This) TSRMLS_CC);
5859:
5860: CHECK_EXCEPTION();
5861: ZEND_VM_NEXT_OPCODE();
1.1 misho 5862: }
5863:
1.1.1.2 misho 5864: static int ZEND_FASTCALL ZEND_ADD_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 5865: {
1.1.1.2 misho 5866: USE_OPLINE
5867:
5868:
5869: SAVE_OPLINE();
5870: fast_add_function(&EX_T(opline->result.var).tmp_var,
5871: opline->op1.zv,
5872: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
5873:
5874:
5875: CHECK_EXCEPTION();
5876: ZEND_VM_NEXT_OPCODE();
1.1 misho 5877: }
5878:
1.1.1.2 misho 5879: static int ZEND_FASTCALL ZEND_SUB_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 5880: {
1.1.1.2 misho 5881: USE_OPLINE
5882:
5883:
5884: SAVE_OPLINE();
5885: fast_sub_function(&EX_T(opline->result.var).tmp_var,
5886: opline->op1.zv,
5887: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
5888:
5889:
5890: CHECK_EXCEPTION();
5891: ZEND_VM_NEXT_OPCODE();
1.1 misho 5892: }
5893:
1.1.1.2 misho 5894: static int ZEND_FASTCALL ZEND_MUL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 5895: {
1.1.1.2 misho 5896: USE_OPLINE
5897:
5898:
5899: SAVE_OPLINE();
5900: fast_mul_function(&EX_T(opline->result.var).tmp_var,
5901: opline->op1.zv,
5902: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
5903:
5904:
5905: CHECK_EXCEPTION();
5906: ZEND_VM_NEXT_OPCODE();
1.1 misho 5907: }
5908:
1.1.1.2 misho 5909: static int ZEND_FASTCALL ZEND_DIV_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 5910: {
1.1.1.2 misho 5911: USE_OPLINE
5912:
5913:
5914: SAVE_OPLINE();
5915: fast_div_function(&EX_T(opline->result.var).tmp_var,
5916: opline->op1.zv,
5917: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
5918:
5919:
5920: CHECK_EXCEPTION();
5921: ZEND_VM_NEXT_OPCODE();
1.1 misho 5922: }
5923:
1.1.1.2 misho 5924: static int ZEND_FASTCALL ZEND_MOD_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 5925: {
1.1.1.2 misho 5926: USE_OPLINE
5927:
5928:
5929: SAVE_OPLINE();
5930: fast_mod_function(&EX_T(opline->result.var).tmp_var,
5931: opline->op1.zv,
5932: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
5933:
5934:
5935: CHECK_EXCEPTION();
5936: ZEND_VM_NEXT_OPCODE();
1.1 misho 5937: }
5938:
1.1.1.2 misho 5939: static int ZEND_FASTCALL ZEND_SL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 5940: {
1.1.1.2 misho 5941: USE_OPLINE
5942:
5943:
5944: SAVE_OPLINE();
5945: shift_left_function(&EX_T(opline->result.var).tmp_var,
5946: opline->op1.zv,
5947: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
1.1 misho 5948:
5949:
1.1.1.2 misho 5950: CHECK_EXCEPTION();
1.1 misho 5951: ZEND_VM_NEXT_OPCODE();
5952: }
5953:
1.1.1.2 misho 5954: static int ZEND_FASTCALL ZEND_SR_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 5955: {
1.1.1.2 misho 5956: USE_OPLINE
1.1 misho 5957:
5958:
1.1.1.2 misho 5959: SAVE_OPLINE();
5960: shift_right_function(&EX_T(opline->result.var).tmp_var,
5961: opline->op1.zv,
5962: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
5963:
5964:
5965: CHECK_EXCEPTION();
1.1 misho 5966: ZEND_VM_NEXT_OPCODE();
5967: }
5968:
1.1.1.2 misho 5969: static int ZEND_FASTCALL ZEND_CONCAT_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 5970: {
1.1.1.2 misho 5971: USE_OPLINE
1.1 misho 5972:
1.1.1.2 misho 5973:
5974: SAVE_OPLINE();
5975: concat_function(&EX_T(opline->result.var).tmp_var,
5976: opline->op1.zv,
5977: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
5978:
5979:
5980: CHECK_EXCEPTION();
5981: ZEND_VM_NEXT_OPCODE();
1.1 misho 5982: }
5983:
1.1.1.2 misho 5984: static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 5985: {
1.1.1.2 misho 5986: USE_OPLINE
1.1 misho 5987:
1.1.1.2 misho 5988:
5989: SAVE_OPLINE();
5990: is_identical_function(&EX_T(opline->result.var).tmp_var,
5991: opline->op1.zv,
5992: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
5993:
5994:
5995: CHECK_EXCEPTION();
1.1 misho 5996: ZEND_VM_NEXT_OPCODE();
5997: }
5998:
1.1.1.2 misho 5999: static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 6000: {
1.1.1.2 misho 6001: USE_OPLINE
1.1 misho 6002:
1.1.1.2 misho 6003: zval *result = &EX_T(opline->result.var).tmp_var;
6004:
6005: SAVE_OPLINE();
6006: is_identical_function(result,
6007: opline->op1.zv,
6008: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
6009: Z_LVAL_P(result) = !Z_LVAL_P(result);
6010:
6011:
6012: CHECK_EXCEPTION();
1.1 misho 6013: ZEND_VM_NEXT_OPCODE();
6014: }
6015:
1.1.1.2 misho 6016: static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 6017: {
1.1.1.2 misho 6018: USE_OPLINE
6019:
6020: zval *result = &EX_T(opline->result.var).tmp_var;
6021:
6022: SAVE_OPLINE();
6023: ZVAL_BOOL(result, fast_equal_function(result,
6024: opline->op1.zv,
6025: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC));
6026:
6027:
6028: CHECK_EXCEPTION();
1.1 misho 6029: ZEND_VM_NEXT_OPCODE();
6030: }
6031:
1.1.1.2 misho 6032: static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 6033: {
1.1.1.2 misho 6034: USE_OPLINE
1.1 misho 6035:
1.1.1.2 misho 6036: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 6037:
1.1.1.2 misho 6038: SAVE_OPLINE();
6039: ZVAL_BOOL(result, fast_not_equal_function(result,
6040: opline->op1.zv,
6041: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC));
1.1 misho 6042:
6043:
1.1.1.2 misho 6044: CHECK_EXCEPTION();
6045: ZEND_VM_NEXT_OPCODE();
6046: }
1.1 misho 6047:
1.1.1.2 misho 6048: static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
6049: {
6050: USE_OPLINE
1.1 misho 6051:
1.1.1.2 misho 6052: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 6053:
1.1.1.2 misho 6054: SAVE_OPLINE();
6055: ZVAL_BOOL(result, fast_is_smaller_function(result,
6056: opline->op1.zv,
6057: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC));
1.1 misho 6058:
6059:
1.1.1.2 misho 6060: CHECK_EXCEPTION();
6061: ZEND_VM_NEXT_OPCODE();
6062: }
1.1 misho 6063:
1.1.1.2 misho 6064: static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
6065: {
6066: USE_OPLINE
1.1 misho 6067:
1.1.1.2 misho 6068: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 6069:
1.1.1.2 misho 6070: SAVE_OPLINE();
6071: ZVAL_BOOL(result, fast_is_smaller_or_equal_function(result,
6072: opline->op1.zv,
6073: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC));
1.1 misho 6074:
1.1.1.2 misho 6075:
6076: CHECK_EXCEPTION();
6077: ZEND_VM_NEXT_OPCODE();
1.1 misho 6078: }
6079:
1.1.1.2 misho 6080: static int ZEND_FASTCALL ZEND_BW_OR_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 6081: {
1.1.1.2 misho 6082: USE_OPLINE
1.1 misho 6083:
6084:
1.1.1.2 misho 6085: SAVE_OPLINE();
6086: bitwise_or_function(&EX_T(opline->result.var).tmp_var,
6087: opline->op1.zv,
6088: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
1.1 misho 6089:
6090:
1.1.1.2 misho 6091: CHECK_EXCEPTION();
1.1 misho 6092: ZEND_VM_NEXT_OPCODE();
6093: }
6094:
1.1.1.2 misho 6095: static int ZEND_FASTCALL ZEND_BW_AND_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 6096: {
1.1.1.2 misho 6097: USE_OPLINE
1.1 misho 6098:
6099:
1.1.1.2 misho 6100: SAVE_OPLINE();
6101: bitwise_and_function(&EX_T(opline->result.var).tmp_var,
6102: opline->op1.zv,
6103: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
1.1 misho 6104:
1.1.1.2 misho 6105:
6106: CHECK_EXCEPTION();
1.1 misho 6107: ZEND_VM_NEXT_OPCODE();
6108: }
6109:
1.1.1.2 misho 6110: static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 6111: {
1.1.1.2 misho 6112: USE_OPLINE
1.1 misho 6113:
6114:
1.1.1.2 misho 6115: SAVE_OPLINE();
6116: bitwise_xor_function(&EX_T(opline->result.var).tmp_var,
6117: opline->op1.zv,
6118: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
6119:
6120:
6121: CHECK_EXCEPTION();
1.1 misho 6122: ZEND_VM_NEXT_OPCODE();
6123: }
6124:
1.1.1.2 misho 6125: static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 6126: {
1.1.1.2 misho 6127: USE_OPLINE
6128:
6129:
6130: SAVE_OPLINE();
6131: boolean_xor_function(&EX_T(opline->result.var).tmp_var,
6132: opline->op1.zv,
6133: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
6134:
6135:
6136: CHECK_EXCEPTION();
6137: ZEND_VM_NEXT_OPCODE();
6138: }
6139:
6140: static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
6141: {
6142: USE_OPLINE
6143: zval *function_name;
1.1 misho 6144: zend_class_entry *ce;
6145:
1.1.1.2 misho 6146: SAVE_OPLINE();
6147: zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
1.1 misho 6148:
1.1.1.2 misho 6149: if (IS_CONST == IS_CONST) {
6150: /* no function found. try a static method in class */
6151: if (CACHED_PTR(opline->op1.literal->cache_slot)) {
6152: ce = CACHED_PTR(opline->op1.literal->cache_slot);
1.1 misho 6153: } else {
1.1.1.2 misho 6154: ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
1.1.1.4 ! misho 6155: if (UNEXPECTED(EG(exception) != NULL)) {
! 6156: HANDLE_EXCEPTION();
! 6157: }
1.1.1.2 misho 6158: if (UNEXPECTED(ce == NULL)) {
1.1.1.4 ! misho 6159: zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv));
1.1.1.2 misho 6160: }
6161: CACHE_PTR(opline->op1.literal->cache_slot, ce);
6162: }
6163: EX(called_scope) = ce;
6164: } else {
6165: ce = EX_T(opline->op1.var).class_entry;
6166:
6167: if (opline->extended_value == ZEND_FETCH_CLASS_PARENT || opline->extended_value == ZEND_FETCH_CLASS_SELF) {
6168: EX(called_scope) = EG(called_scope);
6169: } else {
6170: EX(called_scope) = ce;
1.1 misho 6171: }
6172: }
6173:
1.1.1.2 misho 6174: if (IS_CONST == IS_CONST &&
6175: IS_CV == IS_CONST &&
6176: CACHED_PTR(opline->op2.literal->cache_slot)) {
6177: EX(fbc) = CACHED_PTR(opline->op2.literal->cache_slot);
6178: } else if (IS_CONST != IS_CONST &&
6179: IS_CV == IS_CONST &&
6180: (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce))) {
6181: /* do nothing */
6182: } else if (IS_CV != IS_UNUSED) {
6183: char *function_name_strval = NULL;
6184: int function_name_strlen = 0;
6185:
6186:
6187: if (IS_CV == IS_CONST) {
6188: function_name_strval = Z_STRVAL_P(opline->op2.zv);
6189: function_name_strlen = Z_STRLEN_P(opline->op2.zv);
6190: } else {
6191: function_name = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
6192:
6193: if (UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
6194: zend_error_noreturn(E_ERROR, "Function name must be a string");
6195: } else {
6196: function_name_strval = Z_STRVAL_P(function_name);
6197: function_name_strlen = Z_STRLEN_P(function_name);
6198: }
6199: }
6200:
6201: if (function_name_strval) {
6202: if (ce->get_static_method) {
6203: EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
6204: } else {
6205: EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen, ((IS_CV == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC);
1.1 misho 6206: }
1.1.1.2 misho 6207: if (UNEXPECTED(EX(fbc) == NULL)) {
6208: zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name, function_name_strval);
6209: }
6210: if (IS_CV == IS_CONST &&
6211: EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) &&
6212: EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0)) {
6213: if (IS_CONST == IS_CONST) {
6214: CACHE_PTR(opline->op2.literal->cache_slot, EX(fbc));
6215: } else {
6216: CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce, EX(fbc));
6217: }
1.1 misho 6218: }
6219: }
1.1.1.2 misho 6220: if (IS_CV != IS_CONST) {
6221:
6222: }
6223: } else {
6224: if (UNEXPECTED(ce->constructor == NULL)) {
6225: zend_error_noreturn(E_ERROR, "Cannot call constructor");
6226: }
6227: if (EG(This) && Z_OBJCE_P(EG(This)) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) {
6228: zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name);
6229: }
6230: EX(fbc) = ce->constructor;
1.1 misho 6231: }
6232:
1.1.1.2 misho 6233: if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) {
6234: EX(object) = NULL;
6235: } else {
6236: if (EG(This) &&
6237: Z_OBJ_HT_P(EG(This))->get_class_entry &&
6238: !instanceof_function(Z_OBJCE_P(EG(This)), ce TSRMLS_CC)) {
6239: /* We are calling method of the other (incompatible) class,
6240: but passing $this. This is done for compatibility with php-4. */
6241: if (EX(fbc)->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
6242: zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", EX(fbc)->common.scope->name, EX(fbc)->common.function_name);
6243: } else {
6244: /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
6245: zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", EX(fbc)->common.scope->name, EX(fbc)->common.function_name);
6246: }
6247: }
6248: if ((EX(object) = EG(This))) {
6249: Z_ADDREF_P(EX(object));
6250: EX(called_scope) = Z_OBJCE_P(EX(object));
1.1 misho 6251: }
6252: }
6253:
1.1.1.2 misho 6254: CHECK_EXCEPTION();
1.1 misho 6255: ZEND_VM_NEXT_OPCODE();
6256: }
6257:
1.1.1.2 misho 6258: static int ZEND_FASTCALL ZEND_CATCH_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 6259: {
1.1.1.2 misho 6260: USE_OPLINE
6261: zend_class_entry *ce, *catch_ce;
6262: zval *exception;
1.1 misho 6263:
1.1.1.2 misho 6264: SAVE_OPLINE();
6265: /* Check whether an exception has been thrown, if not, jump over code */
6266: zend_exception_restore(TSRMLS_C);
6267: if (EG(exception) == NULL) {
6268: ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->extended_value]);
6269: ZEND_VM_CONTINUE(); /* CHECK_ME */
1.1 misho 6270: }
1.1.1.2 misho 6271: if (CACHED_PTR(opline->op1.literal->cache_slot)) {
6272: catch_ce = CACHED_PTR(opline->op1.literal->cache_slot);
6273: } else {
6274: catch_ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, ZEND_FETCH_CLASS_NO_AUTOLOAD TSRMLS_CC);
1.1 misho 6275:
1.1.1.2 misho 6276: CACHE_PTR(opline->op1.literal->cache_slot, catch_ce);
6277: }
6278: ce = Z_OBJCE_P(EG(exception));
6279:
6280: #ifdef HAVE_DTRACE
6281: if (DTRACE_EXCEPTION_CAUGHT_ENABLED()) {
1.1.1.4 ! misho 6282: DTRACE_EXCEPTION_CAUGHT((char *)ce->name);
1.1.1.2 misho 6283: }
6284: #endif /* HAVE_DTRACE */
6285:
6286: if (ce != catch_ce) {
6287: if (!instanceof_function(ce, catch_ce TSRMLS_CC)) {
6288: if (opline->result.num) {
6289: zend_throw_exception_internal(NULL TSRMLS_CC);
6290: HANDLE_EXCEPTION();
1.1 misho 6291: }
1.1.1.2 misho 6292: ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->extended_value]);
6293: ZEND_VM_CONTINUE(); /* CHECK_ME */
1.1 misho 6294: }
6295: }
6296:
1.1.1.2 misho 6297: exception = EG(exception);
6298: if (!EG(active_symbol_table)) {
6299: if (EX_CV(opline->op2.var)) {
6300: zval_ptr_dtor(EX_CV(opline->op2.var));
6301: }
6302: EX_CV(opline->op2.var) = (zval**)EX_CVs() + (EX(op_array)->last_var + opline->op2.var);
6303: *EX_CV(opline->op2.var) = EG(exception);
6304: } else {
6305: zend_compiled_variable *cv = &CV_DEF_OF(opline->op2.var);
6306: zend_hash_quick_update(EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value,
6307: &EG(exception), sizeof(zval *), (void**)&EX_CV(opline->op2.var));
6308: }
6309: if (UNEXPECTED(EG(exception) != exception)) {
6310: Z_ADDREF_P(EG(exception));
6311: HANDLE_EXCEPTION();
6312: } else {
6313: EG(exception) = NULL;
6314: ZEND_VM_NEXT_OPCODE();
6315: }
1.1 misho 6316: }
6317:
1.1.1.2 misho 6318: static int ZEND_FASTCALL ZEND_CASE_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 6319: {
1.1.1.2 misho 6320: USE_OPLINE
1.1 misho 6321:
1.1.1.2 misho 6322:
6323: SAVE_OPLINE();
6324: if (IS_CONST==IS_VAR) {
6325: PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
1.1 misho 6326: }
1.1.1.2 misho 6327: is_equal_function(&EX_T(opline->result.var).tmp_var,
6328: opline->op1.zv,
6329: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
1.1 misho 6330:
1.1.1.2 misho 6331: CHECK_EXCEPTION();
6332: ZEND_VM_NEXT_OPCODE();
6333: }
1.1 misho 6334:
1.1.1.2 misho 6335: static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
6336: {
6337: USE_OPLINE
6338:
6339: zval *expr_ptr;
6340:
6341: SAVE_OPLINE();
6342: if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && opline->extended_value) {
6343: zval **expr_ptr_ptr = NULL;
6344:
6345: if (IS_CONST == IS_VAR && UNEXPECTED(expr_ptr_ptr == NULL)) {
6346: zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
1.1 misho 6347: }
1.1.1.2 misho 6348: SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr);
6349: expr_ptr = *expr_ptr_ptr;
6350: Z_ADDREF_P(expr_ptr);
1.1 misho 6351: } else {
1.1.1.2 misho 6352: expr_ptr=opline->op1.zv;
6353: if (0) { /* temporary variable */
6354: zval *new_expr;
1.1 misho 6355:
1.1.1.2 misho 6356: ALLOC_ZVAL(new_expr);
6357: INIT_PZVAL_COPY(new_expr, expr_ptr);
6358: expr_ptr = new_expr;
6359: } else if (IS_CONST == IS_CONST || PZVAL_IS_REF(expr_ptr)) {
6360: zval *new_expr;
1.1 misho 6361:
1.1.1.2 misho 6362: ALLOC_ZVAL(new_expr);
6363: INIT_PZVAL_COPY(new_expr, expr_ptr);
6364: expr_ptr = new_expr;
6365: zendi_zval_copy_ctor(*expr_ptr);
6366: } else {
6367: Z_ADDREF_P(expr_ptr);
6368: }
6369: }
1.1 misho 6370:
1.1.1.2 misho 6371: if (IS_CV != IS_UNUSED) {
1.1 misho 6372:
1.1.1.2 misho 6373: zval *offset = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
6374: ulong hval;
6375:
6376: switch (Z_TYPE_P(offset)) {
6377: case IS_DOUBLE:
6378: hval = zend_dval_to_lval(Z_DVAL_P(offset));
6379: goto num_index;
6380: case IS_LONG:
6381: case IS_BOOL:
6382: hval = Z_LVAL_P(offset);
6383: num_index:
6384: zend_hash_index_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), hval, &expr_ptr, sizeof(zval *), NULL);
6385: break;
6386: case IS_STRING:
6387: if (IS_CV == IS_CONST) {
6388: hval = Z_HASH_P(offset);
6389: } else {
6390: ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
6391: if (IS_INTERNED(Z_STRVAL_P(offset))) {
6392: hval = INTERNED_HASH(Z_STRVAL_P(offset));
1.1 misho 6393: } else {
1.1.1.2 misho 6394: hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
1.1 misho 6395: }
6396: }
1.1.1.2 misho 6397: zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
1.1 misho 6398: break;
1.1.1.2 misho 6399: case IS_NULL:
6400: zend_hash_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
1.1 misho 6401: break;
1.1.1.2 misho 6402: default:
6403: zend_error(E_WARNING, "Illegal offset type");
6404: zval_ptr_dtor(&expr_ptr);
6405: /* do nothing */
1.1 misho 6406: break;
6407: }
1.1.1.2 misho 6408:
6409: } else {
6410: zend_hash_next_index_insert(Z_ARRVAL(EX_T(opline->result.var).tmp_var), &expr_ptr, sizeof(zval *), NULL);
1.1 misho 6411: }
1.1.1.2 misho 6412: if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && opline->extended_value) {
1.1 misho 6413:
1.1.1.2 misho 6414: } else {
1.1 misho 6415:
1.1.1.2 misho 6416: }
6417: CHECK_EXCEPTION();
6418: ZEND_VM_NEXT_OPCODE();
6419: }
1.1 misho 6420:
1.1.1.2 misho 6421: static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
6422: {
6423: USE_OPLINE
1.1 misho 6424:
1.1.1.2 misho 6425: array_init(&EX_T(opline->result.var).tmp_var);
6426: if (IS_CONST == IS_UNUSED) {
6427: ZEND_VM_NEXT_OPCODE();
6428: #if 0 || IS_CONST != IS_UNUSED
6429: } else {
6430: return ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
6431: #endif
6432: }
6433: }
1.1 misho 6434:
1.1.1.2 misho 6435: static int ZEND_FASTCALL ZEND_BW_NOT_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
6436: {
6437: USE_OPLINE
6438: zend_free_op free_op1;
1.1 misho 6439:
1.1.1.2 misho 6440: SAVE_OPLINE();
6441: bitwise_not_function(&EX_T(opline->result.var).tmp_var,
6442: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC) TSRMLS_CC);
6443: zval_dtor(free_op1.var);
6444: CHECK_EXCEPTION();
6445: ZEND_VM_NEXT_OPCODE();
6446: }
1.1 misho 6447:
1.1.1.2 misho 6448: static int ZEND_FASTCALL ZEND_BOOL_NOT_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
6449: {
6450: USE_OPLINE
6451: zend_free_op free_op1;
6452:
6453: SAVE_OPLINE();
6454: boolean_not_function(&EX_T(opline->result.var).tmp_var,
6455: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC) TSRMLS_CC);
6456: zval_dtor(free_op1.var);
6457: CHECK_EXCEPTION();
1.1 misho 6458: ZEND_VM_NEXT_OPCODE();
6459: }
6460:
1.1.1.2 misho 6461: static int ZEND_FASTCALL ZEND_ECHO_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 6462: {
1.1.1.2 misho 6463: USE_OPLINE
1.1 misho 6464: zend_free_op free_op1;
1.1.1.2 misho 6465: zval *z;
1.1 misho 6466:
1.1.1.2 misho 6467: SAVE_OPLINE();
6468: z = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 6469:
1.1.1.3 misho 6470: if (IS_TMP_VAR == IS_TMP_VAR && Z_TYPE_P(z) == IS_OBJECT) {
6471: INIT_PZVAL(z);
1.1 misho 6472: }
1.1.1.3 misho 6473: zend_print_variable(z);
1.1 misho 6474:
1.1.1.2 misho 6475: zval_dtor(free_op1.var);
6476: CHECK_EXCEPTION();
6477: ZEND_VM_NEXT_OPCODE();
6478: }
1.1 misho 6479:
1.1.1.2 misho 6480: static int ZEND_FASTCALL ZEND_PRINT_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
6481: {
6482: USE_OPLINE
1.1 misho 6483:
1.1.1.2 misho 6484: ZVAL_LONG(&EX_T(opline->result.var).tmp_var, 1);
6485: return ZEND_ECHO_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
6486: }
1.1 misho 6487:
1.1.1.2 misho 6488: static int ZEND_FASTCALL ZEND_JMPZ_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
6489: {
6490: USE_OPLINE
6491: zend_free_op free_op1;
6492: zval *val;
6493: int ret;
1.1 misho 6494:
1.1.1.2 misho 6495: SAVE_OPLINE();
6496: val = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 6497:
1.1.1.2 misho 6498: if (IS_TMP_VAR == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) {
6499: ret = Z_LVAL_P(val);
6500: } else {
6501: ret = i_zend_is_true(val);
6502: zval_dtor(free_op1.var);
6503: if (UNEXPECTED(EG(exception) != NULL)) {
6504: HANDLE_EXCEPTION();
1.1 misho 6505: }
6506: }
1.1.1.2 misho 6507: if (!ret) {
6508: #if DEBUG_ZEND>=2
6509: printf("Conditional jmp to %d\n", opline->op2.opline_num);
6510: #endif
6511: ZEND_VM_SET_OPCODE(opline->op2.jmp_addr);
6512: ZEND_VM_CONTINUE();
1.1 misho 6513: }
1.1.1.2 misho 6514:
1.1 misho 6515: ZEND_VM_NEXT_OPCODE();
6516: }
6517:
1.1.1.2 misho 6518: static int ZEND_FASTCALL ZEND_JMPNZ_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 6519: {
1.1.1.2 misho 6520: USE_OPLINE
1.1 misho 6521: zend_free_op free_op1;
1.1.1.2 misho 6522: zval *val;
6523: int ret;
1.1 misho 6524:
1.1.1.2 misho 6525: SAVE_OPLINE();
6526: val = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 6527:
1.1.1.2 misho 6528: if (IS_TMP_VAR == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) {
6529: ret = Z_LVAL_P(val);
1.1 misho 6530: } else {
1.1.1.2 misho 6531: ret = i_zend_is_true(val);
6532: zval_dtor(free_op1.var);
6533: if (UNEXPECTED(EG(exception) != NULL)) {
6534: HANDLE_EXCEPTION();
1.1 misho 6535: }
6536: }
1.1.1.2 misho 6537: if (ret) {
6538: #if DEBUG_ZEND>=2
6539: printf("Conditional jmp to %d\n", opline->op2.opline_num);
6540: #endif
6541: ZEND_VM_SET_OPCODE(opline->op2.jmp_addr);
6542: ZEND_VM_CONTINUE();
6543: }
1.1 misho 6544:
1.1.1.2 misho 6545: ZEND_VM_NEXT_OPCODE();
6546: }
1.1 misho 6547:
1.1.1.2 misho 6548: static int ZEND_FASTCALL ZEND_JMPZNZ_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
6549: {
6550: USE_OPLINE
6551: zend_free_op free_op1;
6552: zval *val;
6553: int retval;
1.1 misho 6554:
1.1.1.2 misho 6555: SAVE_OPLINE();
6556: val = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 6557:
1.1.1.2 misho 6558: if (IS_TMP_VAR == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) {
6559: retval = Z_LVAL_P(val);
6560: } else {
6561: retval = i_zend_is_true(val);
6562: zval_dtor(free_op1.var);
6563: if (UNEXPECTED(EG(exception) != NULL)) {
6564: HANDLE_EXCEPTION();
1.1 misho 6565: }
6566: }
1.1.1.2 misho 6567: if (EXPECTED(retval != 0)) {
6568: #if DEBUG_ZEND>=2
6569: printf("Conditional jmp on true to %d\n", opline->extended_value);
6570: #endif
6571: ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->extended_value]);
6572: ZEND_VM_CONTINUE(); /* CHECK_ME */
6573: } else {
6574: #if DEBUG_ZEND>=2
6575: printf("Conditional jmp on false to %d\n", opline->op2.opline_num);
6576: #endif
6577: ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->op2.opline_num]);
6578: ZEND_VM_CONTINUE(); /* CHECK_ME */
6579: }
6580: }
1.1 misho 6581:
1.1.1.2 misho 6582: static int ZEND_FASTCALL ZEND_JMPZ_EX_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
6583: {
6584: USE_OPLINE
6585: zend_free_op free_op1;
6586: zval *val;
6587: int retval;
1.1 misho 6588:
1.1.1.2 misho 6589: SAVE_OPLINE();
6590: val = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 6591:
1.1.1.2 misho 6592: if (IS_TMP_VAR == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) {
6593: retval = Z_LVAL_P(val);
6594: } else {
6595: retval = i_zend_is_true(val);
6596: zval_dtor(free_op1.var);
6597: if (UNEXPECTED(EG(exception) != NULL)) {
6598: HANDLE_EXCEPTION();
1.1 misho 6599: }
1.1.1.2 misho 6600: }
6601: Z_LVAL(EX_T(opline->result.var).tmp_var) = retval;
6602: Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
6603: if (!retval) {
6604: #if DEBUG_ZEND>=2
6605: printf("Conditional jmp to %d\n", opline->op2.opline_num);
6606: #endif
6607: ZEND_VM_SET_OPCODE(opline->op2.jmp_addr);
6608: ZEND_VM_CONTINUE();
6609: }
6610: ZEND_VM_NEXT_OPCODE();
6611: }
1.1 misho 6612:
1.1.1.2 misho 6613: static int ZEND_FASTCALL ZEND_JMPNZ_EX_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
6614: {
6615: USE_OPLINE
6616: zend_free_op free_op1;
6617: zval *val;
6618: int retval;
1.1 misho 6619:
1.1.1.2 misho 6620: SAVE_OPLINE();
6621: val = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 6622:
1.1.1.2 misho 6623: if (IS_TMP_VAR == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) {
6624: retval = Z_LVAL_P(val);
1.1 misho 6625: } else {
1.1.1.2 misho 6626: retval = i_zend_is_true(val);
6627: zval_dtor(free_op1.var);
6628: if (UNEXPECTED(EG(exception) != NULL)) {
6629: HANDLE_EXCEPTION();
6630: }
1.1 misho 6631: }
1.1.1.2 misho 6632: Z_LVAL(EX_T(opline->result.var).tmp_var) = retval;
6633: Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
6634: if (retval) {
6635: #if DEBUG_ZEND>=2
6636: printf("Conditional jmp to %d\n", opline->op2.opline_num);
6637: #endif
6638: ZEND_VM_SET_OPCODE(opline->op2.jmp_addr);
6639: ZEND_VM_CONTINUE();
6640: }
6641: ZEND_VM_NEXT_OPCODE();
6642: }
1.1 misho 6643:
1.1.1.2 misho 6644: static int ZEND_FASTCALL ZEND_FREE_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
6645: {
6646: USE_OPLINE
1.1 misho 6647:
1.1.1.2 misho 6648: SAVE_OPLINE();
6649: if (IS_TMP_VAR == IS_TMP_VAR) {
6650: zendi_zval_dtor(EX_T(opline->op1.var).tmp_var);
1.1 misho 6651: } else {
1.1.1.2 misho 6652: zval_ptr_dtor(&EX_T(opline->op1.var).var.ptr);
1.1 misho 6653: }
1.1.1.2 misho 6654: CHECK_EXCEPTION();
6655: ZEND_VM_NEXT_OPCODE();
1.1 misho 6656: }
6657:
1.1.1.2 misho 6658: static int ZEND_FASTCALL ZEND_RETURN_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 6659: {
1.1.1.2 misho 6660: USE_OPLINE
6661: zval *retval_ptr;
6662: zend_free_op free_op1;
1.1 misho 6663:
1.1.1.2 misho 6664: SAVE_OPLINE();
6665: retval_ptr = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 6666:
1.1.1.2 misho 6667: if (!EG(return_value_ptr_ptr)) {
6668: if (IS_TMP_VAR == IS_TMP_VAR) {
6669: zval_dtor(free_op1.var);
6670: }
6671: } else if (!1) { /* Not a temp var */
6672: if (IS_TMP_VAR == IS_CONST ||
6673: (PZVAL_IS_REF(retval_ptr) && Z_REFCOUNT_P(retval_ptr) > 0)) {
6674: zval *ret;
1.1 misho 6675:
1.1.1.2 misho 6676: ALLOC_ZVAL(ret);
6677: INIT_PZVAL_COPY(ret, retval_ptr);
6678: zval_copy_ctor(ret);
6679: *EG(return_value_ptr_ptr) = ret;
6680: } else if ((IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) &&
6681: retval_ptr == &EG(uninitialized_zval)) {
6682: zval *ret;
1.1 misho 6683:
1.1.1.2 misho 6684: ALLOC_INIT_ZVAL(ret);
6685: *EG(return_value_ptr_ptr) = ret;
1.1 misho 6686: } else {
1.1.1.2 misho 6687: *EG(return_value_ptr_ptr) = retval_ptr;
6688: Z_ADDREF_P(retval_ptr);
1.1 misho 6689: }
1.1.1.2 misho 6690: } else {
6691: zval *ret;
1.1 misho 6692:
1.1.1.2 misho 6693: ALLOC_ZVAL(ret);
6694: INIT_PZVAL_COPY(ret, retval_ptr);
6695: *EG(return_value_ptr_ptr) = ret;
1.1 misho 6696: }
6697:
1.1.1.2 misho 6698: return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
6699: }
1.1 misho 6700:
1.1.1.2 misho 6701: static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
6702: {
6703: USE_OPLINE
6704: zval *retval_ptr;
6705: zval **retval_ptr_ptr;
6706: zend_free_op free_op1;
6707:
6708: SAVE_OPLINE();
6709:
6710: do {
6711: if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR) {
6712: /* Not supposed to happen, but we'll allow it */
6713: zend_error(E_NOTICE, "Only variable references should be returned by reference");
6714:
6715: retval_ptr = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
6716: if (!EG(return_value_ptr_ptr)) {
6717: if (IS_TMP_VAR == IS_TMP_VAR) {
6718: zval_dtor(free_op1.var);
6719: }
6720: } else if (!1) { /* Not a temp var */
6721: zval *ret;
6722:
6723: ALLOC_ZVAL(ret);
6724: INIT_PZVAL_COPY(ret, retval_ptr);
6725: zval_copy_ctor(ret);
6726: *EG(return_value_ptr_ptr) = ret;
1.1 misho 6727: } else {
1.1.1.2 misho 6728: zval *ret;
6729:
6730: ALLOC_ZVAL(ret);
6731: INIT_PZVAL_COPY(ret, retval_ptr);
6732: *EG(return_value_ptr_ptr) = ret;
1.1 misho 6733: }
6734: break;
1.1.1.2 misho 6735: }
1.1 misho 6736:
1.1.1.2 misho 6737: retval_ptr_ptr = NULL;
1.1 misho 6738:
1.1.1.2 misho 6739: if (IS_TMP_VAR == IS_VAR && UNEXPECTED(retval_ptr_ptr == NULL)) {
6740: zend_error_noreturn(E_ERROR, "Cannot return string offsets by reference");
1.1 misho 6741: }
6742:
1.1.1.2 misho 6743: if (IS_TMP_VAR == IS_VAR && !Z_ISREF_PP(retval_ptr_ptr)) {
6744: if (opline->extended_value == ZEND_RETURNS_FUNCTION &&
6745: EX_T(opline->op1.var).var.fcall_returned_reference) {
6746: } else if (EX_T(opline->op1.var).var.ptr_ptr == &EX_T(opline->op1.var).var.ptr) {
6747: zend_error(E_NOTICE, "Only variable references should be returned by reference");
6748: if (EG(return_value_ptr_ptr)) {
1.1.1.4 ! misho 6749: zval *ret;
! 6750:
! 6751: ALLOC_ZVAL(ret);
! 6752: INIT_PZVAL_COPY(ret, *retval_ptr_ptr);
! 6753: zval_copy_ctor(ret);
! 6754: *EG(return_value_ptr_ptr) = ret;
1.1.1.2 misho 6755: }
6756: break;
6757: }
6758: }
1.1 misho 6759:
1.1.1.2 misho 6760: if (EG(return_value_ptr_ptr)) {
6761: SEPARATE_ZVAL_TO_MAKE_IS_REF(retval_ptr_ptr);
6762: Z_ADDREF_PP(retval_ptr_ptr);
1.1 misho 6763:
1.1.1.2 misho 6764: *EG(return_value_ptr_ptr) = *retval_ptr_ptr;
6765: }
6766: } while (0);
1.1 misho 6767:
1.1.1.2 misho 6768: return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
1.1 misho 6769: }
6770:
1.1.1.2 misho 6771: static int ZEND_FASTCALL ZEND_THROW_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 6772: {
1.1.1.2 misho 6773: USE_OPLINE
6774: zval *value;
6775: zval *exception;
1.1 misho 6776: zend_free_op free_op1;
6777:
1.1.1.2 misho 6778: SAVE_OPLINE();
6779: value = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
6780:
6781: if (IS_TMP_VAR == IS_CONST || UNEXPECTED(Z_TYPE_P(value) != IS_OBJECT)) {
6782: zend_error_noreturn(E_ERROR, "Can only throw objects");
6783: }
6784: zend_exception_save(TSRMLS_C);
6785: /* Not sure if a complete copy is what we want here */
6786: ALLOC_ZVAL(exception);
6787: INIT_PZVAL_COPY(exception, value);
1.1 misho 6788: if (!1) {
1.1.1.2 misho 6789: zval_copy_ctor(exception);
1.1 misho 6790: }
6791:
1.1.1.2 misho 6792: zend_throw_exception_object(exception TSRMLS_CC);
6793: zend_exception_restore(TSRMLS_C);
6794:
6795: HANDLE_EXCEPTION();
1.1 misho 6796: }
6797:
1.1.1.2 misho 6798: static int ZEND_FASTCALL ZEND_SEND_VAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 6799: {
1.1.1.2 misho 6800: USE_OPLINE
1.1 misho 6801:
1.1.1.2 misho 6802: SAVE_OPLINE();
6803: if (opline->extended_value==ZEND_DO_FCALL_BY_NAME
6804: && ARG_MUST_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) {
6805: zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", opline->op2.opline_num);
1.1 misho 6806: }
1.1.1.2 misho 6807: {
6808: zval *valptr;
6809: zval *value;
6810: zend_free_op free_op1;
1.1 misho 6811:
1.1.1.2 misho 6812: value = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 6813:
1.1.1.2 misho 6814: ALLOC_ZVAL(valptr);
6815: INIT_PZVAL_COPY(valptr, value);
6816: if (!1) {
6817: zval_copy_ctor(valptr);
6818: }
6819: zend_vm_stack_push(valptr TSRMLS_CC);
1.1 misho 6820:
1.1.1.2 misho 6821: }
6822: CHECK_EXCEPTION();
1.1 misho 6823: ZEND_VM_NEXT_OPCODE();
6824: }
6825:
1.1.1.2 misho 6826: static int ZEND_FASTCALL ZEND_BOOL_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 6827: {
1.1.1.2 misho 6828: USE_OPLINE
1.1 misho 6829: zend_free_op free_op1;
1.1.1.2 misho 6830: zval *retval = &EX_T(opline->result.var).tmp_var;
1.1 misho 6831:
1.1.1.2 misho 6832: SAVE_OPLINE();
6833: /* PHP 3.0 returned "" for false and 1 for true, here we use 0 and 1 for now */
6834: ZVAL_BOOL(retval, i_zend_is_true(_get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC)));
1.1 misho 6835: zval_dtor(free_op1.var);
6836:
1.1.1.2 misho 6837: CHECK_EXCEPTION();
1.1 misho 6838: ZEND_VM_NEXT_OPCODE();
6839: }
6840:
1.1.1.2 misho 6841: static int ZEND_FASTCALL ZEND_CLONE_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 6842: {
1.1.1.2 misho 6843: USE_OPLINE
1.1 misho 6844: zend_free_op free_op1;
1.1.1.2 misho 6845: zval *obj;
6846: zend_class_entry *ce;
6847: zend_function *clone;
6848: zend_object_clone_obj_t clone_call;
1.1 misho 6849:
1.1.1.2 misho 6850: SAVE_OPLINE();
6851: obj = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 6852:
1.1.1.2 misho 6853: if (IS_TMP_VAR == IS_CONST ||
6854: UNEXPECTED(Z_TYPE_P(obj) != IS_OBJECT)) {
6855: zend_error_noreturn(E_ERROR, "__clone method called on non-object");
6856: }
1.1 misho 6857:
1.1.1.2 misho 6858: ce = Z_OBJCE_P(obj);
6859: clone = ce ? ce->clone : NULL;
6860: clone_call = Z_OBJ_HT_P(obj)->clone_obj;
6861: if (UNEXPECTED(clone_call == NULL)) {
6862: if (ce) {
6863: zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s", ce->name);
6864: } else {
6865: zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object");
6866: }
6867: }
1.1 misho 6868:
1.1.1.2 misho 6869: if (ce && clone) {
6870: if (clone->op_array.fn_flags & ZEND_ACC_PRIVATE) {
6871: /* Ensure that if we're calling a private function, we're allowed to do so.
6872: */
6873: if (UNEXPECTED(ce != EG(scope))) {
6874: zend_error_noreturn(E_ERROR, "Call to private %s::__clone() from context '%s'", ce->name, EG(scope) ? EG(scope)->name : "");
6875: }
6876: } else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) {
6877: /* Ensure that if we're calling a protected function, we're allowed to do so.
6878: */
1.1.1.3 misho 6879: if (UNEXPECTED(!zend_check_protected(zend_get_function_root_class(clone), EG(scope)))) {
1.1.1.2 misho 6880: zend_error_noreturn(E_ERROR, "Call to protected %s::__clone() from context '%s'", ce->name, EG(scope) ? EG(scope)->name : "");
6881: }
6882: }
6883: }
1.1 misho 6884:
1.1.1.2 misho 6885: if (EXPECTED(EG(exception) == NULL)) {
6886: zval *retval;
1.1 misho 6887:
1.1.1.2 misho 6888: ALLOC_ZVAL(retval);
6889: Z_OBJVAL_P(retval) = clone_call(obj TSRMLS_CC);
6890: Z_TYPE_P(retval) = IS_OBJECT;
6891: Z_SET_REFCOUNT_P(retval, 1);
6892: Z_SET_ISREF_P(retval);
6893: if (!RETURN_VALUE_USED(opline) || UNEXPECTED(EG(exception) != NULL)) {
6894: zval_ptr_dtor(&retval);
6895: } else {
6896: AI_SET_PTR(&EX_T(opline->result.var), retval);
6897: }
6898: }
1.1 misho 6899:
1.1.1.2 misho 6900: CHECK_EXCEPTION();
1.1 misho 6901: ZEND_VM_NEXT_OPCODE();
6902: }
6903:
1.1.1.2 misho 6904: static int ZEND_FASTCALL ZEND_CAST_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 6905: {
1.1.1.2 misho 6906: USE_OPLINE
1.1 misho 6907: zend_free_op free_op1;
1.1.1.2 misho 6908: zval *expr;
6909: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 6910:
1.1.1.2 misho 6911: SAVE_OPLINE();
6912: expr = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 6913:
1.1.1.2 misho 6914: if (opline->extended_value != IS_STRING) {
6915: ZVAL_COPY_VALUE(result, expr);
6916: if (!1) {
6917: zendi_zval_copy_ctor(*result);
6918: }
6919: }
6920: switch (opline->extended_value) {
6921: case IS_NULL:
6922: convert_to_null(result);
6923: break;
6924: case IS_BOOL:
6925: convert_to_boolean(result);
6926: break;
6927: case IS_LONG:
6928: convert_to_long(result);
6929: break;
6930: case IS_DOUBLE:
6931: convert_to_double(result);
6932: break;
6933: case IS_STRING: {
6934: zval var_copy;
6935: int use_copy;
1.1 misho 6936:
1.1.1.2 misho 6937: zend_make_printable_zval(expr, &var_copy, &use_copy);
6938: if (use_copy) {
6939: ZVAL_COPY_VALUE(result, &var_copy);
6940: if (1) {
6941: zval_dtor(free_op1.var);
6942: }
6943: } else {
6944: ZVAL_COPY_VALUE(result, expr);
6945: if (!1) {
6946: zendi_zval_copy_ctor(*result);
6947: }
6948: }
6949: break;
6950: }
6951: case IS_ARRAY:
6952: convert_to_array(result);
6953: break;
6954: case IS_OBJECT:
6955: convert_to_object(result);
6956: break;
6957: }
1.1 misho 6958:
1.1.1.2 misho 6959: CHECK_EXCEPTION();
1.1 misho 6960: ZEND_VM_NEXT_OPCODE();
6961: }
6962:
1.1.1.2 misho 6963: static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 6964: {
1.1.1.2 misho 6965: USE_OPLINE
6966: zend_op_array *new_op_array=NULL;
1.1 misho 6967: zend_free_op free_op1;
1.1.1.2 misho 6968: zval *inc_filename;
6969: zval *tmp_inc_filename = NULL;
6970: zend_bool failure_retval=0;
1.1 misho 6971:
1.1.1.2 misho 6972: SAVE_OPLINE();
6973: inc_filename = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 6974:
1.1.1.2 misho 6975: if (inc_filename->type!=IS_STRING) {
6976: MAKE_STD_ZVAL(tmp_inc_filename);
6977: ZVAL_COPY_VALUE(tmp_inc_filename, inc_filename);
6978: zval_copy_ctor(tmp_inc_filename);
6979: convert_to_string(tmp_inc_filename);
6980: inc_filename = tmp_inc_filename;
6981: }
1.1 misho 6982:
1.1.1.2 misho 6983: if (opline->extended_value != ZEND_EVAL && strlen(Z_STRVAL_P(inc_filename)) != Z_STRLEN_P(inc_filename)) {
6984: if (opline->extended_value == ZEND_INCLUDE_ONCE || opline->extended_value == ZEND_INCLUDE) {
6985: zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
6986: } else {
6987: zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
6988: }
6989: } else {
6990: switch (opline->extended_value) {
6991: case ZEND_INCLUDE_ONCE:
6992: case ZEND_REQUIRE_ONCE: {
6993: zend_file_handle file_handle;
6994: char *resolved_path;
1.1 misho 6995:
1.1.1.2 misho 6996: resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename) TSRMLS_CC);
6997: if (resolved_path) {
6998: failure_retval = zend_hash_exists(&EG(included_files), resolved_path, strlen(resolved_path)+1);
6999: } else {
7000: resolved_path = Z_STRVAL_P(inc_filename);
7001: }
1.1 misho 7002:
1.1.1.2 misho 7003: if (failure_retval) {
7004: /* do nothing, file already included */
7005: } else if (SUCCESS == zend_stream_open(resolved_path, &file_handle TSRMLS_CC)) {
1.1 misho 7006:
1.1.1.2 misho 7007: if (!file_handle.opened_path) {
7008: file_handle.opened_path = estrdup(resolved_path);
7009: }
1.1 misho 7010:
1.1.1.2 misho 7011: if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) {
7012: new_op_array = zend_compile_file(&file_handle, (opline->extended_value==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
7013: zend_destroy_file_handle(&file_handle TSRMLS_CC);
7014: } else {
7015: zend_file_handle_dtor(&file_handle TSRMLS_CC);
7016: failure_retval=1;
7017: }
7018: } else {
7019: if (opline->extended_value == ZEND_INCLUDE_ONCE) {
7020: zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
7021: } else {
7022: zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
7023: }
7024: }
7025: if (resolved_path != Z_STRVAL_P(inc_filename)) {
7026: efree(resolved_path);
7027: }
7028: }
7029: break;
7030: case ZEND_INCLUDE:
7031: case ZEND_REQUIRE:
7032: new_op_array = compile_filename(opline->extended_value, inc_filename TSRMLS_CC);
7033: break;
7034: case ZEND_EVAL: {
7035: char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);
1.1 misho 7036:
1.1.1.2 misho 7037: new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
7038: efree(eval_desc);
7039: }
7040: break;
7041: EMPTY_SWITCH_DEFAULT_CASE()
7042: }
7043: }
7044: if (tmp_inc_filename) {
7045: zval_ptr_dtor(&tmp_inc_filename);
7046: }
1.1 misho 7047: zval_dtor(free_op1.var);
1.1.1.2 misho 7048: if (UNEXPECTED(EG(exception) != NULL)) {
7049: HANDLE_EXCEPTION();
7050: } else if (EXPECTED(new_op_array != NULL)) {
7051: EX(original_return_value) = EG(return_value_ptr_ptr);
7052: EG(active_op_array) = new_op_array;
7053: if (RETURN_VALUE_USED(opline)) {
7054: EX_T(opline->result.var).var.ptr = NULL;
7055: EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
7056: EG(return_value_ptr_ptr) = EX_T(opline->result.var).var.ptr_ptr;
7057: } else {
7058: EG(return_value_ptr_ptr) = NULL;
7059: }
1.1 misho 7060:
1.1.1.2 misho 7061: EX(current_object) = EX(object);
1.1 misho 7062:
1.1.1.2 misho 7063: EX(function_state).function = (zend_function *) new_op_array;
7064: EX(object) = NULL;
1.1 misho 7065:
1.1.1.2 misho 7066: if (!EG(active_symbol_table)) {
7067: zend_rebuild_symbol_table(TSRMLS_C);
7068: }
1.1 misho 7069:
1.1.1.2 misho 7070: if (EXPECTED(zend_execute == execute)) {
7071: ZEND_VM_ENTER();
7072: } else {
7073: zend_execute(new_op_array TSRMLS_CC);
7074: }
1.1 misho 7075:
1.1.1.2 misho 7076: EX(function_state).function = (zend_function *) EX(op_array);
7077: EX(object) = EX(current_object);
1.1 misho 7078:
1.1.1.2 misho 7079: EG(opline_ptr) = &EX(opline);
7080: EG(active_op_array) = EX(op_array);
7081: EG(return_value_ptr_ptr) = EX(original_return_value);
7082: destroy_op_array(new_op_array TSRMLS_CC);
7083: efree(new_op_array);
7084: if (UNEXPECTED(EG(exception) != NULL)) {
7085: zend_throw_exception_internal(NULL TSRMLS_CC);
7086: HANDLE_EXCEPTION();
7087: } else if (RETURN_VALUE_USED(opline)) {
7088: if (!EX_T(opline->result.var).var.ptr) { /* there was no return statement */
7089: zval *retval;
1.1 misho 7090:
1.1.1.2 misho 7091: ALLOC_ZVAL(retval);
7092: ZVAL_BOOL(retval, 1);
7093: INIT_PZVAL(retval);
7094: EX_T(opline->result.var).var.ptr = retval;
7095: }
7096: }
1.1 misho 7097:
1.1.1.2 misho 7098: } else if (RETURN_VALUE_USED(opline)) {
7099: zval *retval;
1.1 misho 7100:
1.1.1.2 misho 7101: ALLOC_ZVAL(retval);
7102: ZVAL_BOOL(retval, failure_retval);
7103: INIT_PZVAL(retval);
7104: AI_SET_PTR(&EX_T(opline->result.var), retval);
7105: }
1.1 misho 7106: ZEND_VM_NEXT_OPCODE();
7107: }
7108:
1.1.1.2 misho 7109: static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 7110: {
1.1.1.2 misho 7111: USE_OPLINE
1.1 misho 7112: zend_free_op free_op1;
1.1.1.2 misho 7113: zval *array_ptr, **array_ptr_ptr;
7114: HashTable *fe_ht;
7115: zend_object_iterator *iter = NULL;
7116: zend_class_entry *ce = NULL;
7117: zend_bool is_empty = 0;
1.1 misho 7118:
1.1.1.2 misho 7119: SAVE_OPLINE();
1.1 misho 7120:
1.1.1.2 misho 7121: if ((IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) &&
7122: (opline->extended_value & ZEND_FE_RESET_VARIABLE)) {
7123: array_ptr_ptr = NULL;
7124: if (array_ptr_ptr == NULL || array_ptr_ptr == &EG(uninitialized_zval_ptr)) {
7125: MAKE_STD_ZVAL(array_ptr);
7126: ZVAL_NULL(array_ptr);
7127: } else if (Z_TYPE_PP(array_ptr_ptr) == IS_OBJECT) {
7128: if(Z_OBJ_HT_PP(array_ptr_ptr)->get_class_entry == NULL) {
7129: zend_error(E_WARNING, "foreach() cannot iterate over objects without PHP class");
7130: ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num);
7131: }
1.1 misho 7132:
1.1.1.2 misho 7133: ce = Z_OBJCE_PP(array_ptr_ptr);
7134: if (!ce || ce->get_iterator == NULL) {
7135: SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr);
7136: Z_ADDREF_PP(array_ptr_ptr);
7137: }
7138: array_ptr = *array_ptr_ptr;
7139: } else {
7140: if (Z_TYPE_PP(array_ptr_ptr) == IS_ARRAY) {
7141: SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr);
7142: if (opline->extended_value & ZEND_FE_FETCH_BYREF) {
7143: Z_SET_ISREF_PP(array_ptr_ptr);
7144: }
7145: }
7146: array_ptr = *array_ptr_ptr;
7147: Z_ADDREF_P(array_ptr);
7148: }
7149: } else {
7150: array_ptr = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
7151: if (1) { /* IS_TMP_VAR */
7152: zval *tmp;
1.1 misho 7153:
1.1.1.2 misho 7154: ALLOC_ZVAL(tmp);
7155: INIT_PZVAL_COPY(tmp, array_ptr);
7156: array_ptr = tmp;
7157: if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
7158: ce = Z_OBJCE_P(array_ptr);
7159: if (ce && ce->get_iterator) {
7160: Z_DELREF_P(array_ptr);
7161: }
7162: }
7163: } else if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
7164: ce = Z_OBJCE_P(array_ptr);
7165: if (!ce || !ce->get_iterator) {
7166: Z_ADDREF_P(array_ptr);
7167: }
7168: } else if (IS_TMP_VAR == IS_CONST ||
7169: ((IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) &&
7170: !Z_ISREF_P(array_ptr) &&
7171: Z_REFCOUNT_P(array_ptr) > 1)) {
7172: zval *tmp;
1.1 misho 7173:
1.1.1.2 misho 7174: ALLOC_ZVAL(tmp);
7175: INIT_PZVAL_COPY(tmp, array_ptr);
7176: zval_copy_ctor(tmp);
7177: array_ptr = tmp;
7178: } else {
7179: Z_ADDREF_P(array_ptr);
7180: }
7181: }
1.1 misho 7182:
1.1.1.2 misho 7183: if (ce && ce->get_iterator) {
7184: iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC);
1.1 misho 7185:
1.1.1.2 misho 7186: if (iter && EXPECTED(EG(exception) == NULL)) {
7187: array_ptr = zend_iterator_wrap(iter TSRMLS_CC);
7188: } else {
1.1 misho 7189:
1.1.1.2 misho 7190: if (!EG(exception)) {
7191: zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Object of type %s did not create an Iterator", ce->name);
7192: }
7193: zend_throw_exception_internal(NULL TSRMLS_CC);
7194: HANDLE_EXCEPTION();
7195: }
7196: }
1.1 misho 7197:
1.1.1.2 misho 7198: EX_T(opline->result.var).fe.ptr = array_ptr;
1.1 misho 7199:
1.1.1.2 misho 7200: if (iter) {
7201: iter->index = 0;
7202: if (iter->funcs->rewind) {
7203: iter->funcs->rewind(iter TSRMLS_CC);
7204: if (UNEXPECTED(EG(exception) != NULL)) {
7205: zval_ptr_dtor(&array_ptr);
1.1 misho 7206:
1.1.1.2 misho 7207: HANDLE_EXCEPTION();
7208: }
1.1 misho 7209: }
1.1.1.2 misho 7210: is_empty = iter->funcs->valid(iter TSRMLS_CC) != SUCCESS;
7211: if (UNEXPECTED(EG(exception) != NULL)) {
7212: zval_ptr_dtor(&array_ptr);
1.1 misho 7213:
1.1.1.2 misho 7214: HANDLE_EXCEPTION();
7215: }
7216: iter->index = -1; /* will be set to 0 before using next handler */
7217: } else if ((fe_ht = HASH_OF(array_ptr)) != NULL) {
7218: zend_hash_internal_pointer_reset(fe_ht);
7219: if (ce) {
7220: zend_object *zobj = zend_objects_get_address(array_ptr TSRMLS_CC);
7221: while (zend_hash_has_more_elements(fe_ht) == SUCCESS) {
7222: char *str_key;
7223: uint str_key_len;
7224: ulong int_key;
7225: zend_uchar key_type;
1.1 misho 7226:
1.1.1.2 misho 7227: key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL);
7228: if (key_type != HASH_KEY_NON_EXISTANT &&
7229: (key_type == HASH_KEY_IS_LONG ||
7230: zend_check_property_access(zobj, str_key, str_key_len-1 TSRMLS_CC) == SUCCESS)) {
7231: break;
7232: }
7233: zend_hash_move_forward(fe_ht);
7234: }
7235: }
7236: is_empty = zend_hash_has_more_elements(fe_ht) != SUCCESS;
7237: zend_hash_get_pointer(fe_ht, &EX_T(opline->result.var).fe.fe_pos);
7238: } else {
7239: zend_error(E_WARNING, "Invalid argument supplied for foreach()");
7240: is_empty = 1;
7241: }
1.1 misho 7242:
1.1.1.2 misho 7243: if (is_empty) {
7244: ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num);
7245: } else {
7246: CHECK_EXCEPTION();
7247: ZEND_VM_NEXT_OPCODE();
1.1 misho 7248: }
7249: }
7250:
1.1.1.2 misho 7251: static int ZEND_FASTCALL ZEND_EXIT_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 7252: {
1.1.1.2 misho 7253: #if 0 || (IS_TMP_VAR != IS_UNUSED)
7254: USE_OPLINE
1.1 misho 7255:
1.1.1.2 misho 7256: SAVE_OPLINE();
7257: if (IS_TMP_VAR != IS_UNUSED) {
7258: zend_free_op free_op1;
7259: zval *ptr = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 7260:
1.1.1.2 misho 7261: if (Z_TYPE_P(ptr) == IS_LONG) {
7262: EG(exit_status) = Z_LVAL_P(ptr);
7263: } else {
7264: zend_print_variable(ptr);
7265: }
7266: zval_dtor(free_op1.var);
1.1 misho 7267: }
1.1.1.2 misho 7268: #endif
7269: zend_bailout();
7270: ZEND_VM_NEXT_OPCODE(); /* Never reached */
1.1 misho 7271: }
7272:
1.1.1.2 misho 7273: static int ZEND_FASTCALL ZEND_END_SILENCE_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 7274: {
1.1.1.2 misho 7275: USE_OPLINE
7276: zval restored_error_reporting;
1.1 misho 7277:
1.1.1.2 misho 7278: SAVE_OPLINE();
7279: if (!EG(error_reporting) && Z_LVAL(EX_T(opline->op1.var).tmp_var) != 0) {
7280: Z_TYPE(restored_error_reporting) = IS_LONG;
7281: Z_LVAL(restored_error_reporting) = Z_LVAL(EX_T(opline->op1.var).tmp_var);
7282: EG(error_reporting) = Z_LVAL(restored_error_reporting);
7283: convert_to_string(&restored_error_reporting);
7284: if (EXPECTED(EG(error_reporting_ini_entry) != NULL)) {
7285: if (EXPECTED(EG(error_reporting_ini_entry)->modified &&
7286: EG(error_reporting_ini_entry)->value != EG(error_reporting_ini_entry)->orig_value)) {
7287: efree(EG(error_reporting_ini_entry)->value);
7288: }
7289: EG(error_reporting_ini_entry)->value = Z_STRVAL(restored_error_reporting);
7290: EG(error_reporting_ini_entry)->value_length = Z_STRLEN(restored_error_reporting);
7291: } else {
7292: zendi_zval_dtor(restored_error_reporting);
7293: }
1.1 misho 7294: }
1.1.1.2 misho 7295: if (EX(old_error_reporting) == &EX_T(opline->op1.var).tmp_var) {
7296: EX(old_error_reporting) = NULL;
7297: }
7298: CHECK_EXCEPTION();
1.1 misho 7299: ZEND_VM_NEXT_OPCODE();
7300: }
7301:
1.1.1.2 misho 7302: static int ZEND_FASTCALL ZEND_JMP_SET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 7303: {
1.1.1.2 misho 7304: USE_OPLINE
1.1 misho 7305: zend_free_op free_op1;
1.1.1.2 misho 7306: zval *value;
1.1 misho 7307:
1.1.1.2 misho 7308: SAVE_OPLINE();
7309: value = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 7310:
1.1.1.2 misho 7311: if (i_zend_is_true(value)) {
7312: ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, value);
7313: if (!1) {
7314: zendi_zval_copy_ctor(EX_T(opline->result.var).tmp_var);
1.1 misho 7315: }
7316:
1.1.1.2 misho 7317: #if DEBUG_ZEND>=2
7318: printf("Conditional jmp to %d\n", opline->op2.opline_num);
7319: #endif
7320: ZEND_VM_JMP(opline->op2.jmp_addr);
1.1 misho 7321: }
7322:
1.1.1.2 misho 7323: zval_dtor(free_op1.var);
7324: CHECK_EXCEPTION();
1.1 misho 7325: ZEND_VM_NEXT_OPCODE();
7326: }
7327:
1.1.1.2 misho 7328: static int ZEND_FASTCALL ZEND_JMP_SET_VAR_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 7329: {
1.1.1.2 misho 7330: USE_OPLINE
1.1 misho 7331: zend_free_op free_op1;
1.1.1.2 misho 7332: zval *value, *ret;
1.1 misho 7333:
1.1.1.2 misho 7334: SAVE_OPLINE();
7335: value = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
7336:
7337: if (i_zend_is_true(value)) {
7338: if (IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) {
7339: Z_ADDREF_P(value);
7340: EX_T(opline->result.var).var.ptr = value;
7341: EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
1.1 misho 7342: } else {
1.1.1.2 misho 7343: ALLOC_ZVAL(ret);
7344: INIT_PZVAL_COPY(ret, value);
7345: EX_T(opline->result.var).var.ptr = ret;
7346: EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
7347: if (!1) {
7348: zval_copy_ctor(EX_T(opline->result.var).var.ptr);
7349: }
1.1 misho 7350: }
1.1.1.2 misho 7351:
7352: #if DEBUG_ZEND>=2
7353: printf("Conditional jmp to %d\n", opline->op2.opline_num);
7354: #endif
7355: ZEND_VM_JMP(opline->op2.jmp_addr);
1.1 misho 7356: }
1.1.1.2 misho 7357:
7358: zval_dtor(free_op1.var);
7359: CHECK_EXCEPTION();
1.1 misho 7360: ZEND_VM_NEXT_OPCODE();
7361: }
7362:
1.1.1.2 misho 7363: static int ZEND_FASTCALL ZEND_QM_ASSIGN_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 7364: {
1.1.1.2 misho 7365: USE_OPLINE
1.1 misho 7366: zend_free_op free_op1;
1.1.1.2 misho 7367: zval *value;
1.1 misho 7368:
1.1.1.2 misho 7369: SAVE_OPLINE();
7370: value = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 7371:
1.1.1.2 misho 7372: ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, value);
7373: if (!1) {
7374: zval_copy_ctor(&EX_T(opline->result.var).tmp_var);
1.1 misho 7375: }
7376:
1.1.1.2 misho 7377: CHECK_EXCEPTION();
7378: ZEND_VM_NEXT_OPCODE();
7379: }
1.1 misho 7380:
1.1.1.2 misho 7381: static int ZEND_FASTCALL ZEND_QM_ASSIGN_VAR_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
7382: {
7383: USE_OPLINE
7384: zend_free_op free_op1;
7385: zval *value, *ret;
1.1 misho 7386:
1.1.1.2 misho 7387: SAVE_OPLINE();
7388: value = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 7389:
1.1.1.2 misho 7390: if (IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) {
7391: Z_ADDREF_P(value);
7392: EX_T(opline->result.var).var.ptr = value;
7393: EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
1.1 misho 7394: } else {
1.1.1.2 misho 7395: ALLOC_ZVAL(ret);
7396: INIT_PZVAL_COPY(ret, value);
7397: EX_T(opline->result.var).var.ptr = ret;
7398: EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
7399: if (!1) {
7400: zval_copy_ctor(EX_T(opline->result.var).var.ptr);
7401: }
1.1 misho 7402: }
7403:
1.1.1.2 misho 7404: CHECK_EXCEPTION();
1.1 misho 7405: ZEND_VM_NEXT_OPCODE();
7406: }
7407:
1.1.1.2 misho 7408: static int ZEND_FASTCALL ZEND_INSTANCEOF_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 7409: {
1.1.1.2 misho 7410: USE_OPLINE
7411: zend_free_op free_op1;
7412: zval *expr;
7413: zend_bool result;
1.1 misho 7414:
1.1.1.2 misho 7415: SAVE_OPLINE();
7416: expr = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
7417:
7418: if (Z_TYPE_P(expr) == IS_OBJECT && Z_OBJ_HT_P(expr)->get_class_entry) {
7419: result = instanceof_function(Z_OBJCE_P(expr), EX_T(opline->op2.var).class_entry TSRMLS_CC);
1.1 misho 7420: } else {
1.1.1.2 misho 7421: result = 0;
1.1 misho 7422: }
1.1.1.2 misho 7423: ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, result);
7424: zval_dtor(free_op1.var);
7425: CHECK_EXCEPTION();
7426: ZEND_VM_NEXT_OPCODE();
1.1 misho 7427: }
7428:
1.1.1.2 misho 7429: static int ZEND_FASTCALL ZEND_ADD_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 7430: {
1.1.1.2 misho 7431: USE_OPLINE
7432: zend_free_op free_op1;
1.1 misho 7433:
1.1.1.2 misho 7434: SAVE_OPLINE();
7435: fast_add_function(&EX_T(opline->result.var).tmp_var,
7436: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
7437: opline->op2.zv TSRMLS_CC);
1.1 misho 7438: zval_dtor(free_op1.var);
1.1.1.2 misho 7439:
7440: CHECK_EXCEPTION();
1.1 misho 7441: ZEND_VM_NEXT_OPCODE();
7442: }
7443:
1.1.1.2 misho 7444: static int ZEND_FASTCALL ZEND_SUB_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 7445: {
1.1.1.2 misho 7446: USE_OPLINE
7447: zend_free_op free_op1;
1.1 misho 7448:
1.1.1.2 misho 7449: SAVE_OPLINE();
7450: fast_sub_function(&EX_T(opline->result.var).tmp_var,
7451: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
7452: opline->op2.zv TSRMLS_CC);
1.1 misho 7453: zval_dtor(free_op1.var);
1.1.1.2 misho 7454:
7455: CHECK_EXCEPTION();
1.1 misho 7456: ZEND_VM_NEXT_OPCODE();
7457: }
7458:
1.1.1.2 misho 7459: static int ZEND_FASTCALL ZEND_MUL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 7460: {
1.1.1.2 misho 7461: USE_OPLINE
7462: zend_free_op free_op1;
1.1 misho 7463:
1.1.1.2 misho 7464: SAVE_OPLINE();
7465: fast_mul_function(&EX_T(opline->result.var).tmp_var,
7466: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
7467: opline->op2.zv TSRMLS_CC);
1.1 misho 7468: zval_dtor(free_op1.var);
1.1.1.2 misho 7469:
7470: CHECK_EXCEPTION();
1.1 misho 7471: ZEND_VM_NEXT_OPCODE();
7472: }
7473:
1.1.1.2 misho 7474: static int ZEND_FASTCALL ZEND_DIV_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 7475: {
1.1.1.2 misho 7476: USE_OPLINE
7477: zend_free_op free_op1;
1.1 misho 7478:
1.1.1.2 misho 7479: SAVE_OPLINE();
7480: fast_div_function(&EX_T(opline->result.var).tmp_var,
7481: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
7482: opline->op2.zv TSRMLS_CC);
1.1 misho 7483: zval_dtor(free_op1.var);
1.1.1.2 misho 7484:
7485: CHECK_EXCEPTION();
1.1 misho 7486: ZEND_VM_NEXT_OPCODE();
7487: }
7488:
1.1.1.2 misho 7489: static int ZEND_FASTCALL ZEND_MOD_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 7490: {
1.1.1.2 misho 7491: USE_OPLINE
7492: zend_free_op free_op1;
1.1 misho 7493:
1.1.1.2 misho 7494: SAVE_OPLINE();
7495: fast_mod_function(&EX_T(opline->result.var).tmp_var,
7496: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
7497: opline->op2.zv TSRMLS_CC);
1.1 misho 7498: zval_dtor(free_op1.var);
1.1.1.2 misho 7499:
7500: CHECK_EXCEPTION();
1.1 misho 7501: ZEND_VM_NEXT_OPCODE();
7502: }
7503:
1.1.1.2 misho 7504: static int ZEND_FASTCALL ZEND_SL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 7505: {
1.1.1.2 misho 7506: USE_OPLINE
7507: zend_free_op free_op1;
1.1 misho 7508:
1.1.1.2 misho 7509: SAVE_OPLINE();
7510: shift_left_function(&EX_T(opline->result.var).tmp_var,
7511: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
7512: opline->op2.zv TSRMLS_CC);
1.1 misho 7513: zval_dtor(free_op1.var);
1.1.1.2 misho 7514:
7515: CHECK_EXCEPTION();
1.1 misho 7516: ZEND_VM_NEXT_OPCODE();
7517: }
7518:
1.1.1.2 misho 7519: static int ZEND_FASTCALL ZEND_SR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 7520: {
1.1.1.2 misho 7521: USE_OPLINE
7522: zend_free_op free_op1;
1.1 misho 7523:
1.1.1.2 misho 7524: SAVE_OPLINE();
7525: shift_right_function(&EX_T(opline->result.var).tmp_var,
7526: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
7527: opline->op2.zv TSRMLS_CC);
1.1 misho 7528: zval_dtor(free_op1.var);
1.1.1.2 misho 7529:
7530: CHECK_EXCEPTION();
1.1 misho 7531: ZEND_VM_NEXT_OPCODE();
7532: }
7533:
1.1.1.2 misho 7534: static int ZEND_FASTCALL ZEND_CONCAT_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 7535: {
1.1.1.2 misho 7536: USE_OPLINE
7537: zend_free_op free_op1;
1.1 misho 7538:
1.1.1.2 misho 7539: SAVE_OPLINE();
7540: concat_function(&EX_T(opline->result.var).tmp_var,
7541: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
7542: opline->op2.zv TSRMLS_CC);
1.1 misho 7543: zval_dtor(free_op1.var);
1.1.1.2 misho 7544:
7545: CHECK_EXCEPTION();
1.1 misho 7546: ZEND_VM_NEXT_OPCODE();
7547: }
7548:
1.1.1.2 misho 7549: static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 7550: {
1.1.1.2 misho 7551: USE_OPLINE
7552: zend_free_op free_op1;
1.1 misho 7553:
1.1.1.2 misho 7554: SAVE_OPLINE();
7555: is_identical_function(&EX_T(opline->result.var).tmp_var,
7556: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
7557: opline->op2.zv TSRMLS_CC);
1.1 misho 7558: zval_dtor(free_op1.var);
1.1.1.2 misho 7559:
7560: CHECK_EXCEPTION();
1.1 misho 7561: ZEND_VM_NEXT_OPCODE();
7562: }
7563:
1.1.1.2 misho 7564: static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 7565: {
1.1.1.2 misho 7566: USE_OPLINE
7567: zend_free_op free_op1;
7568: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 7569:
1.1.1.2 misho 7570: SAVE_OPLINE();
1.1 misho 7571: is_identical_function(result,
1.1.1.2 misho 7572: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
7573: opline->op2.zv TSRMLS_CC);
1.1 misho 7574: Z_LVAL_P(result) = !Z_LVAL_P(result);
7575: zval_dtor(free_op1.var);
1.1.1.2 misho 7576:
7577: CHECK_EXCEPTION();
1.1 misho 7578: ZEND_VM_NEXT_OPCODE();
7579: }
7580:
1.1.1.2 misho 7581: static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 7582: {
1.1.1.2 misho 7583: USE_OPLINE
7584: zend_free_op free_op1;
7585: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 7586:
1.1.1.2 misho 7587: SAVE_OPLINE();
7588: ZVAL_BOOL(result, fast_equal_function(result,
7589: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
7590: opline->op2.zv TSRMLS_CC));
1.1 misho 7591: zval_dtor(free_op1.var);
1.1.1.2 misho 7592:
7593: CHECK_EXCEPTION();
1.1 misho 7594: ZEND_VM_NEXT_OPCODE();
7595: }
7596:
1.1.1.2 misho 7597: static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 7598: {
1.1.1.2 misho 7599: USE_OPLINE
7600: zend_free_op free_op1;
7601: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 7602:
1.1.1.2 misho 7603: SAVE_OPLINE();
7604: ZVAL_BOOL(result, fast_not_equal_function(result,
7605: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
7606: opline->op2.zv TSRMLS_CC));
1.1 misho 7607: zval_dtor(free_op1.var);
1.1.1.2 misho 7608:
7609: CHECK_EXCEPTION();
1.1 misho 7610: ZEND_VM_NEXT_OPCODE();
7611: }
7612:
1.1.1.2 misho 7613: static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 7614: {
1.1.1.2 misho 7615: USE_OPLINE
7616: zend_free_op free_op1;
7617: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 7618:
1.1.1.2 misho 7619: SAVE_OPLINE();
7620: ZVAL_BOOL(result, fast_is_smaller_function(result,
7621: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
7622: opline->op2.zv TSRMLS_CC));
1.1 misho 7623: zval_dtor(free_op1.var);
1.1.1.2 misho 7624:
7625: CHECK_EXCEPTION();
1.1 misho 7626: ZEND_VM_NEXT_OPCODE();
7627: }
7628:
1.1.1.2 misho 7629: static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 7630: {
1.1.1.2 misho 7631: USE_OPLINE
7632: zend_free_op free_op1;
7633: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 7634:
1.1.1.2 misho 7635: SAVE_OPLINE();
7636: ZVAL_BOOL(result, fast_is_smaller_or_equal_function(result,
7637: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
7638: opline->op2.zv TSRMLS_CC));
1.1 misho 7639: zval_dtor(free_op1.var);
1.1.1.2 misho 7640:
7641: CHECK_EXCEPTION();
1.1 misho 7642: ZEND_VM_NEXT_OPCODE();
7643: }
7644:
1.1.1.2 misho 7645: static int ZEND_FASTCALL ZEND_BW_OR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 7646: {
1.1.1.2 misho 7647: USE_OPLINE
7648: zend_free_op free_op1;
1.1 misho 7649:
1.1.1.2 misho 7650: SAVE_OPLINE();
7651: bitwise_or_function(&EX_T(opline->result.var).tmp_var,
7652: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
7653: opline->op2.zv TSRMLS_CC);
1.1 misho 7654: zval_dtor(free_op1.var);
1.1.1.2 misho 7655:
7656: CHECK_EXCEPTION();
1.1 misho 7657: ZEND_VM_NEXT_OPCODE();
7658: }
7659:
1.1.1.2 misho 7660: static int ZEND_FASTCALL ZEND_BW_AND_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 7661: {
1.1.1.2 misho 7662: USE_OPLINE
7663: zend_free_op free_op1;
1.1 misho 7664:
1.1.1.2 misho 7665: SAVE_OPLINE();
7666: bitwise_and_function(&EX_T(opline->result.var).tmp_var,
7667: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
7668: opline->op2.zv TSRMLS_CC);
1.1 misho 7669: zval_dtor(free_op1.var);
1.1.1.2 misho 7670:
7671: CHECK_EXCEPTION();
1.1 misho 7672: ZEND_VM_NEXT_OPCODE();
7673: }
7674:
1.1.1.2 misho 7675: static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 7676: {
1.1.1.2 misho 7677: USE_OPLINE
7678: zend_free_op free_op1;
1.1 misho 7679:
1.1.1.2 misho 7680: SAVE_OPLINE();
7681: bitwise_xor_function(&EX_T(opline->result.var).tmp_var,
7682: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
7683: opline->op2.zv TSRMLS_CC);
1.1 misho 7684: zval_dtor(free_op1.var);
1.1.1.2 misho 7685:
7686: CHECK_EXCEPTION();
1.1 misho 7687: ZEND_VM_NEXT_OPCODE();
7688: }
7689:
1.1.1.2 misho 7690: static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 7691: {
1.1.1.2 misho 7692: USE_OPLINE
7693: zend_free_op free_op1;
1.1 misho 7694:
1.1.1.2 misho 7695: SAVE_OPLINE();
7696: boolean_xor_function(&EX_T(opline->result.var).tmp_var,
7697: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
7698: opline->op2.zv TSRMLS_CC);
1.1 misho 7699: zval_dtor(free_op1.var);
1.1.1.2 misho 7700:
7701: CHECK_EXCEPTION();
1.1 misho 7702: ZEND_VM_NEXT_OPCODE();
7703: }
7704:
1.1.1.2 misho 7705: static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_CONST(int type, ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 7706: {
1.1.1.2 misho 7707: USE_OPLINE
7708: zend_free_op free_op1;
7709: zval *varname;
7710: zval **retval;
7711: zval tmp_varname;
7712: HashTable *target_symbol_table;
7713: ulong hash_value;
1.1 misho 7714:
1.1.1.2 misho 7715: SAVE_OPLINE();
7716: varname = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 7717:
1.1.1.2 misho 7718: if (IS_TMP_VAR != IS_CONST && UNEXPECTED(Z_TYPE_P(varname) != IS_STRING)) {
7719: ZVAL_COPY_VALUE(&tmp_varname, varname);
7720: zval_copy_ctor(&tmp_varname);
7721: Z_SET_REFCOUNT(tmp_varname, 1);
7722: Z_UNSET_ISREF(tmp_varname);
7723: convert_to_string(&tmp_varname);
7724: varname = &tmp_varname;
1.1 misho 7725: }
7726:
1.1.1.2 misho 7727: if (IS_CONST != IS_UNUSED) {
7728: zend_class_entry *ce;
1.1 misho 7729:
1.1.1.2 misho 7730: if (IS_CONST == IS_CONST) {
7731: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
7732: ce = CACHED_PTR(opline->op2.literal->cache_slot);
7733: } else {
7734: ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
7735: if (UNEXPECTED(ce == NULL)) {
7736: if (IS_TMP_VAR != IS_CONST && varname == &tmp_varname) {
7737: zval_dtor(&tmp_varname);
7738: }
7739: zval_dtor(free_op1.var);
7740: CHECK_EXCEPTION();
7741: ZEND_VM_NEXT_OPCODE();
7742: }
7743: CACHE_PTR(opline->op2.literal->cache_slot, ce);
7744: }
7745: } else {
7746: ce = EX_T(opline->op2.var).class_entry;
7747: }
7748: retval = zend_std_get_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 0, ((IS_TMP_VAR == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
7749: zval_dtor(free_op1.var);
7750: } else {
7751: target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
7752: /*
7753: if (!target_symbol_table) {
7754: CHECK_EXCEPTION();
7755: ZEND_VM_NEXT_OPCODE();
7756: }
7757: */
7758: if (IS_TMP_VAR == IS_CONST) {
7759: hash_value = Z_HASH_P(varname);
7760: } else if (IS_INTERNED(Z_STRVAL_P(varname))) {
7761: hash_value = INTERNED_HASH(Z_STRVAL_P(varname));
7762: } else {
7763: hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1);
1.1 misho 7764: }
7765:
1.1.1.2 misho 7766: if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) {
7767: switch (type) {
7768: case BP_VAR_R:
7769: case BP_VAR_UNSET:
7770: zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_P(varname));
7771: /* break missing intentionally */
7772: case BP_VAR_IS:
7773: retval = &EG(uninitialized_zval_ptr);
7774: break;
7775: case BP_VAR_RW:
7776: zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_P(varname));
7777: /* break missing intentionally */
7778: case BP_VAR_W:
7779: Z_ADDREF_P(&EG(uninitialized_zval));
7780: zend_hash_quick_update(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, &EG(uninitialized_zval_ptr), sizeof(zval *), (void **) &retval);
7781: break;
7782: EMPTY_SWITCH_DEFAULT_CASE()
7783: }
7784: }
7785: switch (opline->extended_value & ZEND_FETCH_TYPE_MASK) {
7786: case ZEND_FETCH_GLOBAL:
7787: if (IS_TMP_VAR != IS_TMP_VAR) {
7788: zval_dtor(free_op1.var);
7789: }
7790: break;
7791: case ZEND_FETCH_LOCAL:
7792: zval_dtor(free_op1.var);
7793: break;
7794: case ZEND_FETCH_STATIC:
7795: zval_update_constant(retval, (void*) 1 TSRMLS_CC);
7796: break;
7797: case ZEND_FETCH_GLOBAL_LOCK:
7798: if (IS_TMP_VAR == IS_VAR && !free_op1.var) {
7799: PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
7800: }
7801: break;
7802: }
1.1 misho 7803: }
7804:
1.1.1.2 misho 7805:
7806: if (IS_TMP_VAR != IS_CONST && varname == &tmp_varname) {
7807: zval_dtor(&tmp_varname);
7808: }
7809: if (opline->extended_value & ZEND_FETCH_MAKE_REF) {
7810: SEPARATE_ZVAL_TO_MAKE_IS_REF(retval);
7811: }
7812: PZVAL_LOCK(*retval);
7813: switch (type) {
7814: case BP_VAR_R:
7815: case BP_VAR_IS:
7816: AI_SET_PTR(&EX_T(opline->result.var), *retval);
7817: break;
7818: case BP_VAR_UNSET: {
7819: zend_free_op free_res;
7820:
7821: PZVAL_UNLOCK(*retval, &free_res);
7822: if (retval != &EG(uninitialized_zval_ptr)) {
7823: SEPARATE_ZVAL_IF_NOT_REF(retval);
7824: }
7825: PZVAL_LOCK(*retval);
7826: FREE_OP_VAR_PTR(free_res);
7827: }
7828: /* break missing intentionally */
7829: default:
7830: EX_T(opline->result.var).var.ptr_ptr = retval;
7831: break;
7832: }
7833: CHECK_EXCEPTION();
1.1 misho 7834: ZEND_VM_NEXT_OPCODE();
7835: }
7836:
1.1.1.2 misho 7837: static int ZEND_FASTCALL ZEND_FETCH_R_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 7838: {
1.1.1.2 misho 7839: return zend_fetch_var_address_helper_SPEC_TMP_CONST(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
7840: }
1.1 misho 7841:
1.1.1.2 misho 7842: static int ZEND_FASTCALL ZEND_FETCH_W_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
7843: {
7844: return zend_fetch_var_address_helper_SPEC_TMP_CONST(BP_VAR_W, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
7845: }
1.1 misho 7846:
1.1.1.2 misho 7847: static int ZEND_FASTCALL ZEND_FETCH_RW_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
7848: {
7849: return zend_fetch_var_address_helper_SPEC_TMP_CONST(BP_VAR_RW, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
7850: }
1.1 misho 7851:
1.1.1.2 misho 7852: static int ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
7853: {
7854: USE_OPLINE
1.1 misho 7855:
1.1.1.2 misho 7856: return zend_fetch_var_address_helper_SPEC_TMP_CONST(ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
7857: }
1.1 misho 7858:
1.1.1.2 misho 7859: static int ZEND_FASTCALL ZEND_FETCH_UNSET_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
7860: {
7861: return zend_fetch_var_address_helper_SPEC_TMP_CONST(BP_VAR_UNSET, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
7862: }
1.1 misho 7863:
1.1.1.2 misho 7864: static int ZEND_FASTCALL ZEND_FETCH_IS_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
7865: {
7866: return zend_fetch_var_address_helper_SPEC_TMP_CONST(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
7867: }
1.1 misho 7868:
1.1.1.2 misho 7869: static int ZEND_FASTCALL ZEND_FETCH_DIM_TMP_VAR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
7870: {
7871: USE_OPLINE
7872: zend_free_op free_op1;
7873: zval *container;
1.1 misho 7874:
1.1.1.2 misho 7875: SAVE_OPLINE();
7876: container = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 7877:
1.1.1.2 misho 7878: if (UNEXPECTED(Z_TYPE_P(container) != IS_ARRAY)) {
7879: PZVAL_LOCK(&EG(uninitialized_zval));
7880: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
1.1 misho 7881: } else {
7882:
1.1.1.2 misho 7883: zval *value = *zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), opline->op2.zv, IS_CONST, BP_VAR_R TSRMLS_CC);
7884:
7885: PZVAL_LOCK(value);
7886: AI_SET_PTR(&EX_T(opline->result.var), value);
1.1 misho 7887:
1.1.1.2 misho 7888: }
7889: CHECK_EXCEPTION();
1.1 misho 7890: ZEND_VM_NEXT_OPCODE();
7891: }
7892:
1.1.1.2 misho 7893: static int ZEND_FASTCALL ZEND_ADD_CHAR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 7894: {
1.1.1.2 misho 7895: USE_OPLINE
7896: zval *str = &EX_T(opline->result.var).tmp_var;
1.1 misho 7897:
1.1.1.2 misho 7898: SAVE_OPLINE();
1.1 misho 7899:
1.1.1.2 misho 7900: if (IS_TMP_VAR == IS_UNUSED) {
7901: /* Initialize for erealloc in add_char_to_string */
7902: Z_STRVAL_P(str) = NULL;
7903: Z_STRLEN_P(str) = 0;
7904: Z_TYPE_P(str) = IS_STRING;
7905:
7906: INIT_PZVAL(str);
1.1 misho 7907: }
1.1.1.2 misho 7908:
7909: add_char_to_string(str, str, opline->op2.zv);
7910:
7911: /* FREE_OP is missing intentionally here - we're always working on the same temporary variable */
7912: /*CHECK_EXCEPTION();*/
1.1 misho 7913: ZEND_VM_NEXT_OPCODE();
7914: }
7915:
1.1.1.2 misho 7916: static int ZEND_FASTCALL ZEND_ADD_STRING_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 7917: {
1.1.1.2 misho 7918: USE_OPLINE
7919: zval *str = &EX_T(opline->result.var).tmp_var;
1.1 misho 7920:
1.1.1.2 misho 7921: SAVE_OPLINE();
1.1 misho 7922:
1.1.1.2 misho 7923: if (IS_TMP_VAR == IS_UNUSED) {
7924: /* Initialize for erealloc in add_string_to_string */
7925: Z_STRVAL_P(str) = NULL;
7926: Z_STRLEN_P(str) = 0;
7927: Z_TYPE_P(str) = IS_STRING;
7928:
7929: INIT_PZVAL(str);
7930: }
7931:
7932: add_string_to_string(str, str, opline->op2.zv);
7933:
7934: /* FREE_OP is missing intentionally here - we're always working on the same temporary variable */
7935: /*CHECK_EXCEPTION();*/
7936: ZEND_VM_NEXT_OPCODE();
7937: }
7938:
7939: static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
7940: {
7941: USE_OPLINE
7942: zval *function_name;
7943: char *function_name_strval;
7944: int function_name_strlen;
7945: zend_free_op free_op1;
7946:
7947: SAVE_OPLINE();
7948: zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
7949:
7950: function_name = opline->op2.zv;
7951:
7952: if (IS_CONST != IS_CONST &&
7953: UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
7954: zend_error_noreturn(E_ERROR, "Method name must be a string");
7955: }
7956:
7957: function_name_strval = Z_STRVAL_P(function_name);
7958: function_name_strlen = Z_STRLEN_P(function_name);
7959:
7960: EX(object) = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
7961:
7962: if (EXPECTED(EX(object) != NULL) &&
7963: EXPECTED(Z_TYPE_P(EX(object)) == IS_OBJECT)) {
7964: EX(called_scope) = Z_OBJCE_P(EX(object));
7965:
7966: if (IS_CONST != IS_CONST ||
7967: (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope))) == NULL) {
7968: zval *object = EX(object);
7969:
7970: if (UNEXPECTED(Z_OBJ_HT_P(EX(object))->get_method == NULL)) {
7971: zend_error_noreturn(E_ERROR, "Object does not support method calls");
7972: }
7973:
7974: /* First, locate the function. */
7975: EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen, ((IS_CONST == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC);
7976: if (UNEXPECTED(EX(fbc) == NULL)) {
7977: zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval);
7978: }
7979: if (IS_CONST == IS_CONST &&
7980: EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) &&
7981: EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) &&
7982: EXPECTED(EX(object) == object)) {
7983: CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope), EX(fbc));
7984: }
7985: }
1.1 misho 7986: } else {
1.1.1.2 misho 7987: zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval);
7988: }
7989:
7990: if ((EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) != 0) {
7991: EX(object) = NULL;
7992: } else {
7993: if (!PZVAL_IS_REF(EX(object))) {
7994: Z_ADDREF_P(EX(object)); /* For $this pointer */
7995: } else {
7996: zval *this_ptr;
7997: ALLOC_ZVAL(this_ptr);
7998: INIT_PZVAL_COPY(this_ptr, EX(object));
7999: zval_copy_ctor(this_ptr);
8000: EX(object) = this_ptr;
8001: }
1.1 misho 8002: }
8003:
8004:
1.1.1.2 misho 8005: CHECK_EXCEPTION();
8006: ZEND_VM_NEXT_OPCODE();
8007: }
8008:
8009: static int ZEND_FASTCALL ZEND_CASE_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
8010: {
8011: USE_OPLINE
8012: zend_free_op free_op1;
8013:
8014: SAVE_OPLINE();
8015: if (IS_TMP_VAR==IS_VAR) {
8016: PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
8017: }
8018: is_equal_function(&EX_T(opline->result.var).tmp_var,
8019: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
8020: opline->op2.zv TSRMLS_CC);
8021:
8022: CHECK_EXCEPTION();
8023: ZEND_VM_NEXT_OPCODE();
8024: }
8025:
8026: static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
8027: {
8028: USE_OPLINE
8029: zend_free_op free_op1;
8030: zval *expr_ptr;
8031:
8032: SAVE_OPLINE();
8033: if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && opline->extended_value) {
8034: zval **expr_ptr_ptr = NULL;
8035:
8036: if (IS_TMP_VAR == IS_VAR && UNEXPECTED(expr_ptr_ptr == NULL)) {
8037: zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
8038: }
8039: SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr);
8040: expr_ptr = *expr_ptr_ptr;
8041: Z_ADDREF_P(expr_ptr);
8042: } else {
8043: expr_ptr=_get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
8044: if (1) { /* temporary variable */
8045: zval *new_expr;
8046:
8047: ALLOC_ZVAL(new_expr);
8048: INIT_PZVAL_COPY(new_expr, expr_ptr);
8049: expr_ptr = new_expr;
8050: } else if (IS_TMP_VAR == IS_CONST || PZVAL_IS_REF(expr_ptr)) {
1.1 misho 8051: zval *new_expr;
8052:
8053: ALLOC_ZVAL(new_expr);
8054: INIT_PZVAL_COPY(new_expr, expr_ptr);
8055: expr_ptr = new_expr;
8056: zendi_zval_copy_ctor(*expr_ptr);
8057: } else {
8058: Z_ADDREF_P(expr_ptr);
8059: }
8060: }
1.1.1.2 misho 8061:
8062: if (IS_CONST != IS_UNUSED) {
8063:
8064: zval *offset = opline->op2.zv;
8065: ulong hval;
8066:
1.1 misho 8067: switch (Z_TYPE_P(offset)) {
8068: case IS_DOUBLE:
1.1.1.2 misho 8069: hval = zend_dval_to_lval(Z_DVAL_P(offset));
8070: goto num_index;
1.1 misho 8071: case IS_LONG:
8072: case IS_BOOL:
1.1.1.2 misho 8073: hval = Z_LVAL_P(offset);
8074: num_index:
8075: zend_hash_index_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), hval, &expr_ptr, sizeof(zval *), NULL);
1.1 misho 8076: break;
8077: case IS_STRING:
1.1.1.2 misho 8078: if (IS_CONST == IS_CONST) {
8079: hval = Z_HASH_P(offset);
8080: } else {
8081: ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
8082: if (IS_INTERNED(Z_STRVAL_P(offset))) {
8083: hval = INTERNED_HASH(Z_STRVAL_P(offset));
8084: } else {
8085: hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
8086: }
8087: }
8088: zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
1.1 misho 8089: break;
8090: case IS_NULL:
1.1.1.2 misho 8091: zend_hash_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
1.1 misho 8092: break;
8093: default:
8094: zend_error(E_WARNING, "Illegal offset type");
8095: zval_ptr_dtor(&expr_ptr);
8096: /* do nothing */
8097: break;
8098: }
1.1.1.2 misho 8099:
1.1 misho 8100: } else {
1.1.1.2 misho 8101: zend_hash_next_index_insert(Z_ARRVAL(EX_T(opline->result.var).tmp_var), &expr_ptr, sizeof(zval *), NULL);
1.1 misho 8102: }
1.1.1.2 misho 8103: if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && opline->extended_value) {
1.1 misho 8104:
8105: } else {
8106:
8107: }
1.1.1.2 misho 8108: CHECK_EXCEPTION();
1.1 misho 8109: ZEND_VM_NEXT_OPCODE();
8110: }
8111:
1.1.1.2 misho 8112: static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 8113: {
1.1.1.2 misho 8114: USE_OPLINE
1.1 misho 8115:
1.1.1.2 misho 8116: array_init(&EX_T(opline->result.var).tmp_var);
1.1 misho 8117: if (IS_TMP_VAR == IS_UNUSED) {
8118: ZEND_VM_NEXT_OPCODE();
8119: #if 0 || IS_TMP_VAR != IS_UNUSED
8120: } else {
1.1.1.2 misho 8121: return ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
1.1 misho 8122: #endif
8123: }
8124: }
8125:
1.1.1.2 misho 8126: static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 8127: {
1.1.1.2 misho 8128: USE_OPLINE
8129: zval tmp, *varname;
8130: HashTable *target_symbol_table;
8131: zend_free_op free_op1;
8132:
8133: SAVE_OPLINE();
8134: if (IS_TMP_VAR == IS_CV &&
8135: IS_CONST == IS_UNUSED &&
8136: (opline->extended_value & ZEND_QUICK_SET)) {
8137: if (EG(active_symbol_table)) {
8138: zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.var);
8139:
8140: zend_delete_variable(EX(prev_execute_data), EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value TSRMLS_CC);
8141: EX_CV(opline->op1.var) = NULL;
8142: } else if (EX_CV(opline->op1.var)) {
8143: zval_ptr_dtor(EX_CV(opline->op1.var));
8144: EX_CV(opline->op1.var) = NULL;
8145: }
8146: CHECK_EXCEPTION();
8147: ZEND_VM_NEXT_OPCODE();
8148: }
8149:
8150: varname = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
8151:
8152: if (IS_TMP_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
8153: ZVAL_COPY_VALUE(&tmp, varname);
8154: zval_copy_ctor(&tmp);
8155: convert_to_string(&tmp);
8156: varname = &tmp;
8157: } else if (IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) {
8158: Z_ADDREF_P(varname);
8159: }
8160:
8161: if (IS_CONST != IS_UNUSED) {
8162: zend_class_entry *ce;
8163:
8164: if (IS_CONST == IS_CONST) {
8165: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
8166: ce = CACHED_PTR(opline->op2.literal->cache_slot);
8167: } else {
8168: ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
1.1.1.4 ! misho 8169: if (UNEXPECTED(EG(exception) != NULL)) {
1.1.1.2 misho 8170: if (IS_TMP_VAR != IS_CONST && varname == &tmp) {
8171: zval_dtor(&tmp);
8172: } else if (IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) {
8173: zval_ptr_dtor(&varname);
8174: }
8175: zval_dtor(free_op1.var);
1.1.1.4 ! misho 8176: HANDLE_EXCEPTION();
! 8177: }
! 8178: if (UNEXPECTED(ce == NULL)) {
! 8179: zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op2.zv));
1.1.1.2 misho 8180: }
8181: CACHE_PTR(opline->op2.literal->cache_slot, ce);
8182: }
8183: } else {
8184: ce = EX_T(opline->op2.var).class_entry;
8185: }
8186: zend_std_unset_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), ((IS_TMP_VAR == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
8187: } else {
8188: ulong hash_value = zend_inline_hash_func(varname->value.str.val, varname->value.str.len+1);
8189:
8190: target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
8191: zend_delete_variable(execute_data, target_symbol_table, varname->value.str.val, varname->value.str.len+1, hash_value TSRMLS_CC);
8192: }
1.1 misho 8193:
1.1.1.2 misho 8194: if (IS_TMP_VAR != IS_CONST && varname == &tmp) {
8195: zval_dtor(&tmp);
8196: } else if (IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) {
8197: zval_ptr_dtor(&varname);
8198: }
1.1 misho 8199: zval_dtor(free_op1.var);
1.1.1.2 misho 8200: CHECK_EXCEPTION();
1.1 misho 8201: ZEND_VM_NEXT_OPCODE();
8202: }
8203:
1.1.1.2 misho 8204: static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 8205: {
1.1.1.2 misho 8206: USE_OPLINE
8207: zval **value;
8208: zend_bool isset = 1;
1.1 misho 8209:
1.1.1.2 misho 8210: SAVE_OPLINE();
8211: if (IS_TMP_VAR == IS_CV &&
8212: IS_CONST == IS_UNUSED &&
8213: (opline->extended_value & ZEND_QUICK_SET)) {
8214: if (EX_CV(opline->op1.var)) {
8215: value = EX_CV(opline->op1.var);
8216: } else if (EG(active_symbol_table)) {
8217: zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.var);
8218:
8219: if (zend_hash_quick_find(EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value, (void **) &value) == FAILURE) {
8220: isset = 0;
8221: }
8222: } else {
8223: isset = 0;
8224: }
8225: } else {
8226: HashTable *target_symbol_table;
8227: zend_free_op free_op1;
8228: zval tmp, *varname = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
8229:
8230: if (IS_TMP_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
8231: ZVAL_COPY_VALUE(&tmp, varname);
8232: zval_copy_ctor(&tmp);
8233: convert_to_string(&tmp);
8234: varname = &tmp;
8235: }
8236:
8237: if (IS_CONST != IS_UNUSED) {
8238: zend_class_entry *ce;
8239:
8240: if (IS_CONST == IS_CONST) {
8241: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
8242: ce = CACHED_PTR(opline->op2.literal->cache_slot);
8243: } else {
8244: ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
8245: if (UNEXPECTED(ce == NULL)) {
8246: CHECK_EXCEPTION();
8247: ZEND_VM_NEXT_OPCODE();
8248: }
8249: CACHE_PTR(opline->op2.literal->cache_slot, ce);
8250: }
8251: } else {
8252: ce = EX_T(opline->op2.var).class_entry;
8253: }
8254: value = zend_std_get_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 1, ((IS_TMP_VAR == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
8255: if (!value) {
8256: isset = 0;
8257: }
8258: } else {
8259: target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
8260: if (zend_hash_find(target_symbol_table, varname->value.str.val, varname->value.str.len+1, (void **) &value) == FAILURE) {
8261: isset = 0;
8262: }
8263: }
8264:
8265: if (IS_TMP_VAR != IS_CONST && varname == &tmp) {
8266: zval_dtor(&tmp);
8267: }
8268: zval_dtor(free_op1.var);
8269: }
8270:
8271: if (opline->extended_value & ZEND_ISSET) {
8272: if (isset && Z_TYPE_PP(value) != IS_NULL) {
8273: ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 1);
8274: } else {
8275: ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
8276: }
8277: } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
8278: if (!isset || !i_zend_is_true(*value)) {
8279: ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 1);
8280: } else {
8281: ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
8282: }
8283: }
8284:
8285: CHECK_EXCEPTION();
1.1 misho 8286: ZEND_VM_NEXT_OPCODE();
8287: }
8288:
1.1.1.2 misho 8289: static int ZEND_FASTCALL ZEND_ADD_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 8290: {
1.1.1.2 misho 8291: USE_OPLINE
1.1 misho 8292: zend_free_op free_op1, free_op2;
8293:
1.1.1.2 misho 8294: SAVE_OPLINE();
8295: fast_add_function(&EX_T(opline->result.var).tmp_var,
8296: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
8297: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 8298: zval_dtor(free_op1.var);
1.1.1.2 misho 8299: zval_dtor(free_op2.var);
8300: CHECK_EXCEPTION();
1.1 misho 8301: ZEND_VM_NEXT_OPCODE();
8302: }
8303:
1.1.1.2 misho 8304: static int ZEND_FASTCALL ZEND_SUB_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 8305: {
1.1.1.2 misho 8306: USE_OPLINE
1.1 misho 8307: zend_free_op free_op1, free_op2;
8308:
1.1.1.2 misho 8309: SAVE_OPLINE();
8310: fast_sub_function(&EX_T(opline->result.var).tmp_var,
8311: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
8312: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 8313: zval_dtor(free_op1.var);
1.1.1.2 misho 8314: zval_dtor(free_op2.var);
8315: CHECK_EXCEPTION();
1.1 misho 8316: ZEND_VM_NEXT_OPCODE();
8317: }
8318:
1.1.1.2 misho 8319: static int ZEND_FASTCALL ZEND_MUL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 8320: {
1.1.1.2 misho 8321: USE_OPLINE
1.1 misho 8322: zend_free_op free_op1, free_op2;
8323:
1.1.1.2 misho 8324: SAVE_OPLINE();
8325: fast_mul_function(&EX_T(opline->result.var).tmp_var,
8326: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
8327: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 8328: zval_dtor(free_op1.var);
1.1.1.2 misho 8329: zval_dtor(free_op2.var);
8330: CHECK_EXCEPTION();
1.1 misho 8331: ZEND_VM_NEXT_OPCODE();
8332: }
8333:
1.1.1.2 misho 8334: static int ZEND_FASTCALL ZEND_DIV_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 8335: {
1.1.1.2 misho 8336: USE_OPLINE
1.1 misho 8337: zend_free_op free_op1, free_op2;
8338:
1.1.1.2 misho 8339: SAVE_OPLINE();
8340: fast_div_function(&EX_T(opline->result.var).tmp_var,
8341: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
8342: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 8343: zval_dtor(free_op1.var);
1.1.1.2 misho 8344: zval_dtor(free_op2.var);
8345: CHECK_EXCEPTION();
1.1 misho 8346: ZEND_VM_NEXT_OPCODE();
8347: }
8348:
1.1.1.2 misho 8349: static int ZEND_FASTCALL ZEND_MOD_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 8350: {
1.1.1.2 misho 8351: USE_OPLINE
1.1 misho 8352: zend_free_op free_op1, free_op2;
8353:
1.1.1.2 misho 8354: SAVE_OPLINE();
8355: fast_mod_function(&EX_T(opline->result.var).tmp_var,
8356: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
8357: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 8358: zval_dtor(free_op1.var);
1.1.1.2 misho 8359: zval_dtor(free_op2.var);
8360: CHECK_EXCEPTION();
1.1 misho 8361: ZEND_VM_NEXT_OPCODE();
8362: }
8363:
1.1.1.2 misho 8364: static int ZEND_FASTCALL ZEND_SL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 8365: {
1.1.1.2 misho 8366: USE_OPLINE
1.1 misho 8367: zend_free_op free_op1, free_op2;
8368:
1.1.1.2 misho 8369: SAVE_OPLINE();
8370: shift_left_function(&EX_T(opline->result.var).tmp_var,
8371: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
8372: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 8373: zval_dtor(free_op1.var);
1.1.1.2 misho 8374: zval_dtor(free_op2.var);
8375: CHECK_EXCEPTION();
1.1 misho 8376: ZEND_VM_NEXT_OPCODE();
8377: }
8378:
1.1.1.2 misho 8379: static int ZEND_FASTCALL ZEND_SR_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 8380: {
1.1.1.2 misho 8381: USE_OPLINE
1.1 misho 8382: zend_free_op free_op1, free_op2;
8383:
1.1.1.2 misho 8384: SAVE_OPLINE();
8385: shift_right_function(&EX_T(opline->result.var).tmp_var,
8386: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
8387: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 8388: zval_dtor(free_op1.var);
1.1.1.2 misho 8389: zval_dtor(free_op2.var);
8390: CHECK_EXCEPTION();
1.1 misho 8391: ZEND_VM_NEXT_OPCODE();
8392: }
8393:
1.1.1.2 misho 8394: static int ZEND_FASTCALL ZEND_CONCAT_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 8395: {
1.1.1.2 misho 8396: USE_OPLINE
1.1 misho 8397: zend_free_op free_op1, free_op2;
8398:
1.1.1.2 misho 8399: SAVE_OPLINE();
8400: concat_function(&EX_T(opline->result.var).tmp_var,
8401: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
8402: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 8403: zval_dtor(free_op1.var);
1.1.1.2 misho 8404: zval_dtor(free_op2.var);
8405: CHECK_EXCEPTION();
1.1 misho 8406: ZEND_VM_NEXT_OPCODE();
8407: }
8408:
1.1.1.2 misho 8409: static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 8410: {
1.1.1.2 misho 8411: USE_OPLINE
1.1 misho 8412: zend_free_op free_op1, free_op2;
8413:
1.1.1.2 misho 8414: SAVE_OPLINE();
8415: is_identical_function(&EX_T(opline->result.var).tmp_var,
8416: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
8417: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 8418: zval_dtor(free_op1.var);
1.1.1.2 misho 8419: zval_dtor(free_op2.var);
8420: CHECK_EXCEPTION();
1.1 misho 8421: ZEND_VM_NEXT_OPCODE();
8422: }
8423:
1.1.1.2 misho 8424: static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 8425: {
1.1.1.2 misho 8426: USE_OPLINE
1.1 misho 8427: zend_free_op free_op1, free_op2;
1.1.1.2 misho 8428: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 8429:
1.1.1.2 misho 8430: SAVE_OPLINE();
8431: is_identical_function(result,
8432: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
8433: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
8434: Z_LVAL_P(result) = !Z_LVAL_P(result);
1.1 misho 8435: zval_dtor(free_op1.var);
1.1.1.2 misho 8436: zval_dtor(free_op2.var);
8437: CHECK_EXCEPTION();
1.1 misho 8438: ZEND_VM_NEXT_OPCODE();
8439: }
8440:
1.1.1.2 misho 8441: static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 8442: {
1.1.1.2 misho 8443: USE_OPLINE
1.1 misho 8444: zend_free_op free_op1, free_op2;
1.1.1.2 misho 8445: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 8446:
1.1.1.2 misho 8447: SAVE_OPLINE();
8448: ZVAL_BOOL(result, fast_equal_function(result,
8449: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
8450: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC));
1.1 misho 8451: zval_dtor(free_op1.var);
1.1.1.2 misho 8452: zval_dtor(free_op2.var);
8453: CHECK_EXCEPTION();
1.1 misho 8454: ZEND_VM_NEXT_OPCODE();
8455: }
8456:
1.1.1.2 misho 8457: static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 8458: {
1.1.1.2 misho 8459: USE_OPLINE
1.1 misho 8460: zend_free_op free_op1, free_op2;
1.1.1.2 misho 8461: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 8462:
1.1.1.2 misho 8463: SAVE_OPLINE();
8464: ZVAL_BOOL(result, fast_not_equal_function(result,
8465: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
8466: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC));
1.1 misho 8467: zval_dtor(free_op1.var);
1.1.1.2 misho 8468: zval_dtor(free_op2.var);
8469: CHECK_EXCEPTION();
1.1 misho 8470: ZEND_VM_NEXT_OPCODE();
8471: }
8472:
1.1.1.2 misho 8473: static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 8474: {
1.1.1.2 misho 8475: USE_OPLINE
1.1 misho 8476: zend_free_op free_op1, free_op2;
1.1.1.2 misho 8477: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 8478:
1.1.1.2 misho 8479: SAVE_OPLINE();
8480: ZVAL_BOOL(result, fast_is_smaller_function(result,
8481: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
8482: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC));
1.1 misho 8483: zval_dtor(free_op1.var);
1.1.1.2 misho 8484: zval_dtor(free_op2.var);
8485: CHECK_EXCEPTION();
1.1 misho 8486: ZEND_VM_NEXT_OPCODE();
8487: }
8488:
1.1.1.2 misho 8489: static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 8490: {
1.1.1.2 misho 8491: USE_OPLINE
1.1 misho 8492: zend_free_op free_op1, free_op2;
1.1.1.2 misho 8493: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 8494:
1.1.1.2 misho 8495: SAVE_OPLINE();
8496: ZVAL_BOOL(result, fast_is_smaller_or_equal_function(result,
8497: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
8498: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC));
1.1 misho 8499: zval_dtor(free_op1.var);
1.1.1.2 misho 8500: zval_dtor(free_op2.var);
8501: CHECK_EXCEPTION();
1.1 misho 8502: ZEND_VM_NEXT_OPCODE();
8503: }
8504:
1.1.1.2 misho 8505: static int ZEND_FASTCALL ZEND_BW_OR_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 8506: {
1.1.1.2 misho 8507: USE_OPLINE
1.1 misho 8508: zend_free_op free_op1, free_op2;
8509:
1.1.1.2 misho 8510: SAVE_OPLINE();
8511: bitwise_or_function(&EX_T(opline->result.var).tmp_var,
8512: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
8513: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 8514: zval_dtor(free_op1.var);
1.1.1.2 misho 8515: zval_dtor(free_op2.var);
8516: CHECK_EXCEPTION();
1.1 misho 8517: ZEND_VM_NEXT_OPCODE();
8518: }
8519:
1.1.1.2 misho 8520: static int ZEND_FASTCALL ZEND_BW_AND_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 8521: {
1.1.1.2 misho 8522: USE_OPLINE
1.1 misho 8523: zend_free_op free_op1, free_op2;
8524:
1.1.1.2 misho 8525: SAVE_OPLINE();
8526: bitwise_and_function(&EX_T(opline->result.var).tmp_var,
8527: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
8528: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 8529: zval_dtor(free_op1.var);
1.1.1.2 misho 8530: zval_dtor(free_op2.var);
8531: CHECK_EXCEPTION();
1.1 misho 8532: ZEND_VM_NEXT_OPCODE();
8533: }
8534:
1.1.1.2 misho 8535: static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
8536: {
8537: USE_OPLINE
8538: zend_free_op free_op1, free_op2;
8539:
8540: SAVE_OPLINE();
8541: bitwise_xor_function(&EX_T(opline->result.var).tmp_var,
8542: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
8543: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
8544: zval_dtor(free_op1.var);
8545: zval_dtor(free_op2.var);
8546: CHECK_EXCEPTION();
8547: ZEND_VM_NEXT_OPCODE();
8548: }
8549:
8550: static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
8551: {
8552: USE_OPLINE
8553: zend_free_op free_op1, free_op2;
8554:
8555: SAVE_OPLINE();
8556: boolean_xor_function(&EX_T(opline->result.var).tmp_var,
8557: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
8558: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
8559: zval_dtor(free_op1.var);
8560: zval_dtor(free_op2.var);
8561: CHECK_EXCEPTION();
8562: ZEND_VM_NEXT_OPCODE();
8563: }
8564:
8565: static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 8566: {
1.1.1.2 misho 8567: USE_OPLINE
1.1 misho 8568: zend_free_op free_op2;
1.1.1.2 misho 8569: zval *str = &EX_T(opline->result.var).tmp_var;
8570: zval *var;
1.1 misho 8571: zval var_copy;
8572: int use_copy = 0;
8573:
1.1.1.2 misho 8574: SAVE_OPLINE();
8575: var = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
8576:
1.1 misho 8577: if (IS_TMP_VAR == IS_UNUSED) {
8578: /* Initialize for erealloc in add_string_to_string */
8579: Z_STRVAL_P(str) = NULL;
8580: Z_STRLEN_P(str) = 0;
8581: Z_TYPE_P(str) = IS_STRING;
8582:
8583: INIT_PZVAL(str);
8584: }
8585:
1.1.1.2 misho 8586: if (Z_TYPE_P(var) != IS_STRING) {
8587: zend_make_printable_zval(var, &var_copy, &use_copy);
8588:
8589: if (use_copy) {
8590: var = &var_copy;
8591: }
8592: }
8593: add_string_to_string(str, str, var);
8594:
8595: if (use_copy) {
8596: zval_dtor(var);
8597: }
8598: /* original comment, possibly problematic:
8599: * FREE_OP is missing intentionally here - we're always working on the same temporary variable
8600: * (Zeev): I don't think it's problematic, we only use variables
8601: * which aren't affected by FREE_OP(Ts, )'s anyway, unless they're
8602: * string offsets or overloaded objects
8603: */
8604: zval_dtor(free_op2.var);
8605:
8606: CHECK_EXCEPTION();
8607: ZEND_VM_NEXT_OPCODE();
8608: }
8609:
8610: static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
8611: {
8612: USE_OPLINE
8613: zval *function_name;
8614: char *function_name_strval;
8615: int function_name_strlen;
8616: zend_free_op free_op1, free_op2;
8617:
8618: SAVE_OPLINE();
8619: zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
8620:
8621: function_name = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
8622:
8623: if (IS_TMP_VAR != IS_CONST &&
8624: UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
8625: zend_error_noreturn(E_ERROR, "Method name must be a string");
8626: }
8627:
8628: function_name_strval = Z_STRVAL_P(function_name);
8629: function_name_strlen = Z_STRLEN_P(function_name);
8630:
8631: EX(object) = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
8632:
8633: if (EXPECTED(EX(object) != NULL) &&
8634: EXPECTED(Z_TYPE_P(EX(object)) == IS_OBJECT)) {
8635: EX(called_scope) = Z_OBJCE_P(EX(object));
8636:
8637: if (IS_TMP_VAR != IS_CONST ||
8638: (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope))) == NULL) {
8639: zval *object = EX(object);
8640:
8641: if (UNEXPECTED(Z_OBJ_HT_P(EX(object))->get_method == NULL)) {
8642: zend_error_noreturn(E_ERROR, "Object does not support method calls");
8643: }
8644:
8645: /* First, locate the function. */
8646: EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen, ((IS_TMP_VAR == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC);
8647: if (UNEXPECTED(EX(fbc) == NULL)) {
8648: zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval);
8649: }
8650: if (IS_TMP_VAR == IS_CONST &&
8651: EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) &&
8652: EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) &&
8653: EXPECTED(EX(object) == object)) {
8654: CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope), EX(fbc));
8655: }
8656: }
8657: } else {
8658: zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval);
8659: }
8660:
8661: if ((EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) != 0) {
8662: EX(object) = NULL;
8663: } else {
8664: if (!PZVAL_IS_REF(EX(object))) {
8665: Z_ADDREF_P(EX(object)); /* For $this pointer */
8666: } else {
8667: zval *this_ptr;
8668: ALLOC_ZVAL(this_ptr);
8669: INIT_PZVAL_COPY(this_ptr, EX(object));
8670: zval_copy_ctor(this_ptr);
8671: EX(object) = this_ptr;
8672: }
8673: }
8674:
8675: zval_dtor(free_op2.var);
8676:
8677: CHECK_EXCEPTION();
8678: ZEND_VM_NEXT_OPCODE();
8679: }
8680:
8681: static int ZEND_FASTCALL ZEND_CASE_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
8682: {
8683: USE_OPLINE
8684: zend_free_op free_op1, free_op2;
8685:
8686: SAVE_OPLINE();
8687: if (IS_TMP_VAR==IS_VAR) {
8688: PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
8689: }
8690: is_equal_function(&EX_T(opline->result.var).tmp_var,
8691: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
8692: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
8693:
8694: zval_dtor(free_op2.var);
8695: CHECK_EXCEPTION();
8696: ZEND_VM_NEXT_OPCODE();
8697: }
8698:
8699: static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
8700: {
8701: USE_OPLINE
8702: zend_free_op free_op1;
8703: zval *expr_ptr;
8704:
8705: SAVE_OPLINE();
8706: if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && opline->extended_value) {
8707: zval **expr_ptr_ptr = NULL;
8708:
8709: if (IS_TMP_VAR == IS_VAR && UNEXPECTED(expr_ptr_ptr == NULL)) {
8710: zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
8711: }
8712: SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr);
8713: expr_ptr = *expr_ptr_ptr;
8714: Z_ADDREF_P(expr_ptr);
8715: } else {
8716: expr_ptr=_get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
8717: if (1) { /* temporary variable */
8718: zval *new_expr;
8719:
8720: ALLOC_ZVAL(new_expr);
8721: INIT_PZVAL_COPY(new_expr, expr_ptr);
8722: expr_ptr = new_expr;
8723: } else if (IS_TMP_VAR == IS_CONST || PZVAL_IS_REF(expr_ptr)) {
8724: zval *new_expr;
8725:
8726: ALLOC_ZVAL(new_expr);
8727: INIT_PZVAL_COPY(new_expr, expr_ptr);
8728: expr_ptr = new_expr;
8729: zendi_zval_copy_ctor(*expr_ptr);
8730: } else {
8731: Z_ADDREF_P(expr_ptr);
8732: }
8733: }
8734:
8735: if (IS_TMP_VAR != IS_UNUSED) {
8736: zend_free_op free_op2;
8737: zval *offset = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
8738: ulong hval;
8739:
8740: switch (Z_TYPE_P(offset)) {
8741: case IS_DOUBLE:
8742: hval = zend_dval_to_lval(Z_DVAL_P(offset));
8743: goto num_index;
8744: case IS_LONG:
8745: case IS_BOOL:
8746: hval = Z_LVAL_P(offset);
8747: num_index:
8748: zend_hash_index_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), hval, &expr_ptr, sizeof(zval *), NULL);
8749: break;
8750: case IS_STRING:
8751: if (IS_TMP_VAR == IS_CONST) {
8752: hval = Z_HASH_P(offset);
8753: } else {
8754: ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
8755: if (IS_INTERNED(Z_STRVAL_P(offset))) {
8756: hval = INTERNED_HASH(Z_STRVAL_P(offset));
8757: } else {
8758: hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
8759: }
8760: }
8761: zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
8762: break;
8763: case IS_NULL:
8764: zend_hash_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
8765: break;
8766: default:
8767: zend_error(E_WARNING, "Illegal offset type");
8768: zval_ptr_dtor(&expr_ptr);
8769: /* do nothing */
8770: break;
8771: }
8772: zval_dtor(free_op2.var);
8773: } else {
8774: zend_hash_next_index_insert(Z_ARRVAL(EX_T(opline->result.var).tmp_var), &expr_ptr, sizeof(zval *), NULL);
8775: }
8776: if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && opline->extended_value) {
8777:
8778: } else {
8779:
8780: }
8781: CHECK_EXCEPTION();
8782: ZEND_VM_NEXT_OPCODE();
8783: }
8784:
8785: static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
8786: {
8787: USE_OPLINE
8788:
8789: array_init(&EX_T(opline->result.var).tmp_var);
8790: if (IS_TMP_VAR == IS_UNUSED) {
8791: ZEND_VM_NEXT_OPCODE();
8792: #if 0 || IS_TMP_VAR != IS_UNUSED
8793: } else {
8794: return ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
8795: #endif
8796: }
8797: }
8798:
8799: static int ZEND_FASTCALL ZEND_ADD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
8800: {
8801: USE_OPLINE
8802: zend_free_op free_op1, free_op2;
8803:
8804: SAVE_OPLINE();
8805: fast_add_function(&EX_T(opline->result.var).tmp_var,
8806: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
8807: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
8808: zval_dtor(free_op1.var);
8809: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
8810: CHECK_EXCEPTION();
8811: ZEND_VM_NEXT_OPCODE();
8812: }
8813:
8814: static int ZEND_FASTCALL ZEND_SUB_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
8815: {
8816: USE_OPLINE
8817: zend_free_op free_op1, free_op2;
8818:
8819: SAVE_OPLINE();
8820: fast_sub_function(&EX_T(opline->result.var).tmp_var,
8821: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
8822: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
8823: zval_dtor(free_op1.var);
8824: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
8825: CHECK_EXCEPTION();
8826: ZEND_VM_NEXT_OPCODE();
8827: }
8828:
8829: static int ZEND_FASTCALL ZEND_MUL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
8830: {
8831: USE_OPLINE
8832: zend_free_op free_op1, free_op2;
8833:
8834: SAVE_OPLINE();
8835: fast_mul_function(&EX_T(opline->result.var).tmp_var,
8836: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
8837: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
8838: zval_dtor(free_op1.var);
8839: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
8840: CHECK_EXCEPTION();
8841: ZEND_VM_NEXT_OPCODE();
8842: }
8843:
8844: static int ZEND_FASTCALL ZEND_DIV_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
8845: {
8846: USE_OPLINE
8847: zend_free_op free_op1, free_op2;
8848:
8849: SAVE_OPLINE();
8850: fast_div_function(&EX_T(opline->result.var).tmp_var,
8851: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
8852: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
8853: zval_dtor(free_op1.var);
8854: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
8855: CHECK_EXCEPTION();
8856: ZEND_VM_NEXT_OPCODE();
8857: }
8858:
8859: static int ZEND_FASTCALL ZEND_MOD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
8860: {
8861: USE_OPLINE
8862: zend_free_op free_op1, free_op2;
8863:
8864: SAVE_OPLINE();
8865: fast_mod_function(&EX_T(opline->result.var).tmp_var,
8866: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
8867: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
8868: zval_dtor(free_op1.var);
8869: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
8870: CHECK_EXCEPTION();
8871: ZEND_VM_NEXT_OPCODE();
8872: }
8873:
8874: static int ZEND_FASTCALL ZEND_SL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
8875: {
8876: USE_OPLINE
8877: zend_free_op free_op1, free_op2;
8878:
8879: SAVE_OPLINE();
8880: shift_left_function(&EX_T(opline->result.var).tmp_var,
8881: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
8882: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
8883: zval_dtor(free_op1.var);
8884: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
8885: CHECK_EXCEPTION();
8886: ZEND_VM_NEXT_OPCODE();
8887: }
8888:
8889: static int ZEND_FASTCALL ZEND_SR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
8890: {
8891: USE_OPLINE
8892: zend_free_op free_op1, free_op2;
8893:
8894: SAVE_OPLINE();
8895: shift_right_function(&EX_T(opline->result.var).tmp_var,
8896: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
8897: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
8898: zval_dtor(free_op1.var);
8899: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
8900: CHECK_EXCEPTION();
8901: ZEND_VM_NEXT_OPCODE();
8902: }
8903:
8904: static int ZEND_FASTCALL ZEND_CONCAT_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
8905: {
8906: USE_OPLINE
8907: zend_free_op free_op1, free_op2;
8908:
8909: SAVE_OPLINE();
8910: concat_function(&EX_T(opline->result.var).tmp_var,
8911: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
8912: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
8913: zval_dtor(free_op1.var);
8914: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
8915: CHECK_EXCEPTION();
8916: ZEND_VM_NEXT_OPCODE();
8917: }
8918:
8919: static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
8920: {
8921: USE_OPLINE
8922: zend_free_op free_op1, free_op2;
8923:
8924: SAVE_OPLINE();
8925: is_identical_function(&EX_T(opline->result.var).tmp_var,
8926: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
8927: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
8928: zval_dtor(free_op1.var);
8929: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
8930: CHECK_EXCEPTION();
8931: ZEND_VM_NEXT_OPCODE();
8932: }
8933:
8934: static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
8935: {
8936: USE_OPLINE
8937: zend_free_op free_op1, free_op2;
8938: zval *result = &EX_T(opline->result.var).tmp_var;
8939:
8940: SAVE_OPLINE();
8941: is_identical_function(result,
8942: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
8943: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
8944: Z_LVAL_P(result) = !Z_LVAL_P(result);
8945: zval_dtor(free_op1.var);
8946: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
8947: CHECK_EXCEPTION();
8948: ZEND_VM_NEXT_OPCODE();
8949: }
8950:
8951: static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
8952: {
8953: USE_OPLINE
8954: zend_free_op free_op1, free_op2;
8955: zval *result = &EX_T(opline->result.var).tmp_var;
8956:
8957: SAVE_OPLINE();
8958: ZVAL_BOOL(result, fast_equal_function(result,
8959: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
8960: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC));
8961: zval_dtor(free_op1.var);
8962: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
8963: CHECK_EXCEPTION();
8964: ZEND_VM_NEXT_OPCODE();
8965: }
8966:
8967: static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
8968: {
8969: USE_OPLINE
8970: zend_free_op free_op1, free_op2;
8971: zval *result = &EX_T(opline->result.var).tmp_var;
8972:
8973: SAVE_OPLINE();
8974: ZVAL_BOOL(result, fast_not_equal_function(result,
8975: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
8976: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC));
8977: zval_dtor(free_op1.var);
8978: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
8979: CHECK_EXCEPTION();
8980: ZEND_VM_NEXT_OPCODE();
8981: }
8982:
8983: static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
8984: {
8985: USE_OPLINE
8986: zend_free_op free_op1, free_op2;
8987: zval *result = &EX_T(opline->result.var).tmp_var;
8988:
8989: SAVE_OPLINE();
8990: ZVAL_BOOL(result, fast_is_smaller_function(result,
8991: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
8992: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC));
8993: zval_dtor(free_op1.var);
8994: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
8995: CHECK_EXCEPTION();
8996: ZEND_VM_NEXT_OPCODE();
8997: }
8998:
8999: static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
9000: {
9001: USE_OPLINE
9002: zend_free_op free_op1, free_op2;
9003: zval *result = &EX_T(opline->result.var).tmp_var;
9004:
9005: SAVE_OPLINE();
9006: ZVAL_BOOL(result, fast_is_smaller_or_equal_function(result,
9007: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
9008: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC));
9009: zval_dtor(free_op1.var);
9010: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
9011: CHECK_EXCEPTION();
9012: ZEND_VM_NEXT_OPCODE();
9013: }
9014:
9015: static int ZEND_FASTCALL ZEND_BW_OR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
9016: {
9017: USE_OPLINE
9018: zend_free_op free_op1, free_op2;
9019:
9020: SAVE_OPLINE();
9021: bitwise_or_function(&EX_T(opline->result.var).tmp_var,
9022: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
9023: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
9024: zval_dtor(free_op1.var);
9025: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
9026: CHECK_EXCEPTION();
9027: ZEND_VM_NEXT_OPCODE();
9028: }
9029:
9030: static int ZEND_FASTCALL ZEND_BW_AND_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
9031: {
9032: USE_OPLINE
9033: zend_free_op free_op1, free_op2;
9034:
9035: SAVE_OPLINE();
9036: bitwise_and_function(&EX_T(opline->result.var).tmp_var,
9037: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
9038: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
9039: zval_dtor(free_op1.var);
9040: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
9041: CHECK_EXCEPTION();
9042: ZEND_VM_NEXT_OPCODE();
9043: }
9044:
9045: static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
9046: {
9047: USE_OPLINE
9048: zend_free_op free_op1, free_op2;
9049:
9050: SAVE_OPLINE();
9051: bitwise_xor_function(&EX_T(opline->result.var).tmp_var,
9052: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
9053: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
9054: zval_dtor(free_op1.var);
9055: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
9056: CHECK_EXCEPTION();
9057: ZEND_VM_NEXT_OPCODE();
9058: }
9059:
9060: static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
9061: {
9062: USE_OPLINE
9063: zend_free_op free_op1, free_op2;
9064:
9065: SAVE_OPLINE();
9066: boolean_xor_function(&EX_T(opline->result.var).tmp_var,
9067: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
9068: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
9069: zval_dtor(free_op1.var);
9070: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
9071: CHECK_EXCEPTION();
9072: ZEND_VM_NEXT_OPCODE();
9073: }
9074:
9075: static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_VAR(int type, ZEND_OPCODE_HANDLER_ARGS)
9076: {
9077: USE_OPLINE
9078: zend_free_op free_op1;
9079: zval *varname;
9080: zval **retval;
9081: zval tmp_varname;
9082: HashTable *target_symbol_table;
9083: ulong hash_value;
9084:
9085: SAVE_OPLINE();
9086: varname = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
9087:
9088: if (IS_TMP_VAR != IS_CONST && UNEXPECTED(Z_TYPE_P(varname) != IS_STRING)) {
9089: ZVAL_COPY_VALUE(&tmp_varname, varname);
9090: zval_copy_ctor(&tmp_varname);
9091: Z_SET_REFCOUNT(tmp_varname, 1);
9092: Z_UNSET_ISREF(tmp_varname);
9093: convert_to_string(&tmp_varname);
9094: varname = &tmp_varname;
9095: }
9096:
9097: if (IS_VAR != IS_UNUSED) {
9098: zend_class_entry *ce;
9099:
9100: if (IS_VAR == IS_CONST) {
9101: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
9102: ce = CACHED_PTR(opline->op2.literal->cache_slot);
9103: } else {
9104: ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
9105: if (UNEXPECTED(ce == NULL)) {
9106: if (IS_TMP_VAR != IS_CONST && varname == &tmp_varname) {
9107: zval_dtor(&tmp_varname);
9108: }
9109: zval_dtor(free_op1.var);
9110: CHECK_EXCEPTION();
9111: ZEND_VM_NEXT_OPCODE();
9112: }
9113: CACHE_PTR(opline->op2.literal->cache_slot, ce);
9114: }
9115: } else {
9116: ce = EX_T(opline->op2.var).class_entry;
9117: }
9118: retval = zend_std_get_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 0, ((IS_TMP_VAR == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
9119: zval_dtor(free_op1.var);
9120: } else {
9121: target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
9122: /*
9123: if (!target_symbol_table) {
9124: CHECK_EXCEPTION();
9125: ZEND_VM_NEXT_OPCODE();
9126: }
9127: */
9128: if (IS_TMP_VAR == IS_CONST) {
9129: hash_value = Z_HASH_P(varname);
9130: } else if (IS_INTERNED(Z_STRVAL_P(varname))) {
9131: hash_value = INTERNED_HASH(Z_STRVAL_P(varname));
9132: } else {
9133: hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1);
9134: }
9135:
9136: if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) {
9137: switch (type) {
9138: case BP_VAR_R:
9139: case BP_VAR_UNSET:
9140: zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_P(varname));
9141: /* break missing intentionally */
9142: case BP_VAR_IS:
9143: retval = &EG(uninitialized_zval_ptr);
9144: break;
9145: case BP_VAR_RW:
9146: zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_P(varname));
9147: /* break missing intentionally */
9148: case BP_VAR_W:
9149: Z_ADDREF_P(&EG(uninitialized_zval));
9150: zend_hash_quick_update(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, &EG(uninitialized_zval_ptr), sizeof(zval *), (void **) &retval);
9151: break;
9152: EMPTY_SWITCH_DEFAULT_CASE()
9153: }
9154: }
9155: switch (opline->extended_value & ZEND_FETCH_TYPE_MASK) {
9156: case ZEND_FETCH_GLOBAL:
9157: if (IS_TMP_VAR != IS_TMP_VAR) {
9158: zval_dtor(free_op1.var);
9159: }
9160: break;
9161: case ZEND_FETCH_LOCAL:
9162: zval_dtor(free_op1.var);
9163: break;
9164: case ZEND_FETCH_STATIC:
9165: zval_update_constant(retval, (void*) 1 TSRMLS_CC);
9166: break;
9167: case ZEND_FETCH_GLOBAL_LOCK:
9168: if (IS_TMP_VAR == IS_VAR && !free_op1.var) {
9169: PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
9170: }
9171: break;
9172: }
9173: }
9174:
9175:
9176: if (IS_TMP_VAR != IS_CONST && varname == &tmp_varname) {
9177: zval_dtor(&tmp_varname);
9178: }
9179: if (opline->extended_value & ZEND_FETCH_MAKE_REF) {
9180: SEPARATE_ZVAL_TO_MAKE_IS_REF(retval);
9181: }
9182: PZVAL_LOCK(*retval);
9183: switch (type) {
9184: case BP_VAR_R:
9185: case BP_VAR_IS:
9186: AI_SET_PTR(&EX_T(opline->result.var), *retval);
9187: break;
9188: case BP_VAR_UNSET: {
9189: zend_free_op free_res;
9190:
9191: PZVAL_UNLOCK(*retval, &free_res);
9192: if (retval != &EG(uninitialized_zval_ptr)) {
9193: SEPARATE_ZVAL_IF_NOT_REF(retval);
9194: }
9195: PZVAL_LOCK(*retval);
9196: FREE_OP_VAR_PTR(free_res);
9197: }
9198: /* break missing intentionally */
9199: default:
9200: EX_T(opline->result.var).var.ptr_ptr = retval;
9201: break;
9202: }
9203: CHECK_EXCEPTION();
9204: ZEND_VM_NEXT_OPCODE();
9205: }
9206:
9207: static int ZEND_FASTCALL ZEND_FETCH_R_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
9208: {
9209: return zend_fetch_var_address_helper_SPEC_TMP_VAR(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
9210: }
9211:
9212: static int ZEND_FASTCALL ZEND_FETCH_W_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
9213: {
9214: return zend_fetch_var_address_helper_SPEC_TMP_VAR(BP_VAR_W, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
9215: }
9216:
9217: static int ZEND_FASTCALL ZEND_FETCH_RW_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
9218: {
9219: return zend_fetch_var_address_helper_SPEC_TMP_VAR(BP_VAR_RW, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
9220: }
9221:
9222: static int ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
9223: {
9224: USE_OPLINE
9225:
9226: return zend_fetch_var_address_helper_SPEC_TMP_VAR(ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
9227: }
9228:
9229: static int ZEND_FASTCALL ZEND_FETCH_UNSET_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
9230: {
9231: return zend_fetch_var_address_helper_SPEC_TMP_VAR(BP_VAR_UNSET, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
9232: }
9233:
9234: static int ZEND_FASTCALL ZEND_FETCH_IS_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
9235: {
9236: return zend_fetch_var_address_helper_SPEC_TMP_VAR(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
9237: }
9238:
9239: static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
9240: {
9241: USE_OPLINE
9242: zend_free_op free_op2;
9243: zval *str = &EX_T(opline->result.var).tmp_var;
9244: zval *var;
9245: zval var_copy;
9246: int use_copy = 0;
9247:
9248: SAVE_OPLINE();
9249: var = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
9250:
9251: if (IS_TMP_VAR == IS_UNUSED) {
9252: /* Initialize for erealloc in add_string_to_string */
9253: Z_STRVAL_P(str) = NULL;
9254: Z_STRLEN_P(str) = 0;
9255: Z_TYPE_P(str) = IS_STRING;
9256:
9257: INIT_PZVAL(str);
9258: }
9259:
9260: if (Z_TYPE_P(var) != IS_STRING) {
9261: zend_make_printable_zval(var, &var_copy, &use_copy);
9262:
9263: if (use_copy) {
9264: var = &var_copy;
9265: }
9266: }
9267: add_string_to_string(str, str, var);
9268:
9269: if (use_copy) {
9270: zval_dtor(var);
9271: }
9272: /* original comment, possibly problematic:
9273: * FREE_OP is missing intentionally here - we're always working on the same temporary variable
9274: * (Zeev): I don't think it's problematic, we only use variables
9275: * which aren't affected by FREE_OP(Ts, )'s anyway, unless they're
9276: * string offsets or overloaded objects
9277: */
9278: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
9279:
9280: CHECK_EXCEPTION();
9281: ZEND_VM_NEXT_OPCODE();
9282: }
9283:
9284: static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
9285: {
9286: USE_OPLINE
9287: zval *function_name;
9288: char *function_name_strval;
9289: int function_name_strlen;
9290: zend_free_op free_op1, free_op2;
9291:
9292: SAVE_OPLINE();
9293: zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
9294:
9295: function_name = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
9296:
9297: if (IS_VAR != IS_CONST &&
9298: UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
9299: zend_error_noreturn(E_ERROR, "Method name must be a string");
9300: }
9301:
9302: function_name_strval = Z_STRVAL_P(function_name);
9303: function_name_strlen = Z_STRLEN_P(function_name);
9304:
9305: EX(object) = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
9306:
9307: if (EXPECTED(EX(object) != NULL) &&
9308: EXPECTED(Z_TYPE_P(EX(object)) == IS_OBJECT)) {
9309: EX(called_scope) = Z_OBJCE_P(EX(object));
9310:
9311: if (IS_VAR != IS_CONST ||
9312: (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope))) == NULL) {
9313: zval *object = EX(object);
9314:
9315: if (UNEXPECTED(Z_OBJ_HT_P(EX(object))->get_method == NULL)) {
9316: zend_error_noreturn(E_ERROR, "Object does not support method calls");
9317: }
9318:
9319: /* First, locate the function. */
9320: EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen, ((IS_VAR == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC);
9321: if (UNEXPECTED(EX(fbc) == NULL)) {
9322: zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval);
9323: }
9324: if (IS_VAR == IS_CONST &&
9325: EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) &&
9326: EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) &&
9327: EXPECTED(EX(object) == object)) {
9328: CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope), EX(fbc));
9329: }
9330: }
9331: } else {
9332: zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval);
9333: }
9334:
9335: if ((EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) != 0) {
9336: EX(object) = NULL;
9337: } else {
9338: if (!PZVAL_IS_REF(EX(object))) {
9339: Z_ADDREF_P(EX(object)); /* For $this pointer */
9340: } else {
9341: zval *this_ptr;
9342: ALLOC_ZVAL(this_ptr);
9343: INIT_PZVAL_COPY(this_ptr, EX(object));
9344: zval_copy_ctor(this_ptr);
9345: EX(object) = this_ptr;
9346: }
9347: }
9348:
9349: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
9350:
9351: CHECK_EXCEPTION();
9352: ZEND_VM_NEXT_OPCODE();
9353: }
9354:
9355: static int ZEND_FASTCALL ZEND_CASE_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
9356: {
9357: USE_OPLINE
9358: zend_free_op free_op1, free_op2;
9359:
9360: SAVE_OPLINE();
9361: if (IS_TMP_VAR==IS_VAR) {
9362: PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
9363: }
9364: is_equal_function(&EX_T(opline->result.var).tmp_var,
9365: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
9366: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
9367:
9368: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
9369: CHECK_EXCEPTION();
9370: ZEND_VM_NEXT_OPCODE();
9371: }
9372:
9373: static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
9374: {
9375: USE_OPLINE
9376: zend_free_op free_op1;
9377: zval *expr_ptr;
9378:
9379: SAVE_OPLINE();
9380: if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && opline->extended_value) {
9381: zval **expr_ptr_ptr = NULL;
9382:
9383: if (IS_TMP_VAR == IS_VAR && UNEXPECTED(expr_ptr_ptr == NULL)) {
9384: zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
9385: }
9386: SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr);
9387: expr_ptr = *expr_ptr_ptr;
9388: Z_ADDREF_P(expr_ptr);
9389: } else {
9390: expr_ptr=_get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
9391: if (1) { /* temporary variable */
9392: zval *new_expr;
9393:
9394: ALLOC_ZVAL(new_expr);
9395: INIT_PZVAL_COPY(new_expr, expr_ptr);
9396: expr_ptr = new_expr;
9397: } else if (IS_TMP_VAR == IS_CONST || PZVAL_IS_REF(expr_ptr)) {
9398: zval *new_expr;
9399:
9400: ALLOC_ZVAL(new_expr);
9401: INIT_PZVAL_COPY(new_expr, expr_ptr);
9402: expr_ptr = new_expr;
9403: zendi_zval_copy_ctor(*expr_ptr);
9404: } else {
9405: Z_ADDREF_P(expr_ptr);
9406: }
9407: }
9408:
9409: if (IS_VAR != IS_UNUSED) {
9410: zend_free_op free_op2;
9411: zval *offset = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
9412: ulong hval;
9413:
9414: switch (Z_TYPE_P(offset)) {
9415: case IS_DOUBLE:
9416: hval = zend_dval_to_lval(Z_DVAL_P(offset));
9417: goto num_index;
9418: case IS_LONG:
9419: case IS_BOOL:
9420: hval = Z_LVAL_P(offset);
9421: num_index:
9422: zend_hash_index_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), hval, &expr_ptr, sizeof(zval *), NULL);
9423: break;
9424: case IS_STRING:
9425: if (IS_VAR == IS_CONST) {
9426: hval = Z_HASH_P(offset);
9427: } else {
9428: ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
9429: if (IS_INTERNED(Z_STRVAL_P(offset))) {
9430: hval = INTERNED_HASH(Z_STRVAL_P(offset));
9431: } else {
9432: hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
9433: }
9434: }
9435: zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
9436: break;
9437: case IS_NULL:
9438: zend_hash_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
9439: break;
9440: default:
9441: zend_error(E_WARNING, "Illegal offset type");
9442: zval_ptr_dtor(&expr_ptr);
9443: /* do nothing */
9444: break;
9445: }
9446: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
9447: } else {
9448: zend_hash_next_index_insert(Z_ARRVAL(EX_T(opline->result.var).tmp_var), &expr_ptr, sizeof(zval *), NULL);
9449: }
9450: if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && opline->extended_value) {
9451:
9452: } else {
9453:
9454: }
9455: CHECK_EXCEPTION();
9456: ZEND_VM_NEXT_OPCODE();
9457: }
9458:
9459: static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
9460: {
9461: USE_OPLINE
9462:
9463: array_init(&EX_T(opline->result.var).tmp_var);
9464: if (IS_TMP_VAR == IS_UNUSED) {
9465: ZEND_VM_NEXT_OPCODE();
9466: #if 0 || IS_TMP_VAR != IS_UNUSED
9467: } else {
9468: return ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
9469: #endif
9470: }
9471: }
9472:
9473: static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
9474: {
9475: USE_OPLINE
9476: zval tmp, *varname;
9477: HashTable *target_symbol_table;
9478: zend_free_op free_op1;
9479:
9480: SAVE_OPLINE();
9481: if (IS_TMP_VAR == IS_CV &&
9482: IS_VAR == IS_UNUSED &&
9483: (opline->extended_value & ZEND_QUICK_SET)) {
9484: if (EG(active_symbol_table)) {
9485: zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.var);
9486:
9487: zend_delete_variable(EX(prev_execute_data), EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value TSRMLS_CC);
9488: EX_CV(opline->op1.var) = NULL;
9489: } else if (EX_CV(opline->op1.var)) {
9490: zval_ptr_dtor(EX_CV(opline->op1.var));
9491: EX_CV(opline->op1.var) = NULL;
9492: }
9493: CHECK_EXCEPTION();
9494: ZEND_VM_NEXT_OPCODE();
9495: }
9496:
9497: varname = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
9498:
9499: if (IS_TMP_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
9500: ZVAL_COPY_VALUE(&tmp, varname);
9501: zval_copy_ctor(&tmp);
9502: convert_to_string(&tmp);
9503: varname = &tmp;
9504: } else if (IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) {
9505: Z_ADDREF_P(varname);
9506: }
9507:
9508: if (IS_VAR != IS_UNUSED) {
9509: zend_class_entry *ce;
9510:
9511: if (IS_VAR == IS_CONST) {
9512: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
9513: ce = CACHED_PTR(opline->op2.literal->cache_slot);
9514: } else {
9515: ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
1.1.1.4 ! misho 9516: if (UNEXPECTED(EG(exception) != NULL)) {
1.1.1.2 misho 9517: if (IS_TMP_VAR != IS_CONST && varname == &tmp) {
9518: zval_dtor(&tmp);
9519: } else if (IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) {
9520: zval_ptr_dtor(&varname);
9521: }
9522: zval_dtor(free_op1.var);
1.1.1.4 ! misho 9523: HANDLE_EXCEPTION();
! 9524: }
! 9525: if (UNEXPECTED(ce == NULL)) {
! 9526: zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op2.zv));
1.1.1.2 misho 9527: }
9528: CACHE_PTR(opline->op2.literal->cache_slot, ce);
9529: }
9530: } else {
9531: ce = EX_T(opline->op2.var).class_entry;
9532: }
9533: zend_std_unset_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), ((IS_TMP_VAR == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
9534: } else {
9535: ulong hash_value = zend_inline_hash_func(varname->value.str.val, varname->value.str.len+1);
9536:
9537: target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
9538: zend_delete_variable(execute_data, target_symbol_table, varname->value.str.val, varname->value.str.len+1, hash_value TSRMLS_CC);
9539: }
9540:
9541: if (IS_TMP_VAR != IS_CONST && varname == &tmp) {
9542: zval_dtor(&tmp);
9543: } else if (IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) {
9544: zval_ptr_dtor(&varname);
9545: }
9546: zval_dtor(free_op1.var);
9547: CHECK_EXCEPTION();
9548: ZEND_VM_NEXT_OPCODE();
9549: }
9550:
9551: static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
9552: {
9553: USE_OPLINE
9554: zval **value;
9555: zend_bool isset = 1;
9556:
9557: SAVE_OPLINE();
9558: if (IS_TMP_VAR == IS_CV &&
9559: IS_VAR == IS_UNUSED &&
9560: (opline->extended_value & ZEND_QUICK_SET)) {
9561: if (EX_CV(opline->op1.var)) {
9562: value = EX_CV(opline->op1.var);
9563: } else if (EG(active_symbol_table)) {
9564: zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.var);
9565:
9566: if (zend_hash_quick_find(EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value, (void **) &value) == FAILURE) {
9567: isset = 0;
9568: }
9569: } else {
9570: isset = 0;
9571: }
9572: } else {
9573: HashTable *target_symbol_table;
9574: zend_free_op free_op1;
9575: zval tmp, *varname = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
9576:
9577: if (IS_TMP_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
9578: ZVAL_COPY_VALUE(&tmp, varname);
9579: zval_copy_ctor(&tmp);
9580: convert_to_string(&tmp);
9581: varname = &tmp;
9582: }
9583:
9584: if (IS_VAR != IS_UNUSED) {
9585: zend_class_entry *ce;
9586:
9587: if (IS_VAR == IS_CONST) {
9588: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
9589: ce = CACHED_PTR(opline->op2.literal->cache_slot);
9590: } else {
9591: ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
9592: if (UNEXPECTED(ce == NULL)) {
9593: CHECK_EXCEPTION();
9594: ZEND_VM_NEXT_OPCODE();
9595: }
9596: CACHE_PTR(opline->op2.literal->cache_slot, ce);
9597: }
9598: } else {
9599: ce = EX_T(opline->op2.var).class_entry;
9600: }
9601: value = zend_std_get_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 1, ((IS_TMP_VAR == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
9602: if (!value) {
9603: isset = 0;
9604: }
9605: } else {
9606: target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
9607: if (zend_hash_find(target_symbol_table, varname->value.str.val, varname->value.str.len+1, (void **) &value) == FAILURE) {
9608: isset = 0;
9609: }
9610: }
9611:
9612: if (IS_TMP_VAR != IS_CONST && varname == &tmp) {
9613: zval_dtor(&tmp);
9614: }
9615: zval_dtor(free_op1.var);
9616: }
9617:
9618: if (opline->extended_value & ZEND_ISSET) {
9619: if (isset && Z_TYPE_PP(value) != IS_NULL) {
9620: ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 1);
9621: } else {
9622: ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
9623: }
9624: } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
9625: if (!isset || !i_zend_is_true(*value)) {
9626: ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 1);
9627: } else {
9628: ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
9629: }
9630: }
9631:
9632: CHECK_EXCEPTION();
9633: ZEND_VM_NEXT_OPCODE();
9634: }
9635:
9636: static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_UNUSED(int type, ZEND_OPCODE_HANDLER_ARGS)
9637: {
9638: USE_OPLINE
9639: zend_free_op free_op1;
9640: zval *varname;
9641: zval **retval;
9642: zval tmp_varname;
9643: HashTable *target_symbol_table;
9644: ulong hash_value;
9645:
9646: SAVE_OPLINE();
9647: varname = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
9648:
9649: if (IS_TMP_VAR != IS_CONST && UNEXPECTED(Z_TYPE_P(varname) != IS_STRING)) {
9650: ZVAL_COPY_VALUE(&tmp_varname, varname);
9651: zval_copy_ctor(&tmp_varname);
9652: Z_SET_REFCOUNT(tmp_varname, 1);
9653: Z_UNSET_ISREF(tmp_varname);
9654: convert_to_string(&tmp_varname);
9655: varname = &tmp_varname;
9656: }
9657:
9658: if (IS_UNUSED != IS_UNUSED) {
9659: zend_class_entry *ce;
9660:
9661: if (IS_UNUSED == IS_CONST) {
9662: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
9663: ce = CACHED_PTR(opline->op2.literal->cache_slot);
9664: } else {
9665: ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
9666: if (UNEXPECTED(ce == NULL)) {
9667: if (IS_TMP_VAR != IS_CONST && varname == &tmp_varname) {
9668: zval_dtor(&tmp_varname);
9669: }
9670: zval_dtor(free_op1.var);
9671: CHECK_EXCEPTION();
9672: ZEND_VM_NEXT_OPCODE();
9673: }
9674: CACHE_PTR(opline->op2.literal->cache_slot, ce);
9675: }
9676: } else {
9677: ce = EX_T(opline->op2.var).class_entry;
9678: }
9679: retval = zend_std_get_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 0, ((IS_TMP_VAR == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
9680: zval_dtor(free_op1.var);
9681: } else {
9682: target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
9683: /*
9684: if (!target_symbol_table) {
9685: CHECK_EXCEPTION();
9686: ZEND_VM_NEXT_OPCODE();
9687: }
9688: */
9689: if (IS_TMP_VAR == IS_CONST) {
9690: hash_value = Z_HASH_P(varname);
9691: } else if (IS_INTERNED(Z_STRVAL_P(varname))) {
9692: hash_value = INTERNED_HASH(Z_STRVAL_P(varname));
9693: } else {
9694: hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1);
9695: }
9696:
9697: if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) {
9698: switch (type) {
9699: case BP_VAR_R:
9700: case BP_VAR_UNSET:
9701: zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_P(varname));
9702: /* break missing intentionally */
9703: case BP_VAR_IS:
9704: retval = &EG(uninitialized_zval_ptr);
9705: break;
9706: case BP_VAR_RW:
9707: zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_P(varname));
9708: /* break missing intentionally */
9709: case BP_VAR_W:
9710: Z_ADDREF_P(&EG(uninitialized_zval));
9711: zend_hash_quick_update(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, &EG(uninitialized_zval_ptr), sizeof(zval *), (void **) &retval);
9712: break;
9713: EMPTY_SWITCH_DEFAULT_CASE()
9714: }
9715: }
9716: switch (opline->extended_value & ZEND_FETCH_TYPE_MASK) {
9717: case ZEND_FETCH_GLOBAL:
9718: if (IS_TMP_VAR != IS_TMP_VAR) {
9719: zval_dtor(free_op1.var);
9720: }
9721: break;
9722: case ZEND_FETCH_LOCAL:
9723: zval_dtor(free_op1.var);
9724: break;
9725: case ZEND_FETCH_STATIC:
9726: zval_update_constant(retval, (void*) 1 TSRMLS_CC);
9727: break;
9728: case ZEND_FETCH_GLOBAL_LOCK:
9729: if (IS_TMP_VAR == IS_VAR && !free_op1.var) {
9730: PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
9731: }
9732: break;
9733: }
9734: }
9735:
1.1 misho 9736:
1.1.1.2 misho 9737: if (IS_TMP_VAR != IS_CONST && varname == &tmp_varname) {
9738: zval_dtor(&tmp_varname);
1.1 misho 9739: }
1.1.1.2 misho 9740: if (opline->extended_value & ZEND_FETCH_MAKE_REF) {
9741: SEPARATE_ZVAL_TO_MAKE_IS_REF(retval);
1.1 misho 9742: }
1.1.1.2 misho 9743: PZVAL_LOCK(*retval);
9744: switch (type) {
9745: case BP_VAR_R:
9746: case BP_VAR_IS:
9747: AI_SET_PTR(&EX_T(opline->result.var), *retval);
9748: break;
9749: case BP_VAR_UNSET: {
9750: zend_free_op free_res;
9751:
9752: PZVAL_UNLOCK(*retval, &free_res);
9753: if (retval != &EG(uninitialized_zval_ptr)) {
9754: SEPARATE_ZVAL_IF_NOT_REF(retval);
9755: }
9756: PZVAL_LOCK(*retval);
9757: FREE_OP_VAR_PTR(free_res);
9758: }
9759: /* break missing intentionally */
9760: default:
9761: EX_T(opline->result.var).var.ptr_ptr = retval;
9762: break;
9763: }
9764: CHECK_EXCEPTION();
1.1 misho 9765: ZEND_VM_NEXT_OPCODE();
9766: }
9767:
1.1.1.2 misho 9768: static int ZEND_FASTCALL ZEND_FETCH_R_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 9769: {
1.1.1.2 misho 9770: return zend_fetch_var_address_helper_SPEC_TMP_UNUSED(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
9771: }
1.1 misho 9772:
1.1.1.2 misho 9773: static int ZEND_FASTCALL ZEND_FETCH_W_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
9774: {
9775: return zend_fetch_var_address_helper_SPEC_TMP_UNUSED(BP_VAR_W, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
9776: }
1.1 misho 9777:
1.1.1.2 misho 9778: static int ZEND_FASTCALL ZEND_FETCH_RW_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
9779: {
9780: return zend_fetch_var_address_helper_SPEC_TMP_UNUSED(BP_VAR_RW, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
9781: }
1.1 misho 9782:
1.1.1.2 misho 9783: static int ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
9784: {
9785: USE_OPLINE
1.1 misho 9786:
1.1.1.2 misho 9787: return zend_fetch_var_address_helper_SPEC_TMP_UNUSED(ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
1.1 misho 9788: }
9789:
1.1.1.2 misho 9790: static int ZEND_FASTCALL ZEND_FETCH_UNSET_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 9791: {
1.1.1.2 misho 9792: return zend_fetch_var_address_helper_SPEC_TMP_UNUSED(BP_VAR_UNSET, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
9793: }
1.1 misho 9794:
1.1.1.2 misho 9795: static int ZEND_FASTCALL ZEND_FETCH_IS_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
9796: {
9797: return zend_fetch_var_address_helper_SPEC_TMP_UNUSED(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
1.1 misho 9798: }
9799:
1.1.1.2 misho 9800: static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 9801: {
1.1.1.2 misho 9802: USE_OPLINE
9803: zend_free_op free_op1;
1.1 misho 9804: zval *expr_ptr;
9805:
1.1.1.2 misho 9806: SAVE_OPLINE();
9807: if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && opline->extended_value) {
9808: zval **expr_ptr_ptr = NULL;
1.1 misho 9809:
1.1.1.2 misho 9810: if (IS_TMP_VAR == IS_VAR && UNEXPECTED(expr_ptr_ptr == NULL)) {
9811: zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
9812: }
9813: SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr);
1.1 misho 9814: expr_ptr = *expr_ptr_ptr;
1.1.1.2 misho 9815: Z_ADDREF_P(expr_ptr);
1.1 misho 9816: } else {
1.1.1.2 misho 9817: expr_ptr=_get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
9818: if (1) { /* temporary variable */
9819: zval *new_expr;
1.1 misho 9820:
1.1.1.2 misho 9821: ALLOC_ZVAL(new_expr);
9822: INIT_PZVAL_COPY(new_expr, expr_ptr);
9823: expr_ptr = new_expr;
9824: } else if (IS_TMP_VAR == IS_CONST || PZVAL_IS_REF(expr_ptr)) {
1.1 misho 9825: zval *new_expr;
9826:
9827: ALLOC_ZVAL(new_expr);
9828: INIT_PZVAL_COPY(new_expr, expr_ptr);
9829: expr_ptr = new_expr;
9830: zendi_zval_copy_ctor(*expr_ptr);
9831: } else {
9832: Z_ADDREF_P(expr_ptr);
9833: }
9834: }
1.1.1.2 misho 9835:
9836: if (IS_UNUSED != IS_UNUSED) {
9837:
9838: zval *offset = NULL;
9839: ulong hval;
9840:
1.1 misho 9841: switch (Z_TYPE_P(offset)) {
9842: case IS_DOUBLE:
1.1.1.2 misho 9843: hval = zend_dval_to_lval(Z_DVAL_P(offset));
9844: goto num_index;
1.1 misho 9845: case IS_LONG:
9846: case IS_BOOL:
1.1.1.2 misho 9847: hval = Z_LVAL_P(offset);
9848: num_index:
9849: zend_hash_index_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), hval, &expr_ptr, sizeof(zval *), NULL);
1.1 misho 9850: break;
9851: case IS_STRING:
1.1.1.2 misho 9852: if (IS_UNUSED == IS_CONST) {
9853: hval = Z_HASH_P(offset);
9854: } else {
9855: ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
9856: if (IS_INTERNED(Z_STRVAL_P(offset))) {
9857: hval = INTERNED_HASH(Z_STRVAL_P(offset));
9858: } else {
9859: hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
9860: }
9861: }
9862: zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
1.1 misho 9863: break;
9864: case IS_NULL:
1.1.1.2 misho 9865: zend_hash_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
1.1 misho 9866: break;
9867: default:
9868: zend_error(E_WARNING, "Illegal offset type");
9869: zval_ptr_dtor(&expr_ptr);
9870: /* do nothing */
9871: break;
9872: }
1.1.1.2 misho 9873:
1.1 misho 9874: } else {
1.1.1.2 misho 9875: zend_hash_next_index_insert(Z_ARRVAL(EX_T(opline->result.var).tmp_var), &expr_ptr, sizeof(zval *), NULL);
1.1 misho 9876: }
1.1.1.2 misho 9877: if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && opline->extended_value) {
1.1 misho 9878:
9879: } else {
9880:
9881: }
1.1.1.2 misho 9882: CHECK_EXCEPTION();
1.1 misho 9883: ZEND_VM_NEXT_OPCODE();
9884: }
9885:
1.1.1.2 misho 9886: static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 9887: {
1.1.1.2 misho 9888: USE_OPLINE
1.1 misho 9889:
1.1.1.2 misho 9890: array_init(&EX_T(opline->result.var).tmp_var);
1.1 misho 9891: if (IS_TMP_VAR == IS_UNUSED) {
9892: ZEND_VM_NEXT_OPCODE();
9893: #if 0 || IS_TMP_VAR != IS_UNUSED
9894: } else {
1.1.1.2 misho 9895: return ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
1.1 misho 9896: #endif
9897: }
9898: }
9899:
1.1.1.2 misho 9900: static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 9901: {
1.1.1.2 misho 9902: USE_OPLINE
9903: zval tmp, *varname;
9904: HashTable *target_symbol_table;
1.1 misho 9905: zend_free_op free_op1;
9906:
1.1.1.2 misho 9907: SAVE_OPLINE();
9908: if (IS_TMP_VAR == IS_CV &&
9909: IS_UNUSED == IS_UNUSED &&
9910: (opline->extended_value & ZEND_QUICK_SET)) {
9911: if (EG(active_symbol_table)) {
9912: zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.var);
1.1 misho 9913:
1.1.1.2 misho 9914: zend_delete_variable(EX(prev_execute_data), EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value TSRMLS_CC);
9915: EX_CV(opline->op1.var) = NULL;
9916: } else if (EX_CV(opline->op1.var)) {
9917: zval_ptr_dtor(EX_CV(opline->op1.var));
9918: EX_CV(opline->op1.var) = NULL;
9919: }
9920: CHECK_EXCEPTION();
9921: ZEND_VM_NEXT_OPCODE();
1.1 misho 9922: }
9923:
1.1.1.2 misho 9924: varname = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 9925:
1.1.1.2 misho 9926: if (IS_TMP_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
9927: ZVAL_COPY_VALUE(&tmp, varname);
9928: zval_copy_ctor(&tmp);
9929: convert_to_string(&tmp);
9930: varname = &tmp;
9931: } else if (IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) {
9932: Z_ADDREF_P(varname);
9933: }
1.1 misho 9934:
1.1.1.2 misho 9935: if (IS_UNUSED != IS_UNUSED) {
9936: zend_class_entry *ce;
9937:
9938: if (IS_UNUSED == IS_CONST) {
9939: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
9940: ce = CACHED_PTR(opline->op2.literal->cache_slot);
9941: } else {
9942: ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
1.1.1.4 ! misho 9943: if (UNEXPECTED(EG(exception) != NULL)) {
1.1.1.2 misho 9944: if (IS_TMP_VAR != IS_CONST && varname == &tmp) {
9945: zval_dtor(&tmp);
9946: } else if (IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) {
9947: zval_ptr_dtor(&varname);
9948: }
9949: zval_dtor(free_op1.var);
1.1.1.4 ! misho 9950: HANDLE_EXCEPTION();
! 9951: }
! 9952: if (UNEXPECTED(ce == NULL)) {
! 9953: zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op2.zv));
1.1.1.2 misho 9954: }
9955: CACHE_PTR(opline->op2.literal->cache_slot, ce);
9956: }
1.1 misho 9957: } else {
1.1.1.2 misho 9958: ce = EX_T(opline->op2.var).class_entry;
1.1 misho 9959: }
1.1.1.2 misho 9960: zend_std_unset_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), ((IS_TMP_VAR == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
1.1 misho 9961: } else {
1.1.1.2 misho 9962: ulong hash_value = zend_inline_hash_func(varname->value.str.val, varname->value.str.len+1);
1.1 misho 9963:
1.1.1.2 misho 9964: target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
9965: zend_delete_variable(execute_data, target_symbol_table, varname->value.str.val, varname->value.str.len+1, hash_value TSRMLS_CC);
9966: }
1.1 misho 9967:
1.1.1.2 misho 9968: if (IS_TMP_VAR != IS_CONST && varname == &tmp) {
9969: zval_dtor(&tmp);
9970: } else if (IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) {
9971: zval_ptr_dtor(&varname);
1.1 misho 9972: }
1.1.1.2 misho 9973: zval_dtor(free_op1.var);
9974: CHECK_EXCEPTION();
1.1 misho 9975: ZEND_VM_NEXT_OPCODE();
9976: }
9977:
1.1.1.2 misho 9978: static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 9979: {
1.1.1.2 misho 9980: USE_OPLINE
9981: zval **value;
9982: zend_bool isset = 1;
1.1 misho 9983:
1.1.1.2 misho 9984: SAVE_OPLINE();
9985: if (IS_TMP_VAR == IS_CV &&
9986: IS_UNUSED == IS_UNUSED &&
9987: (opline->extended_value & ZEND_QUICK_SET)) {
9988: if (EX_CV(opline->op1.var)) {
9989: value = EX_CV(opline->op1.var);
9990: } else if (EG(active_symbol_table)) {
9991: zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.var);
9992:
9993: if (zend_hash_quick_find(EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value, (void **) &value) == FAILURE) {
9994: isset = 0;
9995: }
9996: } else {
9997: isset = 0;
9998: }
1.1 misho 9999: } else {
1.1.1.2 misho 10000: HashTable *target_symbol_table;
10001: zend_free_op free_op1;
10002: zval tmp, *varname = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
10003:
10004: if (IS_TMP_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
10005: ZVAL_COPY_VALUE(&tmp, varname);
10006: zval_copy_ctor(&tmp);
10007: convert_to_string(&tmp);
10008: varname = &tmp;
10009: }
10010:
10011: if (IS_UNUSED != IS_UNUSED) {
10012: zend_class_entry *ce;
10013:
10014: if (IS_UNUSED == IS_CONST) {
10015: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
10016: ce = CACHED_PTR(opline->op2.literal->cache_slot);
10017: } else {
10018: ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
10019: if (UNEXPECTED(ce == NULL)) {
10020: CHECK_EXCEPTION();
10021: ZEND_VM_NEXT_OPCODE();
10022: }
10023: CACHE_PTR(opline->op2.literal->cache_slot, ce);
10024: }
10025: } else {
10026: ce = EX_T(opline->op2.var).class_entry;
10027: }
10028: value = zend_std_get_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 1, ((IS_TMP_VAR == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
10029: if (!value) {
10030: isset = 0;
10031: }
10032: } else {
10033: target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
10034: if (zend_hash_find(target_symbol_table, varname->value.str.val, varname->value.str.len+1, (void **) &value) == FAILURE) {
10035: isset = 0;
10036: }
10037: }
10038:
10039: if (IS_TMP_VAR != IS_CONST && varname == &tmp) {
10040: zval_dtor(&tmp);
10041: }
10042: zval_dtor(free_op1.var);
10043: }
10044:
10045: if (opline->extended_value & ZEND_ISSET) {
10046: if (isset && Z_TYPE_PP(value) != IS_NULL) {
10047: ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 1);
10048: } else {
10049: ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
10050: }
10051: } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
10052: if (!isset || !i_zend_is_true(*value)) {
10053: ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 1);
10054: } else {
10055: ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
10056: }
1.1 misho 10057: }
1.1.1.2 misho 10058:
10059: CHECK_EXCEPTION();
10060: ZEND_VM_NEXT_OPCODE();
1.1 misho 10061: }
10062:
10063: static int ZEND_FASTCALL ZEND_ADD_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
10064: {
1.1.1.2 misho 10065: USE_OPLINE
1.1 misho 10066: zend_free_op free_op1;
10067:
1.1.1.2 misho 10068: SAVE_OPLINE();
10069: fast_add_function(&EX_T(opline->result.var).tmp_var,
10070: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
10071: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
1.1 misho 10072: zval_dtor(free_op1.var);
10073:
1.1.1.2 misho 10074: CHECK_EXCEPTION();
1.1 misho 10075: ZEND_VM_NEXT_OPCODE();
10076: }
10077:
10078: static int ZEND_FASTCALL ZEND_SUB_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
10079: {
1.1.1.2 misho 10080: USE_OPLINE
1.1 misho 10081: zend_free_op free_op1;
10082:
1.1.1.2 misho 10083: SAVE_OPLINE();
10084: fast_sub_function(&EX_T(opline->result.var).tmp_var,
10085: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
10086: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
1.1 misho 10087: zval_dtor(free_op1.var);
10088:
1.1.1.2 misho 10089: CHECK_EXCEPTION();
1.1 misho 10090: ZEND_VM_NEXT_OPCODE();
10091: }
10092:
10093: static int ZEND_FASTCALL ZEND_MUL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
10094: {
1.1.1.2 misho 10095: USE_OPLINE
1.1 misho 10096: zend_free_op free_op1;
10097:
1.1.1.2 misho 10098: SAVE_OPLINE();
10099: fast_mul_function(&EX_T(opline->result.var).tmp_var,
10100: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
10101: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
1.1 misho 10102: zval_dtor(free_op1.var);
10103:
1.1.1.2 misho 10104: CHECK_EXCEPTION();
1.1 misho 10105: ZEND_VM_NEXT_OPCODE();
10106: }
10107:
10108: static int ZEND_FASTCALL ZEND_DIV_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
10109: {
1.1.1.2 misho 10110: USE_OPLINE
1.1 misho 10111: zend_free_op free_op1;
10112:
1.1.1.2 misho 10113: SAVE_OPLINE();
10114: fast_div_function(&EX_T(opline->result.var).tmp_var,
10115: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
10116: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
1.1 misho 10117: zval_dtor(free_op1.var);
10118:
1.1.1.2 misho 10119: CHECK_EXCEPTION();
1.1 misho 10120: ZEND_VM_NEXT_OPCODE();
10121: }
10122:
10123: static int ZEND_FASTCALL ZEND_MOD_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
10124: {
1.1.1.2 misho 10125: USE_OPLINE
1.1 misho 10126: zend_free_op free_op1;
10127:
1.1.1.2 misho 10128: SAVE_OPLINE();
10129: fast_mod_function(&EX_T(opline->result.var).tmp_var,
10130: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
10131: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
1.1 misho 10132: zval_dtor(free_op1.var);
10133:
1.1.1.2 misho 10134: CHECK_EXCEPTION();
1.1 misho 10135: ZEND_VM_NEXT_OPCODE();
10136: }
10137:
10138: static int ZEND_FASTCALL ZEND_SL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
10139: {
1.1.1.2 misho 10140: USE_OPLINE
1.1 misho 10141: zend_free_op free_op1;
10142:
1.1.1.2 misho 10143: SAVE_OPLINE();
10144: shift_left_function(&EX_T(opline->result.var).tmp_var,
10145: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
10146: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
1.1 misho 10147: zval_dtor(free_op1.var);
10148:
1.1.1.2 misho 10149: CHECK_EXCEPTION();
1.1 misho 10150: ZEND_VM_NEXT_OPCODE();
10151: }
10152:
10153: static int ZEND_FASTCALL ZEND_SR_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
10154: {
1.1.1.2 misho 10155: USE_OPLINE
1.1 misho 10156: zend_free_op free_op1;
10157:
1.1.1.2 misho 10158: SAVE_OPLINE();
10159: shift_right_function(&EX_T(opline->result.var).tmp_var,
10160: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
10161: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
1.1 misho 10162: zval_dtor(free_op1.var);
10163:
1.1.1.2 misho 10164: CHECK_EXCEPTION();
1.1 misho 10165: ZEND_VM_NEXT_OPCODE();
10166: }
10167:
10168: static int ZEND_FASTCALL ZEND_CONCAT_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
10169: {
1.1.1.2 misho 10170: USE_OPLINE
1.1 misho 10171: zend_free_op free_op1;
10172:
1.1.1.2 misho 10173: SAVE_OPLINE();
10174: concat_function(&EX_T(opline->result.var).tmp_var,
10175: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
10176: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
1.1 misho 10177: zval_dtor(free_op1.var);
10178:
1.1.1.2 misho 10179: CHECK_EXCEPTION();
1.1 misho 10180: ZEND_VM_NEXT_OPCODE();
10181: }
10182:
10183: static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
10184: {
1.1.1.2 misho 10185: USE_OPLINE
1.1 misho 10186: zend_free_op free_op1;
10187:
1.1.1.2 misho 10188: SAVE_OPLINE();
10189: is_identical_function(&EX_T(opline->result.var).tmp_var,
10190: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
10191: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
1.1 misho 10192: zval_dtor(free_op1.var);
10193:
1.1.1.2 misho 10194: CHECK_EXCEPTION();
1.1 misho 10195: ZEND_VM_NEXT_OPCODE();
10196: }
10197:
10198: static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
10199: {
1.1.1.2 misho 10200: USE_OPLINE
1.1 misho 10201: zend_free_op free_op1;
1.1.1.2 misho 10202: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 10203:
1.1.1.2 misho 10204: SAVE_OPLINE();
1.1 misho 10205: is_identical_function(result,
1.1.1.2 misho 10206: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
10207: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
1.1 misho 10208: Z_LVAL_P(result) = !Z_LVAL_P(result);
10209: zval_dtor(free_op1.var);
10210:
1.1.1.2 misho 10211: CHECK_EXCEPTION();
1.1 misho 10212: ZEND_VM_NEXT_OPCODE();
10213: }
10214:
10215: static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
10216: {
1.1.1.2 misho 10217: USE_OPLINE
1.1 misho 10218: zend_free_op free_op1;
1.1.1.2 misho 10219: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 10220:
1.1.1.2 misho 10221: SAVE_OPLINE();
10222: ZVAL_BOOL(result, fast_equal_function(result,
10223: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
10224: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC));
1.1 misho 10225: zval_dtor(free_op1.var);
10226:
1.1.1.2 misho 10227: CHECK_EXCEPTION();
1.1 misho 10228: ZEND_VM_NEXT_OPCODE();
10229: }
10230:
10231: static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
10232: {
1.1.1.2 misho 10233: USE_OPLINE
1.1 misho 10234: zend_free_op free_op1;
1.1.1.2 misho 10235: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 10236:
1.1.1.2 misho 10237: SAVE_OPLINE();
10238: ZVAL_BOOL(result, fast_not_equal_function(result,
10239: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
10240: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC));
1.1 misho 10241: zval_dtor(free_op1.var);
10242:
1.1.1.2 misho 10243: CHECK_EXCEPTION();
1.1 misho 10244: ZEND_VM_NEXT_OPCODE();
10245: }
10246:
10247: static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
10248: {
1.1.1.2 misho 10249: USE_OPLINE
1.1 misho 10250: zend_free_op free_op1;
1.1.1.2 misho 10251: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 10252:
1.1.1.2 misho 10253: SAVE_OPLINE();
10254: ZVAL_BOOL(result, fast_is_smaller_function(result,
10255: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
10256: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC));
1.1 misho 10257: zval_dtor(free_op1.var);
10258:
1.1.1.2 misho 10259: CHECK_EXCEPTION();
1.1 misho 10260: ZEND_VM_NEXT_OPCODE();
10261: }
10262:
10263: static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
10264: {
1.1.1.2 misho 10265: USE_OPLINE
1.1 misho 10266: zend_free_op free_op1;
1.1.1.2 misho 10267: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 10268:
1.1.1.2 misho 10269: SAVE_OPLINE();
10270: ZVAL_BOOL(result, fast_is_smaller_or_equal_function(result,
10271: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
10272: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC));
1.1 misho 10273: zval_dtor(free_op1.var);
10274:
1.1.1.2 misho 10275: CHECK_EXCEPTION();
1.1 misho 10276: ZEND_VM_NEXT_OPCODE();
10277: }
10278:
10279: static int ZEND_FASTCALL ZEND_BW_OR_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
10280: {
1.1.1.2 misho 10281: USE_OPLINE
1.1 misho 10282: zend_free_op free_op1;
10283:
1.1.1.2 misho 10284: SAVE_OPLINE();
10285: bitwise_or_function(&EX_T(opline->result.var).tmp_var,
10286: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
10287: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
1.1 misho 10288: zval_dtor(free_op1.var);
10289:
1.1.1.2 misho 10290: CHECK_EXCEPTION();
1.1 misho 10291: ZEND_VM_NEXT_OPCODE();
10292: }
10293:
10294: static int ZEND_FASTCALL ZEND_BW_AND_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
10295: {
1.1.1.2 misho 10296: USE_OPLINE
1.1 misho 10297: zend_free_op free_op1;
10298:
1.1.1.2 misho 10299: SAVE_OPLINE();
10300: bitwise_and_function(&EX_T(opline->result.var).tmp_var,
10301: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
10302: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
1.1 misho 10303: zval_dtor(free_op1.var);
10304:
1.1.1.2 misho 10305: CHECK_EXCEPTION();
1.1 misho 10306: ZEND_VM_NEXT_OPCODE();
10307: }
10308:
10309: static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
10310: {
1.1.1.2 misho 10311: USE_OPLINE
1.1 misho 10312: zend_free_op free_op1;
10313:
1.1.1.2 misho 10314: SAVE_OPLINE();
10315: bitwise_xor_function(&EX_T(opline->result.var).tmp_var,
10316: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
10317: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
1.1 misho 10318: zval_dtor(free_op1.var);
10319:
1.1.1.2 misho 10320: CHECK_EXCEPTION();
1.1 misho 10321: ZEND_VM_NEXT_OPCODE();
10322: }
10323:
10324: static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
10325: {
1.1.1.2 misho 10326: USE_OPLINE
1.1 misho 10327: zend_free_op free_op1;
10328:
1.1.1.2 misho 10329: SAVE_OPLINE();
10330: boolean_xor_function(&EX_T(opline->result.var).tmp_var,
10331: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
10332: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
1.1 misho 10333: zval_dtor(free_op1.var);
10334:
1.1.1.2 misho 10335: CHECK_EXCEPTION();
1.1 misho 10336: ZEND_VM_NEXT_OPCODE();
10337: }
10338:
10339: static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
10340: {
1.1.1.2 misho 10341: USE_OPLINE
1.1 misho 10342:
1.1.1.2 misho 10343: zval *str = &EX_T(opline->result.var).tmp_var;
10344: zval *var;
1.1 misho 10345: zval var_copy;
10346: int use_copy = 0;
10347:
1.1.1.2 misho 10348: SAVE_OPLINE();
10349: var = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
10350:
1.1 misho 10351: if (IS_TMP_VAR == IS_UNUSED) {
10352: /* Initialize for erealloc in add_string_to_string */
10353: Z_STRVAL_P(str) = NULL;
10354: Z_STRLEN_P(str) = 0;
10355: Z_TYPE_P(str) = IS_STRING;
10356:
10357: INIT_PZVAL(str);
10358: }
10359:
10360: if (Z_TYPE_P(var) != IS_STRING) {
10361: zend_make_printable_zval(var, &var_copy, &use_copy);
10362:
10363: if (use_copy) {
10364: var = &var_copy;
10365: }
10366: }
10367: add_string_to_string(str, str, var);
10368:
10369: if (use_copy) {
10370: zval_dtor(var);
10371: }
10372: /* original comment, possibly problematic:
10373: * FREE_OP is missing intentionally here - we're always working on the same temporary variable
10374: * (Zeev): I don't think it's problematic, we only use variables
10375: * which aren't affected by FREE_OP(Ts, )'s anyway, unless they're
10376: * string offsets or overloaded objects
10377: */
10378:
1.1.1.2 misho 10379: CHECK_EXCEPTION();
1.1 misho 10380: ZEND_VM_NEXT_OPCODE();
10381: }
10382:
10383: static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
10384: {
1.1.1.2 misho 10385: USE_OPLINE
1.1 misho 10386: zval *function_name;
10387: char *function_name_strval;
10388: int function_name_strlen;
10389: zend_free_op free_op1;
10390:
1.1.1.2 misho 10391: SAVE_OPLINE();
1.1 misho 10392: zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
10393:
1.1.1.2 misho 10394: function_name = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
1.1 misho 10395:
1.1.1.2 misho 10396: if (IS_CV != IS_CONST &&
10397: UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
1.1 misho 10398: zend_error_noreturn(E_ERROR, "Method name must be a string");
10399: }
10400:
10401: function_name_strval = Z_STRVAL_P(function_name);
10402: function_name_strlen = Z_STRLEN_P(function_name);
10403:
1.1.1.2 misho 10404: EX(object) = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 10405:
1.1.1.2 misho 10406: if (EXPECTED(EX(object) != NULL) &&
10407: EXPECTED(Z_TYPE_P(EX(object)) == IS_OBJECT)) {
10408: EX(called_scope) = Z_OBJCE_P(EX(object));
1.1 misho 10409:
1.1.1.2 misho 10410: if (IS_CV != IS_CONST ||
10411: (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope))) == NULL) {
10412: zval *object = EX(object);
10413:
10414: if (UNEXPECTED(Z_OBJ_HT_P(EX(object))->get_method == NULL)) {
10415: zend_error_noreturn(E_ERROR, "Object does not support method calls");
10416: }
10417:
10418: /* First, locate the function. */
10419: EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen, ((IS_CV == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC);
10420: if (UNEXPECTED(EX(fbc) == NULL)) {
10421: zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval);
10422: }
10423: if (IS_CV == IS_CONST &&
10424: EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) &&
10425: EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) &&
10426: EXPECTED(EX(object) == object)) {
10427: CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope), EX(fbc));
10428: }
1.1 misho 10429: }
10430: } else {
10431: zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval);
10432: }
10433:
10434: if ((EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) != 0) {
10435: EX(object) = NULL;
10436: } else {
10437: if (!PZVAL_IS_REF(EX(object))) {
10438: Z_ADDREF_P(EX(object)); /* For $this pointer */
10439: } else {
10440: zval *this_ptr;
10441: ALLOC_ZVAL(this_ptr);
10442: INIT_PZVAL_COPY(this_ptr, EX(object));
10443: zval_copy_ctor(this_ptr);
10444: EX(object) = this_ptr;
10445: }
10446: }
10447:
10448:
1.1.1.2 misho 10449: CHECK_EXCEPTION();
1.1 misho 10450: ZEND_VM_NEXT_OPCODE();
10451: }
10452:
10453: static int ZEND_FASTCALL ZEND_CASE_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
10454: {
1.1.1.2 misho 10455: USE_OPLINE
1.1 misho 10456: zend_free_op free_op1;
10457:
1.1.1.2 misho 10458: SAVE_OPLINE();
1.1 misho 10459: if (IS_TMP_VAR==IS_VAR) {
1.1.1.2 misho 10460: PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
1.1 misho 10461: }
1.1.1.2 misho 10462: is_equal_function(&EX_T(opline->result.var).tmp_var,
10463: _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
10464: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
10465:
10466: CHECK_EXCEPTION();
1.1 misho 10467: ZEND_VM_NEXT_OPCODE();
10468: }
10469:
10470: static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
10471: {
1.1.1.2 misho 10472: USE_OPLINE
1.1 misho 10473: zend_free_op free_op1;
10474: zval *expr_ptr;
10475:
1.1.1.2 misho 10476: SAVE_OPLINE();
10477: if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && opline->extended_value) {
10478: zval **expr_ptr_ptr = NULL;
1.1 misho 10479:
1.1.1.2 misho 10480: if (IS_TMP_VAR == IS_VAR && UNEXPECTED(expr_ptr_ptr == NULL)) {
10481: zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
10482: }
10483: SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr);
1.1 misho 10484: expr_ptr = *expr_ptr_ptr;
1.1.1.2 misho 10485: Z_ADDREF_P(expr_ptr);
1.1 misho 10486: } else {
1.1.1.2 misho 10487: expr_ptr=_get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
10488: if (1) { /* temporary variable */
10489: zval *new_expr;
1.1 misho 10490:
1.1.1.2 misho 10491: ALLOC_ZVAL(new_expr);
10492: INIT_PZVAL_COPY(new_expr, expr_ptr);
10493: expr_ptr = new_expr;
10494: } else if (IS_TMP_VAR == IS_CONST || PZVAL_IS_REF(expr_ptr)) {
1.1 misho 10495: zval *new_expr;
10496:
10497: ALLOC_ZVAL(new_expr);
10498: INIT_PZVAL_COPY(new_expr, expr_ptr);
10499: expr_ptr = new_expr;
10500: zendi_zval_copy_ctor(*expr_ptr);
10501: } else {
10502: Z_ADDREF_P(expr_ptr);
10503: }
10504: }
1.1.1.2 misho 10505:
10506: if (IS_CV != IS_UNUSED) {
10507:
10508: zval *offset = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
10509: ulong hval;
10510:
1.1 misho 10511: switch (Z_TYPE_P(offset)) {
10512: case IS_DOUBLE:
1.1.1.2 misho 10513: hval = zend_dval_to_lval(Z_DVAL_P(offset));
10514: goto num_index;
1.1 misho 10515: case IS_LONG:
10516: case IS_BOOL:
1.1.1.2 misho 10517: hval = Z_LVAL_P(offset);
10518: num_index:
10519: zend_hash_index_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), hval, &expr_ptr, sizeof(zval *), NULL);
1.1 misho 10520: break;
10521: case IS_STRING:
1.1.1.2 misho 10522: if (IS_CV == IS_CONST) {
10523: hval = Z_HASH_P(offset);
10524: } else {
10525: ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
10526: if (IS_INTERNED(Z_STRVAL_P(offset))) {
10527: hval = INTERNED_HASH(Z_STRVAL_P(offset));
10528: } else {
10529: hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
10530: }
10531: }
10532: zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
1.1 misho 10533: break;
10534: case IS_NULL:
1.1.1.2 misho 10535: zend_hash_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
1.1 misho 10536: break;
10537: default:
10538: zend_error(E_WARNING, "Illegal offset type");
10539: zval_ptr_dtor(&expr_ptr);
10540: /* do nothing */
10541: break;
10542: }
10543:
10544: } else {
1.1.1.2 misho 10545: zend_hash_next_index_insert(Z_ARRVAL(EX_T(opline->result.var).tmp_var), &expr_ptr, sizeof(zval *), NULL);
1.1 misho 10546: }
1.1.1.2 misho 10547: if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && opline->extended_value) {
1.1 misho 10548:
10549: } else {
10550:
10551: }
1.1.1.2 misho 10552: CHECK_EXCEPTION();
1.1 misho 10553: ZEND_VM_NEXT_OPCODE();
10554: }
10555:
10556: static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
10557: {
1.1.1.2 misho 10558: USE_OPLINE
1.1 misho 10559:
1.1.1.2 misho 10560: array_init(&EX_T(opline->result.var).tmp_var);
1.1 misho 10561: if (IS_TMP_VAR == IS_UNUSED) {
10562: ZEND_VM_NEXT_OPCODE();
10563: #if 0 || IS_TMP_VAR != IS_UNUSED
10564: } else {
10565: return ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
10566: #endif
10567: }
10568: }
10569:
10570: static int ZEND_FASTCALL ZEND_BW_NOT_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
10571: {
1.1.1.2 misho 10572: USE_OPLINE
1.1 misho 10573: zend_free_op free_op1;
10574:
1.1.1.2 misho 10575: SAVE_OPLINE();
10576: bitwise_not_function(&EX_T(opline->result.var).tmp_var,
10577: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC) TSRMLS_CC);
1.1 misho 10578: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 10579: CHECK_EXCEPTION();
1.1 misho 10580: ZEND_VM_NEXT_OPCODE();
10581: }
10582:
10583: static int ZEND_FASTCALL ZEND_BOOL_NOT_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
10584: {
1.1.1.2 misho 10585: USE_OPLINE
1.1 misho 10586: zend_free_op free_op1;
10587:
1.1.1.2 misho 10588: SAVE_OPLINE();
10589: boolean_not_function(&EX_T(opline->result.var).tmp_var,
10590: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC) TSRMLS_CC);
1.1 misho 10591: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 10592: CHECK_EXCEPTION();
1.1 misho 10593: ZEND_VM_NEXT_OPCODE();
10594: }
10595:
10596: static int ZEND_FASTCALL ZEND_PRE_INC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
10597: {
1.1.1.2 misho 10598: USE_OPLINE
1.1 misho 10599: zend_free_op free_op1;
1.1.1.2 misho 10600: zval **var_ptr;
10601:
10602: SAVE_OPLINE();
10603: var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 10604:
1.1.1.2 misho 10605: if (IS_VAR == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
1.1 misho 10606: zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
10607: }
1.1.1.2 misho 10608: if (IS_VAR == IS_VAR && UNEXPECTED(*var_ptr == &EG(error_zval))) {
10609: if (RETURN_VALUE_USED(opline)) {
10610: PZVAL_LOCK(&EG(uninitialized_zval));
10611: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
1.1 misho 10612: }
10613: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 10614: CHECK_EXCEPTION();
1.1 misho 10615: ZEND_VM_NEXT_OPCODE();
10616: }
10617:
10618: SEPARATE_ZVAL_IF_NOT_REF(var_ptr);
10619:
1.1.1.2 misho 10620: if (UNEXPECTED(Z_TYPE_PP(var_ptr) == IS_OBJECT)
10621: && Z_OBJ_HANDLER_PP(var_ptr, get)
1.1 misho 10622: && Z_OBJ_HANDLER_PP(var_ptr, set)) {
10623: /* proxy object */
10624: zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC);
10625: Z_ADDREF_P(val);
1.1.1.2 misho 10626: fast_increment_function(val);
1.1 misho 10627: Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC);
10628: zval_ptr_dtor(&val);
10629: } else {
1.1.1.2 misho 10630: fast_increment_function(*var_ptr);
1.1 misho 10631: }
10632:
1.1.1.2 misho 10633: if (RETURN_VALUE_USED(opline)) {
1.1 misho 10634: PZVAL_LOCK(*var_ptr);
1.1.1.2 misho 10635: AI_SET_PTR(&EX_T(opline->result.var), *var_ptr);
1.1 misho 10636: }
10637:
10638: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 10639: CHECK_EXCEPTION();
1.1 misho 10640: ZEND_VM_NEXT_OPCODE();
10641: }
10642:
10643: static int ZEND_FASTCALL ZEND_PRE_DEC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
10644: {
1.1.1.2 misho 10645: USE_OPLINE
1.1 misho 10646: zend_free_op free_op1;
1.1.1.2 misho 10647: zval **var_ptr;
1.1 misho 10648:
1.1.1.2 misho 10649: SAVE_OPLINE();
10650: var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
10651:
10652: if (IS_VAR == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
1.1 misho 10653: zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
10654: }
1.1.1.2 misho 10655: if (IS_VAR == IS_VAR && UNEXPECTED(*var_ptr == &EG(error_zval))) {
10656: if (RETURN_VALUE_USED(opline)) {
10657: PZVAL_LOCK(&EG(uninitialized_zval));
10658: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
1.1 misho 10659: }
10660: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 10661: CHECK_EXCEPTION();
1.1 misho 10662: ZEND_VM_NEXT_OPCODE();
10663: }
10664:
10665: SEPARATE_ZVAL_IF_NOT_REF(var_ptr);
10666:
1.1.1.2 misho 10667: if (UNEXPECTED(Z_TYPE_PP(var_ptr) == IS_OBJECT)
10668: && Z_OBJ_HANDLER_PP(var_ptr, get)
1.1 misho 10669: && Z_OBJ_HANDLER_PP(var_ptr, set)) {
10670: /* proxy object */
10671: zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC);
10672: Z_ADDREF_P(val);
1.1.1.2 misho 10673: fast_decrement_function(val);
1.1 misho 10674: Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC);
10675: zval_ptr_dtor(&val);
10676: } else {
1.1.1.2 misho 10677: fast_decrement_function(*var_ptr);
1.1 misho 10678: }
10679:
1.1.1.2 misho 10680: if (RETURN_VALUE_USED(opline)) {
1.1 misho 10681: PZVAL_LOCK(*var_ptr);
1.1.1.2 misho 10682: AI_SET_PTR(&EX_T(opline->result.var), *var_ptr);
1.1 misho 10683: }
10684:
10685: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 10686: CHECK_EXCEPTION();
1.1 misho 10687: ZEND_VM_NEXT_OPCODE();
10688: }
10689:
10690: static int ZEND_FASTCALL ZEND_POST_INC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
10691: {
1.1.1.2 misho 10692: USE_OPLINE
1.1 misho 10693: zend_free_op free_op1;
1.1.1.2 misho 10694: zval **var_ptr, *retval;
1.1 misho 10695:
1.1.1.2 misho 10696: SAVE_OPLINE();
10697: var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
10698:
10699: if (IS_VAR == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
1.1 misho 10700: zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
10701: }
1.1.1.2 misho 10702: if (IS_VAR == IS_VAR && UNEXPECTED(*var_ptr == &EG(error_zval))) {
10703: ZVAL_NULL(&EX_T(opline->result.var).tmp_var);
1.1 misho 10704: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 10705: CHECK_EXCEPTION();
1.1 misho 10706: ZEND_VM_NEXT_OPCODE();
10707: }
10708:
1.1.1.2 misho 10709: retval = &EX_T(opline->result.var).tmp_var;
10710: ZVAL_COPY_VALUE(retval, *var_ptr);
10711: zendi_zval_copy_ctor(*retval);
1.1 misho 10712:
10713: SEPARATE_ZVAL_IF_NOT_REF(var_ptr);
10714:
1.1.1.2 misho 10715: if (UNEXPECTED(Z_TYPE_PP(var_ptr) == IS_OBJECT)
10716: && Z_OBJ_HANDLER_PP(var_ptr, get)
1.1 misho 10717: && Z_OBJ_HANDLER_PP(var_ptr, set)) {
10718: /* proxy object */
10719: zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC);
10720: Z_ADDREF_P(val);
1.1.1.2 misho 10721: fast_increment_function(val);
1.1 misho 10722: Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC);
10723: zval_ptr_dtor(&val);
10724: } else {
1.1.1.2 misho 10725: fast_increment_function(*var_ptr);
1.1 misho 10726: }
10727:
10728: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 10729: CHECK_EXCEPTION();
1.1 misho 10730: ZEND_VM_NEXT_OPCODE();
10731: }
10732:
10733: static int ZEND_FASTCALL ZEND_POST_DEC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
10734: {
1.1.1.2 misho 10735: USE_OPLINE
1.1 misho 10736: zend_free_op free_op1;
1.1.1.2 misho 10737: zval **var_ptr, *retval;
1.1 misho 10738:
1.1.1.2 misho 10739: SAVE_OPLINE();
10740: var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
10741:
10742: if (IS_VAR == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
1.1 misho 10743: zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
10744: }
1.1.1.2 misho 10745: if (IS_VAR == IS_VAR && UNEXPECTED(*var_ptr == &EG(error_zval))) {
10746: ZVAL_NULL(&EX_T(opline->result.var).tmp_var);
1.1 misho 10747: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 10748: CHECK_EXCEPTION();
1.1 misho 10749: ZEND_VM_NEXT_OPCODE();
10750: }
10751:
1.1.1.2 misho 10752: retval = &EX_T(opline->result.var).tmp_var;
10753: ZVAL_COPY_VALUE(retval, *var_ptr);
10754: zendi_zval_copy_ctor(*retval);
1.1 misho 10755:
10756: SEPARATE_ZVAL_IF_NOT_REF(var_ptr);
10757:
1.1.1.2 misho 10758: if (UNEXPECTED(Z_TYPE_PP(var_ptr) == IS_OBJECT)
10759: && Z_OBJ_HANDLER_PP(var_ptr, get)
1.1 misho 10760: && Z_OBJ_HANDLER_PP(var_ptr, set)) {
10761: /* proxy object */
10762: zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC);
10763: Z_ADDREF_P(val);
1.1.1.2 misho 10764: fast_decrement_function(val);
1.1 misho 10765: Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC);
10766: zval_ptr_dtor(&val);
10767: } else {
1.1.1.2 misho 10768: fast_decrement_function(*var_ptr);
1.1 misho 10769: }
10770:
10771: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 10772: CHECK_EXCEPTION();
1.1 misho 10773: ZEND_VM_NEXT_OPCODE();
10774: }
10775:
10776: static int ZEND_FASTCALL ZEND_ECHO_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
10777: {
1.1.1.2 misho 10778: USE_OPLINE
1.1 misho 10779: zend_free_op free_op1;
1.1.1.2 misho 10780: zval *z;
10781:
10782: SAVE_OPLINE();
10783: z = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 10784:
1.1.1.3 misho 10785: if (IS_VAR == IS_TMP_VAR && Z_TYPE_P(z) == IS_OBJECT) {
10786: INIT_PZVAL(z);
1.1 misho 10787: }
1.1.1.3 misho 10788: zend_print_variable(z);
1.1 misho 10789:
10790: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 10791: CHECK_EXCEPTION();
1.1 misho 10792: ZEND_VM_NEXT_OPCODE();
10793: }
10794:
10795: static int ZEND_FASTCALL ZEND_PRINT_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
10796: {
1.1.1.2 misho 10797: USE_OPLINE
1.1 misho 10798:
1.1.1.2 misho 10799: ZVAL_LONG(&EX_T(opline->result.var).tmp_var, 1);
1.1 misho 10800: return ZEND_ECHO_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
10801: }
10802:
10803: static int ZEND_FASTCALL ZEND_JMPZ_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
10804: {
1.1.1.2 misho 10805: USE_OPLINE
1.1 misho 10806: zend_free_op free_op1;
1.1.1.2 misho 10807: zval *val;
1.1 misho 10808: int ret;
10809:
1.1.1.2 misho 10810: SAVE_OPLINE();
10811: val = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
10812:
10813: if (IS_VAR == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) {
1.1 misho 10814: ret = Z_LVAL_P(val);
10815: } else {
10816: ret = i_zend_is_true(val);
10817: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
10818: if (UNEXPECTED(EG(exception) != NULL)) {
1.1.1.2 misho 10819: HANDLE_EXCEPTION();
1.1 misho 10820: }
10821: }
10822: if (!ret) {
10823: #if DEBUG_ZEND>=2
1.1.1.2 misho 10824: printf("Conditional jmp to %d\n", opline->op2.opline_num);
1.1 misho 10825: #endif
1.1.1.2 misho 10826: ZEND_VM_SET_OPCODE(opline->op2.jmp_addr);
1.1 misho 10827: ZEND_VM_CONTINUE();
10828: }
10829:
10830: ZEND_VM_NEXT_OPCODE();
10831: }
10832:
10833: static int ZEND_FASTCALL ZEND_JMPNZ_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
10834: {
1.1.1.2 misho 10835: USE_OPLINE
1.1 misho 10836: zend_free_op free_op1;
1.1.1.2 misho 10837: zval *val;
1.1 misho 10838: int ret;
10839:
1.1.1.2 misho 10840: SAVE_OPLINE();
10841: val = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
10842:
10843: if (IS_VAR == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) {
1.1 misho 10844: ret = Z_LVAL_P(val);
10845: } else {
10846: ret = i_zend_is_true(val);
10847: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
10848: if (UNEXPECTED(EG(exception) != NULL)) {
1.1.1.2 misho 10849: HANDLE_EXCEPTION();
1.1 misho 10850: }
10851: }
10852: if (ret) {
10853: #if DEBUG_ZEND>=2
1.1.1.2 misho 10854: printf("Conditional jmp to %d\n", opline->op2.opline_num);
1.1 misho 10855: #endif
1.1.1.2 misho 10856: ZEND_VM_SET_OPCODE(opline->op2.jmp_addr);
1.1 misho 10857: ZEND_VM_CONTINUE();
10858: }
10859:
10860: ZEND_VM_NEXT_OPCODE();
10861: }
10862:
10863: static int ZEND_FASTCALL ZEND_JMPZNZ_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
10864: {
1.1.1.2 misho 10865: USE_OPLINE
1.1 misho 10866: zend_free_op free_op1;
1.1.1.2 misho 10867: zval *val;
1.1 misho 10868: int retval;
10869:
1.1.1.2 misho 10870: SAVE_OPLINE();
10871: val = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
10872:
10873: if (IS_VAR == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) {
1.1 misho 10874: retval = Z_LVAL_P(val);
10875: } else {
10876: retval = i_zend_is_true(val);
10877: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
10878: if (UNEXPECTED(EG(exception) != NULL)) {
1.1.1.2 misho 10879: HANDLE_EXCEPTION();
1.1 misho 10880: }
10881: }
10882: if (EXPECTED(retval != 0)) {
10883: #if DEBUG_ZEND>=2
10884: printf("Conditional jmp on true to %d\n", opline->extended_value);
10885: #endif
10886: ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->extended_value]);
10887: ZEND_VM_CONTINUE(); /* CHECK_ME */
10888: } else {
10889: #if DEBUG_ZEND>=2
1.1.1.2 misho 10890: printf("Conditional jmp on false to %d\n", opline->op2.opline_num);
1.1 misho 10891: #endif
1.1.1.2 misho 10892: ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->op2.opline_num]);
1.1 misho 10893: ZEND_VM_CONTINUE(); /* CHECK_ME */
10894: }
10895: }
10896:
10897: static int ZEND_FASTCALL ZEND_JMPZ_EX_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
10898: {
1.1.1.2 misho 10899: USE_OPLINE
1.1 misho 10900: zend_free_op free_op1;
1.1.1.2 misho 10901: zval *val;
1.1 misho 10902: int retval;
10903:
1.1.1.2 misho 10904: SAVE_OPLINE();
10905: val = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
10906:
10907: if (IS_VAR == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) {
1.1 misho 10908: retval = Z_LVAL_P(val);
10909: } else {
10910: retval = i_zend_is_true(val);
10911: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
10912: if (UNEXPECTED(EG(exception) != NULL)) {
1.1.1.2 misho 10913: HANDLE_EXCEPTION();
1.1 misho 10914: }
10915: }
1.1.1.2 misho 10916: Z_LVAL(EX_T(opline->result.var).tmp_var) = retval;
10917: Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
1.1 misho 10918: if (!retval) {
10919: #if DEBUG_ZEND>=2
1.1.1.2 misho 10920: printf("Conditional jmp to %d\n", opline->op2.opline_num);
1.1 misho 10921: #endif
1.1.1.2 misho 10922: ZEND_VM_SET_OPCODE(opline->op2.jmp_addr);
1.1 misho 10923: ZEND_VM_CONTINUE();
10924: }
10925: ZEND_VM_NEXT_OPCODE();
10926: }
10927:
10928: static int ZEND_FASTCALL ZEND_JMPNZ_EX_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
10929: {
1.1.1.2 misho 10930: USE_OPLINE
1.1 misho 10931: zend_free_op free_op1;
1.1.1.2 misho 10932: zval *val;
1.1 misho 10933: int retval;
10934:
1.1.1.2 misho 10935: SAVE_OPLINE();
10936: val = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
10937:
10938: if (IS_VAR == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) {
1.1 misho 10939: retval = Z_LVAL_P(val);
10940: } else {
10941: retval = i_zend_is_true(val);
10942: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
10943: if (UNEXPECTED(EG(exception) != NULL)) {
1.1.1.2 misho 10944: HANDLE_EXCEPTION();
1.1 misho 10945: }
10946: }
1.1.1.2 misho 10947: Z_LVAL(EX_T(opline->result.var).tmp_var) = retval;
10948: Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
1.1 misho 10949: if (retval) {
10950: #if DEBUG_ZEND>=2
1.1.1.2 misho 10951: printf("Conditional jmp to %d\n", opline->op2.opline_num);
1.1 misho 10952: #endif
1.1.1.2 misho 10953: ZEND_VM_SET_OPCODE(opline->op2.jmp_addr);
1.1 misho 10954: ZEND_VM_CONTINUE();
10955: }
10956: ZEND_VM_NEXT_OPCODE();
10957: }
10958:
1.1.1.2 misho 10959: static int ZEND_FASTCALL ZEND_FREE_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
10960: {
10961: USE_OPLINE
10962:
10963: SAVE_OPLINE();
10964: if (IS_VAR == IS_TMP_VAR) {
10965: zendi_zval_dtor(EX_T(opline->op1.var).tmp_var);
10966: } else {
10967: zval_ptr_dtor(&EX_T(opline->op1.var).var.ptr);
10968: }
10969: CHECK_EXCEPTION();
10970: ZEND_VM_NEXT_OPCODE();
10971: }
10972:
1.1 misho 10973: static int ZEND_FASTCALL ZEND_RETURN_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
10974: {
1.1.1.2 misho 10975: USE_OPLINE
10976: zval *retval_ptr;
10977: zend_free_op free_op1;
10978:
10979: SAVE_OPLINE();
10980: retval_ptr = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
10981:
10982: if (!EG(return_value_ptr_ptr)) {
10983: if (IS_VAR == IS_TMP_VAR) {
10984: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
10985: }
10986: } else if (!0) { /* Not a temp var */
10987: if (IS_VAR == IS_CONST ||
10988: (PZVAL_IS_REF(retval_ptr) && Z_REFCOUNT_P(retval_ptr) > 0)) {
10989: zval *ret;
10990:
10991: ALLOC_ZVAL(ret);
10992: INIT_PZVAL_COPY(ret, retval_ptr);
10993: zval_copy_ctor(ret);
10994: *EG(return_value_ptr_ptr) = ret;
10995: } else if ((IS_VAR == IS_CV || IS_VAR == IS_VAR) &&
10996: retval_ptr == &EG(uninitialized_zval)) {
10997: zval *ret;
10998:
10999: ALLOC_INIT_ZVAL(ret);
11000: *EG(return_value_ptr_ptr) = ret;
11001: } else {
11002: *EG(return_value_ptr_ptr) = retval_ptr;
11003: Z_ADDREF_P(retval_ptr);
11004: }
11005: } else {
11006: zval *ret;
11007:
11008: ALLOC_ZVAL(ret);
11009: INIT_PZVAL_COPY(ret, retval_ptr);
11010: *EG(return_value_ptr_ptr) = ret;
11011: }
11012: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
11013: return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
11014: }
11015:
11016: static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
11017: {
11018: USE_OPLINE
1.1 misho 11019: zval *retval_ptr;
11020: zval **retval_ptr_ptr;
11021: zend_free_op free_op1;
11022:
1.1.1.2 misho 11023: SAVE_OPLINE();
1.1 misho 11024:
1.1.1.2 misho 11025: do {
1.1 misho 11026: if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR) {
11027: /* Not supposed to happen, but we'll allow it */
11028: zend_error(E_NOTICE, "Only variable references should be returned by reference");
1.1.1.2 misho 11029:
11030: retval_ptr = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
11031: if (!EG(return_value_ptr_ptr)) {
11032: if (IS_VAR == IS_TMP_VAR) {
11033: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
11034: }
11035: } else if (!0) { /* Not a temp var */
11036: zval *ret;
11037:
11038: ALLOC_ZVAL(ret);
11039: INIT_PZVAL_COPY(ret, retval_ptr);
11040: zval_copy_ctor(ret);
11041: *EG(return_value_ptr_ptr) = ret;
11042: } else {
11043: zval *ret;
11044:
11045: ALLOC_ZVAL(ret);
11046: INIT_PZVAL_COPY(ret, retval_ptr);
11047: *EG(return_value_ptr_ptr) = ret;
11048: }
11049: break;
1.1 misho 11050: }
11051:
1.1.1.2 misho 11052: retval_ptr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 11053:
1.1.1.2 misho 11054: if (IS_VAR == IS_VAR && UNEXPECTED(retval_ptr_ptr == NULL)) {
1.1 misho 11055: zend_error_noreturn(E_ERROR, "Cannot return string offsets by reference");
11056: }
11057:
11058: if (IS_VAR == IS_VAR && !Z_ISREF_PP(retval_ptr_ptr)) {
11059: if (opline->extended_value == ZEND_RETURNS_FUNCTION &&
1.1.1.2 misho 11060: EX_T(opline->op1.var).var.fcall_returned_reference) {
11061: } else if (EX_T(opline->op1.var).var.ptr_ptr == &EX_T(opline->op1.var).var.ptr) {
1.1 misho 11062: zend_error(E_NOTICE, "Only variable references should be returned by reference");
1.1.1.2 misho 11063: if (EG(return_value_ptr_ptr)) {
1.1.1.4 ! misho 11064: zval *ret;
! 11065:
! 11066: ALLOC_ZVAL(ret);
! 11067: INIT_PZVAL_COPY(ret, *retval_ptr_ptr);
! 11068: zval_copy_ctor(ret);
! 11069: *EG(return_value_ptr_ptr) = ret;
1.1.1.2 misho 11070: }
11071: break;
1.1 misho 11072: }
11073: }
11074:
11075: if (EG(return_value_ptr_ptr)) {
11076: SEPARATE_ZVAL_TO_MAKE_IS_REF(retval_ptr_ptr);
11077: Z_ADDREF_PP(retval_ptr_ptr);
11078:
1.1.1.2 misho 11079: *EG(return_value_ptr_ptr) = *retval_ptr_ptr;
1.1 misho 11080: }
1.1.1.2 misho 11081: } while (0);
1.1 misho 11082:
11083: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
11084: return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
11085: }
11086:
11087: static int ZEND_FASTCALL ZEND_THROW_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
11088: {
1.1.1.2 misho 11089: USE_OPLINE
1.1 misho 11090: zval *value;
11091: zval *exception;
11092: zend_free_op free_op1;
11093:
1.1.1.2 misho 11094: SAVE_OPLINE();
11095: value = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 11096:
1.1.1.2 misho 11097: if (IS_VAR == IS_CONST || UNEXPECTED(Z_TYPE_P(value) != IS_OBJECT)) {
1.1 misho 11098: zend_error_noreturn(E_ERROR, "Can only throw objects");
11099: }
11100: zend_exception_save(TSRMLS_C);
11101: /* Not sure if a complete copy is what we want here */
11102: ALLOC_ZVAL(exception);
11103: INIT_PZVAL_COPY(exception, value);
11104: if (!0) {
11105: zval_copy_ctor(exception);
11106: }
11107:
11108: zend_throw_exception_object(exception TSRMLS_CC);
11109: zend_exception_restore(TSRMLS_C);
11110: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 11111: HANDLE_EXCEPTION();
1.1 misho 11112: }
11113:
11114: static int ZEND_FASTCALL zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS)
11115: {
1.1.1.2 misho 11116: USE_OPLINE
1.1 misho 11117: zval *varptr;
11118: zend_free_op free_op1;
1.1.1.2 misho 11119: varptr = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 11120:
11121: if (varptr == &EG(uninitialized_zval)) {
11122: ALLOC_ZVAL(varptr);
11123: INIT_ZVAL(*varptr);
11124: Z_SET_REFCOUNT_P(varptr, 0);
11125: } else if (PZVAL_IS_REF(varptr)) {
11126: zval *original_var = varptr;
11127:
11128: ALLOC_ZVAL(varptr);
1.1.1.2 misho 11129: ZVAL_COPY_VALUE(varptr, original_var);
1.1 misho 11130: Z_UNSET_ISREF_P(varptr);
11131: Z_SET_REFCOUNT_P(varptr, 0);
11132: zval_copy_ctor(varptr);
11133: }
11134: Z_ADDREF_P(varptr);
11135: zend_vm_stack_push(varptr TSRMLS_CC);
11136: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; /* for string offsets */
11137:
1.1.1.2 misho 11138: CHECK_EXCEPTION();
1.1 misho 11139: ZEND_VM_NEXT_OPCODE();
11140: }
11141:
11142: static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
11143: {
1.1.1.2 misho 11144: USE_OPLINE
1.1 misho 11145: zend_free_op free_op1;
11146: zval *varptr;
11147:
1.1.1.2 misho 11148: SAVE_OPLINE();
1.1 misho 11149: if (opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) { /* Had function_ptr at compile_time */
11150: if (!(opline->extended_value & ZEND_ARG_SEND_BY_REF)) {
11151: return zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
11152: }
1.1.1.2 misho 11153: } else if (!ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) {
1.1 misho 11154: return zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
11155: }
11156:
11157: if (IS_VAR == IS_VAR &&
11158: (opline->extended_value & ZEND_ARG_SEND_FUNCTION) &&
1.1.1.2 misho 11159: EX_T(opline->op1.var).var.fcall_returned_reference &&
11160: EX_T(opline->op1.var).var.ptr) {
11161: varptr = EX_T(opline->op1.var).var.ptr;
1.1 misho 11162: PZVAL_UNLOCK_EX(varptr, &free_op1, 0);
11163: } else {
1.1.1.2 misho 11164: varptr = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 11165: }
11166: if ((!(opline->extended_value & ZEND_ARG_SEND_FUNCTION) ||
1.1.1.2 misho 11167: EX_T(opline->op1.var).var.fcall_returned_reference) &&
1.1 misho 11168: varptr != &EG(uninitialized_zval) &&
11169: (PZVAL_IS_REF(varptr) ||
11170: (Z_REFCOUNT_P(varptr) == 1 && (IS_VAR == IS_CV || free_op1.var)))) {
11171: Z_SET_ISREF_P(varptr);
11172: Z_ADDREF_P(varptr);
11173: zend_vm_stack_push(varptr TSRMLS_CC);
11174: } else {
11175: zval *valptr;
11176:
11177: if ((opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) ?
11178: !(opline->extended_value & ZEND_ARG_SEND_SILENT) :
1.1.1.2 misho 11179: !ARG_MAY_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) {
1.1 misho 11180: zend_error(E_STRICT, "Only variables should be passed by reference");
11181: }
11182: ALLOC_ZVAL(valptr);
11183: INIT_PZVAL_COPY(valptr, varptr);
11184: if (!0) {
11185: zval_copy_ctor(valptr);
11186: }
11187: zend_vm_stack_push(valptr TSRMLS_CC);
11188: }
11189: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 11190: CHECK_EXCEPTION();
1.1 misho 11191: ZEND_VM_NEXT_OPCODE();
11192: }
11193:
11194: static int ZEND_FASTCALL ZEND_SEND_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
11195: {
1.1.1.2 misho 11196: USE_OPLINE
1.1 misho 11197: zend_free_op free_op1;
11198: zval **varptr_ptr;
11199: zval *varptr;
11200:
1.1.1.2 misho 11201: SAVE_OPLINE();
11202: varptr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
11203:
11204: if (IS_VAR == IS_VAR && UNEXPECTED(varptr_ptr == NULL)) {
1.1 misho 11205: zend_error_noreturn(E_ERROR, "Only variables can be passed by reference");
11206: }
11207:
1.1.1.2 misho 11208: if (IS_VAR == IS_VAR && UNEXPECTED(*varptr_ptr == &EG(error_zval))) {
1.1 misho 11209: ALLOC_INIT_ZVAL(varptr);
11210: zend_vm_stack_push(varptr TSRMLS_CC);
1.1.1.2 misho 11211: CHECK_EXCEPTION();
1.1 misho 11212: ZEND_VM_NEXT_OPCODE();
11213: }
11214:
1.1.1.3 misho 11215: if (opline->extended_value == ZEND_DO_FCALL_BY_NAME &&
11216: EX(function_state).function->type == ZEND_INTERNAL_FUNCTION &&
11217: !ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) {
1.1 misho 11218: return zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
11219: }
11220:
11221: SEPARATE_ZVAL_TO_MAKE_IS_REF(varptr_ptr);
11222: varptr = *varptr_ptr;
11223: Z_ADDREF_P(varptr);
11224: zend_vm_stack_push(varptr TSRMLS_CC);
11225:
11226: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 11227: CHECK_EXCEPTION();
1.1 misho 11228: ZEND_VM_NEXT_OPCODE();
11229: }
11230:
11231: static int ZEND_FASTCALL ZEND_SEND_VAR_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
11232: {
1.1.1.2 misho 11233: USE_OPLINE
1.1 misho 11234:
11235: if ((opline->extended_value == ZEND_DO_FCALL_BY_NAME)
1.1.1.2 misho 11236: && ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) {
1.1 misho 11237: return ZEND_SEND_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
11238: }
1.1.1.2 misho 11239: SAVE_OPLINE();
1.1 misho 11240: return zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
11241: }
11242:
11243: static int ZEND_FASTCALL ZEND_BOOL_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
11244: {
1.1.1.2 misho 11245: USE_OPLINE
1.1 misho 11246: zend_free_op free_op1;
1.1.1.2 misho 11247: zval *retval = &EX_T(opline->result.var).tmp_var;
1.1 misho 11248:
1.1.1.2 misho 11249: SAVE_OPLINE();
1.1 misho 11250: /* PHP 3.0 returned "" for false and 1 for true, here we use 0 and 1 for now */
1.1.1.2 misho 11251: ZVAL_BOOL(retval, i_zend_is_true(_get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC)));
1.1 misho 11252: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
11253:
1.1.1.2 misho 11254: CHECK_EXCEPTION();
1.1 misho 11255: ZEND_VM_NEXT_OPCODE();
11256: }
11257:
11258: static int ZEND_FASTCALL ZEND_SWITCH_FREE_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
11259: {
1.1.1.2 misho 11260: USE_OPLINE
1.1 misho 11261:
1.1.1.2 misho 11262: SAVE_OPLINE();
11263: zval_ptr_dtor(&EX_T(opline->op1.var).var.ptr);
11264: CHECK_EXCEPTION();
1.1 misho 11265: ZEND_VM_NEXT_OPCODE();
11266: }
11267:
11268: static int ZEND_FASTCALL ZEND_CLONE_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
11269: {
1.1.1.2 misho 11270: USE_OPLINE
1.1 misho 11271: zend_free_op free_op1;
1.1.1.2 misho 11272: zval *obj;
1.1 misho 11273: zend_class_entry *ce;
11274: zend_function *clone;
11275: zend_object_clone_obj_t clone_call;
11276:
1.1.1.2 misho 11277: SAVE_OPLINE();
11278: obj = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
11279:
1.1 misho 11280: if (IS_VAR == IS_CONST ||
1.1.1.2 misho 11281: UNEXPECTED(Z_TYPE_P(obj) != IS_OBJECT)) {
1.1 misho 11282: zend_error_noreturn(E_ERROR, "__clone method called on non-object");
11283: }
11284:
11285: ce = Z_OBJCE_P(obj);
11286: clone = ce ? ce->clone : NULL;
11287: clone_call = Z_OBJ_HT_P(obj)->clone_obj;
1.1.1.2 misho 11288: if (UNEXPECTED(clone_call == NULL)) {
1.1 misho 11289: if (ce) {
11290: zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s", ce->name);
11291: } else {
11292: zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object");
11293: }
11294: }
11295:
11296: if (ce && clone) {
11297: if (clone->op_array.fn_flags & ZEND_ACC_PRIVATE) {
11298: /* Ensure that if we're calling a private function, we're allowed to do so.
11299: */
1.1.1.2 misho 11300: if (UNEXPECTED(ce != EG(scope))) {
1.1 misho 11301: zend_error_noreturn(E_ERROR, "Call to private %s::__clone() from context '%s'", ce->name, EG(scope) ? EG(scope)->name : "");
11302: }
11303: } else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) {
11304: /* Ensure that if we're calling a protected function, we're allowed to do so.
11305: */
1.1.1.3 misho 11306: if (UNEXPECTED(!zend_check_protected(zend_get_function_root_class(clone), EG(scope)))) {
1.1 misho 11307: zend_error_noreturn(E_ERROR, "Call to protected %s::__clone() from context '%s'", ce->name, EG(scope) ? EG(scope)->name : "");
11308: }
11309: }
11310: }
11311:
1.1.1.2 misho 11312: if (EXPECTED(EG(exception) == NULL)) {
11313: zval *retval;
11314:
11315: ALLOC_ZVAL(retval);
11316: Z_OBJVAL_P(retval) = clone_call(obj TSRMLS_CC);
11317: Z_TYPE_P(retval) = IS_OBJECT;
11318: Z_SET_REFCOUNT_P(retval, 1);
11319: Z_SET_ISREF_P(retval);
11320: if (!RETURN_VALUE_USED(opline) || UNEXPECTED(EG(exception) != NULL)) {
11321: zval_ptr_dtor(&retval);
11322: } else {
11323: AI_SET_PTR(&EX_T(opline->result.var), retval);
1.1 misho 11324: }
11325: }
11326: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 11327: CHECK_EXCEPTION();
1.1 misho 11328: ZEND_VM_NEXT_OPCODE();
11329: }
11330:
11331: static int ZEND_FASTCALL ZEND_CAST_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
11332: {
1.1.1.2 misho 11333: USE_OPLINE
1.1 misho 11334: zend_free_op free_op1;
1.1.1.2 misho 11335: zval *expr;
11336: zval *result = &EX_T(opline->result.var).tmp_var;
11337:
11338: SAVE_OPLINE();
11339: expr = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 11340:
11341: if (opline->extended_value != IS_STRING) {
1.1.1.2 misho 11342: ZVAL_COPY_VALUE(result, expr);
1.1 misho 11343: if (!0) {
11344: zendi_zval_copy_ctor(*result);
11345: }
11346: }
11347: switch (opline->extended_value) {
11348: case IS_NULL:
11349: convert_to_null(result);
11350: break;
11351: case IS_BOOL:
11352: convert_to_boolean(result);
11353: break;
11354: case IS_LONG:
11355: convert_to_long(result);
11356: break;
11357: case IS_DOUBLE:
11358: convert_to_double(result);
11359: break;
11360: case IS_STRING: {
11361: zval var_copy;
11362: int use_copy;
11363:
11364: zend_make_printable_zval(expr, &var_copy, &use_copy);
11365: if (use_copy) {
1.1.1.2 misho 11366: ZVAL_COPY_VALUE(result, &var_copy);
1.1 misho 11367: if (0) {
11368: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
11369: }
11370: } else {
1.1.1.2 misho 11371: ZVAL_COPY_VALUE(result, expr);
1.1 misho 11372: if (!0) {
11373: zendi_zval_copy_ctor(*result);
11374: }
11375: }
11376: break;
11377: }
11378: case IS_ARRAY:
11379: convert_to_array(result);
11380: break;
11381: case IS_OBJECT:
11382: convert_to_object(result);
11383: break;
11384: }
11385: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 11386: CHECK_EXCEPTION();
1.1 misho 11387: ZEND_VM_NEXT_OPCODE();
11388: }
11389:
11390: static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
11391: {
1.1.1.2 misho 11392: USE_OPLINE
1.1 misho 11393: zend_op_array *new_op_array=NULL;
11394: zend_free_op free_op1;
1.1.1.2 misho 11395: zval *inc_filename;
11396: zval *tmp_inc_filename = NULL;
1.1 misho 11397: zend_bool failure_retval=0;
11398:
1.1.1.2 misho 11399: SAVE_OPLINE();
11400: inc_filename = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
11401:
1.1 misho 11402: if (inc_filename->type!=IS_STRING) {
1.1.1.2 misho 11403: MAKE_STD_ZVAL(tmp_inc_filename);
11404: ZVAL_COPY_VALUE(tmp_inc_filename, inc_filename);
11405: zval_copy_ctor(tmp_inc_filename);
11406: convert_to_string(tmp_inc_filename);
11407: inc_filename = tmp_inc_filename;
1.1 misho 11408: }
11409:
1.1.1.2 misho 11410: if (opline->extended_value != ZEND_EVAL && strlen(Z_STRVAL_P(inc_filename)) != Z_STRLEN_P(inc_filename)) {
11411: if (opline->extended_value == ZEND_INCLUDE_ONCE || opline->extended_value == ZEND_INCLUDE) {
1.1 misho 11412: zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
11413: } else {
11414: zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
11415: }
11416: } else {
1.1.1.2 misho 11417: switch (opline->extended_value) {
1.1 misho 11418: case ZEND_INCLUDE_ONCE:
11419: case ZEND_REQUIRE_ONCE: {
11420: zend_file_handle file_handle;
11421: char *resolved_path;
11422:
11423: resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename) TSRMLS_CC);
11424: if (resolved_path) {
11425: failure_retval = zend_hash_exists(&EG(included_files), resolved_path, strlen(resolved_path)+1);
11426: } else {
11427: resolved_path = Z_STRVAL_P(inc_filename);
11428: }
11429:
11430: if (failure_retval) {
11431: /* do nothing, file already included */
11432: } else if (SUCCESS == zend_stream_open(resolved_path, &file_handle TSRMLS_CC)) {
11433:
11434: if (!file_handle.opened_path) {
11435: file_handle.opened_path = estrdup(resolved_path);
11436: }
11437:
11438: if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) {
1.1.1.2 misho 11439: new_op_array = zend_compile_file(&file_handle, (opline->extended_value==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
1.1 misho 11440: zend_destroy_file_handle(&file_handle TSRMLS_CC);
11441: } else {
11442: zend_file_handle_dtor(&file_handle TSRMLS_CC);
11443: failure_retval=1;
11444: }
11445: } else {
1.1.1.2 misho 11446: if (opline->extended_value == ZEND_INCLUDE_ONCE) {
1.1 misho 11447: zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
11448: } else {
11449: zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
11450: }
11451: }
11452: if (resolved_path != Z_STRVAL_P(inc_filename)) {
11453: efree(resolved_path);
11454: }
11455: }
11456: break;
11457: case ZEND_INCLUDE:
11458: case ZEND_REQUIRE:
1.1.1.2 misho 11459: new_op_array = compile_filename(opline->extended_value, inc_filename TSRMLS_CC);
1.1 misho 11460: break;
11461: case ZEND_EVAL: {
11462: char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);
11463:
11464: new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
11465: efree(eval_desc);
11466: }
11467: break;
11468: EMPTY_SWITCH_DEFAULT_CASE()
11469: }
11470: }
1.1.1.2 misho 11471: if (tmp_inc_filename) {
11472: zval_ptr_dtor(&tmp_inc_filename);
1.1 misho 11473: }
11474: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 11475: if (UNEXPECTED(EG(exception) != NULL)) {
11476: HANDLE_EXCEPTION();
11477: } else if (EXPECTED(new_op_array != NULL)) {
1.1 misho 11478: EX(original_return_value) = EG(return_value_ptr_ptr);
11479: EG(active_op_array) = new_op_array;
1.1.1.2 misho 11480: if (RETURN_VALUE_USED(opline)) {
11481: EX_T(opline->result.var).var.ptr = NULL;
11482: EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
11483: EG(return_value_ptr_ptr) = EX_T(opline->result.var).var.ptr_ptr;
11484: } else {
11485: EG(return_value_ptr_ptr) = NULL;
11486: }
1.1 misho 11487:
11488: EX(current_object) = EX(object);
11489:
11490: EX(function_state).function = (zend_function *) new_op_array;
11491: EX(object) = NULL;
11492:
11493: if (!EG(active_symbol_table)) {
11494: zend_rebuild_symbol_table(TSRMLS_C);
11495: }
11496:
1.1.1.2 misho 11497: if (EXPECTED(zend_execute == execute)) {
1.1 misho 11498: ZEND_VM_ENTER();
11499: } else {
11500: zend_execute(new_op_array TSRMLS_CC);
11501: }
11502:
1.1.1.2 misho 11503: EX(function_state).function = (zend_function *) EX(op_array);
11504: EX(object) = EX(current_object);
1.1 misho 11505:
1.1.1.2 misho 11506: EG(opline_ptr) = &EX(opline);
11507: EG(active_op_array) = EX(op_array);
11508: EG(return_value_ptr_ptr) = EX(original_return_value);
11509: destroy_op_array(new_op_array TSRMLS_CC);
11510: efree(new_op_array);
11511: if (UNEXPECTED(EG(exception) != NULL)) {
11512: zend_throw_exception_internal(NULL TSRMLS_CC);
11513: HANDLE_EXCEPTION();
11514: } else if (RETURN_VALUE_USED(opline)) {
11515: if (!EX_T(opline->result.var).var.ptr) { /* there was no return statement */
11516: zval *retval;
1.1 misho 11517:
1.1.1.2 misho 11518: ALLOC_ZVAL(retval);
11519: ZVAL_BOOL(retval, 1);
11520: INIT_PZVAL(retval);
11521: EX_T(opline->result.var).var.ptr = retval;
11522: }
1.1 misho 11523: }
11524:
1.1.1.2 misho 11525: } else if (RETURN_VALUE_USED(opline)) {
11526: zval *retval;
11527:
11528: ALLOC_ZVAL(retval);
11529: ZVAL_BOOL(retval, failure_retval);
11530: INIT_PZVAL(retval);
11531: AI_SET_PTR(&EX_T(opline->result.var), retval);
1.1 misho 11532: }
11533: ZEND_VM_NEXT_OPCODE();
11534: }
11535:
11536: static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
11537: {
1.1.1.2 misho 11538: USE_OPLINE
1.1 misho 11539: zend_free_op free_op1;
11540: zval *array_ptr, **array_ptr_ptr;
11541: HashTable *fe_ht;
11542: zend_object_iterator *iter = NULL;
11543: zend_class_entry *ce = NULL;
11544: zend_bool is_empty = 0;
11545:
1.1.1.2 misho 11546: SAVE_OPLINE();
11547:
11548: if ((IS_VAR == IS_CV || IS_VAR == IS_VAR) &&
11549: (opline->extended_value & ZEND_FE_RESET_VARIABLE)) {
11550: array_ptr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 11551: if (array_ptr_ptr == NULL || array_ptr_ptr == &EG(uninitialized_zval_ptr)) {
1.1.1.2 misho 11552: MAKE_STD_ZVAL(array_ptr);
11553: ZVAL_NULL(array_ptr);
1.1 misho 11554: } else if (Z_TYPE_PP(array_ptr_ptr) == IS_OBJECT) {
11555: if(Z_OBJ_HT_PP(array_ptr_ptr)->get_class_entry == NULL) {
11556: zend_error(E_WARNING, "foreach() cannot iterate over objects without PHP class");
1.1.1.2 misho 11557: ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num);
1.1 misho 11558: }
11559:
11560: ce = Z_OBJCE_PP(array_ptr_ptr);
11561: if (!ce || ce->get_iterator == NULL) {
11562: SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr);
11563: Z_ADDREF_PP(array_ptr_ptr);
11564: }
11565: array_ptr = *array_ptr_ptr;
11566: } else {
11567: if (Z_TYPE_PP(array_ptr_ptr) == IS_ARRAY) {
11568: SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr);
11569: if (opline->extended_value & ZEND_FE_FETCH_BYREF) {
11570: Z_SET_ISREF_PP(array_ptr_ptr);
11571: }
11572: }
11573: array_ptr = *array_ptr_ptr;
11574: Z_ADDREF_P(array_ptr);
11575: }
11576: } else {
1.1.1.2 misho 11577: array_ptr = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 11578: if (0) { /* IS_TMP_VAR */
11579: zval *tmp;
11580:
11581: ALLOC_ZVAL(tmp);
11582: INIT_PZVAL_COPY(tmp, array_ptr);
11583: array_ptr = tmp;
11584: if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
11585: ce = Z_OBJCE_P(array_ptr);
11586: if (ce && ce->get_iterator) {
11587: Z_DELREF_P(array_ptr);
11588: }
11589: }
11590: } else if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
11591: ce = Z_OBJCE_P(array_ptr);
11592: if (!ce || !ce->get_iterator) {
11593: Z_ADDREF_P(array_ptr);
11594: }
11595: } else if (IS_VAR == IS_CONST ||
11596: ((IS_VAR == IS_CV || IS_VAR == IS_VAR) &&
11597: !Z_ISREF_P(array_ptr) &&
11598: Z_REFCOUNT_P(array_ptr) > 1)) {
11599: zval *tmp;
11600:
11601: ALLOC_ZVAL(tmp);
11602: INIT_PZVAL_COPY(tmp, array_ptr);
11603: zval_copy_ctor(tmp);
11604: array_ptr = tmp;
11605: } else {
11606: Z_ADDREF_P(array_ptr);
11607: }
11608: }
11609:
11610: if (ce && ce->get_iterator) {
11611: iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC);
11612:
1.1.1.2 misho 11613: if (iter && EXPECTED(EG(exception) == NULL)) {
1.1 misho 11614: array_ptr = zend_iterator_wrap(iter TSRMLS_CC);
11615: } else {
1.1.1.2 misho 11616: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1 misho 11617: if (!EG(exception)) {
11618: zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Object of type %s did not create an Iterator", ce->name);
11619: }
11620: zend_throw_exception_internal(NULL TSRMLS_CC);
1.1.1.2 misho 11621: HANDLE_EXCEPTION();
1.1 misho 11622: }
11623: }
11624:
1.1.1.2 misho 11625: EX_T(opline->result.var).fe.ptr = array_ptr;
1.1 misho 11626:
11627: if (iter) {
11628: iter->index = 0;
11629: if (iter->funcs->rewind) {
11630: iter->funcs->rewind(iter TSRMLS_CC);
1.1.1.2 misho 11631: if (UNEXPECTED(EG(exception) != NULL)) {
1.1 misho 11632: zval_ptr_dtor(&array_ptr);
1.1.1.2 misho 11633: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
11634: HANDLE_EXCEPTION();
1.1 misho 11635: }
11636: }
11637: is_empty = iter->funcs->valid(iter TSRMLS_CC) != SUCCESS;
1.1.1.2 misho 11638: if (UNEXPECTED(EG(exception) != NULL)) {
1.1 misho 11639: zval_ptr_dtor(&array_ptr);
1.1.1.2 misho 11640: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
11641: HANDLE_EXCEPTION();
1.1 misho 11642: }
11643: iter->index = -1; /* will be set to 0 before using next handler */
11644: } else if ((fe_ht = HASH_OF(array_ptr)) != NULL) {
11645: zend_hash_internal_pointer_reset(fe_ht);
11646: if (ce) {
11647: zend_object *zobj = zend_objects_get_address(array_ptr TSRMLS_CC);
11648: while (zend_hash_has_more_elements(fe_ht) == SUCCESS) {
11649: char *str_key;
11650: uint str_key_len;
11651: ulong int_key;
11652: zend_uchar key_type;
11653:
11654: key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL);
11655: if (key_type != HASH_KEY_NON_EXISTANT &&
11656: (key_type == HASH_KEY_IS_LONG ||
11657: zend_check_property_access(zobj, str_key, str_key_len-1 TSRMLS_CC) == SUCCESS)) {
11658: break;
11659: }
11660: zend_hash_move_forward(fe_ht);
11661: }
11662: }
11663: is_empty = zend_hash_has_more_elements(fe_ht) != SUCCESS;
1.1.1.2 misho 11664: zend_hash_get_pointer(fe_ht, &EX_T(opline->result.var).fe.fe_pos);
1.1 misho 11665: } else {
11666: zend_error(E_WARNING, "Invalid argument supplied for foreach()");
11667: is_empty = 1;
11668: }
11669:
1.1.1.2 misho 11670: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1 misho 11671: if (is_empty) {
1.1.1.2 misho 11672: ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num);
1.1 misho 11673: } else {
1.1.1.2 misho 11674: CHECK_EXCEPTION();
1.1 misho 11675: ZEND_VM_NEXT_OPCODE();
11676: }
11677: }
11678:
11679: static int ZEND_FASTCALL ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
11680: {
1.1.1.2 misho 11681: USE_OPLINE
1.1 misho 11682:
1.1.1.2 misho 11683: zval *array = EX_T(opline->op1.var).fe.ptr;
1.1 misho 11684: zval **value;
11685: char *str_key;
11686: uint str_key_len;
11687: ulong int_key;
11688: HashTable *fe_ht;
11689: zend_object_iterator *iter = NULL;
11690: int key_type = 0;
11691: zend_bool use_key = (zend_bool)(opline->extended_value & ZEND_FE_FETCH_WITH_KEY);
11692:
1.1.1.2 misho 11693: SAVE_OPLINE();
11694:
1.1 misho 11695: switch (zend_iterator_unwrap(array, &iter TSRMLS_CC)) {
11696: default:
11697: case ZEND_ITER_INVALID:
11698: zend_error(E_WARNING, "Invalid argument supplied for foreach()");
1.1.1.2 misho 11699: ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num);
1.1 misho 11700:
11701: case ZEND_ITER_PLAIN_OBJECT: {
1.1.1.2 misho 11702: const char *class_name, *prop_name;
1.1 misho 11703: zend_object *zobj = zend_objects_get_address(array TSRMLS_CC);
11704:
1.1.1.2 misho 11705: fe_ht = Z_OBJPROP_P(array);
11706: zend_hash_set_pointer(fe_ht, &EX_T(opline->op1.var).fe.fe_pos);
1.1 misho 11707: do {
11708: if (zend_hash_get_current_data(fe_ht, (void **) &value)==FAILURE) {
11709: /* reached end of iteration */
1.1.1.2 misho 11710: ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num);
1.1 misho 11711: }
11712: key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL);
11713:
11714: zend_hash_move_forward(fe_ht);
11715: } while (key_type == HASH_KEY_NON_EXISTANT ||
11716: (key_type != HASH_KEY_IS_LONG &&
11717: zend_check_property_access(zobj, str_key, str_key_len-1 TSRMLS_CC) != SUCCESS));
1.1.1.2 misho 11718: zend_hash_get_pointer(fe_ht, &EX_T(opline->op1.var).fe.fe_pos);
1.1 misho 11719: if (use_key && key_type != HASH_KEY_IS_LONG) {
11720: zend_unmangle_property_name(str_key, str_key_len-1, &class_name, &prop_name);
11721: str_key_len = strlen(prop_name);
11722: str_key = estrndup(prop_name, str_key_len);
11723: str_key_len++;
11724: }
11725: break;
11726: }
11727:
11728: case ZEND_ITER_PLAIN_ARRAY:
1.1.1.2 misho 11729: fe_ht = Z_ARRVAL_P(array);
11730: zend_hash_set_pointer(fe_ht, &EX_T(opline->op1.var).fe.fe_pos);
1.1 misho 11731: if (zend_hash_get_current_data(fe_ht, (void **) &value)==FAILURE) {
11732: /* reached end of iteration */
1.1.1.2 misho 11733: ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num);
1.1 misho 11734: }
11735: if (use_key) {
11736: key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 1, NULL);
11737: }
11738: zend_hash_move_forward(fe_ht);
1.1.1.2 misho 11739: zend_hash_get_pointer(fe_ht, &EX_T(opline->op1.var).fe.fe_pos);
1.1 misho 11740: break;
11741:
11742: case ZEND_ITER_OBJECT:
11743: /* !iter happens from exception */
11744: if (iter && ++iter->index > 0) {
11745: /* This could cause an endless loop if index becomes zero again.
11746: * In case that ever happens we need an additional flag. */
11747: iter->funcs->move_forward(iter TSRMLS_CC);
1.1.1.2 misho 11748: if (UNEXPECTED(EG(exception) != NULL)) {
1.1 misho 11749: zval_ptr_dtor(&array);
1.1.1.2 misho 11750: HANDLE_EXCEPTION();
1.1 misho 11751: }
11752: }
11753: /* If index is zero we come from FE_RESET and checked valid() already. */
11754: if (!iter || (iter->index > 0 && iter->funcs->valid(iter TSRMLS_CC) == FAILURE)) {
11755: /* reached end of iteration */
1.1.1.2 misho 11756: if (UNEXPECTED(EG(exception) != NULL)) {
1.1 misho 11757: zval_ptr_dtor(&array);
1.1.1.2 misho 11758: HANDLE_EXCEPTION();
1.1 misho 11759: }
1.1.1.2 misho 11760: ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num);
1.1 misho 11761: }
11762: iter->funcs->get_current_data(iter, &value TSRMLS_CC);
1.1.1.2 misho 11763: if (UNEXPECTED(EG(exception) != NULL)) {
1.1 misho 11764: zval_ptr_dtor(&array);
1.1.1.2 misho 11765: HANDLE_EXCEPTION();
1.1 misho 11766: }
11767: if (!value) {
11768: /* failure in get_current_data */
1.1.1.2 misho 11769: ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num);
1.1 misho 11770: }
11771: if (use_key) {
11772: if (iter->funcs->get_current_key) {
11773: key_type = iter->funcs->get_current_key(iter, &str_key, &str_key_len, &int_key TSRMLS_CC);
1.1.1.2 misho 11774: if (UNEXPECTED(EG(exception) != NULL)) {
1.1 misho 11775: zval_ptr_dtor(&array);
1.1.1.2 misho 11776: HANDLE_EXCEPTION();
1.1 misho 11777: }
11778: } else {
11779: key_type = HASH_KEY_IS_LONG;
11780: int_key = iter->index;
11781: }
11782: }
11783: break;
11784: }
11785:
11786: if (opline->extended_value & ZEND_FE_FETCH_BYREF) {
11787: SEPARATE_ZVAL_IF_NOT_REF(value);
11788: Z_SET_ISREF_PP(value);
1.1.1.2 misho 11789: EX_T(opline->result.var).var.ptr_ptr = value;
1.1 misho 11790: Z_ADDREF_PP(value);
11791: } else {
11792: PZVAL_LOCK(*value);
1.1.1.2 misho 11793: AI_SET_PTR(&EX_T(opline->result.var), *value);
1.1 misho 11794: }
11795:
11796: if (use_key) {
1.1.1.2 misho 11797: zval *key = &EX_T((opline+1)->result.var).tmp_var;
1.1 misho 11798:
11799: switch (key_type) {
11800: case HASH_KEY_IS_STRING:
1.1.1.2 misho 11801: Z_STRVAL_P(key) = (char*)str_key;
1.1 misho 11802: Z_STRLEN_P(key) = str_key_len-1;
11803: Z_TYPE_P(key) = IS_STRING;
11804: break;
11805: case HASH_KEY_IS_LONG:
11806: Z_LVAL_P(key) = int_key;
11807: Z_TYPE_P(key) = IS_LONG;
11808: break;
11809: default:
11810: case HASH_KEY_NON_EXISTANT:
11811: ZVAL_NULL(key);
11812: break;
11813: }
11814: }
11815:
1.1.1.2 misho 11816: CHECK_EXCEPTION();
1.1 misho 11817: ZEND_VM_INC_OPCODE();
11818: ZEND_VM_NEXT_OPCODE();
11819: }
11820:
11821: static int ZEND_FASTCALL ZEND_EXIT_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
11822: {
11823: #if 0 || (IS_VAR != IS_UNUSED)
1.1.1.2 misho 11824: USE_OPLINE
11825:
11826: SAVE_OPLINE();
1.1 misho 11827: if (IS_VAR != IS_UNUSED) {
11828: zend_free_op free_op1;
1.1.1.2 misho 11829: zval *ptr = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 11830:
11831: if (Z_TYPE_P(ptr) == IS_LONG) {
11832: EG(exit_status) = Z_LVAL_P(ptr);
11833: } else {
11834: zend_print_variable(ptr);
11835: }
11836: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
11837: }
11838: #endif
11839: zend_bailout();
1.1.1.2 misho 11840: ZEND_VM_NEXT_OPCODE(); /* Never reached */
1.1 misho 11841: }
11842:
11843: static int ZEND_FASTCALL ZEND_JMP_SET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
11844: {
1.1.1.2 misho 11845: USE_OPLINE
11846: zend_free_op free_op1;
11847: zval *value;
11848:
11849: SAVE_OPLINE();
11850: value = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
11851:
11852: if (i_zend_is_true(value)) {
11853: ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, value);
11854: if (!0) {
11855: zendi_zval_copy_ctor(EX_T(opline->result.var).tmp_var);
11856: }
11857: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
11858: #if DEBUG_ZEND>=2
11859: printf("Conditional jmp to %d\n", opline->op2.opline_num);
11860: #endif
11861: ZEND_VM_JMP(opline->op2.jmp_addr);
11862: }
11863:
11864: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
11865: CHECK_EXCEPTION();
11866: ZEND_VM_NEXT_OPCODE();
11867: }
11868:
11869: static int ZEND_FASTCALL ZEND_JMP_SET_VAR_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
11870: {
11871: USE_OPLINE
1.1 misho 11872: zend_free_op free_op1;
1.1.1.2 misho 11873: zval *value, *ret;
11874:
11875: SAVE_OPLINE();
11876: value = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 11877:
11878: if (i_zend_is_true(value)) {
1.1.1.2 misho 11879: if (IS_VAR == IS_VAR || IS_VAR == IS_CV) {
11880: Z_ADDREF_P(value);
11881: EX_T(opline->result.var).var.ptr = value;
11882: EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
11883: } else {
11884: ALLOC_ZVAL(ret);
11885: INIT_PZVAL_COPY(ret, value);
11886: EX_T(opline->result.var).var.ptr = ret;
11887: EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
11888: if (!0) {
11889: zval_copy_ctor(EX_T(opline->result.var).var.ptr);
11890: }
11891: }
1.1 misho 11892: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
11893: #if DEBUG_ZEND>=2
1.1.1.2 misho 11894: printf("Conditional jmp to %d\n", opline->op2.opline_num);
1.1 misho 11895: #endif
1.1.1.2 misho 11896: ZEND_VM_JMP(opline->op2.jmp_addr);
1.1 misho 11897: }
11898:
11899: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 11900: CHECK_EXCEPTION();
1.1 misho 11901: ZEND_VM_NEXT_OPCODE();
11902: }
11903:
11904: static int ZEND_FASTCALL ZEND_QM_ASSIGN_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
11905: {
1.1.1.2 misho 11906: USE_OPLINE
1.1 misho 11907: zend_free_op free_op1;
1.1.1.2 misho 11908: zval *value;
1.1 misho 11909:
1.1.1.2 misho 11910: SAVE_OPLINE();
11911: value = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
11912:
11913: ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, value);
1.1 misho 11914: if (!0) {
1.1.1.2 misho 11915: zval_copy_ctor(&EX_T(opline->result.var).tmp_var);
11916: }
11917: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
11918: CHECK_EXCEPTION();
11919: ZEND_VM_NEXT_OPCODE();
11920: }
11921:
11922: static int ZEND_FASTCALL ZEND_QM_ASSIGN_VAR_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
11923: {
11924: USE_OPLINE
11925: zend_free_op free_op1;
11926: zval *value, *ret;
11927:
11928: SAVE_OPLINE();
11929: value = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
11930:
11931: if (IS_VAR == IS_VAR || IS_VAR == IS_CV) {
11932: Z_ADDREF_P(value);
11933: EX_T(opline->result.var).var.ptr = value;
11934: EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
11935: } else {
11936: ALLOC_ZVAL(ret);
11937: INIT_PZVAL_COPY(ret, value);
11938: EX_T(opline->result.var).var.ptr = ret;
11939: EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
11940: if (!0) {
11941: zval_copy_ctor(EX_T(opline->result.var).var.ptr);
11942: }
1.1 misho 11943: }
1.1.1.2 misho 11944:
1.1 misho 11945: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 11946: CHECK_EXCEPTION();
1.1 misho 11947: ZEND_VM_NEXT_OPCODE();
11948: }
11949:
11950: static int ZEND_FASTCALL ZEND_INSTANCEOF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
11951: {
1.1.1.2 misho 11952: USE_OPLINE
1.1 misho 11953: zend_free_op free_op1;
1.1.1.2 misho 11954: zval *expr;
1.1 misho 11955: zend_bool result;
11956:
1.1.1.2 misho 11957: SAVE_OPLINE();
11958: expr = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
11959:
1.1 misho 11960: if (Z_TYPE_P(expr) == IS_OBJECT && Z_OBJ_HT_P(expr)->get_class_entry) {
1.1.1.2 misho 11961: result = instanceof_function(Z_OBJCE_P(expr), EX_T(opline->op2.var).class_entry TSRMLS_CC);
1.1 misho 11962: } else {
11963: result = 0;
11964: }
1.1.1.2 misho 11965: ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, result);
1.1 misho 11966: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 11967: CHECK_EXCEPTION();
1.1 misho 11968: ZEND_VM_NEXT_OPCODE();
11969: }
11970:
11971: static int ZEND_FASTCALL ZEND_ADD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
11972: {
1.1.1.2 misho 11973: USE_OPLINE
1.1 misho 11974: zend_free_op free_op1;
11975:
1.1.1.2 misho 11976: SAVE_OPLINE();
11977: fast_add_function(&EX_T(opline->result.var).tmp_var,
11978: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
11979: opline->op2.zv TSRMLS_CC);
1.1 misho 11980: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
11981:
1.1.1.2 misho 11982: CHECK_EXCEPTION();
1.1 misho 11983: ZEND_VM_NEXT_OPCODE();
11984: }
11985:
11986: static int ZEND_FASTCALL ZEND_SUB_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
11987: {
1.1.1.2 misho 11988: USE_OPLINE
1.1 misho 11989: zend_free_op free_op1;
11990:
1.1.1.2 misho 11991: SAVE_OPLINE();
11992: fast_sub_function(&EX_T(opline->result.var).tmp_var,
11993: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
11994: opline->op2.zv TSRMLS_CC);
1.1 misho 11995: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
11996:
1.1.1.2 misho 11997: CHECK_EXCEPTION();
1.1 misho 11998: ZEND_VM_NEXT_OPCODE();
11999: }
12000:
12001: static int ZEND_FASTCALL ZEND_MUL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
12002: {
1.1.1.2 misho 12003: USE_OPLINE
1.1 misho 12004: zend_free_op free_op1;
12005:
1.1.1.2 misho 12006: SAVE_OPLINE();
12007: fast_mul_function(&EX_T(opline->result.var).tmp_var,
12008: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
12009: opline->op2.zv TSRMLS_CC);
1.1 misho 12010: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
12011:
1.1.1.2 misho 12012: CHECK_EXCEPTION();
1.1 misho 12013: ZEND_VM_NEXT_OPCODE();
12014: }
12015:
12016: static int ZEND_FASTCALL ZEND_DIV_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
12017: {
1.1.1.2 misho 12018: USE_OPLINE
1.1 misho 12019: zend_free_op free_op1;
12020:
1.1.1.2 misho 12021: SAVE_OPLINE();
12022: fast_div_function(&EX_T(opline->result.var).tmp_var,
12023: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
12024: opline->op2.zv TSRMLS_CC);
1.1 misho 12025: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
12026:
1.1.1.2 misho 12027: CHECK_EXCEPTION();
1.1 misho 12028: ZEND_VM_NEXT_OPCODE();
12029: }
12030:
12031: static int ZEND_FASTCALL ZEND_MOD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
12032: {
1.1.1.2 misho 12033: USE_OPLINE
1.1 misho 12034: zend_free_op free_op1;
12035:
1.1.1.2 misho 12036: SAVE_OPLINE();
12037: fast_mod_function(&EX_T(opline->result.var).tmp_var,
12038: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
12039: opline->op2.zv TSRMLS_CC);
1.1 misho 12040: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
12041:
1.1.1.2 misho 12042: CHECK_EXCEPTION();
1.1 misho 12043: ZEND_VM_NEXT_OPCODE();
12044: }
12045:
12046: static int ZEND_FASTCALL ZEND_SL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
12047: {
1.1.1.2 misho 12048: USE_OPLINE
1.1 misho 12049: zend_free_op free_op1;
12050:
1.1.1.2 misho 12051: SAVE_OPLINE();
12052: shift_left_function(&EX_T(opline->result.var).tmp_var,
12053: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
12054: opline->op2.zv TSRMLS_CC);
1.1 misho 12055: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
12056:
1.1.1.2 misho 12057: CHECK_EXCEPTION();
1.1 misho 12058: ZEND_VM_NEXT_OPCODE();
12059: }
12060:
12061: static int ZEND_FASTCALL ZEND_SR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
12062: {
1.1.1.2 misho 12063: USE_OPLINE
1.1 misho 12064: zend_free_op free_op1;
12065:
1.1.1.2 misho 12066: SAVE_OPLINE();
12067: shift_right_function(&EX_T(opline->result.var).tmp_var,
12068: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
12069: opline->op2.zv TSRMLS_CC);
1.1 misho 12070: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
12071:
1.1.1.2 misho 12072: CHECK_EXCEPTION();
1.1 misho 12073: ZEND_VM_NEXT_OPCODE();
12074: }
12075:
12076: static int ZEND_FASTCALL ZEND_CONCAT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
12077: {
1.1.1.2 misho 12078: USE_OPLINE
1.1 misho 12079: zend_free_op free_op1;
12080:
1.1.1.2 misho 12081: SAVE_OPLINE();
12082: concat_function(&EX_T(opline->result.var).tmp_var,
12083: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
12084: opline->op2.zv TSRMLS_CC);
1.1 misho 12085: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
12086:
1.1.1.2 misho 12087: CHECK_EXCEPTION();
1.1 misho 12088: ZEND_VM_NEXT_OPCODE();
12089: }
12090:
12091: static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
12092: {
1.1.1.2 misho 12093: USE_OPLINE
1.1 misho 12094: zend_free_op free_op1;
12095:
1.1.1.2 misho 12096: SAVE_OPLINE();
12097: is_identical_function(&EX_T(opline->result.var).tmp_var,
12098: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
12099: opline->op2.zv TSRMLS_CC);
1.1 misho 12100: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
12101:
1.1.1.2 misho 12102: CHECK_EXCEPTION();
1.1 misho 12103: ZEND_VM_NEXT_OPCODE();
12104: }
12105:
12106: static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
12107: {
1.1.1.2 misho 12108: USE_OPLINE
1.1 misho 12109: zend_free_op free_op1;
1.1.1.2 misho 12110: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 12111:
1.1.1.2 misho 12112: SAVE_OPLINE();
1.1 misho 12113: is_identical_function(result,
1.1.1.2 misho 12114: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
12115: opline->op2.zv TSRMLS_CC);
1.1 misho 12116: Z_LVAL_P(result) = !Z_LVAL_P(result);
12117: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
12118:
1.1.1.2 misho 12119: CHECK_EXCEPTION();
1.1 misho 12120: ZEND_VM_NEXT_OPCODE();
12121: }
12122:
12123: static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
12124: {
1.1.1.2 misho 12125: USE_OPLINE
1.1 misho 12126: zend_free_op free_op1;
1.1.1.2 misho 12127: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 12128:
1.1.1.2 misho 12129: SAVE_OPLINE();
12130: ZVAL_BOOL(result, fast_equal_function(result,
12131: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
12132: opline->op2.zv TSRMLS_CC));
1.1 misho 12133: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
12134:
1.1.1.2 misho 12135: CHECK_EXCEPTION();
1.1 misho 12136: ZEND_VM_NEXT_OPCODE();
12137: }
12138:
12139: static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
12140: {
1.1.1.2 misho 12141: USE_OPLINE
1.1 misho 12142: zend_free_op free_op1;
1.1.1.2 misho 12143: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 12144:
1.1.1.2 misho 12145: SAVE_OPLINE();
12146: ZVAL_BOOL(result, fast_not_equal_function(result,
12147: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
12148: opline->op2.zv TSRMLS_CC));
1.1 misho 12149: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
12150:
1.1.1.2 misho 12151: CHECK_EXCEPTION();
1.1 misho 12152: ZEND_VM_NEXT_OPCODE();
12153: }
12154:
12155: static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
12156: {
1.1.1.2 misho 12157: USE_OPLINE
1.1 misho 12158: zend_free_op free_op1;
1.1.1.2 misho 12159: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 12160:
1.1.1.2 misho 12161: SAVE_OPLINE();
12162: ZVAL_BOOL(result, fast_is_smaller_function(result,
12163: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
12164: opline->op2.zv TSRMLS_CC));
1.1 misho 12165: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
12166:
1.1.1.2 misho 12167: CHECK_EXCEPTION();
1.1 misho 12168: ZEND_VM_NEXT_OPCODE();
12169: }
12170:
12171: static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
12172: {
1.1.1.2 misho 12173: USE_OPLINE
1.1 misho 12174: zend_free_op free_op1;
1.1.1.2 misho 12175: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 12176:
1.1.1.2 misho 12177: SAVE_OPLINE();
12178: ZVAL_BOOL(result, fast_is_smaller_or_equal_function(result,
12179: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
12180: opline->op2.zv TSRMLS_CC));
1.1 misho 12181: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
12182:
1.1.1.2 misho 12183: CHECK_EXCEPTION();
1.1 misho 12184: ZEND_VM_NEXT_OPCODE();
12185: }
12186:
12187: static int ZEND_FASTCALL ZEND_BW_OR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
12188: {
1.1.1.2 misho 12189: USE_OPLINE
1.1 misho 12190: zend_free_op free_op1;
12191:
1.1.1.2 misho 12192: SAVE_OPLINE();
12193: bitwise_or_function(&EX_T(opline->result.var).tmp_var,
12194: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
12195: opline->op2.zv TSRMLS_CC);
1.1 misho 12196: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
12197:
1.1.1.2 misho 12198: CHECK_EXCEPTION();
1.1 misho 12199: ZEND_VM_NEXT_OPCODE();
12200: }
12201:
12202: static int ZEND_FASTCALL ZEND_BW_AND_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
12203: {
1.1.1.2 misho 12204: USE_OPLINE
1.1 misho 12205: zend_free_op free_op1;
12206:
1.1.1.2 misho 12207: SAVE_OPLINE();
12208: bitwise_and_function(&EX_T(opline->result.var).tmp_var,
12209: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
12210: opline->op2.zv TSRMLS_CC);
1.1 misho 12211: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
12212:
1.1.1.2 misho 12213: CHECK_EXCEPTION();
1.1 misho 12214: ZEND_VM_NEXT_OPCODE();
12215: }
12216:
12217: static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
12218: {
1.1.1.2 misho 12219: USE_OPLINE
1.1 misho 12220: zend_free_op free_op1;
12221:
1.1.1.2 misho 12222: SAVE_OPLINE();
12223: bitwise_xor_function(&EX_T(opline->result.var).tmp_var,
12224: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
12225: opline->op2.zv TSRMLS_CC);
1.1 misho 12226: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
12227:
1.1.1.2 misho 12228: CHECK_EXCEPTION();
1.1 misho 12229: ZEND_VM_NEXT_OPCODE();
12230: }
12231:
12232: static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
12233: {
1.1.1.2 misho 12234: USE_OPLINE
1.1 misho 12235: zend_free_op free_op1;
12236:
1.1.1.2 misho 12237: SAVE_OPLINE();
12238: boolean_xor_function(&EX_T(opline->result.var).tmp_var,
12239: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
12240: opline->op2.zv TSRMLS_CC);
1.1 misho 12241: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
12242:
1.1.1.2 misho 12243: CHECK_EXCEPTION();
1.1 misho 12244: ZEND_VM_NEXT_OPCODE();
12245: }
12246:
12247: static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
12248: {
1.1.1.2 misho 12249: USE_OPLINE
1.1 misho 12250: zend_free_op free_op1, free_op_data1;
1.1.1.2 misho 12251: zval **object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 12252: zval *object;
1.1.1.2 misho 12253: zval *property = opline->op2.zv;
12254: zval *value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R);
1.1 misho 12255: int have_get_ptr = 0;
12256:
1.1.1.2 misho 12257: if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 12258: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
12259: }
12260:
12261: make_real_object(object_ptr TSRMLS_CC);
12262: object = *object_ptr;
12263:
1.1.1.2 misho 12264: if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
1.1 misho 12265: zend_error(E_WARNING, "Attempt to assign property of non-object");
12266:
12267: FREE_OP(free_op_data1);
12268:
1.1.1.2 misho 12269: if (RETURN_VALUE_USED(opline)) {
12270: PZVAL_LOCK(&EG(uninitialized_zval));
12271: EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
12272: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 12273: }
12274: } else {
12275: /* here we are sure we are dealing with an object */
12276: if (0) {
12277: MAKE_REAL_ZVAL_PTR(property);
12278: }
12279:
12280: /* here property is a string */
12281: if (opline->extended_value == ZEND_ASSIGN_OBJ
12282: && Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
1.1.1.2 misho 12283: zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 12284: if (zptr != NULL) { /* NULL means no success in getting PTR */
12285: SEPARATE_ZVAL_IF_NOT_REF(zptr);
12286:
12287: have_get_ptr = 1;
12288: binary_op(*zptr, *zptr, value TSRMLS_CC);
1.1.1.2 misho 12289: if (RETURN_VALUE_USED(opline)) {
1.1 misho 12290: PZVAL_LOCK(*zptr);
1.1.1.2 misho 12291: EX_T(opline->result.var).var.ptr = *zptr;
12292: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 12293: }
12294: }
12295: }
12296:
12297: if (!have_get_ptr) {
12298: zval *z = NULL;
12299:
12300: if (opline->extended_value == ZEND_ASSIGN_OBJ) {
12301: if (Z_OBJ_HT_P(object)->read_property) {
1.1.1.2 misho 12302: z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 12303: }
12304: } else /* if (opline->extended_value == ZEND_ASSIGN_DIM) */ {
12305: if (Z_OBJ_HT_P(object)->read_dimension) {
12306: z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC);
12307: }
12308: }
12309: if (z) {
12310: if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
12311: zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
12312:
12313: if (Z_REFCOUNT_P(z) == 0) {
12314: GC_REMOVE_ZVAL_FROM_BUFFER(z);
12315: zval_dtor(z);
12316: FREE_ZVAL(z);
12317: }
12318: z = value;
12319: }
12320: Z_ADDREF_P(z);
12321: SEPARATE_ZVAL_IF_NOT_REF(&z);
12322: binary_op(z, z, value TSRMLS_CC);
12323: if (opline->extended_value == ZEND_ASSIGN_OBJ) {
1.1.1.2 misho 12324: Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 12325: } else /* if (opline->extended_value == ZEND_ASSIGN_DIM) */ {
12326: Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC);
12327: }
1.1.1.2 misho 12328: if (RETURN_VALUE_USED(opline)) {
1.1 misho 12329: PZVAL_LOCK(z);
1.1.1.2 misho 12330: EX_T(opline->result.var).var.ptr = z;
12331: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 12332: }
12333: zval_ptr_dtor(&z);
12334: } else {
12335: zend_error(E_WARNING, "Attempt to assign property of non-object");
1.1.1.2 misho 12336: if (RETURN_VALUE_USED(opline)) {
12337: PZVAL_LOCK(&EG(uninitialized_zval));
12338: EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
12339: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 12340: }
12341: }
12342: }
12343:
12344: if (0) {
12345: zval_ptr_dtor(&property);
12346: } else {
12347:
12348: }
12349: FREE_OP(free_op_data1);
12350: }
12351:
12352: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
12353: /* assign_obj has two opcodes! */
1.1.1.2 misho 12354: CHECK_EXCEPTION();
1.1 misho 12355: ZEND_VM_INC_OPCODE();
12356: ZEND_VM_NEXT_OPCODE();
12357: }
12358:
12359: static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_CONST(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
12360: {
1.1.1.2 misho 12361: USE_OPLINE
1.1 misho 12362: zend_free_op free_op1, free_op_data2, free_op_data1;
12363: zval **var_ptr;
12364: zval *value;
12365:
1.1.1.2 misho 12366: SAVE_OPLINE();
1.1 misho 12367: switch (opline->extended_value) {
12368: case ZEND_ASSIGN_OBJ:
12369: return zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
12370: break;
12371: case ZEND_ASSIGN_DIM: {
1.1.1.2 misho 12372: zval **container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 12373:
1.1.1.2 misho 12374: if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 12375: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
1.1.1.2 misho 12376: } else if (UNEXPECTED(Z_TYPE_PP(container) == IS_OBJECT)) {
1.1 misho 12377: if (IS_VAR == IS_VAR && !(free_op1.var != NULL)) {
12378: Z_ADDREF_PP(container); /* undo the effect of get_obj_zval_ptr_ptr() */
12379: }
12380: return zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
12381: } else {
1.1.1.2 misho 12382: zval *dim = opline->op2.zv;
1.1 misho 12383:
1.1.1.2 misho 12384: zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), container, dim, IS_CONST, BP_VAR_RW TSRMLS_CC);
12385: value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R);
12386: var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC);
1.1 misho 12387: }
12388: }
12389: break;
12390: default:
1.1.1.2 misho 12391: value = opline->op2.zv;
12392: var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 12393: /* do nothing */
12394: break;
12395: }
12396:
1.1.1.2 misho 12397: if (UNEXPECTED(var_ptr == NULL)) {
1.1 misho 12398: zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets");
12399: }
12400:
1.1.1.2 misho 12401: if (UNEXPECTED(*var_ptr == &EG(error_zval))) {
12402: if (RETURN_VALUE_USED(opline)) {
12403: PZVAL_LOCK(&EG(uninitialized_zval));
12404: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
1.1 misho 12405: }
12406:
12407: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 12408: CHECK_EXCEPTION();
12409: if (opline->extended_value == ZEND_ASSIGN_DIM) {
12410: ZEND_VM_INC_OPCODE();
12411: }
1.1 misho 12412: ZEND_VM_NEXT_OPCODE();
12413: }
12414:
12415: SEPARATE_ZVAL_IF_NOT_REF(var_ptr);
12416:
1.1.1.2 misho 12417: if (UNEXPECTED(Z_TYPE_PP(var_ptr) == IS_OBJECT)
12418: && Z_OBJ_HANDLER_PP(var_ptr, get)
1.1 misho 12419: && Z_OBJ_HANDLER_PP(var_ptr, set)) {
12420: /* proxy object */
12421: zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC);
12422: Z_ADDREF_P(objval);
12423: binary_op(objval, objval, value TSRMLS_CC);
12424: Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC);
12425: zval_ptr_dtor(&objval);
12426: } else {
12427: binary_op(*var_ptr, *var_ptr, value TSRMLS_CC);
12428: }
12429:
1.1.1.2 misho 12430: if (RETURN_VALUE_USED(opline)) {
1.1 misho 12431: PZVAL_LOCK(*var_ptr);
1.1.1.2 misho 12432: AI_SET_PTR(&EX_T(opline->result.var), *var_ptr);
1.1 misho 12433: }
12434:
12435: if (opline->extended_value == ZEND_ASSIGN_DIM) {
12436: FREE_OP(free_op_data1);
12437: FREE_OP_VAR_PTR(free_op_data2);
1.1.1.2 misho 12438: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
12439: CHECK_EXCEPTION();
12440: ZEND_VM_INC_OPCODE();
12441: } else {
12442: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
12443: CHECK_EXCEPTION();
1.1 misho 12444: }
12445: ZEND_VM_NEXT_OPCODE();
12446: }
12447:
12448: static int ZEND_FASTCALL ZEND_ASSIGN_ADD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
12449: {
12450: return zend_binary_assign_op_helper_SPEC_VAR_CONST(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
12451: }
12452:
12453: static int ZEND_FASTCALL ZEND_ASSIGN_SUB_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
12454: {
12455: return zend_binary_assign_op_helper_SPEC_VAR_CONST(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
12456: }
12457:
12458: static int ZEND_FASTCALL ZEND_ASSIGN_MUL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
12459: {
12460: return zend_binary_assign_op_helper_SPEC_VAR_CONST(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
12461: }
12462:
12463: static int ZEND_FASTCALL ZEND_ASSIGN_DIV_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
12464: {
12465: return zend_binary_assign_op_helper_SPEC_VAR_CONST(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
12466: }
12467:
12468: static int ZEND_FASTCALL ZEND_ASSIGN_MOD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
12469: {
12470: return zend_binary_assign_op_helper_SPEC_VAR_CONST(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
12471: }
12472:
12473: static int ZEND_FASTCALL ZEND_ASSIGN_SL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
12474: {
12475: return zend_binary_assign_op_helper_SPEC_VAR_CONST(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
12476: }
12477:
12478: static int ZEND_FASTCALL ZEND_ASSIGN_SR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
12479: {
12480: return zend_binary_assign_op_helper_SPEC_VAR_CONST(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
12481: }
12482:
12483: static int ZEND_FASTCALL ZEND_ASSIGN_CONCAT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
12484: {
12485: return zend_binary_assign_op_helper_SPEC_VAR_CONST(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
12486: }
12487:
12488: static int ZEND_FASTCALL ZEND_ASSIGN_BW_OR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
12489: {
12490: return zend_binary_assign_op_helper_SPEC_VAR_CONST(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
12491: }
12492:
12493: static int ZEND_FASTCALL ZEND_ASSIGN_BW_AND_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
12494: {
12495: return zend_binary_assign_op_helper_SPEC_VAR_CONST(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
12496: }
12497:
12498: static int ZEND_FASTCALL ZEND_ASSIGN_BW_XOR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
12499: {
12500: return zend_binary_assign_op_helper_SPEC_VAR_CONST(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
12501: }
12502:
12503: static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_CONST(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS)
12504: {
1.1.1.2 misho 12505: USE_OPLINE
1.1 misho 12506: zend_free_op free_op1;
1.1.1.2 misho 12507: zval **object_ptr;
1.1 misho 12508: zval *object;
1.1.1.2 misho 12509: zval *property;
12510: zval **retval;
1.1 misho 12511: int have_get_ptr = 0;
12512:
1.1.1.2 misho 12513: SAVE_OPLINE();
12514: object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
12515: property = opline->op2.zv;
12516: retval = &EX_T(opline->result.var).var.ptr;
12517:
12518: if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 12519: zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
12520: }
12521:
12522: make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
12523: object = *object_ptr;
12524:
1.1.1.2 misho 12525: if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
1.1 misho 12526: zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
12527:
1.1.1.2 misho 12528: if (RETURN_VALUE_USED(opline)) {
12529: PZVAL_LOCK(&EG(uninitialized_zval));
12530: *retval = &EG(uninitialized_zval);
1.1 misho 12531: }
12532: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 12533: CHECK_EXCEPTION();
1.1 misho 12534: ZEND_VM_NEXT_OPCODE();
12535: }
12536:
12537: /* here we are sure we are dealing with an object */
12538:
12539: if (0) {
12540: MAKE_REAL_ZVAL_PTR(property);
12541: }
12542:
12543: if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
1.1.1.2 misho 12544: zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 12545: if (zptr != NULL) { /* NULL means no success in getting PTR */
12546: SEPARATE_ZVAL_IF_NOT_REF(zptr);
12547:
12548: have_get_ptr = 1;
12549: incdec_op(*zptr);
1.1.1.2 misho 12550: if (RETURN_VALUE_USED(opline)) {
1.1 misho 12551: *retval = *zptr;
12552: PZVAL_LOCK(*retval);
12553: }
12554: }
12555: }
12556:
12557: if (!have_get_ptr) {
12558: if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
1.1.1.2 misho 12559: zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 12560:
1.1.1.2 misho 12561: if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
1.1 misho 12562: zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
12563:
12564: if (Z_REFCOUNT_P(z) == 0) {
12565: GC_REMOVE_ZVAL_FROM_BUFFER(z);
12566: zval_dtor(z);
12567: FREE_ZVAL(z);
12568: }
12569: z = value;
12570: }
12571: Z_ADDREF_P(z);
12572: SEPARATE_ZVAL_IF_NOT_REF(&z);
12573: incdec_op(z);
12574: *retval = z;
1.1.1.2 misho 12575: Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
12576: SELECTIVE_PZVAL_LOCK(*retval, opline);
1.1 misho 12577: zval_ptr_dtor(&z);
12578: } else {
12579: zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
1.1.1.2 misho 12580: if (RETURN_VALUE_USED(opline)) {
12581: PZVAL_LOCK(&EG(uninitialized_zval));
12582: *retval = &EG(uninitialized_zval);
1.1 misho 12583: }
12584: }
12585: }
12586:
12587: if (0) {
12588: zval_ptr_dtor(&property);
12589: } else {
12590:
12591: }
12592: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 12593: CHECK_EXCEPTION();
1.1 misho 12594: ZEND_VM_NEXT_OPCODE();
12595: }
12596:
12597: static int ZEND_FASTCALL ZEND_PRE_INC_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
12598: {
12599: return zend_pre_incdec_property_helper_SPEC_VAR_CONST(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
12600: }
12601:
12602: static int ZEND_FASTCALL ZEND_PRE_DEC_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
12603: {
12604: return zend_pre_incdec_property_helper_SPEC_VAR_CONST(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
12605: }
12606:
12607: static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_CONST(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS)
12608: {
1.1.1.2 misho 12609: USE_OPLINE
1.1 misho 12610: zend_free_op free_op1;
1.1.1.2 misho 12611: zval **object_ptr;
1.1 misho 12612: zval *object;
1.1.1.2 misho 12613: zval *property;
12614: zval *retval;
1.1 misho 12615: int have_get_ptr = 0;
12616:
1.1.1.2 misho 12617: SAVE_OPLINE();
12618: object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
12619: property = opline->op2.zv;
12620: retval = &EX_T(opline->result.var).tmp_var;
12621:
12622: if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 12623: zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
12624: }
12625:
12626: make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
12627: object = *object_ptr;
12628:
1.1.1.2 misho 12629: if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
1.1 misho 12630: zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
12631:
1.1.1.2 misho 12632: ZVAL_NULL(retval);
1.1 misho 12633: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 12634: CHECK_EXCEPTION();
1.1 misho 12635: ZEND_VM_NEXT_OPCODE();
12636: }
12637:
12638: /* here we are sure we are dealing with an object */
12639:
12640: if (0) {
12641: MAKE_REAL_ZVAL_PTR(property);
12642: }
12643:
12644: if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
1.1.1.2 misho 12645: zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 12646: if (zptr != NULL) { /* NULL means no success in getting PTR */
12647: have_get_ptr = 1;
12648: SEPARATE_ZVAL_IF_NOT_REF(zptr);
12649:
1.1.1.2 misho 12650: ZVAL_COPY_VALUE(retval, *zptr);
1.1 misho 12651: zendi_zval_copy_ctor(*retval);
12652:
12653: incdec_op(*zptr);
12654:
12655: }
12656: }
12657:
12658: if (!have_get_ptr) {
12659: if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
1.1.1.2 misho 12660: zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 12661: zval *z_copy;
12662:
1.1.1.2 misho 12663: if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
1.1 misho 12664: zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
12665:
12666: if (Z_REFCOUNT_P(z) == 0) {
12667: GC_REMOVE_ZVAL_FROM_BUFFER(z);
12668: zval_dtor(z);
12669: FREE_ZVAL(z);
12670: }
12671: z = value;
12672: }
1.1.1.2 misho 12673: ZVAL_COPY_VALUE(retval, z);
1.1 misho 12674: zendi_zval_copy_ctor(*retval);
12675: ALLOC_ZVAL(z_copy);
1.1.1.2 misho 12676: INIT_PZVAL_COPY(z_copy, z);
1.1 misho 12677: zendi_zval_copy_ctor(*z_copy);
12678: incdec_op(z_copy);
12679: Z_ADDREF_P(z);
1.1.1.2 misho 12680: Z_OBJ_HT_P(object)->write_property(object, property, z_copy, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 12681: zval_ptr_dtor(&z_copy);
12682: zval_ptr_dtor(&z);
12683: } else {
12684: zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
1.1.1.2 misho 12685: ZVAL_NULL(retval);
12686: }
12687: }
12688:
12689: if (0) {
12690: zval_ptr_dtor(&property);
12691: } else {
12692:
12693: }
12694: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
12695: CHECK_EXCEPTION();
12696: ZEND_VM_NEXT_OPCODE();
12697: }
12698:
12699: static int ZEND_FASTCALL ZEND_POST_INC_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
12700: {
12701: return zend_post_incdec_property_helper_SPEC_VAR_CONST(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
12702: }
12703:
12704: static int ZEND_FASTCALL ZEND_POST_DEC_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
12705: {
12706: return zend_post_incdec_property_helper_SPEC_VAR_CONST(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
12707: }
12708:
12709: static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_CONST(int type, ZEND_OPCODE_HANDLER_ARGS)
12710: {
12711: USE_OPLINE
12712: zend_free_op free_op1;
12713: zval *varname;
12714: zval **retval;
12715: zval tmp_varname;
12716: HashTable *target_symbol_table;
12717: ulong hash_value;
12718:
12719: SAVE_OPLINE();
12720: varname = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
12721:
12722: if (IS_VAR != IS_CONST && UNEXPECTED(Z_TYPE_P(varname) != IS_STRING)) {
12723: ZVAL_COPY_VALUE(&tmp_varname, varname);
12724: zval_copy_ctor(&tmp_varname);
12725: Z_SET_REFCOUNT(tmp_varname, 1);
12726: Z_UNSET_ISREF(tmp_varname);
12727: convert_to_string(&tmp_varname);
12728: varname = &tmp_varname;
12729: }
12730:
12731: if (IS_CONST != IS_UNUSED) {
12732: zend_class_entry *ce;
12733:
12734: if (IS_CONST == IS_CONST) {
12735: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
12736: ce = CACHED_PTR(opline->op2.literal->cache_slot);
12737: } else {
12738: ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
12739: if (UNEXPECTED(ce == NULL)) {
12740: if (IS_VAR != IS_CONST && varname == &tmp_varname) {
12741: zval_dtor(&tmp_varname);
12742: }
12743: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
12744: CHECK_EXCEPTION();
12745: ZEND_VM_NEXT_OPCODE();
12746: }
12747: CACHE_PTR(opline->op2.literal->cache_slot, ce);
12748: }
12749: } else {
12750: ce = EX_T(opline->op2.var).class_entry;
12751: }
12752: retval = zend_std_get_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 0, ((IS_VAR == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
12753: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
12754: } else {
12755: target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
12756: /*
12757: if (!target_symbol_table) {
12758: CHECK_EXCEPTION();
12759: ZEND_VM_NEXT_OPCODE();
12760: }
12761: */
12762: if (IS_VAR == IS_CONST) {
12763: hash_value = Z_HASH_P(varname);
12764: } else if (IS_INTERNED(Z_STRVAL_P(varname))) {
12765: hash_value = INTERNED_HASH(Z_STRVAL_P(varname));
12766: } else {
12767: hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1);
12768: }
12769:
12770: if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) {
12771: switch (type) {
12772: case BP_VAR_R:
12773: case BP_VAR_UNSET:
12774: zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_P(varname));
12775: /* break missing intentionally */
12776: case BP_VAR_IS:
12777: retval = &EG(uninitialized_zval_ptr);
12778: break;
12779: case BP_VAR_RW:
12780: zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_P(varname));
12781: /* break missing intentionally */
12782: case BP_VAR_W:
12783: Z_ADDREF_P(&EG(uninitialized_zval));
12784: zend_hash_quick_update(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, &EG(uninitialized_zval_ptr), sizeof(zval *), (void **) &retval);
12785: break;
12786: EMPTY_SWITCH_DEFAULT_CASE()
12787: }
12788: }
12789: switch (opline->extended_value & ZEND_FETCH_TYPE_MASK) {
12790: case ZEND_FETCH_GLOBAL:
12791: if (IS_VAR != IS_TMP_VAR) {
12792: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
12793: }
12794: break;
12795: case ZEND_FETCH_LOCAL:
12796: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
12797: break;
12798: case ZEND_FETCH_STATIC:
12799: zval_update_constant(retval, (void*) 1 TSRMLS_CC);
12800: break;
12801: case ZEND_FETCH_GLOBAL_LOCK:
12802: if (IS_VAR == IS_VAR && !free_op1.var) {
12803: PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
12804: }
12805: break;
12806: }
12807: }
12808:
12809:
12810: if (IS_VAR != IS_CONST && varname == &tmp_varname) {
12811: zval_dtor(&tmp_varname);
12812: }
12813: if (opline->extended_value & ZEND_FETCH_MAKE_REF) {
12814: SEPARATE_ZVAL_TO_MAKE_IS_REF(retval);
12815: }
12816: PZVAL_LOCK(*retval);
12817: switch (type) {
12818: case BP_VAR_R:
12819: case BP_VAR_IS:
12820: AI_SET_PTR(&EX_T(opline->result.var), *retval);
12821: break;
12822: case BP_VAR_UNSET: {
12823: zend_free_op free_res;
12824:
12825: PZVAL_UNLOCK(*retval, &free_res);
12826: if (retval != &EG(uninitialized_zval_ptr)) {
12827: SEPARATE_ZVAL_IF_NOT_REF(retval);
12828: }
12829: PZVAL_LOCK(*retval);
12830: FREE_OP_VAR_PTR(free_res);
1.1 misho 12831: }
1.1.1.2 misho 12832: /* break missing intentionally */
12833: default:
12834: EX_T(opline->result.var).var.ptr_ptr = retval;
12835: break;
1.1 misho 12836: }
1.1.1.2 misho 12837: CHECK_EXCEPTION();
12838: ZEND_VM_NEXT_OPCODE();
12839: }
12840:
12841: static int ZEND_FASTCALL ZEND_FETCH_R_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
12842: {
12843: return zend_fetch_var_address_helper_SPEC_VAR_CONST(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
12844: }
1.1 misho 12845:
1.1.1.2 misho 12846: static int ZEND_FASTCALL ZEND_FETCH_W_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
12847: {
12848: return zend_fetch_var_address_helper_SPEC_VAR_CONST(BP_VAR_W, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
12849: }
1.1 misho 12850:
1.1.1.2 misho 12851: static int ZEND_FASTCALL ZEND_FETCH_RW_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
12852: {
12853: return zend_fetch_var_address_helper_SPEC_VAR_CONST(BP_VAR_RW, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
1.1 misho 12854: }
12855:
1.1.1.2 misho 12856: static int ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 12857: {
1.1.1.2 misho 12858: USE_OPLINE
12859:
12860: return zend_fetch_var_address_helper_SPEC_VAR_CONST(ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
1.1 misho 12861: }
12862:
1.1.1.2 misho 12863: static int ZEND_FASTCALL ZEND_FETCH_UNSET_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 12864: {
1.1.1.2 misho 12865: return zend_fetch_var_address_helper_SPEC_VAR_CONST(BP_VAR_UNSET, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
12866: }
12867:
12868: static int ZEND_FASTCALL ZEND_FETCH_IS_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
12869: {
12870: return zend_fetch_var_address_helper_SPEC_VAR_CONST(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
1.1 misho 12871: }
12872:
12873: static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
12874: {
1.1.1.2 misho 12875: USE_OPLINE
1.1 misho 12876: zend_free_op free_op1;
12877: zval **container;
12878:
1.1.1.2 misho 12879: SAVE_OPLINE();
12880:
12881: if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) &&
1.1 misho 12882: IS_VAR != IS_CV &&
1.1.1.2 misho 12883: EX_T(opline->op1.var).var.ptr_ptr) {
12884: PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
1.1 misho 12885: }
1.1.1.2 misho 12886: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
12887: zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_R TSRMLS_CC);
1.1 misho 12888:
12889: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 12890: CHECK_EXCEPTION();
1.1 misho 12891: ZEND_VM_NEXT_OPCODE();
12892: }
12893:
12894: static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
12895: {
1.1.1.2 misho 12896: USE_OPLINE
1.1 misho 12897: zend_free_op free_op1;
1.1.1.2 misho 12898: zval **container;
12899:
12900: SAVE_OPLINE();
12901: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 12902:
1.1.1.2 misho 12903: if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 12904: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
12905: }
1.1.1.2 misho 12906: zend_fetch_dimension_address(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_W TSRMLS_CC);
1.1 misho 12907:
1.1.1.2 misho 12908: if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
12909: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 12910: }
12911: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
12912:
12913: /* We are going to assign the result by reference */
1.1.1.2 misho 12914: if (UNEXPECTED(opline->extended_value != 0)) {
12915: zval **retval_ptr = EX_T(opline->result.var).var.ptr_ptr;
12916:
12917: if (retval_ptr) {
12918: Z_DELREF_PP(retval_ptr);
12919: SEPARATE_ZVAL_TO_MAKE_IS_REF(retval_ptr);
12920: Z_ADDREF_PP(retval_ptr);
12921: }
1.1 misho 12922: }
12923:
1.1.1.2 misho 12924: CHECK_EXCEPTION();
1.1 misho 12925: ZEND_VM_NEXT_OPCODE();
12926: }
12927:
12928: static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
12929: {
1.1.1.2 misho 12930: USE_OPLINE
1.1 misho 12931: zend_free_op free_op1;
1.1.1.2 misho 12932: zval **container;
1.1 misho 12933:
1.1.1.2 misho 12934: SAVE_OPLINE();
12935: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
12936:
12937: if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 12938: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
12939: }
1.1.1.2 misho 12940: zend_fetch_dimension_address(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_RW TSRMLS_CC);
1.1 misho 12941:
1.1.1.2 misho 12942: if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
12943: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 12944: }
12945: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 12946: CHECK_EXCEPTION();
1.1 misho 12947: ZEND_VM_NEXT_OPCODE();
12948: }
12949:
12950: static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
12951: {
1.1.1.2 misho 12952: USE_OPLINE
1.1 misho 12953: zend_free_op free_op1;
1.1.1.2 misho 12954: zval **container;
1.1 misho 12955:
1.1.1.2 misho 12956: SAVE_OPLINE();
12957: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
12958: zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_IS TSRMLS_CC);
1.1 misho 12959:
12960: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 12961: CHECK_EXCEPTION();
1.1 misho 12962: ZEND_VM_NEXT_OPCODE();
12963: }
12964:
12965: static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
12966: {
1.1.1.2 misho 12967: USE_OPLINE
1.1 misho 12968: zend_free_op free_op1;
12969: zval **container;
12970:
1.1.1.2 misho 12971: SAVE_OPLINE();
12972:
12973: if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
12974: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
12975: if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 12976: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
12977: }
1.1.1.2 misho 12978: zend_fetch_dimension_address(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_W TSRMLS_CC);
12979: if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
12980: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 12981: }
12982: } else {
12983: if (IS_CONST == IS_UNUSED) {
12984: zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
12985: }
1.1.1.2 misho 12986: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
12987: zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_R TSRMLS_CC);
1.1 misho 12988: }
12989:
12990: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 12991: CHECK_EXCEPTION();
1.1 misho 12992: ZEND_VM_NEXT_OPCODE();
12993: }
12994:
12995: static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
12996: {
1.1.1.2 misho 12997: USE_OPLINE
1.1 misho 12998: zend_free_op free_op1;
1.1.1.2 misho 12999: zval **container;
13000:
13001: SAVE_OPLINE();
13002: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 13003:
13004: if (IS_VAR == IS_CV) {
13005: if (container != &EG(uninitialized_zval_ptr)) {
13006: SEPARATE_ZVAL_IF_NOT_REF(container);
13007: }
13008: }
1.1.1.2 misho 13009: if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 13010: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
13011: }
1.1.1.2 misho 13012: zend_fetch_dimension_address(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_UNSET TSRMLS_CC);
1.1 misho 13013:
1.1.1.2 misho 13014: if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
13015: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 13016: }
13017: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 13018: if (UNEXPECTED(EX_T(opline->result.var).var.ptr_ptr == NULL)) {
1.1 misho 13019: zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
13020: } else {
13021: zend_free_op free_res;
1.1.1.2 misho 13022: zval **retval_ptr = EX_T(opline->result.var).var.ptr_ptr;
1.1 misho 13023:
1.1.1.2 misho 13024: PZVAL_UNLOCK(*retval_ptr, &free_res);
13025: if (retval_ptr != &EG(uninitialized_zval_ptr)) {
13026: SEPARATE_ZVAL_IF_NOT_REF(retval_ptr);
1.1 misho 13027: }
1.1.1.2 misho 13028: PZVAL_LOCK(*retval_ptr);
1.1 misho 13029: FREE_OP_VAR_PTR(free_res);
1.1.1.2 misho 13030: CHECK_EXCEPTION();
13031: ZEND_VM_NEXT_OPCODE();
1.1 misho 13032: }
13033: }
13034:
1.1.1.2 misho 13035: static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_VAR_CONST(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 13036: {
1.1.1.2 misho 13037: USE_OPLINE
1.1 misho 13038: zend_free_op free_op1;
1.1.1.2 misho 13039: zval *container;
1.1 misho 13040:
1.1.1.2 misho 13041: zval *offset;
1.1 misho 13042:
1.1.1.2 misho 13043: SAVE_OPLINE();
13044: container = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
13045: offset = opline->op2.zv;
13046:
13047: if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
13048: UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
13049: zend_error(E_NOTICE, "Trying to get property of non-object");
13050: PZVAL_LOCK(&EG(uninitialized_zval));
13051: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
1.1 misho 13052:
13053: } else {
13054: zval *retval;
13055:
13056: if (0) {
13057: MAKE_REAL_ZVAL_PTR(offset);
13058: }
13059:
13060: /* here we are sure we are dealing with an object */
1.1.1.2 misho 13061: retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 13062:
1.1.1.2 misho 13063: PZVAL_LOCK(retval);
13064: AI_SET_PTR(&EX_T(opline->result.var), retval);
1.1 misho 13065:
13066: if (0) {
13067: zval_ptr_dtor(&offset);
13068: } else {
13069:
13070: }
13071: }
13072:
13073: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 13074: CHECK_EXCEPTION();
1.1 misho 13075: ZEND_VM_NEXT_OPCODE();
13076: }
13077:
13078: static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
13079: {
1.1.1.2 misho 13080: return zend_fetch_property_address_read_helper_SPEC_VAR_CONST(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
1.1 misho 13081: }
13082:
13083: static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
13084: {
1.1.1.2 misho 13085: USE_OPLINE
1.1 misho 13086: zend_free_op free_op1;
1.1.1.2 misho 13087: zval *property;
1.1 misho 13088: zval **container;
13089:
1.1.1.2 misho 13090: SAVE_OPLINE();
13091: property = opline->op2.zv;
13092:
1.1 misho 13093: if (IS_VAR == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
1.1.1.2 misho 13094: PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
13095: EX_T(opline->op1.var).var.ptr = *EX_T(opline->op1.var).var.ptr_ptr;
1.1 misho 13096: }
13097:
13098: if (0) {
13099: MAKE_REAL_ZVAL_PTR(property);
13100: }
1.1.1.2 misho 13101: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
13102: if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 13103: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
13104: }
1.1.1.2 misho 13105:
13106: zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_W TSRMLS_CC);
1.1 misho 13107: if (0) {
13108: zval_ptr_dtor(&property);
13109: } else {
13110:
13111: }
1.1.1.2 misho 13112: if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
13113: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 13114: }
13115: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
13116:
13117: /* We are going to assign the result by reference */
13118: if (opline->extended_value & ZEND_FETCH_MAKE_REF) {
1.1.1.2 misho 13119: zval **retval_ptr = EX_T(opline->result.var).var.ptr_ptr;
13120:
13121: Z_DELREF_PP(retval_ptr);
13122: SEPARATE_ZVAL_TO_MAKE_IS_REF(retval_ptr);
13123: Z_ADDREF_PP(retval_ptr);
13124: EX_T(opline->result.var).var.ptr = *EX_T(opline->result.var).var.ptr_ptr;
13125: EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
1.1 misho 13126: }
13127:
1.1.1.2 misho 13128: CHECK_EXCEPTION();
1.1 misho 13129: ZEND_VM_NEXT_OPCODE();
13130: }
13131:
13132: static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
13133: {
1.1.1.2 misho 13134: USE_OPLINE
1.1 misho 13135: zend_free_op free_op1;
1.1.1.2 misho 13136: zval *property;
13137: zval **container;
13138:
13139: SAVE_OPLINE();
13140: property = opline->op2.zv;
13141: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 13142:
13143: if (0) {
13144: MAKE_REAL_ZVAL_PTR(property);
13145: }
1.1.1.2 misho 13146: if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 13147: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
13148: }
1.1.1.2 misho 13149: zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_RW TSRMLS_CC);
1.1 misho 13150: if (0) {
13151: zval_ptr_dtor(&property);
13152: } else {
13153:
13154: }
1.1.1.2 misho 13155: if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
13156: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 13157: }
13158: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 13159: CHECK_EXCEPTION();
1.1 misho 13160: ZEND_VM_NEXT_OPCODE();
13161: }
13162:
13163: static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
13164: {
1.1.1.2 misho 13165: USE_OPLINE
13166: zend_free_op free_op1;
13167: zval *container;
13168:
13169: zval *offset;
13170:
13171: SAVE_OPLINE();
13172: container = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
13173: offset = opline->op2.zv;
13174:
13175: if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
13176: UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
13177: PZVAL_LOCK(&EG(uninitialized_zval));
13178: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
13179:
13180: } else {
13181: zval *retval;
13182:
13183: if (0) {
13184: MAKE_REAL_ZVAL_PTR(offset);
13185: }
13186:
13187: /* here we are sure we are dealing with an object */
13188: retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
13189:
13190: PZVAL_LOCK(retval);
13191: AI_SET_PTR(&EX_T(opline->result.var), retval);
13192:
13193: if (0) {
13194: zval_ptr_dtor(&offset);
13195: } else {
13196:
13197: }
13198: }
13199:
13200: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
13201: CHECK_EXCEPTION();
13202: ZEND_VM_NEXT_OPCODE();
1.1 misho 13203: }
13204:
13205: static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
13206: {
1.1.1.2 misho 13207: USE_OPLINE
1.1 misho 13208:
1.1.1.2 misho 13209: if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
1.1 misho 13210: /* Behave like FETCH_OBJ_W */
13211: zend_free_op free_op1;
1.1.1.2 misho 13212: zval *property;
13213: zval **container;
13214:
13215: SAVE_OPLINE();
13216: property = opline->op2.zv;
13217: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 13218:
13219: if (0) {
13220: MAKE_REAL_ZVAL_PTR(property);
13221: }
1.1.1.2 misho 13222: if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 13223: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
13224: }
1.1.1.2 misho 13225: zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_W TSRMLS_CC);
1.1 misho 13226: if (0) {
13227: zval_ptr_dtor(&property);
13228: } else {
13229:
13230: }
1.1.1.2 misho 13231: if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
13232: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 13233: }
13234: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 13235: CHECK_EXCEPTION();
1.1 misho 13236: ZEND_VM_NEXT_OPCODE();
13237: } else {
1.1.1.2 misho 13238: return zend_fetch_property_address_read_helper_SPEC_VAR_CONST(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
1.1 misho 13239: }
13240: }
13241:
13242: static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
13243: {
1.1.1.2 misho 13244: USE_OPLINE
1.1 misho 13245: zend_free_op free_op1, free_res;
1.1.1.2 misho 13246: zval **container;
13247: zval *property;
13248:
13249: SAVE_OPLINE();
13250: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
13251: property = opline->op2.zv;
1.1 misho 13252:
13253: if (IS_VAR == IS_CV) {
13254: if (container != &EG(uninitialized_zval_ptr)) {
13255: SEPARATE_ZVAL_IF_NOT_REF(container);
13256: }
13257: }
13258: if (0) {
13259: MAKE_REAL_ZVAL_PTR(property);
13260: }
1.1.1.2 misho 13261: if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 13262: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
13263: }
1.1.1.2 misho 13264: zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_UNSET TSRMLS_CC);
1.1 misho 13265: if (0) {
13266: zval_ptr_dtor(&property);
13267: } else {
13268:
13269: }
1.1.1.2 misho 13270: if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
13271: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 13272: }
13273: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
13274:
1.1.1.2 misho 13275: PZVAL_UNLOCK(*EX_T(opline->result.var).var.ptr_ptr, &free_res);
13276: if (EX_T(opline->result.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) {
13277: SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.var).var.ptr_ptr);
1.1 misho 13278: }
1.1.1.2 misho 13279: PZVAL_LOCK(*EX_T(opline->result.var).var.ptr_ptr);
1.1 misho 13280: FREE_OP_VAR_PTR(free_res);
1.1.1.2 misho 13281: CHECK_EXCEPTION();
1.1 misho 13282: ZEND_VM_NEXT_OPCODE();
13283: }
13284:
13285: static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
13286: {
1.1.1.2 misho 13287: USE_OPLINE
1.1 misho 13288: zend_free_op free_op1;
1.1.1.2 misho 13289: zval **object_ptr;
13290: zval *property_name;
13291:
13292: SAVE_OPLINE();
13293: object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
13294: property_name = opline->op2.zv;
1.1 misho 13295:
13296: if (0) {
13297: MAKE_REAL_ZVAL_PTR(property_name);
13298: }
1.1.1.2 misho 13299: if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 13300: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
13301: }
1.1.1.2 misho 13302: zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), ZEND_ASSIGN_OBJ, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 13303: if (0) {
13304: zval_ptr_dtor(&property_name);
13305: } else {
13306:
13307: }
13308: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
13309: /* assign_obj has two opcodes! */
1.1.1.2 misho 13310: CHECK_EXCEPTION();
1.1 misho 13311: ZEND_VM_INC_OPCODE();
13312: ZEND_VM_NEXT_OPCODE();
13313: }
13314:
13315: static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
13316: {
1.1.1.2 misho 13317: USE_OPLINE
1.1 misho 13318: zend_free_op free_op1;
1.1.1.2 misho 13319: zval **object_ptr;
1.1 misho 13320:
1.1.1.2 misho 13321: SAVE_OPLINE();
13322: object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
13323:
13324: if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 13325: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
13326: }
13327: if (Z_TYPE_PP(object_ptr) == IS_OBJECT) {
13328:
1.1.1.2 misho 13329: zval *property_name = opline->op2.zv;
1.1 misho 13330:
13331: if (0) {
13332: MAKE_REAL_ZVAL_PTR(property_name);
13333: }
1.1.1.2 misho 13334: zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), ZEND_ASSIGN_DIM, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 13335: if (0) {
13336: zval_ptr_dtor(&property_name);
13337: } else {
13338:
13339: }
13340: } else {
13341: zend_free_op free_op_data1, free_op_data2;
13342: zval *value;
1.1.1.2 misho 13343: zval *dim = opline->op2.zv;
1.1 misho 13344: zval **variable_ptr_ptr;
13345:
1.1.1.2 misho 13346: zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), object_ptr, dim, IS_CONST, BP_VAR_W TSRMLS_CC);
13347:
13348: value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R);
13349: variable_ptr_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC);
13350: if (UNEXPECTED(variable_ptr_ptr == NULL)) {
13351: if (zend_assign_to_string_offset(&EX_T((opline+1)->op2.var), value, (opline+1)->op1_type TSRMLS_CC)) {
13352: if (RETURN_VALUE_USED(opline)) {
13353: zval *retval;
1.1 misho 13354:
1.1.1.2 misho 13355: ALLOC_ZVAL(retval);
13356: ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T((opline+1)->op2.var).str_offset.str)+EX_T((opline+1)->op2.var).str_offset.offset, 1, 1);
13357: INIT_PZVAL(retval);
13358: AI_SET_PTR(&EX_T(opline->result.var), retval);
13359: }
13360: } else if (RETURN_VALUE_USED(opline)) {
13361: PZVAL_LOCK(&EG(uninitialized_zval));
13362: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
13363: }
13364: } else if (UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) {
13365: if (IS_TMP_FREE(free_op_data1)) {
13366: zval_dtor(value);
13367: }
13368: if (RETURN_VALUE_USED(opline)) {
13369: PZVAL_LOCK(&EG(uninitialized_zval));
13370: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
13371: }
13372: } else {
13373: if ((opline+1)->op1_type == IS_TMP_VAR) {
13374: value = zend_assign_tmp_to_variable(variable_ptr_ptr, value TSRMLS_CC);
13375: } else if ((opline+1)->op1_type == IS_CONST) {
13376: value = zend_assign_const_to_variable(variable_ptr_ptr, value TSRMLS_CC);
13377: } else {
13378: value = zend_assign_to_variable(variable_ptr_ptr, value TSRMLS_CC);
13379: }
13380: if (RETURN_VALUE_USED(opline)) {
1.1 misho 13381: PZVAL_LOCK(value);
1.1.1.2 misho 13382: AI_SET_PTR(&EX_T(opline->result.var), value);
1.1 misho 13383: }
13384: }
13385: FREE_OP_VAR_PTR(free_op_data2);
13386: FREE_OP_IF_VAR(free_op_data1);
13387: }
13388: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
13389: /* assign_dim has two opcodes! */
1.1.1.2 misho 13390: CHECK_EXCEPTION();
1.1 misho 13391: ZEND_VM_INC_OPCODE();
13392: ZEND_VM_NEXT_OPCODE();
13393: }
13394:
13395: static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
13396: {
1.1.1.2 misho 13397: USE_OPLINE
1.1 misho 13398: zend_free_op free_op1;
1.1.1.2 misho 13399: zval *value;
13400: zval **variable_ptr_ptr;
1.1 misho 13401:
1.1.1.2 misho 13402: SAVE_OPLINE();
13403: value = opline->op2.zv;
13404: variable_ptr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
13405:
13406: if (IS_VAR == IS_VAR && UNEXPECTED(variable_ptr_ptr == NULL)) {
13407: if (zend_assign_to_string_offset(&EX_T(opline->op1.var), value, IS_CONST TSRMLS_CC)) {
13408: if (RETURN_VALUE_USED(opline)) {
13409: zval *retval;
13410:
13411: ALLOC_ZVAL(retval);
13412: ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T(opline->op1.var).str_offset.str)+EX_T(opline->op1.var).str_offset.offset, 1, 1);
13413: INIT_PZVAL(retval);
13414: AI_SET_PTR(&EX_T(opline->result.var), retval);
13415: }
13416: } else if (RETURN_VALUE_USED(opline)) {
13417: PZVAL_LOCK(&EG(uninitialized_zval));
13418: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
13419: }
13420: } else if (IS_VAR == IS_VAR && UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) {
13421: if (0) {
13422: zval_dtor(value);
13423: }
13424: if (RETURN_VALUE_USED(opline)) {
13425: PZVAL_LOCK(&EG(uninitialized_zval));
13426: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
13427: }
13428: } else {
13429: if (IS_CONST == IS_TMP_VAR) {
13430: value = zend_assign_tmp_to_variable(variable_ptr_ptr, value TSRMLS_CC);
13431: } else if (IS_CONST == IS_CONST) {
13432: value = zend_assign_const_to_variable(variable_ptr_ptr, value TSRMLS_CC);
13433: } else {
13434: value = zend_assign_to_variable(variable_ptr_ptr, value TSRMLS_CC);
13435: }
13436: if (RETURN_VALUE_USED(opline)) {
1.1 misho 13437: PZVAL_LOCK(value);
1.1.1.2 misho 13438: AI_SET_PTR(&EX_T(opline->result.var), value);
1.1 misho 13439: }
13440: }
13441:
13442: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
13443:
13444: /* zend_assign_to_variable() always takes care of op2, never free it! */
13445:
1.1.1.2 misho 13446: CHECK_EXCEPTION();
1.1 misho 13447: ZEND_VM_NEXT_OPCODE();
13448: }
13449:
13450: static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
13451: {
1.1.1.2 misho 13452: USE_OPLINE
1.1 misho 13453: zval *function_name;
13454: char *function_name_strval;
13455: int function_name_strlen;
13456: zend_free_op free_op1;
13457:
1.1.1.2 misho 13458: SAVE_OPLINE();
1.1 misho 13459: zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
13460:
1.1.1.2 misho 13461: function_name = opline->op2.zv;
1.1 misho 13462:
1.1.1.2 misho 13463: if (IS_CONST != IS_CONST &&
13464: UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
1.1 misho 13465: zend_error_noreturn(E_ERROR, "Method name must be a string");
13466: }
13467:
13468: function_name_strval = Z_STRVAL_P(function_name);
13469: function_name_strlen = Z_STRLEN_P(function_name);
13470:
1.1.1.2 misho 13471: EX(object) = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 13472:
1.1.1.2 misho 13473: if (EXPECTED(EX(object) != NULL) &&
13474: EXPECTED(Z_TYPE_P(EX(object)) == IS_OBJECT)) {
13475: EX(called_scope) = Z_OBJCE_P(EX(object));
1.1 misho 13476:
1.1.1.2 misho 13477: if (IS_CONST != IS_CONST ||
13478: (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope))) == NULL) {
13479: zval *object = EX(object);
13480:
13481: if (UNEXPECTED(Z_OBJ_HT_P(EX(object))->get_method == NULL)) {
13482: zend_error_noreturn(E_ERROR, "Object does not support method calls");
13483: }
13484:
13485: /* First, locate the function. */
13486: EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen, ((IS_CONST == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC);
13487: if (UNEXPECTED(EX(fbc) == NULL)) {
13488: zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval);
13489: }
13490: if (IS_CONST == IS_CONST &&
13491: EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) &&
13492: EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) &&
13493: EXPECTED(EX(object) == object)) {
13494: CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope), EX(fbc));
13495: }
1.1 misho 13496: }
13497: } else {
13498: zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval);
13499: }
13500:
13501: if ((EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) != 0) {
13502: EX(object) = NULL;
13503: } else {
13504: if (!PZVAL_IS_REF(EX(object))) {
13505: Z_ADDREF_P(EX(object)); /* For $this pointer */
13506: } else {
13507: zval *this_ptr;
13508: ALLOC_ZVAL(this_ptr);
13509: INIT_PZVAL_COPY(this_ptr, EX(object));
13510: zval_copy_ctor(this_ptr);
13511: EX(object) = this_ptr;
13512: }
13513: }
13514:
13515: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
13516:
1.1.1.2 misho 13517: CHECK_EXCEPTION();
1.1 misho 13518: ZEND_VM_NEXT_OPCODE();
13519: }
13520:
13521: static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
13522: {
1.1.1.2 misho 13523: USE_OPLINE
1.1 misho 13524: zval *function_name;
13525: zend_class_entry *ce;
13526:
1.1.1.2 misho 13527: SAVE_OPLINE();
1.1 misho 13528: zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
13529:
13530: if (IS_VAR == IS_CONST) {
13531: /* no function found. try a static method in class */
1.1.1.2 misho 13532: if (CACHED_PTR(opline->op1.literal->cache_slot)) {
13533: ce = CACHED_PTR(opline->op1.literal->cache_slot);
13534: } else {
13535: ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
1.1.1.4 ! misho 13536: if (UNEXPECTED(EG(exception) != NULL)) {
! 13537: HANDLE_EXCEPTION();
! 13538: }
1.1.1.2 misho 13539: if (UNEXPECTED(ce == NULL)) {
1.1.1.4 ! misho 13540: zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv));
1.1.1.2 misho 13541: }
13542: CACHE_PTR(opline->op1.literal->cache_slot, ce);
1.1 misho 13543: }
13544: EX(called_scope) = ce;
13545: } else {
1.1.1.2 misho 13546: ce = EX_T(opline->op1.var).class_entry;
1.1 misho 13547:
1.1.1.2 misho 13548: if (opline->extended_value == ZEND_FETCH_CLASS_PARENT || opline->extended_value == ZEND_FETCH_CLASS_SELF) {
1.1 misho 13549: EX(called_scope) = EG(called_scope);
13550: } else {
13551: EX(called_scope) = ce;
13552: }
13553: }
1.1.1.2 misho 13554:
13555: if (IS_VAR == IS_CONST &&
13556: IS_CONST == IS_CONST &&
13557: CACHED_PTR(opline->op2.literal->cache_slot)) {
13558: EX(fbc) = CACHED_PTR(opline->op2.literal->cache_slot);
13559: } else if (IS_VAR != IS_CONST &&
13560: IS_CONST == IS_CONST &&
13561: (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce))) {
13562: /* do nothing */
13563: } else if (IS_CONST != IS_UNUSED) {
1.1 misho 13564: char *function_name_strval = NULL;
13565: int function_name_strlen = 0;
13566:
13567:
13568: if (IS_CONST == IS_CONST) {
1.1.1.2 misho 13569: function_name_strval = Z_STRVAL_P(opline->op2.zv);
13570: function_name_strlen = Z_STRLEN_P(opline->op2.zv);
1.1 misho 13571: } else {
1.1.1.2 misho 13572: function_name = opline->op2.zv;
1.1 misho 13573:
1.1.1.2 misho 13574: if (UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
1.1 misho 13575: zend_error_noreturn(E_ERROR, "Function name must be a string");
13576: } else {
13577: function_name_strval = Z_STRVAL_P(function_name);
13578: function_name_strlen = Z_STRLEN_P(function_name);
13579: }
13580: }
13581:
13582: if (function_name_strval) {
13583: if (ce->get_static_method) {
13584: EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
13585: } else {
1.1.1.2 misho 13586: EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen, ((IS_CONST == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC);
1.1 misho 13587: }
1.1.1.2 misho 13588: if (UNEXPECTED(EX(fbc) == NULL)) {
1.1 misho 13589: zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name, function_name_strval);
13590: }
1.1.1.2 misho 13591: if (IS_CONST == IS_CONST &&
13592: EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) &&
13593: EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0)) {
13594: if (IS_VAR == IS_CONST) {
13595: CACHE_PTR(opline->op2.literal->cache_slot, EX(fbc));
13596: } else {
13597: CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce, EX(fbc));
13598: }
13599: }
1.1 misho 13600: }
13601: if (IS_CONST != IS_CONST) {
13602:
13603: }
13604: } else {
1.1.1.2 misho 13605: if (UNEXPECTED(ce->constructor == NULL)) {
1.1 misho 13606: zend_error_noreturn(E_ERROR, "Cannot call constructor");
13607: }
13608: if (EG(This) && Z_OBJCE_P(EG(This)) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) {
1.1.1.2 misho 13609: zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name);
1.1 misho 13610: }
13611: EX(fbc) = ce->constructor;
13612: }
13613:
13614: if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) {
13615: EX(object) = NULL;
13616: } else {
13617: if (EG(This) &&
13618: Z_OBJ_HT_P(EG(This))->get_class_entry &&
13619: !instanceof_function(Z_OBJCE_P(EG(This)), ce TSRMLS_CC)) {
13620: /* We are calling method of the other (incompatible) class,
13621: but passing $this. This is done for compatibility with php-4. */
13622: if (EX(fbc)->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
1.1.1.2 misho 13623: zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", EX(fbc)->common.scope->name, EX(fbc)->common.function_name);
1.1 misho 13624: } else {
13625: /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
1.1.1.2 misho 13626: zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", EX(fbc)->common.scope->name, EX(fbc)->common.function_name);
1.1 misho 13627: }
13628: }
13629: if ((EX(object) = EG(This))) {
13630: Z_ADDREF_P(EX(object));
13631: EX(called_scope) = Z_OBJCE_P(EX(object));
13632: }
13633: }
13634:
1.1.1.2 misho 13635: CHECK_EXCEPTION();
1.1 misho 13636: ZEND_VM_NEXT_OPCODE();
13637: }
13638:
13639: static int ZEND_FASTCALL ZEND_CASE_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
13640: {
1.1.1.2 misho 13641: USE_OPLINE
1.1 misho 13642: zend_free_op free_op1;
13643:
1.1.1.2 misho 13644: SAVE_OPLINE();
1.1 misho 13645: if (IS_VAR==IS_VAR) {
1.1.1.2 misho 13646: PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
1.1 misho 13647: }
1.1.1.2 misho 13648: is_equal_function(&EX_T(opline->result.var).tmp_var,
13649: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
13650: opline->op2.zv TSRMLS_CC);
13651:
13652: CHECK_EXCEPTION();
1.1 misho 13653: ZEND_VM_NEXT_OPCODE();
13654: }
13655:
13656: static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
13657: {
1.1.1.2 misho 13658: USE_OPLINE
1.1 misho 13659:
1.1.1.2 misho 13660: SAVE_OPLINE();
1.1 misho 13661: if (IS_VAR == IS_UNUSED) {
1.1.1.2 misho 13662: zend_constant *c;
13663: zval *retval;
13664:
13665: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
13666: c = CACHED_PTR(opline->op2.literal->cache_slot);
13667: } else if ((c = zend_quick_get_constant(opline->op2.literal + 1, opline->extended_value TSRMLS_CC)) == NULL) {
1.1 misho 13668: if ((opline->extended_value & IS_CONSTANT_UNQUALIFIED) != 0) {
1.1.1.2 misho 13669: char *actual = (char *)zend_memrchr(Z_STRVAL_P(opline->op2.zv), '\\', Z_STRLEN_P(opline->op2.zv));
1.1 misho 13670: if(!actual) {
1.1.1.2 misho 13671: actual = Z_STRVAL_P(opline->op2.zv);
1.1 misho 13672: } else {
13673: actual++;
13674: }
13675: /* non-qualified constant - allow text substitution */
13676: zend_error(E_NOTICE, "Use of undefined constant %s - assumed '%s'", actual, actual);
1.1.1.2 misho 13677: ZVAL_STRINGL(&EX_T(opline->result.var).tmp_var, actual, Z_STRLEN_P(opline->op2.zv)-(actual - Z_STRVAL_P(opline->op2.zv)), 1);
13678: CHECK_EXCEPTION();
13679: ZEND_VM_NEXT_OPCODE();
1.1 misho 13680: } else {
1.1.1.2 misho 13681: zend_error_noreturn(E_ERROR, "Undefined constant '%s'", Z_STRVAL_P(opline->op2.zv));
1.1 misho 13682: }
1.1.1.2 misho 13683: } else {
13684: CACHE_PTR(opline->op2.literal->cache_slot, c);
1.1 misho 13685: }
1.1.1.2 misho 13686: retval = &EX_T(opline->result.var).tmp_var;
13687: ZVAL_COPY_VALUE(retval, &c->value);
13688: zval_copy_ctor(retval);
13689: CHECK_EXCEPTION();
1.1 misho 13690: ZEND_VM_NEXT_OPCODE();
13691: } else {
13692: /* class constant */
13693: zend_class_entry *ce;
13694: zval **value;
13695:
13696: if (IS_VAR == IS_CONST) {
1.1.1.2 misho 13697: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
13698: value = CACHED_PTR(opline->op2.literal->cache_slot);
13699: ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, *value);
13700: zval_copy_ctor(&EX_T(opline->result.var).tmp_var);
13701: CHECK_EXCEPTION();
13702: ZEND_VM_NEXT_OPCODE();
13703: } else if (CACHED_PTR(opline->op1.literal->cache_slot)) {
13704: ce = CACHED_PTR(opline->op1.literal->cache_slot);
13705: } else {
13706: ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
1.1.1.4 ! misho 13707: if (UNEXPECTED(EG(exception) != NULL)) {
! 13708: HANDLE_EXCEPTION();
! 13709: }
1.1.1.2 misho 13710: if (UNEXPECTED(ce == NULL)) {
1.1.1.4 ! misho 13711: zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv));
1.1.1.2 misho 13712: }
13713: CACHE_PTR(opline->op1.literal->cache_slot, ce);
1.1 misho 13714: }
13715: } else {
1.1.1.2 misho 13716: ce = EX_T(opline->op1.var).class_entry;
13717: if ((value = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce)) != NULL) {
13718: ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, *value);
13719: zval_copy_ctor(&EX_T(opline->result.var).tmp_var);
13720: CHECK_EXCEPTION();
13721: ZEND_VM_NEXT_OPCODE();
13722: }
1.1 misho 13723: }
13724:
1.1.1.2 misho 13725: if (EXPECTED(zend_hash_quick_find(&ce->constants_table, Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv)+1, Z_HASH_P(opline->op2.zv), (void **) &value) == SUCCESS)) {
1.1 misho 13726: if (Z_TYPE_PP(value) == IS_CONSTANT_ARRAY ||
13727: (Z_TYPE_PP(value) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT) {
13728: zend_class_entry *old_scope = EG(scope);
13729:
13730: EG(scope) = ce;
13731: zval_update_constant(value, (void *) 1 TSRMLS_CC);
13732: EG(scope) = old_scope;
13733: }
1.1.1.2 misho 13734: if (IS_VAR == IS_CONST) {
13735: CACHE_PTR(opline->op2.literal->cache_slot, value);
13736: } else {
13737: CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce, value);
13738: }
13739: ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, *value);
13740: zval_copy_ctor(&EX_T(opline->result.var).tmp_var);
1.1 misho 13741: } else {
1.1.1.2 misho 13742: zend_error_noreturn(E_ERROR, "Undefined class constant '%s'", Z_STRVAL_P(opline->op2.zv));
1.1 misho 13743: }
13744:
1.1.1.2 misho 13745: CHECK_EXCEPTION();
1.1 misho 13746: ZEND_VM_NEXT_OPCODE();
13747: }
13748: }
13749:
13750: static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
13751: {
1.1.1.2 misho 13752: USE_OPLINE
1.1 misho 13753: zend_free_op free_op1;
13754: zval *expr_ptr;
13755:
1.1.1.2 misho 13756: SAVE_OPLINE();
13757: if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && opline->extended_value) {
13758: zval **expr_ptr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 13759:
1.1.1.2 misho 13760: if (IS_VAR == IS_VAR && UNEXPECTED(expr_ptr_ptr == NULL)) {
13761: zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
13762: }
13763: SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr);
1.1 misho 13764: expr_ptr = *expr_ptr_ptr;
1.1.1.2 misho 13765: Z_ADDREF_P(expr_ptr);
1.1 misho 13766: } else {
1.1.1.2 misho 13767: expr_ptr=_get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
13768: if (0) { /* temporary variable */
13769: zval *new_expr;
1.1 misho 13770:
1.1.1.2 misho 13771: ALLOC_ZVAL(new_expr);
13772: INIT_PZVAL_COPY(new_expr, expr_ptr);
13773: expr_ptr = new_expr;
13774: } else if (IS_VAR == IS_CONST || PZVAL_IS_REF(expr_ptr)) {
1.1 misho 13775: zval *new_expr;
13776:
13777: ALLOC_ZVAL(new_expr);
13778: INIT_PZVAL_COPY(new_expr, expr_ptr);
13779: expr_ptr = new_expr;
13780: zendi_zval_copy_ctor(*expr_ptr);
13781: } else {
13782: Z_ADDREF_P(expr_ptr);
13783: }
13784: }
1.1.1.2 misho 13785:
13786: if (IS_CONST != IS_UNUSED) {
13787:
13788: zval *offset = opline->op2.zv;
13789: ulong hval;
13790:
1.1 misho 13791: switch (Z_TYPE_P(offset)) {
13792: case IS_DOUBLE:
1.1.1.2 misho 13793: hval = zend_dval_to_lval(Z_DVAL_P(offset));
13794: goto num_index;
1.1 misho 13795: case IS_LONG:
13796: case IS_BOOL:
1.1.1.2 misho 13797: hval = Z_LVAL_P(offset);
13798: num_index:
13799: zend_hash_index_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), hval, &expr_ptr, sizeof(zval *), NULL);
1.1 misho 13800: break;
13801: case IS_STRING:
1.1.1.2 misho 13802: if (IS_CONST == IS_CONST) {
13803: hval = Z_HASH_P(offset);
13804: } else {
13805: ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
13806: if (IS_INTERNED(Z_STRVAL_P(offset))) {
13807: hval = INTERNED_HASH(Z_STRVAL_P(offset));
13808: } else {
13809: hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
13810: }
13811: }
13812: zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
1.1 misho 13813: break;
13814: case IS_NULL:
1.1.1.2 misho 13815: zend_hash_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
1.1 misho 13816: break;
13817: default:
13818: zend_error(E_WARNING, "Illegal offset type");
13819: zval_ptr_dtor(&expr_ptr);
13820: /* do nothing */
13821: break;
13822: }
13823:
13824: } else {
1.1.1.2 misho 13825: zend_hash_next_index_insert(Z_ARRVAL(EX_T(opline->result.var).tmp_var), &expr_ptr, sizeof(zval *), NULL);
1.1 misho 13826: }
1.1.1.2 misho 13827: if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && opline->extended_value) {
1.1 misho 13828: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
13829: } else {
13830: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
13831: }
1.1.1.2 misho 13832: CHECK_EXCEPTION();
1.1 misho 13833: ZEND_VM_NEXT_OPCODE();
13834: }
13835:
13836: static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
13837: {
1.1.1.2 misho 13838: USE_OPLINE
1.1 misho 13839:
1.1.1.2 misho 13840: array_init(&EX_T(opline->result.var).tmp_var);
1.1 misho 13841: if (IS_VAR == IS_UNUSED) {
13842: ZEND_VM_NEXT_OPCODE();
13843: #if 0 || IS_VAR != IS_UNUSED
13844: } else {
13845: return ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
13846: #endif
13847: }
13848: }
13849:
1.1.1.2 misho 13850: static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
13851: {
13852: USE_OPLINE
13853: zval tmp, *varname;
13854: HashTable *target_symbol_table;
13855: zend_free_op free_op1;
13856:
13857: SAVE_OPLINE();
13858: if (IS_VAR == IS_CV &&
13859: IS_CONST == IS_UNUSED &&
13860: (opline->extended_value & ZEND_QUICK_SET)) {
13861: if (EG(active_symbol_table)) {
13862: zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.var);
13863:
13864: zend_delete_variable(EX(prev_execute_data), EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value TSRMLS_CC);
13865: EX_CV(opline->op1.var) = NULL;
13866: } else if (EX_CV(opline->op1.var)) {
13867: zval_ptr_dtor(EX_CV(opline->op1.var));
13868: EX_CV(opline->op1.var) = NULL;
13869: }
13870: CHECK_EXCEPTION();
13871: ZEND_VM_NEXT_OPCODE();
13872: }
13873:
13874: varname = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
13875:
13876: if (IS_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
13877: ZVAL_COPY_VALUE(&tmp, varname);
13878: zval_copy_ctor(&tmp);
13879: convert_to_string(&tmp);
13880: varname = &tmp;
13881: } else if (IS_VAR == IS_VAR || IS_VAR == IS_CV) {
13882: Z_ADDREF_P(varname);
13883: }
13884:
13885: if (IS_CONST != IS_UNUSED) {
13886: zend_class_entry *ce;
13887:
13888: if (IS_CONST == IS_CONST) {
13889: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
13890: ce = CACHED_PTR(opline->op2.literal->cache_slot);
13891: } else {
13892: ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
1.1.1.4 ! misho 13893: if (UNEXPECTED(EG(exception) != NULL)) {
1.1.1.2 misho 13894: if (IS_VAR != IS_CONST && varname == &tmp) {
13895: zval_dtor(&tmp);
13896: } else if (IS_VAR == IS_VAR || IS_VAR == IS_CV) {
13897: zval_ptr_dtor(&varname);
13898: }
13899: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.4 ! misho 13900: HANDLE_EXCEPTION();
! 13901: }
! 13902: if (UNEXPECTED(ce == NULL)) {
! 13903: zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op2.zv));
1.1.1.2 misho 13904: }
13905: CACHE_PTR(opline->op2.literal->cache_slot, ce);
13906: }
13907: } else {
13908: ce = EX_T(opline->op2.var).class_entry;
13909: }
13910: zend_std_unset_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), ((IS_VAR == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
13911: } else {
13912: ulong hash_value = zend_inline_hash_func(varname->value.str.val, varname->value.str.len+1);
13913:
13914: target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
13915: zend_delete_variable(execute_data, target_symbol_table, varname->value.str.val, varname->value.str.len+1, hash_value TSRMLS_CC);
13916: }
13917:
13918: if (IS_VAR != IS_CONST && varname == &tmp) {
13919: zval_dtor(&tmp);
13920: } else if (IS_VAR == IS_VAR || IS_VAR == IS_CV) {
13921: zval_ptr_dtor(&varname);
13922: }
13923: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
13924: CHECK_EXCEPTION();
13925: ZEND_VM_NEXT_OPCODE();
13926: }
13927:
1.1 misho 13928: static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
13929: {
1.1.1.2 misho 13930: USE_OPLINE
1.1 misho 13931: zend_free_op free_op1;
1.1.1.2 misho 13932: zval **container;
1.1 misho 13933: zval *offset;
1.1.1.2 misho 13934: ulong hval;
1.1 misho 13935:
1.1.1.2 misho 13936: SAVE_OPLINE();
13937: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 13938: if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) {
13939: SEPARATE_ZVAL_IF_NOT_REF(container);
13940: }
1.1.1.2 misho 13941: offset = opline->op2.zv;
1.1 misho 13942:
13943: if (IS_VAR != IS_VAR || container) {
13944: switch (Z_TYPE_PP(container)) {
13945: case IS_ARRAY: {
13946: HashTable *ht = Z_ARRVAL_PP(container);
13947:
13948: switch (Z_TYPE_P(offset)) {
13949: case IS_DOUBLE:
1.1.1.2 misho 13950: hval = zend_dval_to_lval(Z_DVAL_P(offset));
1.1.1.3 misho 13951: zend_hash_index_del(ht, hval);
13952: break;
1.1 misho 13953: case IS_RESOURCE:
13954: case IS_BOOL:
13955: case IS_LONG:
1.1.1.2 misho 13956: hval = Z_LVAL_P(offset);
13957: zend_hash_index_del(ht, hval);
1.1 misho 13958: break;
13959: case IS_STRING:
13960: if (IS_CONST == IS_CV || IS_CONST == IS_VAR) {
13961: Z_ADDREF_P(offset);
13962: }
1.1.1.2 misho 13963: if (IS_CONST == IS_CONST) {
13964: hval = Z_HASH_P(offset);
13965: } else {
13966: ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_dim);
13967: if (IS_INTERNED(Z_STRVAL_P(offset))) {
13968: hval = INTERNED_HASH(Z_STRVAL_P(offset));
13969: } else {
13970: hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
1.1 misho 13971: }
13972: }
1.1.1.2 misho 13973: if (ht == &EG(symbol_table)) {
13974: zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC);
13975: } else {
13976: zend_hash_quick_del(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval);
13977: }
13978: if (IS_CONST == IS_CV || IS_CONST == IS_VAR) {
13979: zval_ptr_dtor(&offset);
13980: }
13981: break;
13982: num_index_dim:
13983: zend_hash_index_del(ht, hval);
1.1 misho 13984: if (IS_CONST == IS_CV || IS_CONST == IS_VAR) {
13985: zval_ptr_dtor(&offset);
13986: }
13987: break;
13988: case IS_NULL:
13989: zend_hash_del(ht, "", sizeof(""));
13990: break;
13991: default:
13992: zend_error(E_WARNING, "Illegal offset type in unset");
13993: break;
13994: }
13995:
13996: break;
13997: }
13998: case IS_OBJECT:
1.1.1.2 misho 13999: if (UNEXPECTED(Z_OBJ_HT_P(*container)->unset_dimension == NULL)) {
1.1 misho 14000: zend_error_noreturn(E_ERROR, "Cannot use object as array");
14001: }
14002: if (0) {
14003: MAKE_REAL_ZVAL_PTR(offset);
14004: }
14005: Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC);
14006: if (0) {
14007: zval_ptr_dtor(&offset);
14008: } else {
14009:
14010: }
14011: break;
14012: case IS_STRING:
14013: zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
14014: ZEND_VM_CONTINUE(); /* bailed out before */
14015: default:
14016:
14017: break;
14018: }
14019: } else {
14020:
14021: }
14022: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
14023:
1.1.1.2 misho 14024: CHECK_EXCEPTION();
1.1 misho 14025: ZEND_VM_NEXT_OPCODE();
14026: }
14027:
14028: static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
14029: {
1.1.1.2 misho 14030: USE_OPLINE
1.1 misho 14031: zend_free_op free_op1;
1.1.1.2 misho 14032: zval **container;
14033: zval *offset;
14034:
14035: SAVE_OPLINE();
14036: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
14037: offset = opline->op2.zv;
1.1 misho 14038:
14039: if (IS_VAR != IS_VAR || container) {
14040: if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) {
14041: SEPARATE_ZVAL_IF_NOT_REF(container);
14042: }
1.1.1.2 misho 14043: if (Z_TYPE_PP(container) == IS_OBJECT) {
14044: if (0) {
14045: MAKE_REAL_ZVAL_PTR(offset);
14046: }
14047: if (Z_OBJ_HT_P(*container)->unset_property) {
14048: Z_OBJ_HT_P(*container)->unset_property(*container, offset, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
14049: } else {
14050: zend_error(E_NOTICE, "Trying to unset property of non-object");
14051: }
14052: if (0) {
14053: zval_ptr_dtor(&offset);
14054: } else {
14055:
14056: }
14057: } else {
14058:
14059: }
14060: } else {
14061:
14062: }
14063: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
14064:
14065: CHECK_EXCEPTION();
14066: ZEND_VM_NEXT_OPCODE();
14067: }
14068:
14069: static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
14070: {
14071: USE_OPLINE
14072: zval **value;
14073: zend_bool isset = 1;
14074:
14075: SAVE_OPLINE();
14076: if (IS_VAR == IS_CV &&
14077: IS_CONST == IS_UNUSED &&
14078: (opline->extended_value & ZEND_QUICK_SET)) {
14079: if (EX_CV(opline->op1.var)) {
14080: value = EX_CV(opline->op1.var);
14081: } else if (EG(active_symbol_table)) {
14082: zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.var);
14083:
14084: if (zend_hash_quick_find(EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value, (void **) &value) == FAILURE) {
14085: isset = 0;
14086: }
14087: } else {
14088: isset = 0;
14089: }
14090: } else {
14091: HashTable *target_symbol_table;
14092: zend_free_op free_op1;
14093: zval tmp, *varname = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
14094:
14095: if (IS_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
14096: ZVAL_COPY_VALUE(&tmp, varname);
14097: zval_copy_ctor(&tmp);
14098: convert_to_string(&tmp);
14099: varname = &tmp;
14100: }
14101:
14102: if (IS_CONST != IS_UNUSED) {
14103: zend_class_entry *ce;
14104:
14105: if (IS_CONST == IS_CONST) {
14106: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
14107: ce = CACHED_PTR(opline->op2.literal->cache_slot);
14108: } else {
14109: ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
14110: if (UNEXPECTED(ce == NULL)) {
14111: CHECK_EXCEPTION();
14112: ZEND_VM_NEXT_OPCODE();
14113: }
14114: CACHE_PTR(opline->op2.literal->cache_slot, ce);
14115: }
1.1 misho 14116: } else {
1.1.1.2 misho 14117: ce = EX_T(opline->op2.var).class_entry;
1.1 misho 14118: }
1.1.1.2 misho 14119: value = zend_std_get_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 1, ((IS_VAR == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
14120: if (!value) {
14121: isset = 0;
1.1 misho 14122: }
14123: } else {
1.1.1.2 misho 14124: target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
14125: if (zend_hash_find(target_symbol_table, varname->value.str.val, varname->value.str.len+1, (void **) &value) == FAILURE) {
14126: isset = 0;
14127: }
14128: }
1.1 misho 14129:
1.1.1.2 misho 14130: if (IS_VAR != IS_CONST && varname == &tmp) {
14131: zval_dtor(&tmp);
1.1 misho 14132: }
1.1.1.2 misho 14133: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
14134: }
1.1 misho 14135:
1.1.1.2 misho 14136: if (opline->extended_value & ZEND_ISSET) {
14137: if (isset && Z_TYPE_PP(value) != IS_NULL) {
14138: ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 1);
14139: } else {
14140: ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
14141: }
14142: } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
14143: if (!isset || !i_zend_is_true(*value)) {
14144: ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 1);
14145: } else {
14146: ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
14147: }
1.1 misho 14148: }
14149:
1.1.1.2 misho 14150: CHECK_EXCEPTION();
1.1 misho 14151: ZEND_VM_NEXT_OPCODE();
14152: }
14153:
14154: static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_CONST(int prop_dim, ZEND_OPCODE_HANDLER_ARGS)
14155: {
1.1.1.2 misho 14156: USE_OPLINE
1.1 misho 14157: zend_free_op free_op1;
1.1.1.2 misho 14158: zval **container;
1.1 misho 14159: zval **value = NULL;
14160: int result = 0;
1.1.1.2 misho 14161: ulong hval;
14162: zval *offset;
1.1 misho 14163:
1.1.1.2 misho 14164: SAVE_OPLINE();
14165: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 14166:
1.1.1.2 misho 14167: offset = opline->op2.zv;
1.1 misho 14168:
1.1.1.2 misho 14169: if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) {
14170: HashTable *ht;
14171: int isset = 0;
1.1 misho 14172:
1.1.1.2 misho 14173: ht = Z_ARRVAL_PP(container);
1.1 misho 14174:
1.1.1.2 misho 14175: switch (Z_TYPE_P(offset)) {
14176: case IS_DOUBLE:
14177: hval = zend_dval_to_lval(Z_DVAL_P(offset));
14178: goto num_index_prop;
14179: case IS_RESOURCE:
14180: case IS_BOOL:
14181: case IS_LONG:
14182: hval = Z_LVAL_P(offset);
14183: num_index_prop:
14184: if (zend_hash_index_find(ht, hval, (void **) &value) == SUCCESS) {
14185: isset = 1;
14186: }
14187: break;
14188: case IS_STRING:
14189: if (IS_CONST == IS_CONST) {
14190: hval = Z_HASH_P(offset);
14191: } else {
14192: if (!prop_dim) {
14193: ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_prop);
1.1 misho 14194: }
1.1.1.2 misho 14195: if (IS_INTERNED(Z_STRVAL_P(offset))) {
14196: hval = INTERNED_HASH(Z_STRVAL_P(offset));
1.1 misho 14197: } else {
1.1.1.2 misho 14198: hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
1.1 misho 14199: }
14200: }
1.1.1.2 misho 14201: if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) {
14202: isset = 1;
1.1 misho 14203: }
1.1.1.2 misho 14204: break;
14205: case IS_NULL:
14206: if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) {
14207: isset = 1;
14208: }
14209: break;
14210: default:
14211: zend_error(E_WARNING, "Illegal offset type in isset or empty");
14212: break;
14213: }
14214:
14215: if (opline->extended_value & ZEND_ISSET) {
14216: if (isset && Z_TYPE_PP(value) == IS_NULL) {
14217: result = 0;
14218: } else {
14219: result = isset;
1.1 misho 14220: }
1.1.1.2 misho 14221: } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
14222: if (!isset || !i_zend_is_true(*value)) {
14223: result = 0;
1.1 misho 14224: } else {
1.1.1.2 misho 14225: result = 1;
14226: }
14227: }
1.1 misho 14228:
1.1.1.2 misho 14229: } else if (Z_TYPE_PP(container) == IS_OBJECT) {
14230: if (0) {
14231: MAKE_REAL_ZVAL_PTR(offset);
14232: }
14233: if (prop_dim) {
14234: if (Z_OBJ_HT_P(*container)->has_property) {
14235: result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
14236: } else {
14237: zend_error(E_NOTICE, "Trying to check property of non-object");
14238: result = 0;
14239: }
14240: } else {
14241: if (Z_OBJ_HT_P(*container)->has_dimension) {
14242: result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0 TSRMLS_CC);
14243: } else {
14244: zend_error(E_NOTICE, "Trying to check element of non-array");
14245: result = 0;
1.1 misho 14246: }
1.1.1.2 misho 14247: }
14248: if (0) {
14249: zval_ptr_dtor(&offset);
14250: } else {
14251:
14252: }
14253: } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */
14254: zval tmp;
1.1 misho 14255:
1.1.1.2 misho 14256: if (Z_TYPE_P(offset) != IS_LONG) {
14257: if (Z_TYPE_P(offset) <= IS_BOOL /* simple scalar types */
14258: || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */
14259: && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) {
14260: ZVAL_COPY_VALUE(&tmp, offset);
1.1 misho 14261: zval_copy_ctor(&tmp);
14262: convert_to_long(&tmp);
14263: offset = &tmp;
1.1.1.2 misho 14264: } else {
14265: /* can not be converted to proper offset, return "not set" */
14266: result = 0;
1.1 misho 14267: }
1.1.1.2 misho 14268: }
14269: if (Z_TYPE_P(offset) == IS_LONG) {
14270: if (opline->extended_value & ZEND_ISSET) {
14271: if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
14272: result = 1;
14273: }
14274: } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
14275: if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') {
14276: result = 1;
1.1 misho 14277: }
14278: }
1.1.1.2 misho 14279: }
1.1 misho 14280:
1.1.1.2 misho 14281: } else {
1.1 misho 14282:
14283: }
14284:
1.1.1.2 misho 14285: Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
14286: if (opline->extended_value & ZEND_ISSET) {
14287: Z_LVAL(EX_T(opline->result.var).tmp_var) = result;
14288: } else {
14289: Z_LVAL(EX_T(opline->result.var).tmp_var) = !result;
1.1 misho 14290: }
14291:
14292: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
14293:
1.1.1.2 misho 14294: CHECK_EXCEPTION();
1.1 misho 14295: ZEND_VM_NEXT_OPCODE();
14296: }
14297:
14298: static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
14299: {
14300: return zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_CONST(0, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
14301: }
14302:
14303: static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
14304: {
14305: return zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_CONST(1, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
14306: }
14307:
14308: static int ZEND_FASTCALL ZEND_ADD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
14309: {
1.1.1.2 misho 14310: USE_OPLINE
1.1 misho 14311: zend_free_op free_op1, free_op2;
14312:
1.1.1.2 misho 14313: SAVE_OPLINE();
14314: fast_add_function(&EX_T(opline->result.var).tmp_var,
14315: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
14316: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 14317: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
14318: zval_dtor(free_op2.var);
1.1.1.2 misho 14319: CHECK_EXCEPTION();
1.1 misho 14320: ZEND_VM_NEXT_OPCODE();
14321: }
14322:
14323: static int ZEND_FASTCALL ZEND_SUB_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
14324: {
1.1.1.2 misho 14325: USE_OPLINE
1.1 misho 14326: zend_free_op free_op1, free_op2;
14327:
1.1.1.2 misho 14328: SAVE_OPLINE();
14329: fast_sub_function(&EX_T(opline->result.var).tmp_var,
14330: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
14331: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 14332: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
14333: zval_dtor(free_op2.var);
1.1.1.2 misho 14334: CHECK_EXCEPTION();
1.1 misho 14335: ZEND_VM_NEXT_OPCODE();
14336: }
14337:
14338: static int ZEND_FASTCALL ZEND_MUL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
14339: {
1.1.1.2 misho 14340: USE_OPLINE
1.1 misho 14341: zend_free_op free_op1, free_op2;
14342:
1.1.1.2 misho 14343: SAVE_OPLINE();
14344: fast_mul_function(&EX_T(opline->result.var).tmp_var,
14345: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
14346: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 14347: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
14348: zval_dtor(free_op2.var);
1.1.1.2 misho 14349: CHECK_EXCEPTION();
1.1 misho 14350: ZEND_VM_NEXT_OPCODE();
14351: }
14352:
14353: static int ZEND_FASTCALL ZEND_DIV_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
14354: {
1.1.1.2 misho 14355: USE_OPLINE
1.1 misho 14356: zend_free_op free_op1, free_op2;
14357:
1.1.1.2 misho 14358: SAVE_OPLINE();
14359: fast_div_function(&EX_T(opline->result.var).tmp_var,
14360: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
14361: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 14362: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
14363: zval_dtor(free_op2.var);
1.1.1.2 misho 14364: CHECK_EXCEPTION();
1.1 misho 14365: ZEND_VM_NEXT_OPCODE();
14366: }
14367:
14368: static int ZEND_FASTCALL ZEND_MOD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
14369: {
1.1.1.2 misho 14370: USE_OPLINE
1.1 misho 14371: zend_free_op free_op1, free_op2;
14372:
1.1.1.2 misho 14373: SAVE_OPLINE();
14374: fast_mod_function(&EX_T(opline->result.var).tmp_var,
14375: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
14376: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 14377: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
14378: zval_dtor(free_op2.var);
1.1.1.2 misho 14379: CHECK_EXCEPTION();
1.1 misho 14380: ZEND_VM_NEXT_OPCODE();
14381: }
14382:
14383: static int ZEND_FASTCALL ZEND_SL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
14384: {
1.1.1.2 misho 14385: USE_OPLINE
1.1 misho 14386: zend_free_op free_op1, free_op2;
14387:
1.1.1.2 misho 14388: SAVE_OPLINE();
14389: shift_left_function(&EX_T(opline->result.var).tmp_var,
14390: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
14391: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 14392: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
14393: zval_dtor(free_op2.var);
1.1.1.2 misho 14394: CHECK_EXCEPTION();
1.1 misho 14395: ZEND_VM_NEXT_OPCODE();
14396: }
14397:
14398: static int ZEND_FASTCALL ZEND_SR_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
14399: {
1.1.1.2 misho 14400: USE_OPLINE
1.1 misho 14401: zend_free_op free_op1, free_op2;
14402:
1.1.1.2 misho 14403: SAVE_OPLINE();
14404: shift_right_function(&EX_T(opline->result.var).tmp_var,
14405: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
14406: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 14407: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
14408: zval_dtor(free_op2.var);
1.1.1.2 misho 14409: CHECK_EXCEPTION();
1.1 misho 14410: ZEND_VM_NEXT_OPCODE();
14411: }
14412:
14413: static int ZEND_FASTCALL ZEND_CONCAT_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
14414: {
1.1.1.2 misho 14415: USE_OPLINE
1.1 misho 14416: zend_free_op free_op1, free_op2;
14417:
1.1.1.2 misho 14418: SAVE_OPLINE();
14419: concat_function(&EX_T(opline->result.var).tmp_var,
14420: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
14421: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 14422: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
14423: zval_dtor(free_op2.var);
1.1.1.2 misho 14424: CHECK_EXCEPTION();
1.1 misho 14425: ZEND_VM_NEXT_OPCODE();
14426: }
14427:
14428: static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
14429: {
1.1.1.2 misho 14430: USE_OPLINE
1.1 misho 14431: zend_free_op free_op1, free_op2;
14432:
1.1.1.2 misho 14433: SAVE_OPLINE();
14434: is_identical_function(&EX_T(opline->result.var).tmp_var,
14435: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
14436: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 14437: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
14438: zval_dtor(free_op2.var);
1.1.1.2 misho 14439: CHECK_EXCEPTION();
1.1 misho 14440: ZEND_VM_NEXT_OPCODE();
14441: }
14442:
14443: static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
14444: {
1.1.1.2 misho 14445: USE_OPLINE
1.1 misho 14446: zend_free_op free_op1, free_op2;
1.1.1.2 misho 14447: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 14448:
1.1.1.2 misho 14449: SAVE_OPLINE();
1.1 misho 14450: is_identical_function(result,
1.1.1.2 misho 14451: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
14452: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 14453: Z_LVAL_P(result) = !Z_LVAL_P(result);
14454: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
14455: zval_dtor(free_op2.var);
1.1.1.2 misho 14456: CHECK_EXCEPTION();
1.1 misho 14457: ZEND_VM_NEXT_OPCODE();
14458: }
14459:
14460: static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
14461: {
1.1.1.2 misho 14462: USE_OPLINE
1.1 misho 14463: zend_free_op free_op1, free_op2;
1.1.1.2 misho 14464: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 14465:
1.1.1.2 misho 14466: SAVE_OPLINE();
14467: ZVAL_BOOL(result, fast_equal_function(result,
14468: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
14469: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC));
1.1 misho 14470: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
14471: zval_dtor(free_op2.var);
1.1.1.2 misho 14472: CHECK_EXCEPTION();
1.1 misho 14473: ZEND_VM_NEXT_OPCODE();
14474: }
14475:
14476: static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
14477: {
1.1.1.2 misho 14478: USE_OPLINE
1.1 misho 14479: zend_free_op free_op1, free_op2;
1.1.1.2 misho 14480: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 14481:
1.1.1.2 misho 14482: SAVE_OPLINE();
14483: ZVAL_BOOL(result, fast_not_equal_function(result,
14484: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
14485: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC));
1.1 misho 14486: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
14487: zval_dtor(free_op2.var);
1.1.1.2 misho 14488: CHECK_EXCEPTION();
1.1 misho 14489: ZEND_VM_NEXT_OPCODE();
14490: }
14491:
14492: static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
14493: {
1.1.1.2 misho 14494: USE_OPLINE
1.1 misho 14495: zend_free_op free_op1, free_op2;
1.1.1.2 misho 14496: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 14497:
1.1.1.2 misho 14498: SAVE_OPLINE();
14499: ZVAL_BOOL(result, fast_is_smaller_function(result,
14500: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
14501: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC));
1.1 misho 14502: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
14503: zval_dtor(free_op2.var);
1.1.1.2 misho 14504: CHECK_EXCEPTION();
1.1 misho 14505: ZEND_VM_NEXT_OPCODE();
14506: }
14507:
14508: static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
14509: {
1.1.1.2 misho 14510: USE_OPLINE
1.1 misho 14511: zend_free_op free_op1, free_op2;
1.1.1.2 misho 14512: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 14513:
1.1.1.2 misho 14514: SAVE_OPLINE();
14515: ZVAL_BOOL(result, fast_is_smaller_or_equal_function(result,
14516: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
14517: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC));
1.1 misho 14518: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
14519: zval_dtor(free_op2.var);
1.1.1.2 misho 14520: CHECK_EXCEPTION();
1.1 misho 14521: ZEND_VM_NEXT_OPCODE();
14522: }
14523:
14524: static int ZEND_FASTCALL ZEND_BW_OR_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
14525: {
1.1.1.2 misho 14526: USE_OPLINE
1.1 misho 14527: zend_free_op free_op1, free_op2;
14528:
1.1.1.2 misho 14529: SAVE_OPLINE();
14530: bitwise_or_function(&EX_T(opline->result.var).tmp_var,
14531: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
14532: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 14533: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
14534: zval_dtor(free_op2.var);
1.1.1.2 misho 14535: CHECK_EXCEPTION();
1.1 misho 14536: ZEND_VM_NEXT_OPCODE();
14537: }
14538:
14539: static int ZEND_FASTCALL ZEND_BW_AND_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
14540: {
1.1.1.2 misho 14541: USE_OPLINE
1.1 misho 14542: zend_free_op free_op1, free_op2;
14543:
1.1.1.2 misho 14544: SAVE_OPLINE();
14545: bitwise_and_function(&EX_T(opline->result.var).tmp_var,
14546: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
14547: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 14548: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
14549: zval_dtor(free_op2.var);
1.1.1.2 misho 14550: CHECK_EXCEPTION();
1.1 misho 14551: ZEND_VM_NEXT_OPCODE();
14552: }
14553:
14554: static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
14555: {
1.1.1.2 misho 14556: USE_OPLINE
1.1 misho 14557: zend_free_op free_op1, free_op2;
14558:
1.1.1.2 misho 14559: SAVE_OPLINE();
14560: bitwise_xor_function(&EX_T(opline->result.var).tmp_var,
14561: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
14562: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 14563: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
14564: zval_dtor(free_op2.var);
1.1.1.2 misho 14565: CHECK_EXCEPTION();
1.1 misho 14566: ZEND_VM_NEXT_OPCODE();
14567: }
14568:
14569: static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
14570: {
1.1.1.2 misho 14571: USE_OPLINE
1.1 misho 14572: zend_free_op free_op1, free_op2;
14573:
1.1.1.2 misho 14574: SAVE_OPLINE();
14575: boolean_xor_function(&EX_T(opline->result.var).tmp_var,
14576: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
14577: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 14578: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
14579: zval_dtor(free_op2.var);
1.1.1.2 misho 14580: CHECK_EXCEPTION();
1.1 misho 14581: ZEND_VM_NEXT_OPCODE();
14582: }
14583:
14584: static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_TMP(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
14585: {
1.1.1.2 misho 14586: USE_OPLINE
1.1 misho 14587: zend_free_op free_op1, free_op2, free_op_data1;
1.1.1.2 misho 14588: zval **object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 14589: zval *object;
1.1.1.2 misho 14590: zval *property = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
14591: zval *value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R);
1.1 misho 14592: int have_get_ptr = 0;
14593:
1.1.1.2 misho 14594: if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 14595: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
14596: }
14597:
14598: make_real_object(object_ptr TSRMLS_CC);
14599: object = *object_ptr;
14600:
1.1.1.2 misho 14601: if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
1.1 misho 14602: zend_error(E_WARNING, "Attempt to assign property of non-object");
14603: zval_dtor(free_op2.var);
14604: FREE_OP(free_op_data1);
14605:
1.1.1.2 misho 14606: if (RETURN_VALUE_USED(opline)) {
14607: PZVAL_LOCK(&EG(uninitialized_zval));
14608: EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
14609: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 14610: }
14611: } else {
14612: /* here we are sure we are dealing with an object */
14613: if (1) {
14614: MAKE_REAL_ZVAL_PTR(property);
14615: }
14616:
14617: /* here property is a string */
14618: if (opline->extended_value == ZEND_ASSIGN_OBJ
14619: && Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
1.1.1.2 misho 14620: zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 14621: if (zptr != NULL) { /* NULL means no success in getting PTR */
14622: SEPARATE_ZVAL_IF_NOT_REF(zptr);
14623:
14624: have_get_ptr = 1;
14625: binary_op(*zptr, *zptr, value TSRMLS_CC);
1.1.1.2 misho 14626: if (RETURN_VALUE_USED(opline)) {
1.1 misho 14627: PZVAL_LOCK(*zptr);
1.1.1.2 misho 14628: EX_T(opline->result.var).var.ptr = *zptr;
14629: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 14630: }
14631: }
14632: }
14633:
14634: if (!have_get_ptr) {
14635: zval *z = NULL;
14636:
14637: if (opline->extended_value == ZEND_ASSIGN_OBJ) {
14638: if (Z_OBJ_HT_P(object)->read_property) {
1.1.1.2 misho 14639: z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 14640: }
14641: } else /* if (opline->extended_value == ZEND_ASSIGN_DIM) */ {
14642: if (Z_OBJ_HT_P(object)->read_dimension) {
14643: z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC);
14644: }
14645: }
14646: if (z) {
14647: if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
14648: zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
14649:
14650: if (Z_REFCOUNT_P(z) == 0) {
14651: GC_REMOVE_ZVAL_FROM_BUFFER(z);
14652: zval_dtor(z);
14653: FREE_ZVAL(z);
14654: }
14655: z = value;
14656: }
14657: Z_ADDREF_P(z);
14658: SEPARATE_ZVAL_IF_NOT_REF(&z);
14659: binary_op(z, z, value TSRMLS_CC);
14660: if (opline->extended_value == ZEND_ASSIGN_OBJ) {
1.1.1.2 misho 14661: Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 14662: } else /* if (opline->extended_value == ZEND_ASSIGN_DIM) */ {
14663: Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC);
14664: }
1.1.1.2 misho 14665: if (RETURN_VALUE_USED(opline)) {
1.1 misho 14666: PZVAL_LOCK(z);
1.1.1.2 misho 14667: EX_T(opline->result.var).var.ptr = z;
14668: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 14669: }
14670: zval_ptr_dtor(&z);
14671: } else {
14672: zend_error(E_WARNING, "Attempt to assign property of non-object");
1.1.1.2 misho 14673: if (RETURN_VALUE_USED(opline)) {
14674: PZVAL_LOCK(&EG(uninitialized_zval));
14675: EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
14676: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 14677: }
14678: }
14679: }
14680:
14681: if (1) {
14682: zval_ptr_dtor(&property);
14683: } else {
14684: zval_dtor(free_op2.var);
14685: }
14686: FREE_OP(free_op_data1);
14687: }
14688:
14689: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
14690: /* assign_obj has two opcodes! */
1.1.1.2 misho 14691: CHECK_EXCEPTION();
1.1 misho 14692: ZEND_VM_INC_OPCODE();
14693: ZEND_VM_NEXT_OPCODE();
14694: }
14695:
14696: static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_TMP(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
14697: {
1.1.1.2 misho 14698: USE_OPLINE
1.1 misho 14699: zend_free_op free_op1, free_op2, free_op_data2, free_op_data1;
14700: zval **var_ptr;
14701: zval *value;
14702:
1.1.1.2 misho 14703: SAVE_OPLINE();
1.1 misho 14704: switch (opline->extended_value) {
14705: case ZEND_ASSIGN_OBJ:
14706: return zend_binary_assign_op_obj_helper_SPEC_VAR_TMP(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
14707: break;
14708: case ZEND_ASSIGN_DIM: {
1.1.1.2 misho 14709: zval **container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 14710:
1.1.1.2 misho 14711: if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 14712: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
1.1.1.2 misho 14713: } else if (UNEXPECTED(Z_TYPE_PP(container) == IS_OBJECT)) {
1.1 misho 14714: if (IS_VAR == IS_VAR && !(free_op1.var != NULL)) {
14715: Z_ADDREF_PP(container); /* undo the effect of get_obj_zval_ptr_ptr() */
14716: }
14717: return zend_binary_assign_op_obj_helper_SPEC_VAR_TMP(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
14718: } else {
1.1.1.2 misho 14719: zval *dim = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 14720:
1.1.1.2 misho 14721: zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), container, dim, IS_TMP_VAR, BP_VAR_RW TSRMLS_CC);
14722: value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R);
14723: var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC);
1.1 misho 14724: }
14725: }
14726: break;
14727: default:
1.1.1.2 misho 14728: value = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
14729: var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 14730: /* do nothing */
14731: break;
14732: }
14733:
1.1.1.2 misho 14734: if (UNEXPECTED(var_ptr == NULL)) {
1.1 misho 14735: zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets");
14736: }
14737:
1.1.1.2 misho 14738: if (UNEXPECTED(*var_ptr == &EG(error_zval))) {
14739: if (RETURN_VALUE_USED(opline)) {
14740: PZVAL_LOCK(&EG(uninitialized_zval));
14741: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
1.1 misho 14742: }
14743: zval_dtor(free_op2.var);
14744: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 14745: CHECK_EXCEPTION();
14746: if (opline->extended_value == ZEND_ASSIGN_DIM) {
14747: ZEND_VM_INC_OPCODE();
14748: }
1.1 misho 14749: ZEND_VM_NEXT_OPCODE();
14750: }
14751:
14752: SEPARATE_ZVAL_IF_NOT_REF(var_ptr);
14753:
1.1.1.2 misho 14754: if (UNEXPECTED(Z_TYPE_PP(var_ptr) == IS_OBJECT)
14755: && Z_OBJ_HANDLER_PP(var_ptr, get)
1.1 misho 14756: && Z_OBJ_HANDLER_PP(var_ptr, set)) {
14757: /* proxy object */
14758: zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC);
14759: Z_ADDREF_P(objval);
14760: binary_op(objval, objval, value TSRMLS_CC);
14761: Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC);
14762: zval_ptr_dtor(&objval);
14763: } else {
14764: binary_op(*var_ptr, *var_ptr, value TSRMLS_CC);
14765: }
14766:
1.1.1.2 misho 14767: if (RETURN_VALUE_USED(opline)) {
1.1 misho 14768: PZVAL_LOCK(*var_ptr);
1.1.1.2 misho 14769: AI_SET_PTR(&EX_T(opline->result.var), *var_ptr);
1.1 misho 14770: }
14771: zval_dtor(free_op2.var);
14772:
14773: if (opline->extended_value == ZEND_ASSIGN_DIM) {
14774: FREE_OP(free_op_data1);
14775: FREE_OP_VAR_PTR(free_op_data2);
1.1.1.2 misho 14776: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
14777: CHECK_EXCEPTION();
14778: ZEND_VM_INC_OPCODE();
14779: } else {
14780: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
14781: CHECK_EXCEPTION();
1.1 misho 14782: }
14783: ZEND_VM_NEXT_OPCODE();
14784: }
14785:
14786: static int ZEND_FASTCALL ZEND_ASSIGN_ADD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
14787: {
14788: return zend_binary_assign_op_helper_SPEC_VAR_TMP(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
14789: }
14790:
14791: static int ZEND_FASTCALL ZEND_ASSIGN_SUB_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
14792: {
14793: return zend_binary_assign_op_helper_SPEC_VAR_TMP(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
14794: }
14795:
14796: static int ZEND_FASTCALL ZEND_ASSIGN_MUL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
14797: {
14798: return zend_binary_assign_op_helper_SPEC_VAR_TMP(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
14799: }
14800:
14801: static int ZEND_FASTCALL ZEND_ASSIGN_DIV_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
14802: {
14803: return zend_binary_assign_op_helper_SPEC_VAR_TMP(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
14804: }
14805:
14806: static int ZEND_FASTCALL ZEND_ASSIGN_MOD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
14807: {
14808: return zend_binary_assign_op_helper_SPEC_VAR_TMP(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
14809: }
14810:
14811: static int ZEND_FASTCALL ZEND_ASSIGN_SL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
14812: {
14813: return zend_binary_assign_op_helper_SPEC_VAR_TMP(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
14814: }
14815:
14816: static int ZEND_FASTCALL ZEND_ASSIGN_SR_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
14817: {
14818: return zend_binary_assign_op_helper_SPEC_VAR_TMP(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
14819: }
14820:
14821: static int ZEND_FASTCALL ZEND_ASSIGN_CONCAT_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
14822: {
14823: return zend_binary_assign_op_helper_SPEC_VAR_TMP(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
14824: }
14825:
14826: static int ZEND_FASTCALL ZEND_ASSIGN_BW_OR_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
14827: {
14828: return zend_binary_assign_op_helper_SPEC_VAR_TMP(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
14829: }
14830:
14831: static int ZEND_FASTCALL ZEND_ASSIGN_BW_AND_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
14832: {
14833: return zend_binary_assign_op_helper_SPEC_VAR_TMP(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
14834: }
14835:
14836: static int ZEND_FASTCALL ZEND_ASSIGN_BW_XOR_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
14837: {
14838: return zend_binary_assign_op_helper_SPEC_VAR_TMP(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
14839: }
14840:
14841: static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_TMP(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS)
14842: {
1.1.1.2 misho 14843: USE_OPLINE
1.1 misho 14844: zend_free_op free_op1, free_op2;
1.1.1.2 misho 14845: zval **object_ptr;
1.1 misho 14846: zval *object;
1.1.1.2 misho 14847: zval *property;
14848: zval **retval;
1.1 misho 14849: int have_get_ptr = 0;
14850:
1.1.1.2 misho 14851: SAVE_OPLINE();
14852: object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
14853: property = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
14854: retval = &EX_T(opline->result.var).var.ptr;
14855:
14856: if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 14857: zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
14858: }
14859:
14860: make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
14861: object = *object_ptr;
14862:
1.1.1.2 misho 14863: if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
1.1 misho 14864: zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
14865: zval_dtor(free_op2.var);
1.1.1.2 misho 14866: if (RETURN_VALUE_USED(opline)) {
14867: PZVAL_LOCK(&EG(uninitialized_zval));
14868: *retval = &EG(uninitialized_zval);
1.1 misho 14869: }
14870: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 14871: CHECK_EXCEPTION();
1.1 misho 14872: ZEND_VM_NEXT_OPCODE();
14873: }
14874:
14875: /* here we are sure we are dealing with an object */
14876:
14877: if (1) {
14878: MAKE_REAL_ZVAL_PTR(property);
14879: }
14880:
14881: if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
1.1.1.2 misho 14882: zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 14883: if (zptr != NULL) { /* NULL means no success in getting PTR */
14884: SEPARATE_ZVAL_IF_NOT_REF(zptr);
14885:
14886: have_get_ptr = 1;
14887: incdec_op(*zptr);
1.1.1.2 misho 14888: if (RETURN_VALUE_USED(opline)) {
1.1 misho 14889: *retval = *zptr;
14890: PZVAL_LOCK(*retval);
14891: }
14892: }
14893: }
14894:
14895: if (!have_get_ptr) {
14896: if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
1.1.1.2 misho 14897: zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 14898:
1.1.1.2 misho 14899: if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
1.1 misho 14900: zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
14901:
14902: if (Z_REFCOUNT_P(z) == 0) {
14903: GC_REMOVE_ZVAL_FROM_BUFFER(z);
14904: zval_dtor(z);
14905: FREE_ZVAL(z);
14906: }
14907: z = value;
14908: }
14909: Z_ADDREF_P(z);
14910: SEPARATE_ZVAL_IF_NOT_REF(&z);
14911: incdec_op(z);
14912: *retval = z;
1.1.1.2 misho 14913: Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
14914: SELECTIVE_PZVAL_LOCK(*retval, opline);
1.1 misho 14915: zval_ptr_dtor(&z);
14916: } else {
14917: zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
1.1.1.2 misho 14918: if (RETURN_VALUE_USED(opline)) {
14919: PZVAL_LOCK(&EG(uninitialized_zval));
14920: *retval = &EG(uninitialized_zval);
1.1 misho 14921: }
14922: }
14923: }
14924:
14925: if (1) {
14926: zval_ptr_dtor(&property);
14927: } else {
14928: zval_dtor(free_op2.var);
14929: }
14930: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 14931: CHECK_EXCEPTION();
1.1 misho 14932: ZEND_VM_NEXT_OPCODE();
14933: }
14934:
14935: static int ZEND_FASTCALL ZEND_PRE_INC_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
14936: {
14937: return zend_pre_incdec_property_helper_SPEC_VAR_TMP(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
14938: }
14939:
14940: static int ZEND_FASTCALL ZEND_PRE_DEC_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
14941: {
14942: return zend_pre_incdec_property_helper_SPEC_VAR_TMP(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
14943: }
14944:
14945: static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_TMP(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS)
14946: {
1.1.1.2 misho 14947: USE_OPLINE
1.1 misho 14948: zend_free_op free_op1, free_op2;
1.1.1.2 misho 14949: zval **object_ptr;
1.1 misho 14950: zval *object;
1.1.1.2 misho 14951: zval *property;
14952: zval *retval;
1.1 misho 14953: int have_get_ptr = 0;
14954:
1.1.1.2 misho 14955: SAVE_OPLINE();
14956: object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
14957: property = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
14958: retval = &EX_T(opline->result.var).tmp_var;
14959:
14960: if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 14961: zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
14962: }
14963:
14964: make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
14965: object = *object_ptr;
14966:
1.1.1.2 misho 14967: if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
1.1 misho 14968: zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
14969: zval_dtor(free_op2.var);
1.1.1.2 misho 14970: ZVAL_NULL(retval);
1.1 misho 14971: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 14972: CHECK_EXCEPTION();
1.1 misho 14973: ZEND_VM_NEXT_OPCODE();
14974: }
14975:
14976: /* here we are sure we are dealing with an object */
14977:
14978: if (1) {
14979: MAKE_REAL_ZVAL_PTR(property);
14980: }
14981:
14982: if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
1.1.1.2 misho 14983: zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 14984: if (zptr != NULL) { /* NULL means no success in getting PTR */
14985: have_get_ptr = 1;
14986: SEPARATE_ZVAL_IF_NOT_REF(zptr);
14987:
1.1.1.2 misho 14988: ZVAL_COPY_VALUE(retval, *zptr);
1.1 misho 14989: zendi_zval_copy_ctor(*retval);
14990:
14991: incdec_op(*zptr);
14992:
14993: }
14994: }
14995:
14996: if (!have_get_ptr) {
14997: if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
1.1.1.2 misho 14998: zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 14999: zval *z_copy;
15000:
1.1.1.2 misho 15001: if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
1.1 misho 15002: zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
15003:
15004: if (Z_REFCOUNT_P(z) == 0) {
15005: GC_REMOVE_ZVAL_FROM_BUFFER(z);
15006: zval_dtor(z);
15007: FREE_ZVAL(z);
15008: }
15009: z = value;
15010: }
1.1.1.2 misho 15011: ZVAL_COPY_VALUE(retval, z);
1.1 misho 15012: zendi_zval_copy_ctor(*retval);
15013: ALLOC_ZVAL(z_copy);
1.1.1.2 misho 15014: INIT_PZVAL_COPY(z_copy, z);
1.1 misho 15015: zendi_zval_copy_ctor(*z_copy);
15016: incdec_op(z_copy);
15017: Z_ADDREF_P(z);
1.1.1.2 misho 15018: Z_OBJ_HT_P(object)->write_property(object, property, z_copy, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 15019: zval_ptr_dtor(&z_copy);
15020: zval_ptr_dtor(&z);
15021: } else {
15022: zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
1.1.1.2 misho 15023: ZVAL_NULL(retval);
1.1 misho 15024: }
15025: }
15026:
15027: if (1) {
15028: zval_ptr_dtor(&property);
15029: } else {
15030: zval_dtor(free_op2.var);
15031: }
15032: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 15033: CHECK_EXCEPTION();
1.1 misho 15034: ZEND_VM_NEXT_OPCODE();
15035: }
15036:
15037: static int ZEND_FASTCALL ZEND_POST_INC_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
15038: {
15039: return zend_post_incdec_property_helper_SPEC_VAR_TMP(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
15040: }
15041:
15042: static int ZEND_FASTCALL ZEND_POST_DEC_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
15043: {
15044: return zend_post_incdec_property_helper_SPEC_VAR_TMP(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
15045: }
15046:
15047: static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
15048: {
1.1.1.2 misho 15049: USE_OPLINE
1.1 misho 15050: zend_free_op free_op1, free_op2;
15051: zval **container;
15052:
1.1.1.2 misho 15053: SAVE_OPLINE();
15054:
15055: if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) &&
1.1 misho 15056: IS_VAR != IS_CV &&
1.1.1.2 misho 15057: EX_T(opline->op1.var).var.ptr_ptr) {
15058: PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
1.1 misho 15059: }
1.1.1.2 misho 15060: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
15061: zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC);
1.1 misho 15062: zval_dtor(free_op2.var);
15063: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 15064: CHECK_EXCEPTION();
1.1 misho 15065: ZEND_VM_NEXT_OPCODE();
15066: }
15067:
15068: static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
15069: {
1.1.1.2 misho 15070: USE_OPLINE
1.1 misho 15071: zend_free_op free_op1, free_op2;
1.1.1.2 misho 15072: zval **container;
15073:
15074: SAVE_OPLINE();
15075: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 15076:
1.1.1.2 misho 15077: if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 15078: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
15079: }
1.1.1.2 misho 15080: zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_W TSRMLS_CC);
1.1 misho 15081: zval_dtor(free_op2.var);
1.1.1.2 misho 15082: if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
15083: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 15084: }
15085: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
15086:
15087: /* We are going to assign the result by reference */
1.1.1.2 misho 15088: if (UNEXPECTED(opline->extended_value != 0)) {
15089: zval **retval_ptr = EX_T(opline->result.var).var.ptr_ptr;
15090:
15091: if (retval_ptr) {
15092: Z_DELREF_PP(retval_ptr);
15093: SEPARATE_ZVAL_TO_MAKE_IS_REF(retval_ptr);
15094: Z_ADDREF_PP(retval_ptr);
15095: }
1.1 misho 15096: }
15097:
1.1.1.2 misho 15098: CHECK_EXCEPTION();
1.1 misho 15099: ZEND_VM_NEXT_OPCODE();
15100: }
15101:
15102: static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
15103: {
1.1.1.2 misho 15104: USE_OPLINE
1.1 misho 15105: zend_free_op free_op1, free_op2;
1.1.1.2 misho 15106: zval **container;
1.1 misho 15107:
1.1.1.2 misho 15108: SAVE_OPLINE();
15109: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
15110:
15111: if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 15112: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
15113: }
1.1.1.2 misho 15114: zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_RW TSRMLS_CC);
1.1 misho 15115: zval_dtor(free_op2.var);
1.1.1.2 misho 15116: if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
15117: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 15118: }
15119: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 15120: CHECK_EXCEPTION();
1.1 misho 15121: ZEND_VM_NEXT_OPCODE();
15122: }
15123:
15124: static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
15125: {
1.1.1.2 misho 15126: USE_OPLINE
1.1 misho 15127: zend_free_op free_op1, free_op2;
1.1.1.2 misho 15128: zval **container;
1.1 misho 15129:
1.1.1.2 misho 15130: SAVE_OPLINE();
15131: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
15132: zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_IS TSRMLS_CC);
1.1 misho 15133: zval_dtor(free_op2.var);
15134: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 15135: CHECK_EXCEPTION();
1.1 misho 15136: ZEND_VM_NEXT_OPCODE();
15137: }
15138:
15139: static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
15140: {
1.1.1.2 misho 15141: USE_OPLINE
1.1 misho 15142: zend_free_op free_op1, free_op2;
15143: zval **container;
15144:
1.1.1.2 misho 15145: SAVE_OPLINE();
15146:
15147: if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
15148: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
15149: if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 15150: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
15151: }
1.1.1.2 misho 15152: zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_W TSRMLS_CC);
15153: if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
15154: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 15155: }
15156: } else {
15157: if (IS_TMP_VAR == IS_UNUSED) {
15158: zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
15159: }
1.1.1.2 misho 15160: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
15161: zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC);
1.1 misho 15162: }
15163: zval_dtor(free_op2.var);
15164: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 15165: CHECK_EXCEPTION();
1.1 misho 15166: ZEND_VM_NEXT_OPCODE();
15167: }
15168:
15169: static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
15170: {
1.1.1.2 misho 15171: USE_OPLINE
1.1 misho 15172: zend_free_op free_op1, free_op2;
1.1.1.2 misho 15173: zval **container;
15174:
15175: SAVE_OPLINE();
15176: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 15177:
15178: if (IS_VAR == IS_CV) {
15179: if (container != &EG(uninitialized_zval_ptr)) {
15180: SEPARATE_ZVAL_IF_NOT_REF(container);
15181: }
15182: }
1.1.1.2 misho 15183: if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 15184: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
15185: }
1.1.1.2 misho 15186: zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_UNSET TSRMLS_CC);
1.1 misho 15187: zval_dtor(free_op2.var);
1.1.1.2 misho 15188: if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
15189: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 15190: }
15191: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 15192: if (UNEXPECTED(EX_T(opline->result.var).var.ptr_ptr == NULL)) {
1.1 misho 15193: zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
15194: } else {
15195: zend_free_op free_res;
1.1.1.2 misho 15196: zval **retval_ptr = EX_T(opline->result.var).var.ptr_ptr;
1.1 misho 15197:
1.1.1.2 misho 15198: PZVAL_UNLOCK(*retval_ptr, &free_res);
15199: if (retval_ptr != &EG(uninitialized_zval_ptr)) {
15200: SEPARATE_ZVAL_IF_NOT_REF(retval_ptr);
1.1 misho 15201: }
1.1.1.2 misho 15202: PZVAL_LOCK(*retval_ptr);
1.1 misho 15203: FREE_OP_VAR_PTR(free_res);
1.1.1.2 misho 15204: CHECK_EXCEPTION();
15205: ZEND_VM_NEXT_OPCODE();
1.1 misho 15206: }
15207: }
15208:
1.1.1.2 misho 15209: static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_VAR_TMP(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 15210: {
1.1.1.2 misho 15211: USE_OPLINE
1.1 misho 15212: zend_free_op free_op1;
1.1.1.2 misho 15213: zval *container;
1.1 misho 15214: zend_free_op free_op2;
1.1.1.2 misho 15215: zval *offset;
1.1 misho 15216:
1.1.1.2 misho 15217: SAVE_OPLINE();
15218: container = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
15219: offset = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
15220:
15221: if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
15222: UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
15223: zend_error(E_NOTICE, "Trying to get property of non-object");
15224: PZVAL_LOCK(&EG(uninitialized_zval));
15225: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
1.1 misho 15226: zval_dtor(free_op2.var);
15227: } else {
15228: zval *retval;
15229:
15230: if (1) {
15231: MAKE_REAL_ZVAL_PTR(offset);
15232: }
15233:
15234: /* here we are sure we are dealing with an object */
1.1.1.2 misho 15235: retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 15236:
1.1.1.2 misho 15237: PZVAL_LOCK(retval);
15238: AI_SET_PTR(&EX_T(opline->result.var), retval);
1.1 misho 15239:
15240: if (1) {
15241: zval_ptr_dtor(&offset);
15242: } else {
15243: zval_dtor(free_op2.var);
15244: }
15245: }
15246:
15247: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 15248: CHECK_EXCEPTION();
1.1 misho 15249: ZEND_VM_NEXT_OPCODE();
15250: }
15251:
15252: static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
15253: {
1.1.1.2 misho 15254: return zend_fetch_property_address_read_helper_SPEC_VAR_TMP(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
1.1 misho 15255: }
15256:
15257: static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
15258: {
1.1.1.2 misho 15259: USE_OPLINE
1.1 misho 15260: zend_free_op free_op1, free_op2;
1.1.1.2 misho 15261: zval *property;
1.1 misho 15262: zval **container;
15263:
1.1.1.2 misho 15264: SAVE_OPLINE();
15265: property = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
15266:
1.1 misho 15267: if (IS_VAR == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
1.1.1.2 misho 15268: PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
15269: EX_T(opline->op1.var).var.ptr = *EX_T(opline->op1.var).var.ptr_ptr;
1.1 misho 15270: }
15271:
15272: if (1) {
15273: MAKE_REAL_ZVAL_PTR(property);
15274: }
1.1.1.2 misho 15275: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
15276: if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 15277: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
15278: }
1.1.1.2 misho 15279:
15280: zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_W TSRMLS_CC);
1.1 misho 15281: if (1) {
15282: zval_ptr_dtor(&property);
15283: } else {
15284: zval_dtor(free_op2.var);
15285: }
1.1.1.2 misho 15286: if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
15287: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 15288: }
15289: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
15290:
15291: /* We are going to assign the result by reference */
15292: if (opline->extended_value & ZEND_FETCH_MAKE_REF) {
1.1.1.2 misho 15293: zval **retval_ptr = EX_T(opline->result.var).var.ptr_ptr;
15294:
15295: Z_DELREF_PP(retval_ptr);
15296: SEPARATE_ZVAL_TO_MAKE_IS_REF(retval_ptr);
15297: Z_ADDREF_PP(retval_ptr);
15298: EX_T(opline->result.var).var.ptr = *EX_T(opline->result.var).var.ptr_ptr;
15299: EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
1.1 misho 15300: }
15301:
1.1.1.2 misho 15302: CHECK_EXCEPTION();
1.1 misho 15303: ZEND_VM_NEXT_OPCODE();
15304: }
15305:
15306: static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
15307: {
1.1.1.2 misho 15308: USE_OPLINE
1.1 misho 15309: zend_free_op free_op1, free_op2;
1.1.1.2 misho 15310: zval *property;
15311: zval **container;
15312:
15313: SAVE_OPLINE();
15314: property = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
15315: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 15316:
15317: if (1) {
15318: MAKE_REAL_ZVAL_PTR(property);
15319: }
1.1.1.2 misho 15320: if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 15321: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
15322: }
1.1.1.2 misho 15323: zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_RW TSRMLS_CC);
1.1 misho 15324: if (1) {
15325: zval_ptr_dtor(&property);
15326: } else {
15327: zval_dtor(free_op2.var);
15328: }
1.1.1.2 misho 15329: if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
15330: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 15331: }
15332: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 15333: CHECK_EXCEPTION();
1.1 misho 15334: ZEND_VM_NEXT_OPCODE();
15335: }
15336:
15337: static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
15338: {
1.1.1.2 misho 15339: USE_OPLINE
15340: zend_free_op free_op1;
15341: zval *container;
15342: zend_free_op free_op2;
15343: zval *offset;
15344:
15345: SAVE_OPLINE();
15346: container = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
15347: offset = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
15348:
15349: if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
15350: UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
15351: PZVAL_LOCK(&EG(uninitialized_zval));
15352: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
15353: zval_dtor(free_op2.var);
15354: } else {
15355: zval *retval;
15356:
15357: if (1) {
15358: MAKE_REAL_ZVAL_PTR(offset);
15359: }
15360:
15361: /* here we are sure we are dealing with an object */
15362: retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
15363:
15364: PZVAL_LOCK(retval);
15365: AI_SET_PTR(&EX_T(opline->result.var), retval);
15366:
15367: if (1) {
15368: zval_ptr_dtor(&offset);
15369: } else {
15370: zval_dtor(free_op2.var);
15371: }
15372: }
15373:
15374: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
15375: CHECK_EXCEPTION();
15376: ZEND_VM_NEXT_OPCODE();
1.1 misho 15377: }
15378:
15379: static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
15380: {
1.1.1.2 misho 15381: USE_OPLINE
1.1 misho 15382:
1.1.1.2 misho 15383: if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
1.1 misho 15384: /* Behave like FETCH_OBJ_W */
15385: zend_free_op free_op1, free_op2;
1.1.1.2 misho 15386: zval *property;
15387: zval **container;
15388:
15389: SAVE_OPLINE();
15390: property = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
15391: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 15392:
15393: if (1) {
15394: MAKE_REAL_ZVAL_PTR(property);
15395: }
1.1.1.2 misho 15396: if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 15397: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
15398: }
1.1.1.2 misho 15399: zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_W TSRMLS_CC);
1.1 misho 15400: if (1) {
15401: zval_ptr_dtor(&property);
15402: } else {
15403: zval_dtor(free_op2.var);
15404: }
1.1.1.2 misho 15405: if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
15406: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 15407: }
15408: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 15409: CHECK_EXCEPTION();
1.1 misho 15410: ZEND_VM_NEXT_OPCODE();
15411: } else {
1.1.1.2 misho 15412: return zend_fetch_property_address_read_helper_SPEC_VAR_TMP(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
1.1 misho 15413: }
15414: }
15415:
15416: static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
15417: {
1.1.1.2 misho 15418: USE_OPLINE
1.1 misho 15419: zend_free_op free_op1, free_op2, free_res;
1.1.1.2 misho 15420: zval **container;
15421: zval *property;
15422:
15423: SAVE_OPLINE();
15424: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
15425: property = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 15426:
15427: if (IS_VAR == IS_CV) {
15428: if (container != &EG(uninitialized_zval_ptr)) {
15429: SEPARATE_ZVAL_IF_NOT_REF(container);
15430: }
15431: }
15432: if (1) {
15433: MAKE_REAL_ZVAL_PTR(property);
15434: }
1.1.1.2 misho 15435: if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 15436: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
15437: }
1.1.1.2 misho 15438: zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_UNSET TSRMLS_CC);
1.1 misho 15439: if (1) {
15440: zval_ptr_dtor(&property);
15441: } else {
15442: zval_dtor(free_op2.var);
15443: }
1.1.1.2 misho 15444: if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
15445: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 15446: }
15447: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
15448:
1.1.1.2 misho 15449: PZVAL_UNLOCK(*EX_T(opline->result.var).var.ptr_ptr, &free_res);
15450: if (EX_T(opline->result.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) {
15451: SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.var).var.ptr_ptr);
1.1 misho 15452: }
1.1.1.2 misho 15453: PZVAL_LOCK(*EX_T(opline->result.var).var.ptr_ptr);
1.1 misho 15454: FREE_OP_VAR_PTR(free_res);
1.1.1.2 misho 15455: CHECK_EXCEPTION();
1.1 misho 15456: ZEND_VM_NEXT_OPCODE();
15457: }
15458:
15459: static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
15460: {
1.1.1.2 misho 15461: USE_OPLINE
1.1 misho 15462: zend_free_op free_op1, free_op2;
1.1.1.2 misho 15463: zval **object_ptr;
15464: zval *property_name;
15465:
15466: SAVE_OPLINE();
15467: object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
15468: property_name = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 15469:
15470: if (1) {
15471: MAKE_REAL_ZVAL_PTR(property_name);
15472: }
1.1.1.2 misho 15473: if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 15474: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
15475: }
1.1.1.2 misho 15476: zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), ZEND_ASSIGN_OBJ, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 15477: if (1) {
15478: zval_ptr_dtor(&property_name);
15479: } else {
15480: zval_dtor(free_op2.var);
15481: }
15482: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
15483: /* assign_obj has two opcodes! */
1.1.1.2 misho 15484: CHECK_EXCEPTION();
1.1 misho 15485: ZEND_VM_INC_OPCODE();
15486: ZEND_VM_NEXT_OPCODE();
15487: }
15488:
15489: static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
15490: {
1.1.1.2 misho 15491: USE_OPLINE
1.1 misho 15492: zend_free_op free_op1;
1.1.1.2 misho 15493: zval **object_ptr;
1.1 misho 15494:
1.1.1.2 misho 15495: SAVE_OPLINE();
15496: object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
15497:
15498: if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 15499: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
15500: }
15501: if (Z_TYPE_PP(object_ptr) == IS_OBJECT) {
15502: zend_free_op free_op2;
1.1.1.2 misho 15503: zval *property_name = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 15504:
15505: if (1) {
15506: MAKE_REAL_ZVAL_PTR(property_name);
15507: }
1.1.1.2 misho 15508: zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), ZEND_ASSIGN_DIM, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 15509: if (1) {
15510: zval_ptr_dtor(&property_name);
15511: } else {
15512: zval_dtor(free_op2.var);
15513: }
15514: } else {
15515: zend_free_op free_op2, free_op_data1, free_op_data2;
15516: zval *value;
1.1.1.2 misho 15517: zval *dim = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 15518: zval **variable_ptr_ptr;
15519:
1.1.1.2 misho 15520: zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), object_ptr, dim, IS_TMP_VAR, BP_VAR_W TSRMLS_CC);
1.1 misho 15521: zval_dtor(free_op2.var);
15522:
1.1.1.2 misho 15523: value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R);
15524: variable_ptr_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC);
15525: if (UNEXPECTED(variable_ptr_ptr == NULL)) {
15526: if (zend_assign_to_string_offset(&EX_T((opline+1)->op2.var), value, (opline+1)->op1_type TSRMLS_CC)) {
15527: if (RETURN_VALUE_USED(opline)) {
15528: zval *retval;
15529:
15530: ALLOC_ZVAL(retval);
15531: ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T((opline+1)->op2.var).str_offset.str)+EX_T((opline+1)->op2.var).str_offset.offset, 1, 1);
15532: INIT_PZVAL(retval);
15533: AI_SET_PTR(&EX_T(opline->result.var), retval);
15534: }
15535: } else if (RETURN_VALUE_USED(opline)) {
15536: PZVAL_LOCK(&EG(uninitialized_zval));
15537: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
15538: }
15539: } else if (UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) {
15540: if (IS_TMP_FREE(free_op_data1)) {
15541: zval_dtor(value);
15542: }
15543: if (RETURN_VALUE_USED(opline)) {
15544: PZVAL_LOCK(&EG(uninitialized_zval));
15545: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
15546: }
15547: } else {
15548: if ((opline+1)->op1_type == IS_TMP_VAR) {
15549: value = zend_assign_tmp_to_variable(variable_ptr_ptr, value TSRMLS_CC);
15550: } else if ((opline+1)->op1_type == IS_CONST) {
15551: value = zend_assign_const_to_variable(variable_ptr_ptr, value TSRMLS_CC);
15552: } else {
15553: value = zend_assign_to_variable(variable_ptr_ptr, value TSRMLS_CC);
15554: }
15555: if (RETURN_VALUE_USED(opline)) {
1.1 misho 15556: PZVAL_LOCK(value);
1.1.1.2 misho 15557: AI_SET_PTR(&EX_T(opline->result.var), value);
1.1 misho 15558: }
15559: }
15560: FREE_OP_VAR_PTR(free_op_data2);
15561: FREE_OP_IF_VAR(free_op_data1);
15562: }
15563: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
15564: /* assign_dim has two opcodes! */
1.1.1.2 misho 15565: CHECK_EXCEPTION();
1.1 misho 15566: ZEND_VM_INC_OPCODE();
15567: ZEND_VM_NEXT_OPCODE();
15568: }
15569:
15570: static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
15571: {
1.1.1.2 misho 15572: USE_OPLINE
1.1 misho 15573: zend_free_op free_op1, free_op2;
1.1.1.2 misho 15574: zval *value;
15575: zval **variable_ptr_ptr;
1.1 misho 15576:
1.1.1.2 misho 15577: SAVE_OPLINE();
15578: value = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
15579: variable_ptr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
15580:
15581: if (IS_VAR == IS_VAR && UNEXPECTED(variable_ptr_ptr == NULL)) {
15582: if (zend_assign_to_string_offset(&EX_T(opline->op1.var), value, IS_TMP_VAR TSRMLS_CC)) {
15583: if (RETURN_VALUE_USED(opline)) {
15584: zval *retval;
15585:
15586: ALLOC_ZVAL(retval);
15587: ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T(opline->op1.var).str_offset.str)+EX_T(opline->op1.var).str_offset.offset, 1, 1);
15588: INIT_PZVAL(retval);
15589: AI_SET_PTR(&EX_T(opline->result.var), retval);
15590: }
15591: } else if (RETURN_VALUE_USED(opline)) {
15592: PZVAL_LOCK(&EG(uninitialized_zval));
15593: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
15594: }
15595: } else if (IS_VAR == IS_VAR && UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) {
15596: if (1) {
15597: zval_dtor(value);
15598: }
15599: if (RETURN_VALUE_USED(opline)) {
15600: PZVAL_LOCK(&EG(uninitialized_zval));
15601: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
15602: }
15603: } else {
15604: if (IS_TMP_VAR == IS_TMP_VAR) {
15605: value = zend_assign_tmp_to_variable(variable_ptr_ptr, value TSRMLS_CC);
15606: } else if (IS_TMP_VAR == IS_CONST) {
15607: value = zend_assign_const_to_variable(variable_ptr_ptr, value TSRMLS_CC);
15608: } else {
15609: value = zend_assign_to_variable(variable_ptr_ptr, value TSRMLS_CC);
15610: }
15611: if (RETURN_VALUE_USED(opline)) {
1.1 misho 15612: PZVAL_LOCK(value);
1.1.1.2 misho 15613: AI_SET_PTR(&EX_T(opline->result.var), value);
1.1 misho 15614: }
15615: }
15616:
15617: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
15618:
15619: /* zend_assign_to_variable() always takes care of op2, never free it! */
15620:
1.1.1.2 misho 15621: CHECK_EXCEPTION();
1.1 misho 15622: ZEND_VM_NEXT_OPCODE();
15623: }
15624:
15625: static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
15626: {
1.1.1.2 misho 15627: USE_OPLINE
1.1 misho 15628: zval *function_name;
15629: char *function_name_strval;
15630: int function_name_strlen;
15631: zend_free_op free_op1, free_op2;
15632:
1.1.1.2 misho 15633: SAVE_OPLINE();
1.1 misho 15634: zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
15635:
1.1.1.2 misho 15636: function_name = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 15637:
1.1.1.2 misho 15638: if (IS_TMP_VAR != IS_CONST &&
15639: UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
1.1 misho 15640: zend_error_noreturn(E_ERROR, "Method name must be a string");
15641: }
15642:
15643: function_name_strval = Z_STRVAL_P(function_name);
15644: function_name_strlen = Z_STRLEN_P(function_name);
15645:
1.1.1.2 misho 15646: EX(object) = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 15647:
1.1.1.2 misho 15648: if (EXPECTED(EX(object) != NULL) &&
15649: EXPECTED(Z_TYPE_P(EX(object)) == IS_OBJECT)) {
15650: EX(called_scope) = Z_OBJCE_P(EX(object));
1.1 misho 15651:
1.1.1.2 misho 15652: if (IS_TMP_VAR != IS_CONST ||
15653: (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope))) == NULL) {
15654: zval *object = EX(object);
15655:
15656: if (UNEXPECTED(Z_OBJ_HT_P(EX(object))->get_method == NULL)) {
15657: zend_error_noreturn(E_ERROR, "Object does not support method calls");
15658: }
15659:
15660: /* First, locate the function. */
15661: EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen, ((IS_TMP_VAR == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC);
15662: if (UNEXPECTED(EX(fbc) == NULL)) {
15663: zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval);
15664: }
15665: if (IS_TMP_VAR == IS_CONST &&
15666: EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) &&
15667: EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) &&
15668: EXPECTED(EX(object) == object)) {
15669: CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope), EX(fbc));
15670: }
1.1 misho 15671: }
15672: } else {
15673: zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval);
15674: }
15675:
15676: if ((EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) != 0) {
15677: EX(object) = NULL;
15678: } else {
15679: if (!PZVAL_IS_REF(EX(object))) {
15680: Z_ADDREF_P(EX(object)); /* For $this pointer */
15681: } else {
15682: zval *this_ptr;
15683: ALLOC_ZVAL(this_ptr);
15684: INIT_PZVAL_COPY(this_ptr, EX(object));
15685: zval_copy_ctor(this_ptr);
15686: EX(object) = this_ptr;
15687: }
15688: }
15689:
15690: zval_dtor(free_op2.var);
15691: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
15692:
1.1.1.2 misho 15693: CHECK_EXCEPTION();
1.1 misho 15694: ZEND_VM_NEXT_OPCODE();
15695: }
15696:
15697: static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
15698: {
1.1.1.2 misho 15699: USE_OPLINE
1.1 misho 15700: zval *function_name;
15701: zend_class_entry *ce;
15702:
1.1.1.2 misho 15703: SAVE_OPLINE();
1.1 misho 15704: zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
15705:
15706: if (IS_VAR == IS_CONST) {
15707: /* no function found. try a static method in class */
1.1.1.2 misho 15708: if (CACHED_PTR(opline->op1.literal->cache_slot)) {
15709: ce = CACHED_PTR(opline->op1.literal->cache_slot);
15710: } else {
15711: ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
1.1.1.4 ! misho 15712: if (UNEXPECTED(EG(exception) != NULL)) {
! 15713: HANDLE_EXCEPTION();
! 15714: }
1.1.1.2 misho 15715: if (UNEXPECTED(ce == NULL)) {
1.1.1.4 ! misho 15716: zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv));
1.1.1.2 misho 15717: }
15718: CACHE_PTR(opline->op1.literal->cache_slot, ce);
1.1 misho 15719: }
15720: EX(called_scope) = ce;
15721: } else {
1.1.1.2 misho 15722: ce = EX_T(opline->op1.var).class_entry;
1.1 misho 15723:
1.1.1.2 misho 15724: if (opline->extended_value == ZEND_FETCH_CLASS_PARENT || opline->extended_value == ZEND_FETCH_CLASS_SELF) {
1.1 misho 15725: EX(called_scope) = EG(called_scope);
15726: } else {
15727: EX(called_scope) = ce;
15728: }
15729: }
1.1.1.2 misho 15730:
15731: if (IS_VAR == IS_CONST &&
15732: IS_TMP_VAR == IS_CONST &&
15733: CACHED_PTR(opline->op2.literal->cache_slot)) {
15734: EX(fbc) = CACHED_PTR(opline->op2.literal->cache_slot);
15735: } else if (IS_VAR != IS_CONST &&
15736: IS_TMP_VAR == IS_CONST &&
15737: (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce))) {
15738: /* do nothing */
15739: } else if (IS_TMP_VAR != IS_UNUSED) {
1.1 misho 15740: char *function_name_strval = NULL;
15741: int function_name_strlen = 0;
15742: zend_free_op free_op2;
15743:
15744: if (IS_TMP_VAR == IS_CONST) {
1.1.1.2 misho 15745: function_name_strval = Z_STRVAL_P(opline->op2.zv);
15746: function_name_strlen = Z_STRLEN_P(opline->op2.zv);
1.1 misho 15747: } else {
1.1.1.2 misho 15748: function_name = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 15749:
1.1.1.2 misho 15750: if (UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
1.1 misho 15751: zend_error_noreturn(E_ERROR, "Function name must be a string");
15752: } else {
15753: function_name_strval = Z_STRVAL_P(function_name);
15754: function_name_strlen = Z_STRLEN_P(function_name);
15755: }
15756: }
15757:
15758: if (function_name_strval) {
15759: if (ce->get_static_method) {
15760: EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
15761: } else {
1.1.1.2 misho 15762: EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen, ((IS_TMP_VAR == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC);
1.1 misho 15763: }
1.1.1.2 misho 15764: if (UNEXPECTED(EX(fbc) == NULL)) {
1.1 misho 15765: zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name, function_name_strval);
15766: }
1.1.1.2 misho 15767: if (IS_TMP_VAR == IS_CONST &&
15768: EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) &&
15769: EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0)) {
15770: if (IS_VAR == IS_CONST) {
15771: CACHE_PTR(opline->op2.literal->cache_slot, EX(fbc));
15772: } else {
15773: CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce, EX(fbc));
15774: }
15775: }
1.1 misho 15776: }
15777: if (IS_TMP_VAR != IS_CONST) {
15778: zval_dtor(free_op2.var);
15779: }
15780: } else {
1.1.1.2 misho 15781: if (UNEXPECTED(ce->constructor == NULL)) {
1.1 misho 15782: zend_error_noreturn(E_ERROR, "Cannot call constructor");
15783: }
15784: if (EG(This) && Z_OBJCE_P(EG(This)) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) {
1.1.1.2 misho 15785: zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name);
1.1 misho 15786: }
15787: EX(fbc) = ce->constructor;
15788: }
15789:
15790: if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) {
15791: EX(object) = NULL;
15792: } else {
15793: if (EG(This) &&
15794: Z_OBJ_HT_P(EG(This))->get_class_entry &&
15795: !instanceof_function(Z_OBJCE_P(EG(This)), ce TSRMLS_CC)) {
15796: /* We are calling method of the other (incompatible) class,
15797: but passing $this. This is done for compatibility with php-4. */
15798: if (EX(fbc)->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
1.1.1.2 misho 15799: zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", EX(fbc)->common.scope->name, EX(fbc)->common.function_name);
1.1 misho 15800: } else {
15801: /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
1.1.1.2 misho 15802: zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", EX(fbc)->common.scope->name, EX(fbc)->common.function_name);
1.1 misho 15803: }
15804: }
15805: if ((EX(object) = EG(This))) {
15806: Z_ADDREF_P(EX(object));
15807: EX(called_scope) = Z_OBJCE_P(EX(object));
15808: }
15809: }
15810:
1.1.1.2 misho 15811: CHECK_EXCEPTION();
1.1 misho 15812: ZEND_VM_NEXT_OPCODE();
15813: }
15814:
15815: static int ZEND_FASTCALL ZEND_CASE_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
15816: {
1.1.1.2 misho 15817: USE_OPLINE
1.1 misho 15818: zend_free_op free_op1, free_op2;
15819:
1.1.1.2 misho 15820: SAVE_OPLINE();
1.1 misho 15821: if (IS_VAR==IS_VAR) {
1.1.1.2 misho 15822: PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
1.1 misho 15823: }
1.1.1.2 misho 15824: is_equal_function(&EX_T(opline->result.var).tmp_var,
15825: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
15826: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 15827:
15828: zval_dtor(free_op2.var);
1.1.1.2 misho 15829: CHECK_EXCEPTION();
1.1 misho 15830: ZEND_VM_NEXT_OPCODE();
15831: }
15832:
15833: static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
15834: {
1.1.1.2 misho 15835: USE_OPLINE
15836: zend_free_op free_op1;
1.1 misho 15837: zval *expr_ptr;
15838:
1.1.1.2 misho 15839: SAVE_OPLINE();
15840: if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && opline->extended_value) {
15841: zval **expr_ptr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 15842:
1.1.1.2 misho 15843: if (IS_VAR == IS_VAR && UNEXPECTED(expr_ptr_ptr == NULL)) {
15844: zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
15845: }
15846: SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr);
1.1 misho 15847: expr_ptr = *expr_ptr_ptr;
1.1.1.2 misho 15848: Z_ADDREF_P(expr_ptr);
1.1 misho 15849: } else {
1.1.1.2 misho 15850: expr_ptr=_get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
15851: if (0) { /* temporary variable */
15852: zval *new_expr;
1.1 misho 15853:
1.1.1.2 misho 15854: ALLOC_ZVAL(new_expr);
15855: INIT_PZVAL_COPY(new_expr, expr_ptr);
15856: expr_ptr = new_expr;
15857: } else if (IS_VAR == IS_CONST || PZVAL_IS_REF(expr_ptr)) {
1.1 misho 15858: zval *new_expr;
15859:
15860: ALLOC_ZVAL(new_expr);
15861: INIT_PZVAL_COPY(new_expr, expr_ptr);
15862: expr_ptr = new_expr;
15863: zendi_zval_copy_ctor(*expr_ptr);
15864: } else {
15865: Z_ADDREF_P(expr_ptr);
15866: }
15867: }
1.1.1.2 misho 15868:
15869: if (IS_TMP_VAR != IS_UNUSED) {
15870: zend_free_op free_op2;
15871: zval *offset = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
15872: ulong hval;
15873:
1.1 misho 15874: switch (Z_TYPE_P(offset)) {
15875: case IS_DOUBLE:
1.1.1.2 misho 15876: hval = zend_dval_to_lval(Z_DVAL_P(offset));
15877: goto num_index;
1.1 misho 15878: case IS_LONG:
15879: case IS_BOOL:
1.1.1.2 misho 15880: hval = Z_LVAL_P(offset);
15881: num_index:
15882: zend_hash_index_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), hval, &expr_ptr, sizeof(zval *), NULL);
1.1 misho 15883: break;
15884: case IS_STRING:
1.1.1.2 misho 15885: if (IS_TMP_VAR == IS_CONST) {
15886: hval = Z_HASH_P(offset);
15887: } else {
15888: ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
15889: if (IS_INTERNED(Z_STRVAL_P(offset))) {
15890: hval = INTERNED_HASH(Z_STRVAL_P(offset));
15891: } else {
15892: hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
15893: }
15894: }
15895: zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
1.1 misho 15896: break;
15897: case IS_NULL:
1.1.1.2 misho 15898: zend_hash_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
1.1 misho 15899: break;
15900: default:
15901: zend_error(E_WARNING, "Illegal offset type");
15902: zval_ptr_dtor(&expr_ptr);
15903: /* do nothing */
15904: break;
15905: }
15906: zval_dtor(free_op2.var);
15907: } else {
1.1.1.2 misho 15908: zend_hash_next_index_insert(Z_ARRVAL(EX_T(opline->result.var).tmp_var), &expr_ptr, sizeof(zval *), NULL);
1.1 misho 15909: }
1.1.1.2 misho 15910: if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && opline->extended_value) {
1.1 misho 15911: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
15912: } else {
15913: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
15914: }
1.1.1.2 misho 15915: CHECK_EXCEPTION();
1.1 misho 15916: ZEND_VM_NEXT_OPCODE();
15917: }
15918:
15919: static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
15920: {
1.1.1.2 misho 15921: USE_OPLINE
1.1 misho 15922:
1.1.1.2 misho 15923: array_init(&EX_T(opline->result.var).tmp_var);
1.1 misho 15924: if (IS_VAR == IS_UNUSED) {
15925: ZEND_VM_NEXT_OPCODE();
15926: #if 0 || IS_VAR != IS_UNUSED
15927: } else {
15928: return ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
15929: #endif
15930: }
15931: }
15932:
15933: static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
15934: {
1.1.1.2 misho 15935: USE_OPLINE
1.1 misho 15936: zend_free_op free_op1, free_op2;
1.1.1.2 misho 15937: zval **container;
1.1 misho 15938: zval *offset;
1.1.1.2 misho 15939: ulong hval;
1.1 misho 15940:
1.1.1.2 misho 15941: SAVE_OPLINE();
15942: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 15943: if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) {
15944: SEPARATE_ZVAL_IF_NOT_REF(container);
15945: }
1.1.1.2 misho 15946: offset = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 15947:
15948: if (IS_VAR != IS_VAR || container) {
15949: switch (Z_TYPE_PP(container)) {
15950: case IS_ARRAY: {
15951: HashTable *ht = Z_ARRVAL_PP(container);
15952:
15953: switch (Z_TYPE_P(offset)) {
15954: case IS_DOUBLE:
1.1.1.2 misho 15955: hval = zend_dval_to_lval(Z_DVAL_P(offset));
1.1.1.3 misho 15956: zend_hash_index_del(ht, hval);
15957: break;
1.1 misho 15958: case IS_RESOURCE:
15959: case IS_BOOL:
15960: case IS_LONG:
1.1.1.2 misho 15961: hval = Z_LVAL_P(offset);
15962: zend_hash_index_del(ht, hval);
1.1 misho 15963: break;
15964: case IS_STRING:
15965: if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) {
15966: Z_ADDREF_P(offset);
15967: }
1.1.1.2 misho 15968: if (IS_TMP_VAR == IS_CONST) {
15969: hval = Z_HASH_P(offset);
15970: } else {
15971: ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_dim);
15972: if (IS_INTERNED(Z_STRVAL_P(offset))) {
15973: hval = INTERNED_HASH(Z_STRVAL_P(offset));
15974: } else {
15975: hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
1.1 misho 15976: }
15977: }
1.1.1.2 misho 15978: if (ht == &EG(symbol_table)) {
15979: zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC);
15980: } else {
15981: zend_hash_quick_del(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval);
15982: }
15983: if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) {
15984: zval_ptr_dtor(&offset);
15985: }
15986: break;
15987: num_index_dim:
15988: zend_hash_index_del(ht, hval);
1.1 misho 15989: if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) {
15990: zval_ptr_dtor(&offset);
15991: }
15992: break;
15993: case IS_NULL:
15994: zend_hash_del(ht, "", sizeof(""));
15995: break;
15996: default:
15997: zend_error(E_WARNING, "Illegal offset type in unset");
15998: break;
15999: }
16000: zval_dtor(free_op2.var);
16001: break;
16002: }
16003: case IS_OBJECT:
1.1.1.2 misho 16004: if (UNEXPECTED(Z_OBJ_HT_P(*container)->unset_dimension == NULL)) {
1.1 misho 16005: zend_error_noreturn(E_ERROR, "Cannot use object as array");
16006: }
16007: if (1) {
16008: MAKE_REAL_ZVAL_PTR(offset);
16009: }
16010: Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC);
16011: if (1) {
16012: zval_ptr_dtor(&offset);
16013: } else {
16014: zval_dtor(free_op2.var);
16015: }
16016: break;
16017: case IS_STRING:
16018: zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
16019: ZEND_VM_CONTINUE(); /* bailed out before */
16020: default:
16021: zval_dtor(free_op2.var);
16022: break;
16023: }
16024: } else {
16025: zval_dtor(free_op2.var);
16026: }
16027: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
16028:
1.1.1.2 misho 16029: CHECK_EXCEPTION();
1.1 misho 16030: ZEND_VM_NEXT_OPCODE();
16031: }
16032:
16033: static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
16034: {
1.1.1.2 misho 16035: USE_OPLINE
1.1 misho 16036: zend_free_op free_op1, free_op2;
1.1.1.2 misho 16037: zval **container;
16038: zval *offset;
16039:
16040: SAVE_OPLINE();
16041: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
16042: offset = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 16043:
16044: if (IS_VAR != IS_VAR || container) {
16045: if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) {
16046: SEPARATE_ZVAL_IF_NOT_REF(container);
16047: }
16048: if (Z_TYPE_PP(container) == IS_OBJECT) {
16049: if (1) {
16050: MAKE_REAL_ZVAL_PTR(offset);
16051: }
16052: if (Z_OBJ_HT_P(*container)->unset_property) {
1.1.1.2 misho 16053: Z_OBJ_HT_P(*container)->unset_property(*container, offset, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 16054: } else {
16055: zend_error(E_NOTICE, "Trying to unset property of non-object");
16056: }
16057: if (1) {
16058: zval_ptr_dtor(&offset);
16059: } else {
16060: zval_dtor(free_op2.var);
16061: }
16062: } else {
16063: zval_dtor(free_op2.var);
16064: }
16065: } else {
16066: zval_dtor(free_op2.var);
16067: }
16068: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
16069:
1.1.1.2 misho 16070: CHECK_EXCEPTION();
1.1 misho 16071: ZEND_VM_NEXT_OPCODE();
16072: }
16073:
16074: static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_TMP(int prop_dim, ZEND_OPCODE_HANDLER_ARGS)
16075: {
1.1.1.2 misho 16076: USE_OPLINE
16077: zend_free_op free_op1, free_op2;
16078: zval **container;
1.1 misho 16079: zval **value = NULL;
16080: int result = 0;
1.1.1.2 misho 16081: ulong hval;
16082: zval *offset;
1.1 misho 16083:
1.1.1.2 misho 16084: SAVE_OPLINE();
16085: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 16086:
1.1.1.2 misho 16087: offset = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 16088:
1.1.1.2 misho 16089: if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) {
16090: HashTable *ht;
16091: int isset = 0;
1.1 misho 16092:
1.1.1.2 misho 16093: ht = Z_ARRVAL_PP(container);
16094:
16095: switch (Z_TYPE_P(offset)) {
16096: case IS_DOUBLE:
16097: hval = zend_dval_to_lval(Z_DVAL_P(offset));
16098: goto num_index_prop;
16099: case IS_RESOURCE:
16100: case IS_BOOL:
16101: case IS_LONG:
16102: hval = Z_LVAL_P(offset);
16103: num_index_prop:
16104: if (zend_hash_index_find(ht, hval, (void **) &value) == SUCCESS) {
16105: isset = 1;
16106: }
16107: break;
16108: case IS_STRING:
16109: if (IS_TMP_VAR == IS_CONST) {
16110: hval = Z_HASH_P(offset);
16111: } else {
16112: if (!prop_dim) {
16113: ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_prop);
1.1 misho 16114: }
1.1.1.2 misho 16115: if (IS_INTERNED(Z_STRVAL_P(offset))) {
16116: hval = INTERNED_HASH(Z_STRVAL_P(offset));
1.1 misho 16117: } else {
1.1.1.2 misho 16118: hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
1.1 misho 16119: }
1.1.1.2 misho 16120: }
16121: if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) {
16122: isset = 1;
16123: }
16124: break;
16125: case IS_NULL:
16126: if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) {
16127: isset = 1;
16128: }
16129: break;
16130: default:
16131: zend_error(E_WARNING, "Illegal offset type in isset or empty");
16132: break;
16133: }
16134:
16135: if (opline->extended_value & ZEND_ISSET) {
16136: if (isset && Z_TYPE_PP(value) == IS_NULL) {
16137: result = 0;
16138: } else {
16139: result = isset;
1.1 misho 16140: }
1.1.1.2 misho 16141: } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
16142: if (!isset || !i_zend_is_true(*value)) {
16143: result = 0;
16144: } else {
16145: result = 1;
1.1 misho 16146: }
1.1.1.2 misho 16147: }
16148: zval_dtor(free_op2.var);
16149: } else if (Z_TYPE_PP(container) == IS_OBJECT) {
16150: if (1) {
16151: MAKE_REAL_ZVAL_PTR(offset);
16152: }
16153: if (prop_dim) {
16154: if (Z_OBJ_HT_P(*container)->has_property) {
16155: result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 16156: } else {
1.1.1.2 misho 16157: zend_error(E_NOTICE, "Trying to check property of non-object");
16158: result = 0;
1.1 misho 16159: }
1.1.1.2 misho 16160: } else {
16161: if (Z_OBJ_HT_P(*container)->has_dimension) {
16162: result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0 TSRMLS_CC);
1.1 misho 16163: } else {
1.1.1.2 misho 16164: zend_error(E_NOTICE, "Trying to check element of non-array");
16165: result = 0;
1.1 misho 16166: }
1.1.1.2 misho 16167: }
16168: if (1) {
16169: zval_ptr_dtor(&offset);
16170: } else {
16171: zval_dtor(free_op2.var);
16172: }
16173: } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */
16174: zval tmp;
1.1 misho 16175:
1.1.1.2 misho 16176: if (Z_TYPE_P(offset) != IS_LONG) {
16177: if (Z_TYPE_P(offset) <= IS_BOOL /* simple scalar types */
16178: || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */
16179: && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) {
16180: ZVAL_COPY_VALUE(&tmp, offset);
1.1 misho 16181: zval_copy_ctor(&tmp);
16182: convert_to_long(&tmp);
16183: offset = &tmp;
1.1.1.2 misho 16184: } else {
16185: /* can not be converted to proper offset, return "not set" */
16186: result = 0;
1.1 misho 16187: }
1.1.1.2 misho 16188: }
16189: if (Z_TYPE_P(offset) == IS_LONG) {
16190: if (opline->extended_value & ZEND_ISSET) {
16191: if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
16192: result = 1;
16193: }
16194: } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
16195: if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') {
16196: result = 1;
1.1 misho 16197: }
16198: }
16199: }
1.1.1.2 misho 16200: zval_dtor(free_op2.var);
16201: } else {
16202: zval_dtor(free_op2.var);
1.1 misho 16203: }
16204:
1.1.1.2 misho 16205: Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
16206: if (opline->extended_value & ZEND_ISSET) {
16207: Z_LVAL(EX_T(opline->result.var).tmp_var) = result;
16208: } else {
16209: Z_LVAL(EX_T(opline->result.var).tmp_var) = !result;
1.1 misho 16210: }
16211:
16212: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
16213:
1.1.1.2 misho 16214: CHECK_EXCEPTION();
1.1 misho 16215: ZEND_VM_NEXT_OPCODE();
16216: }
16217:
16218: static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
16219: {
16220: return zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_TMP(0, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
16221: }
16222:
16223: static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
16224: {
16225: return zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_TMP(1, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
16226: }
16227:
16228: static int ZEND_FASTCALL ZEND_ADD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
16229: {
1.1.1.2 misho 16230: USE_OPLINE
1.1 misho 16231: zend_free_op free_op1, free_op2;
16232:
1.1.1.2 misho 16233: SAVE_OPLINE();
16234: fast_add_function(&EX_T(opline->result.var).tmp_var,
16235: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
16236: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 16237: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
16238: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 16239: CHECK_EXCEPTION();
1.1 misho 16240: ZEND_VM_NEXT_OPCODE();
16241: }
16242:
16243: static int ZEND_FASTCALL ZEND_SUB_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
16244: {
1.1.1.2 misho 16245: USE_OPLINE
1.1 misho 16246: zend_free_op free_op1, free_op2;
16247:
1.1.1.2 misho 16248: SAVE_OPLINE();
16249: fast_sub_function(&EX_T(opline->result.var).tmp_var,
16250: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
16251: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 16252: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
16253: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 16254: CHECK_EXCEPTION();
1.1 misho 16255: ZEND_VM_NEXT_OPCODE();
16256: }
16257:
16258: static int ZEND_FASTCALL ZEND_MUL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
16259: {
1.1.1.2 misho 16260: USE_OPLINE
1.1 misho 16261: zend_free_op free_op1, free_op2;
16262:
1.1.1.2 misho 16263: SAVE_OPLINE();
16264: fast_mul_function(&EX_T(opline->result.var).tmp_var,
16265: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
16266: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 16267: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
16268: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 16269: CHECK_EXCEPTION();
1.1 misho 16270: ZEND_VM_NEXT_OPCODE();
16271: }
16272:
16273: static int ZEND_FASTCALL ZEND_DIV_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
16274: {
1.1.1.2 misho 16275: USE_OPLINE
1.1 misho 16276: zend_free_op free_op1, free_op2;
16277:
1.1.1.2 misho 16278: SAVE_OPLINE();
16279: fast_div_function(&EX_T(opline->result.var).tmp_var,
16280: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
16281: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 16282: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
16283: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 16284: CHECK_EXCEPTION();
1.1 misho 16285: ZEND_VM_NEXT_OPCODE();
16286: }
16287:
16288: static int ZEND_FASTCALL ZEND_MOD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
16289: {
1.1.1.2 misho 16290: USE_OPLINE
1.1 misho 16291: zend_free_op free_op1, free_op2;
16292:
1.1.1.2 misho 16293: SAVE_OPLINE();
16294: fast_mod_function(&EX_T(opline->result.var).tmp_var,
16295: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
16296: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 16297: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
16298: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 16299: CHECK_EXCEPTION();
1.1 misho 16300: ZEND_VM_NEXT_OPCODE();
16301: }
16302:
16303: static int ZEND_FASTCALL ZEND_SL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
16304: {
1.1.1.2 misho 16305: USE_OPLINE
1.1 misho 16306: zend_free_op free_op1, free_op2;
16307:
1.1.1.2 misho 16308: SAVE_OPLINE();
16309: shift_left_function(&EX_T(opline->result.var).tmp_var,
16310: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
16311: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 16312: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
16313: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 16314: CHECK_EXCEPTION();
1.1 misho 16315: ZEND_VM_NEXT_OPCODE();
16316: }
16317:
16318: static int ZEND_FASTCALL ZEND_SR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
16319: {
1.1.1.2 misho 16320: USE_OPLINE
1.1 misho 16321: zend_free_op free_op1, free_op2;
16322:
1.1.1.2 misho 16323: SAVE_OPLINE();
16324: shift_right_function(&EX_T(opline->result.var).tmp_var,
16325: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
16326: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 16327: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
16328: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 16329: CHECK_EXCEPTION();
1.1 misho 16330: ZEND_VM_NEXT_OPCODE();
16331: }
16332:
16333: static int ZEND_FASTCALL ZEND_CONCAT_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
16334: {
1.1.1.2 misho 16335: USE_OPLINE
1.1 misho 16336: zend_free_op free_op1, free_op2;
16337:
1.1.1.2 misho 16338: SAVE_OPLINE();
16339: concat_function(&EX_T(opline->result.var).tmp_var,
16340: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
16341: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 16342: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
16343: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 16344: CHECK_EXCEPTION();
1.1 misho 16345: ZEND_VM_NEXT_OPCODE();
16346: }
16347:
16348: static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
16349: {
1.1.1.2 misho 16350: USE_OPLINE
1.1 misho 16351: zend_free_op free_op1, free_op2;
16352:
1.1.1.2 misho 16353: SAVE_OPLINE();
16354: is_identical_function(&EX_T(opline->result.var).tmp_var,
16355: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
16356: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 16357: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
16358: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 16359: CHECK_EXCEPTION();
1.1 misho 16360: ZEND_VM_NEXT_OPCODE();
16361: }
16362:
16363: static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
16364: {
1.1.1.2 misho 16365: USE_OPLINE
1.1 misho 16366: zend_free_op free_op1, free_op2;
1.1.1.2 misho 16367: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 16368:
1.1.1.2 misho 16369: SAVE_OPLINE();
1.1 misho 16370: is_identical_function(result,
1.1.1.2 misho 16371: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
16372: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 16373: Z_LVAL_P(result) = !Z_LVAL_P(result);
16374: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
16375: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 16376: CHECK_EXCEPTION();
1.1 misho 16377: ZEND_VM_NEXT_OPCODE();
16378: }
16379:
16380: static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
16381: {
1.1.1.2 misho 16382: USE_OPLINE
1.1 misho 16383: zend_free_op free_op1, free_op2;
1.1.1.2 misho 16384: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 16385:
1.1.1.2 misho 16386: SAVE_OPLINE();
16387: ZVAL_BOOL(result, fast_equal_function(result,
16388: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
16389: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC));
1.1 misho 16390: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
16391: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 16392: CHECK_EXCEPTION();
1.1 misho 16393: ZEND_VM_NEXT_OPCODE();
16394: }
16395:
16396: static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
16397: {
1.1.1.2 misho 16398: USE_OPLINE
1.1 misho 16399: zend_free_op free_op1, free_op2;
1.1.1.2 misho 16400: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 16401:
1.1.1.2 misho 16402: SAVE_OPLINE();
16403: ZVAL_BOOL(result, fast_not_equal_function(result,
16404: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
16405: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC));
1.1 misho 16406: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
16407: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 16408: CHECK_EXCEPTION();
1.1 misho 16409: ZEND_VM_NEXT_OPCODE();
16410: }
16411:
16412: static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
16413: {
1.1.1.2 misho 16414: USE_OPLINE
1.1 misho 16415: zend_free_op free_op1, free_op2;
1.1.1.2 misho 16416: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 16417:
1.1.1.2 misho 16418: SAVE_OPLINE();
16419: ZVAL_BOOL(result, fast_is_smaller_function(result,
16420: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
16421: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC));
1.1 misho 16422: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
16423: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 16424: CHECK_EXCEPTION();
1.1 misho 16425: ZEND_VM_NEXT_OPCODE();
16426: }
16427:
16428: static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
16429: {
1.1.1.2 misho 16430: USE_OPLINE
1.1 misho 16431: zend_free_op free_op1, free_op2;
1.1.1.2 misho 16432: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 16433:
1.1.1.2 misho 16434: SAVE_OPLINE();
16435: ZVAL_BOOL(result, fast_is_smaller_or_equal_function(result,
16436: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
16437: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC));
1.1 misho 16438: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
16439: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 16440: CHECK_EXCEPTION();
1.1 misho 16441: ZEND_VM_NEXT_OPCODE();
16442: }
16443:
16444: static int ZEND_FASTCALL ZEND_BW_OR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
16445: {
1.1.1.2 misho 16446: USE_OPLINE
1.1 misho 16447: zend_free_op free_op1, free_op2;
16448:
1.1.1.2 misho 16449: SAVE_OPLINE();
16450: bitwise_or_function(&EX_T(opline->result.var).tmp_var,
16451: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
16452: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 16453: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
16454: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 16455: CHECK_EXCEPTION();
1.1 misho 16456: ZEND_VM_NEXT_OPCODE();
16457: }
16458:
16459: static int ZEND_FASTCALL ZEND_BW_AND_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
16460: {
1.1.1.2 misho 16461: USE_OPLINE
1.1 misho 16462: zend_free_op free_op1, free_op2;
16463:
1.1.1.2 misho 16464: SAVE_OPLINE();
16465: bitwise_and_function(&EX_T(opline->result.var).tmp_var,
16466: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
16467: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 16468: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
16469: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 16470: CHECK_EXCEPTION();
1.1 misho 16471: ZEND_VM_NEXT_OPCODE();
16472: }
16473:
16474: static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
16475: {
1.1.1.2 misho 16476: USE_OPLINE
1.1 misho 16477: zend_free_op free_op1, free_op2;
16478:
1.1.1.2 misho 16479: SAVE_OPLINE();
16480: bitwise_xor_function(&EX_T(opline->result.var).tmp_var,
16481: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
16482: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 16483: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
16484: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 16485: CHECK_EXCEPTION();
1.1 misho 16486: ZEND_VM_NEXT_OPCODE();
16487: }
16488:
16489: static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
16490: {
1.1.1.2 misho 16491: USE_OPLINE
1.1 misho 16492: zend_free_op free_op1, free_op2;
16493:
1.1.1.2 misho 16494: SAVE_OPLINE();
16495: boolean_xor_function(&EX_T(opline->result.var).tmp_var,
16496: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
16497: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 16498: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
16499: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 16500: CHECK_EXCEPTION();
1.1 misho 16501: ZEND_VM_NEXT_OPCODE();
16502: }
16503:
16504: static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_VAR(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
16505: {
1.1.1.2 misho 16506: USE_OPLINE
1.1 misho 16507: zend_free_op free_op1, free_op2, free_op_data1;
1.1.1.2 misho 16508: zval **object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 16509: zval *object;
1.1.1.2 misho 16510: zval *property = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
16511: zval *value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R);
1.1 misho 16512: int have_get_ptr = 0;
16513:
1.1.1.2 misho 16514: if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 16515: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
16516: }
16517:
16518: make_real_object(object_ptr TSRMLS_CC);
16519: object = *object_ptr;
16520:
1.1.1.2 misho 16521: if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
1.1 misho 16522: zend_error(E_WARNING, "Attempt to assign property of non-object");
16523: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
16524: FREE_OP(free_op_data1);
16525:
1.1.1.2 misho 16526: if (RETURN_VALUE_USED(opline)) {
16527: PZVAL_LOCK(&EG(uninitialized_zval));
16528: EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
16529: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 16530: }
16531: } else {
16532: /* here we are sure we are dealing with an object */
16533: if (0) {
16534: MAKE_REAL_ZVAL_PTR(property);
16535: }
16536:
16537: /* here property is a string */
16538: if (opline->extended_value == ZEND_ASSIGN_OBJ
16539: && Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
1.1.1.2 misho 16540: zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 16541: if (zptr != NULL) { /* NULL means no success in getting PTR */
16542: SEPARATE_ZVAL_IF_NOT_REF(zptr);
16543:
16544: have_get_ptr = 1;
16545: binary_op(*zptr, *zptr, value TSRMLS_CC);
1.1.1.2 misho 16546: if (RETURN_VALUE_USED(opline)) {
1.1 misho 16547: PZVAL_LOCK(*zptr);
1.1.1.2 misho 16548: EX_T(opline->result.var).var.ptr = *zptr;
16549: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 16550: }
16551: }
16552: }
16553:
16554: if (!have_get_ptr) {
16555: zval *z = NULL;
16556:
16557: if (opline->extended_value == ZEND_ASSIGN_OBJ) {
16558: if (Z_OBJ_HT_P(object)->read_property) {
1.1.1.2 misho 16559: z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 16560: }
16561: } else /* if (opline->extended_value == ZEND_ASSIGN_DIM) */ {
16562: if (Z_OBJ_HT_P(object)->read_dimension) {
16563: z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC);
16564: }
16565: }
16566: if (z) {
16567: if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
16568: zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
16569:
16570: if (Z_REFCOUNT_P(z) == 0) {
16571: GC_REMOVE_ZVAL_FROM_BUFFER(z);
16572: zval_dtor(z);
16573: FREE_ZVAL(z);
16574: }
16575: z = value;
16576: }
16577: Z_ADDREF_P(z);
16578: SEPARATE_ZVAL_IF_NOT_REF(&z);
16579: binary_op(z, z, value TSRMLS_CC);
16580: if (opline->extended_value == ZEND_ASSIGN_OBJ) {
1.1.1.2 misho 16581: Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 16582: } else /* if (opline->extended_value == ZEND_ASSIGN_DIM) */ {
16583: Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC);
16584: }
1.1.1.2 misho 16585: if (RETURN_VALUE_USED(opline)) {
1.1 misho 16586: PZVAL_LOCK(z);
1.1.1.2 misho 16587: EX_T(opline->result.var).var.ptr = z;
16588: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 16589: }
16590: zval_ptr_dtor(&z);
16591: } else {
16592: zend_error(E_WARNING, "Attempt to assign property of non-object");
1.1.1.2 misho 16593: if (RETURN_VALUE_USED(opline)) {
16594: PZVAL_LOCK(&EG(uninitialized_zval));
16595: EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
16596: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 16597: }
16598: }
16599: }
16600:
16601: if (0) {
16602: zval_ptr_dtor(&property);
16603: } else {
16604: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
16605: }
16606: FREE_OP(free_op_data1);
16607: }
16608:
16609: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
16610: /* assign_obj has two opcodes! */
1.1.1.2 misho 16611: CHECK_EXCEPTION();
1.1 misho 16612: ZEND_VM_INC_OPCODE();
16613: ZEND_VM_NEXT_OPCODE();
16614: }
16615:
16616: static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_VAR(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
16617: {
1.1.1.2 misho 16618: USE_OPLINE
1.1 misho 16619: zend_free_op free_op1, free_op2, free_op_data2, free_op_data1;
16620: zval **var_ptr;
16621: zval *value;
16622:
1.1.1.2 misho 16623: SAVE_OPLINE();
1.1 misho 16624: switch (opline->extended_value) {
16625: case ZEND_ASSIGN_OBJ:
16626: return zend_binary_assign_op_obj_helper_SPEC_VAR_VAR(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
16627: break;
16628: case ZEND_ASSIGN_DIM: {
1.1.1.2 misho 16629: zval **container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 16630:
1.1.1.2 misho 16631: if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 16632: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
1.1.1.2 misho 16633: } else if (UNEXPECTED(Z_TYPE_PP(container) == IS_OBJECT)) {
1.1 misho 16634: if (IS_VAR == IS_VAR && !(free_op1.var != NULL)) {
16635: Z_ADDREF_PP(container); /* undo the effect of get_obj_zval_ptr_ptr() */
16636: }
16637: return zend_binary_assign_op_obj_helper_SPEC_VAR_VAR(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
16638: } else {
1.1.1.2 misho 16639: zval *dim = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 16640:
1.1.1.2 misho 16641: zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), container, dim, IS_VAR, BP_VAR_RW TSRMLS_CC);
16642: value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R);
16643: var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC);
1.1 misho 16644: }
16645: }
16646: break;
16647: default:
1.1.1.2 misho 16648: value = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
16649: var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 16650: /* do nothing */
16651: break;
16652: }
16653:
1.1.1.2 misho 16654: if (UNEXPECTED(var_ptr == NULL)) {
1.1 misho 16655: zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets");
16656: }
16657:
1.1.1.2 misho 16658: if (UNEXPECTED(*var_ptr == &EG(error_zval))) {
16659: if (RETURN_VALUE_USED(opline)) {
16660: PZVAL_LOCK(&EG(uninitialized_zval));
16661: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
1.1 misho 16662: }
16663: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
16664: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 16665: CHECK_EXCEPTION();
16666: if (opline->extended_value == ZEND_ASSIGN_DIM) {
16667: ZEND_VM_INC_OPCODE();
16668: }
1.1 misho 16669: ZEND_VM_NEXT_OPCODE();
16670: }
16671:
16672: SEPARATE_ZVAL_IF_NOT_REF(var_ptr);
16673:
1.1.1.2 misho 16674: if (UNEXPECTED(Z_TYPE_PP(var_ptr) == IS_OBJECT)
16675: && Z_OBJ_HANDLER_PP(var_ptr, get)
1.1 misho 16676: && Z_OBJ_HANDLER_PP(var_ptr, set)) {
16677: /* proxy object */
16678: zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC);
16679: Z_ADDREF_P(objval);
16680: binary_op(objval, objval, value TSRMLS_CC);
16681: Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC);
16682: zval_ptr_dtor(&objval);
16683: } else {
16684: binary_op(*var_ptr, *var_ptr, value TSRMLS_CC);
16685: }
16686:
1.1.1.2 misho 16687: if (RETURN_VALUE_USED(opline)) {
1.1 misho 16688: PZVAL_LOCK(*var_ptr);
1.1.1.2 misho 16689: AI_SET_PTR(&EX_T(opline->result.var), *var_ptr);
1.1 misho 16690: }
16691: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
16692:
16693: if (opline->extended_value == ZEND_ASSIGN_DIM) {
16694: FREE_OP(free_op_data1);
16695: FREE_OP_VAR_PTR(free_op_data2);
1.1.1.2 misho 16696: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
16697: CHECK_EXCEPTION();
16698: ZEND_VM_INC_OPCODE();
16699: } else {
16700: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
16701: CHECK_EXCEPTION();
1.1 misho 16702: }
16703: ZEND_VM_NEXT_OPCODE();
16704: }
16705:
16706: static int ZEND_FASTCALL ZEND_ASSIGN_ADD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
16707: {
16708: return zend_binary_assign_op_helper_SPEC_VAR_VAR(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
16709: }
16710:
16711: static int ZEND_FASTCALL ZEND_ASSIGN_SUB_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
16712: {
16713: return zend_binary_assign_op_helper_SPEC_VAR_VAR(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
16714: }
16715:
16716: static int ZEND_FASTCALL ZEND_ASSIGN_MUL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
16717: {
16718: return zend_binary_assign_op_helper_SPEC_VAR_VAR(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
16719: }
16720:
16721: static int ZEND_FASTCALL ZEND_ASSIGN_DIV_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
16722: {
16723: return zend_binary_assign_op_helper_SPEC_VAR_VAR(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
16724: }
16725:
16726: static int ZEND_FASTCALL ZEND_ASSIGN_MOD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
16727: {
16728: return zend_binary_assign_op_helper_SPEC_VAR_VAR(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
16729: }
16730:
16731: static int ZEND_FASTCALL ZEND_ASSIGN_SL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
16732: {
16733: return zend_binary_assign_op_helper_SPEC_VAR_VAR(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
16734: }
16735:
16736: static int ZEND_FASTCALL ZEND_ASSIGN_SR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
16737: {
16738: return zend_binary_assign_op_helper_SPEC_VAR_VAR(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
16739: }
16740:
16741: static int ZEND_FASTCALL ZEND_ASSIGN_CONCAT_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
16742: {
16743: return zend_binary_assign_op_helper_SPEC_VAR_VAR(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
16744: }
16745:
16746: static int ZEND_FASTCALL ZEND_ASSIGN_BW_OR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
16747: {
16748: return zend_binary_assign_op_helper_SPEC_VAR_VAR(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
16749: }
16750:
16751: static int ZEND_FASTCALL ZEND_ASSIGN_BW_AND_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
16752: {
16753: return zend_binary_assign_op_helper_SPEC_VAR_VAR(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
16754: }
16755:
16756: static int ZEND_FASTCALL ZEND_ASSIGN_BW_XOR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
16757: {
16758: return zend_binary_assign_op_helper_SPEC_VAR_VAR(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
16759: }
16760:
16761: static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_VAR(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS)
16762: {
1.1.1.2 misho 16763: USE_OPLINE
1.1 misho 16764: zend_free_op free_op1, free_op2;
1.1.1.2 misho 16765: zval **object_ptr;
1.1 misho 16766: zval *object;
1.1.1.2 misho 16767: zval *property;
16768: zval **retval;
1.1 misho 16769: int have_get_ptr = 0;
16770:
1.1.1.2 misho 16771: SAVE_OPLINE();
16772: object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
16773: property = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
16774: retval = &EX_T(opline->result.var).var.ptr;
16775:
16776: if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 16777: zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
16778: }
16779:
16780: make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
16781: object = *object_ptr;
16782:
1.1.1.2 misho 16783: if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
1.1 misho 16784: zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
16785: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 16786: if (RETURN_VALUE_USED(opline)) {
16787: PZVAL_LOCK(&EG(uninitialized_zval));
16788: *retval = &EG(uninitialized_zval);
1.1 misho 16789: }
16790: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 16791: CHECK_EXCEPTION();
1.1 misho 16792: ZEND_VM_NEXT_OPCODE();
16793: }
16794:
16795: /* here we are sure we are dealing with an object */
16796:
16797: if (0) {
16798: MAKE_REAL_ZVAL_PTR(property);
16799: }
16800:
16801: if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
1.1.1.2 misho 16802: zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 16803: if (zptr != NULL) { /* NULL means no success in getting PTR */
16804: SEPARATE_ZVAL_IF_NOT_REF(zptr);
16805:
16806: have_get_ptr = 1;
16807: incdec_op(*zptr);
1.1.1.2 misho 16808: if (RETURN_VALUE_USED(opline)) {
1.1 misho 16809: *retval = *zptr;
16810: PZVAL_LOCK(*retval);
16811: }
16812: }
16813: }
16814:
16815: if (!have_get_ptr) {
16816: if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
1.1.1.2 misho 16817: zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 16818:
1.1.1.2 misho 16819: if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
1.1 misho 16820: zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
16821:
16822: if (Z_REFCOUNT_P(z) == 0) {
16823: GC_REMOVE_ZVAL_FROM_BUFFER(z);
16824: zval_dtor(z);
16825: FREE_ZVAL(z);
16826: }
16827: z = value;
16828: }
16829: Z_ADDREF_P(z);
16830: SEPARATE_ZVAL_IF_NOT_REF(&z);
16831: incdec_op(z);
16832: *retval = z;
1.1.1.2 misho 16833: Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
16834: SELECTIVE_PZVAL_LOCK(*retval, opline);
1.1 misho 16835: zval_ptr_dtor(&z);
16836: } else {
16837: zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
1.1.1.2 misho 16838: if (RETURN_VALUE_USED(opline)) {
16839: PZVAL_LOCK(&EG(uninitialized_zval));
16840: *retval = &EG(uninitialized_zval);
1.1 misho 16841: }
16842: }
16843: }
16844:
16845: if (0) {
16846: zval_ptr_dtor(&property);
16847: } else {
16848: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
16849: }
16850: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 16851: CHECK_EXCEPTION();
1.1 misho 16852: ZEND_VM_NEXT_OPCODE();
16853: }
16854:
16855: static int ZEND_FASTCALL ZEND_PRE_INC_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
16856: {
16857: return zend_pre_incdec_property_helper_SPEC_VAR_VAR(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
16858: }
16859:
16860: static int ZEND_FASTCALL ZEND_PRE_DEC_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
16861: {
16862: return zend_pre_incdec_property_helper_SPEC_VAR_VAR(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
16863: }
16864:
16865: static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_VAR(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS)
16866: {
1.1.1.2 misho 16867: USE_OPLINE
1.1 misho 16868: zend_free_op free_op1, free_op2;
1.1.1.2 misho 16869: zval **object_ptr;
1.1 misho 16870: zval *object;
1.1.1.2 misho 16871: zval *property;
16872: zval *retval;
1.1 misho 16873: int have_get_ptr = 0;
16874:
1.1.1.2 misho 16875: SAVE_OPLINE();
16876: object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
16877: property = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
16878: retval = &EX_T(opline->result.var).tmp_var;
16879:
16880: if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 16881: zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
16882: }
16883:
16884: make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
16885: object = *object_ptr;
16886:
1.1.1.2 misho 16887: if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
1.1 misho 16888: zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
16889: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 16890: ZVAL_NULL(retval);
1.1 misho 16891: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 16892: CHECK_EXCEPTION();
1.1 misho 16893: ZEND_VM_NEXT_OPCODE();
16894: }
16895:
16896: /* here we are sure we are dealing with an object */
16897:
16898: if (0) {
16899: MAKE_REAL_ZVAL_PTR(property);
16900: }
16901:
16902: if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
1.1.1.2 misho 16903: zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 16904: if (zptr != NULL) { /* NULL means no success in getting PTR */
16905: have_get_ptr = 1;
16906: SEPARATE_ZVAL_IF_NOT_REF(zptr);
16907:
1.1.1.2 misho 16908: ZVAL_COPY_VALUE(retval, *zptr);
1.1 misho 16909: zendi_zval_copy_ctor(*retval);
16910:
16911: incdec_op(*zptr);
16912:
16913: }
16914: }
16915:
16916: if (!have_get_ptr) {
16917: if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
1.1.1.2 misho 16918: zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 16919: zval *z_copy;
16920:
1.1.1.2 misho 16921: if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
1.1 misho 16922: zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
16923:
16924: if (Z_REFCOUNT_P(z) == 0) {
16925: GC_REMOVE_ZVAL_FROM_BUFFER(z);
16926: zval_dtor(z);
16927: FREE_ZVAL(z);
16928: }
16929: z = value;
16930: }
1.1.1.2 misho 16931: ZVAL_COPY_VALUE(retval, z);
1.1 misho 16932: zendi_zval_copy_ctor(*retval);
16933: ALLOC_ZVAL(z_copy);
1.1.1.2 misho 16934: INIT_PZVAL_COPY(z_copy, z);
1.1 misho 16935: zendi_zval_copy_ctor(*z_copy);
16936: incdec_op(z_copy);
16937: Z_ADDREF_P(z);
1.1.1.2 misho 16938: Z_OBJ_HT_P(object)->write_property(object, property, z_copy, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 16939: zval_ptr_dtor(&z_copy);
16940: zval_ptr_dtor(&z);
16941: } else {
16942: zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
1.1.1.2 misho 16943: ZVAL_NULL(retval);
1.1 misho 16944: }
16945: }
16946:
16947: if (0) {
16948: zval_ptr_dtor(&property);
16949: } else {
16950: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
16951: }
16952: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 16953: CHECK_EXCEPTION();
1.1 misho 16954: ZEND_VM_NEXT_OPCODE();
16955: }
16956:
16957: static int ZEND_FASTCALL ZEND_POST_INC_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
16958: {
16959: return zend_post_incdec_property_helper_SPEC_VAR_VAR(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
16960: }
16961:
16962: static int ZEND_FASTCALL ZEND_POST_DEC_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
16963: {
16964: return zend_post_incdec_property_helper_SPEC_VAR_VAR(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
16965: }
16966:
1.1.1.2 misho 16967: static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_VAR(int type, ZEND_OPCODE_HANDLER_ARGS)
16968: {
16969: USE_OPLINE
16970: zend_free_op free_op1;
16971: zval *varname;
16972: zval **retval;
16973: zval tmp_varname;
16974: HashTable *target_symbol_table;
16975: ulong hash_value;
16976:
16977: SAVE_OPLINE();
16978: varname = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
16979:
16980: if (IS_VAR != IS_CONST && UNEXPECTED(Z_TYPE_P(varname) != IS_STRING)) {
16981: ZVAL_COPY_VALUE(&tmp_varname, varname);
16982: zval_copy_ctor(&tmp_varname);
16983: Z_SET_REFCOUNT(tmp_varname, 1);
16984: Z_UNSET_ISREF(tmp_varname);
16985: convert_to_string(&tmp_varname);
16986: varname = &tmp_varname;
16987: }
16988:
16989: if (IS_VAR != IS_UNUSED) {
16990: zend_class_entry *ce;
16991:
16992: if (IS_VAR == IS_CONST) {
16993: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
16994: ce = CACHED_PTR(opline->op2.literal->cache_slot);
16995: } else {
16996: ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
16997: if (UNEXPECTED(ce == NULL)) {
16998: if (IS_VAR != IS_CONST && varname == &tmp_varname) {
16999: zval_dtor(&tmp_varname);
17000: }
17001: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
17002: CHECK_EXCEPTION();
17003: ZEND_VM_NEXT_OPCODE();
17004: }
17005: CACHE_PTR(opline->op2.literal->cache_slot, ce);
17006: }
17007: } else {
17008: ce = EX_T(opline->op2.var).class_entry;
17009: }
17010: retval = zend_std_get_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 0, ((IS_VAR == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
17011: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
17012: } else {
17013: target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
17014: /*
17015: if (!target_symbol_table) {
17016: CHECK_EXCEPTION();
17017: ZEND_VM_NEXT_OPCODE();
17018: }
17019: */
17020: if (IS_VAR == IS_CONST) {
17021: hash_value = Z_HASH_P(varname);
17022: } else if (IS_INTERNED(Z_STRVAL_P(varname))) {
17023: hash_value = INTERNED_HASH(Z_STRVAL_P(varname));
17024: } else {
17025: hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1);
17026: }
17027:
17028: if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) {
17029: switch (type) {
17030: case BP_VAR_R:
17031: case BP_VAR_UNSET:
17032: zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_P(varname));
17033: /* break missing intentionally */
17034: case BP_VAR_IS:
17035: retval = &EG(uninitialized_zval_ptr);
17036: break;
17037: case BP_VAR_RW:
17038: zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_P(varname));
17039: /* break missing intentionally */
17040: case BP_VAR_W:
17041: Z_ADDREF_P(&EG(uninitialized_zval));
17042: zend_hash_quick_update(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, &EG(uninitialized_zval_ptr), sizeof(zval *), (void **) &retval);
17043: break;
17044: EMPTY_SWITCH_DEFAULT_CASE()
17045: }
17046: }
17047: switch (opline->extended_value & ZEND_FETCH_TYPE_MASK) {
17048: case ZEND_FETCH_GLOBAL:
17049: if (IS_VAR != IS_TMP_VAR) {
17050: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
17051: }
17052: break;
17053: case ZEND_FETCH_LOCAL:
17054: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
17055: break;
17056: case ZEND_FETCH_STATIC:
17057: zval_update_constant(retval, (void*) 1 TSRMLS_CC);
17058: break;
17059: case ZEND_FETCH_GLOBAL_LOCK:
17060: if (IS_VAR == IS_VAR && !free_op1.var) {
17061: PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
17062: }
17063: break;
17064: }
17065: }
17066:
17067:
17068: if (IS_VAR != IS_CONST && varname == &tmp_varname) {
17069: zval_dtor(&tmp_varname);
17070: }
17071: if (opline->extended_value & ZEND_FETCH_MAKE_REF) {
17072: SEPARATE_ZVAL_TO_MAKE_IS_REF(retval);
17073: }
17074: PZVAL_LOCK(*retval);
17075: switch (type) {
17076: case BP_VAR_R:
17077: case BP_VAR_IS:
17078: AI_SET_PTR(&EX_T(opline->result.var), *retval);
17079: break;
17080: case BP_VAR_UNSET: {
17081: zend_free_op free_res;
17082:
17083: PZVAL_UNLOCK(*retval, &free_res);
17084: if (retval != &EG(uninitialized_zval_ptr)) {
17085: SEPARATE_ZVAL_IF_NOT_REF(retval);
17086: }
17087: PZVAL_LOCK(*retval);
17088: FREE_OP_VAR_PTR(free_res);
17089: }
17090: /* break missing intentionally */
17091: default:
17092: EX_T(opline->result.var).var.ptr_ptr = retval;
17093: break;
17094: }
17095: CHECK_EXCEPTION();
17096: ZEND_VM_NEXT_OPCODE();
17097: }
17098:
17099: static int ZEND_FASTCALL ZEND_FETCH_R_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
17100: {
17101: return zend_fetch_var_address_helper_SPEC_VAR_VAR(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
17102: }
17103:
17104: static int ZEND_FASTCALL ZEND_FETCH_W_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
17105: {
17106: return zend_fetch_var_address_helper_SPEC_VAR_VAR(BP_VAR_W, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
17107: }
17108:
17109: static int ZEND_FASTCALL ZEND_FETCH_RW_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
17110: {
17111: return zend_fetch_var_address_helper_SPEC_VAR_VAR(BP_VAR_RW, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
17112: }
17113:
17114: static int ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
17115: {
17116: USE_OPLINE
17117:
17118: return zend_fetch_var_address_helper_SPEC_VAR_VAR(ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
17119: }
17120:
17121: static int ZEND_FASTCALL ZEND_FETCH_UNSET_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
17122: {
17123: return zend_fetch_var_address_helper_SPEC_VAR_VAR(BP_VAR_UNSET, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
17124: }
17125:
17126: static int ZEND_FASTCALL ZEND_FETCH_IS_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
17127: {
17128: return zend_fetch_var_address_helper_SPEC_VAR_VAR(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
17129: }
17130:
1.1 misho 17131: static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
17132: {
1.1.1.2 misho 17133: USE_OPLINE
1.1 misho 17134: zend_free_op free_op1, free_op2;
17135: zval **container;
17136:
1.1.1.2 misho 17137: SAVE_OPLINE();
17138:
17139: if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) &&
1.1 misho 17140: IS_VAR != IS_CV &&
1.1.1.2 misho 17141: EX_T(opline->op1.var).var.ptr_ptr) {
17142: PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
1.1 misho 17143: }
1.1.1.2 misho 17144: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
17145: zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC);
1.1 misho 17146: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
17147: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 17148: CHECK_EXCEPTION();
1.1 misho 17149: ZEND_VM_NEXT_OPCODE();
17150: }
17151:
17152: static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
17153: {
1.1.1.2 misho 17154: USE_OPLINE
1.1 misho 17155: zend_free_op free_op1, free_op2;
1.1.1.2 misho 17156: zval **container;
1.1 misho 17157:
1.1.1.2 misho 17158: SAVE_OPLINE();
17159: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
17160:
17161: if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 17162: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
17163: }
1.1.1.2 misho 17164: zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_W TSRMLS_CC);
1.1 misho 17165: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 17166: if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
17167: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 17168: }
17169: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
17170:
17171: /* We are going to assign the result by reference */
1.1.1.2 misho 17172: if (UNEXPECTED(opline->extended_value != 0)) {
17173: zval **retval_ptr = EX_T(opline->result.var).var.ptr_ptr;
17174:
17175: if (retval_ptr) {
17176: Z_DELREF_PP(retval_ptr);
17177: SEPARATE_ZVAL_TO_MAKE_IS_REF(retval_ptr);
17178: Z_ADDREF_PP(retval_ptr);
17179: }
1.1 misho 17180: }
17181:
1.1.1.2 misho 17182: CHECK_EXCEPTION();
1.1 misho 17183: ZEND_VM_NEXT_OPCODE();
17184: }
17185:
17186: static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
17187: {
1.1.1.2 misho 17188: USE_OPLINE
1.1 misho 17189: zend_free_op free_op1, free_op2;
1.1.1.2 misho 17190: zval **container;
17191:
17192: SAVE_OPLINE();
17193: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 17194:
1.1.1.2 misho 17195: if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 17196: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
17197: }
1.1.1.2 misho 17198: zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_RW TSRMLS_CC);
1.1 misho 17199: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 17200: if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
17201: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 17202: }
17203: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 17204: CHECK_EXCEPTION();
1.1 misho 17205: ZEND_VM_NEXT_OPCODE();
17206: }
17207:
17208: static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
17209: {
1.1.1.2 misho 17210: USE_OPLINE
1.1 misho 17211: zend_free_op free_op1, free_op2;
1.1.1.2 misho 17212: zval **container;
1.1 misho 17213:
1.1.1.2 misho 17214: SAVE_OPLINE();
17215: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
17216: zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_IS TSRMLS_CC);
1.1 misho 17217: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
17218: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 17219: CHECK_EXCEPTION();
1.1 misho 17220: ZEND_VM_NEXT_OPCODE();
17221: }
17222:
17223: static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
17224: {
1.1.1.2 misho 17225: USE_OPLINE
1.1 misho 17226: zend_free_op free_op1, free_op2;
17227: zval **container;
17228:
1.1.1.2 misho 17229: SAVE_OPLINE();
17230:
17231: if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
17232: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
17233: if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 17234: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
17235: }
1.1.1.2 misho 17236: zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_W TSRMLS_CC);
17237: if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
17238: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 17239: }
17240: } else {
17241: if (IS_VAR == IS_UNUSED) {
17242: zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
17243: }
1.1.1.2 misho 17244: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
17245: zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC);
1.1 misho 17246: }
17247: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
17248: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 17249: CHECK_EXCEPTION();
1.1 misho 17250: ZEND_VM_NEXT_OPCODE();
17251: }
17252:
17253: static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
17254: {
1.1.1.2 misho 17255: USE_OPLINE
1.1 misho 17256: zend_free_op free_op1, free_op2;
1.1.1.2 misho 17257: zval **container;
17258:
17259: SAVE_OPLINE();
17260: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 17261:
17262: if (IS_VAR == IS_CV) {
17263: if (container != &EG(uninitialized_zval_ptr)) {
17264: SEPARATE_ZVAL_IF_NOT_REF(container);
17265: }
17266: }
1.1.1.2 misho 17267: if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 17268: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
17269: }
1.1.1.2 misho 17270: zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_UNSET TSRMLS_CC);
1.1 misho 17271: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 17272: if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
17273: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 17274: }
17275: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 17276: if (UNEXPECTED(EX_T(opline->result.var).var.ptr_ptr == NULL)) {
1.1 misho 17277: zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
17278: } else {
17279: zend_free_op free_res;
1.1.1.2 misho 17280: zval **retval_ptr = EX_T(opline->result.var).var.ptr_ptr;
1.1 misho 17281:
1.1.1.2 misho 17282: PZVAL_UNLOCK(*retval_ptr, &free_res);
17283: if (retval_ptr != &EG(uninitialized_zval_ptr)) {
17284: SEPARATE_ZVAL_IF_NOT_REF(retval_ptr);
1.1 misho 17285: }
1.1.1.2 misho 17286: PZVAL_LOCK(*retval_ptr);
1.1 misho 17287: FREE_OP_VAR_PTR(free_res);
1.1.1.2 misho 17288: CHECK_EXCEPTION();
17289: ZEND_VM_NEXT_OPCODE();
1.1 misho 17290: }
17291: }
17292:
1.1.1.2 misho 17293: static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_VAR_VAR(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 17294: {
1.1.1.2 misho 17295: USE_OPLINE
1.1 misho 17296: zend_free_op free_op1;
1.1.1.2 misho 17297: zval *container;
1.1 misho 17298: zend_free_op free_op2;
1.1.1.2 misho 17299: zval *offset;
1.1 misho 17300:
1.1.1.2 misho 17301: SAVE_OPLINE();
17302: container = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
17303: offset = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
17304:
17305: if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
17306: UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
17307: zend_error(E_NOTICE, "Trying to get property of non-object");
17308: PZVAL_LOCK(&EG(uninitialized_zval));
17309: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
1.1 misho 17310: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
17311: } else {
17312: zval *retval;
17313:
17314: if (0) {
17315: MAKE_REAL_ZVAL_PTR(offset);
17316: }
17317:
17318: /* here we are sure we are dealing with an object */
1.1.1.2 misho 17319: retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 17320:
1.1.1.2 misho 17321: PZVAL_LOCK(retval);
17322: AI_SET_PTR(&EX_T(opline->result.var), retval);
1.1 misho 17323:
17324: if (0) {
17325: zval_ptr_dtor(&offset);
17326: } else {
17327: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
17328: }
17329: }
17330:
17331: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 17332: CHECK_EXCEPTION();
1.1 misho 17333: ZEND_VM_NEXT_OPCODE();
17334: }
17335:
17336: static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
17337: {
1.1.1.2 misho 17338: return zend_fetch_property_address_read_helper_SPEC_VAR_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
1.1 misho 17339: }
17340:
17341: static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
17342: {
1.1.1.2 misho 17343: USE_OPLINE
1.1 misho 17344: zend_free_op free_op1, free_op2;
1.1.1.2 misho 17345: zval *property;
1.1 misho 17346: zval **container;
17347:
1.1.1.2 misho 17348: SAVE_OPLINE();
17349: property = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
17350:
1.1 misho 17351: if (IS_VAR == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
1.1.1.2 misho 17352: PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
17353: EX_T(opline->op1.var).var.ptr = *EX_T(opline->op1.var).var.ptr_ptr;
1.1 misho 17354: }
17355:
17356: if (0) {
17357: MAKE_REAL_ZVAL_PTR(property);
17358: }
1.1.1.2 misho 17359: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
17360: if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 17361: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
17362: }
1.1.1.2 misho 17363:
17364: zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_W TSRMLS_CC);
1.1 misho 17365: if (0) {
17366: zval_ptr_dtor(&property);
17367: } else {
17368: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
17369: }
1.1.1.2 misho 17370: if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
17371: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 17372: }
17373: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
17374:
17375: /* We are going to assign the result by reference */
17376: if (opline->extended_value & ZEND_FETCH_MAKE_REF) {
1.1.1.2 misho 17377: zval **retval_ptr = EX_T(opline->result.var).var.ptr_ptr;
17378:
17379: Z_DELREF_PP(retval_ptr);
17380: SEPARATE_ZVAL_TO_MAKE_IS_REF(retval_ptr);
17381: Z_ADDREF_PP(retval_ptr);
17382: EX_T(opline->result.var).var.ptr = *EX_T(opline->result.var).var.ptr_ptr;
17383: EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
1.1 misho 17384: }
17385:
1.1.1.2 misho 17386: CHECK_EXCEPTION();
1.1 misho 17387: ZEND_VM_NEXT_OPCODE();
17388: }
17389:
17390: static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
17391: {
1.1.1.2 misho 17392: USE_OPLINE
1.1 misho 17393: zend_free_op free_op1, free_op2;
1.1.1.2 misho 17394: zval *property;
17395: zval **container;
17396:
17397: SAVE_OPLINE();
17398: property = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
17399: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 17400:
17401: if (0) {
17402: MAKE_REAL_ZVAL_PTR(property);
17403: }
1.1.1.2 misho 17404: if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 17405: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
17406: }
1.1.1.2 misho 17407: zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_RW TSRMLS_CC);
1.1 misho 17408: if (0) {
17409: zval_ptr_dtor(&property);
17410: } else {
17411: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
17412: }
1.1.1.2 misho 17413: if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
17414: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 17415: }
17416: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 17417: CHECK_EXCEPTION();
1.1 misho 17418: ZEND_VM_NEXT_OPCODE();
17419: }
17420:
17421: static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
17422: {
1.1.1.2 misho 17423: USE_OPLINE
17424: zend_free_op free_op1;
17425: zval *container;
17426: zend_free_op free_op2;
17427: zval *offset;
17428:
17429: SAVE_OPLINE();
17430: container = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
17431: offset = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
17432:
17433: if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
17434: UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
17435: PZVAL_LOCK(&EG(uninitialized_zval));
17436: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
17437: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
17438: } else {
17439: zval *retval;
17440:
17441: if (0) {
17442: MAKE_REAL_ZVAL_PTR(offset);
17443: }
17444:
17445: /* here we are sure we are dealing with an object */
17446: retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
17447:
17448: PZVAL_LOCK(retval);
17449: AI_SET_PTR(&EX_T(opline->result.var), retval);
17450:
17451: if (0) {
17452: zval_ptr_dtor(&offset);
17453: } else {
17454: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
17455: }
17456: }
17457:
17458: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
17459: CHECK_EXCEPTION();
17460: ZEND_VM_NEXT_OPCODE();
1.1 misho 17461: }
17462:
17463: static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
17464: {
1.1.1.2 misho 17465: USE_OPLINE
1.1 misho 17466:
1.1.1.2 misho 17467: if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
1.1 misho 17468: /* Behave like FETCH_OBJ_W */
17469: zend_free_op free_op1, free_op2;
1.1.1.2 misho 17470: zval *property;
17471: zval **container;
17472:
17473: SAVE_OPLINE();
17474: property = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
17475: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 17476:
17477: if (0) {
17478: MAKE_REAL_ZVAL_PTR(property);
17479: }
1.1.1.2 misho 17480: if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 17481: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
17482: }
1.1.1.2 misho 17483: zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_W TSRMLS_CC);
1.1 misho 17484: if (0) {
17485: zval_ptr_dtor(&property);
17486: } else {
17487: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
17488: }
1.1.1.2 misho 17489: if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
17490: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 17491: }
17492: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 17493: CHECK_EXCEPTION();
1.1 misho 17494: ZEND_VM_NEXT_OPCODE();
17495: } else {
1.1.1.2 misho 17496: return zend_fetch_property_address_read_helper_SPEC_VAR_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
1.1 misho 17497: }
17498: }
17499:
17500: static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
17501: {
1.1.1.2 misho 17502: USE_OPLINE
1.1 misho 17503: zend_free_op free_op1, free_op2, free_res;
1.1.1.2 misho 17504: zval **container;
17505: zval *property;
17506:
17507: SAVE_OPLINE();
17508: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
17509: property = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 17510:
17511: if (IS_VAR == IS_CV) {
17512: if (container != &EG(uninitialized_zval_ptr)) {
17513: SEPARATE_ZVAL_IF_NOT_REF(container);
17514: }
17515: }
17516: if (0) {
17517: MAKE_REAL_ZVAL_PTR(property);
17518: }
1.1.1.2 misho 17519: if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 17520: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
17521: }
1.1.1.2 misho 17522: zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_UNSET TSRMLS_CC);
1.1 misho 17523: if (0) {
17524: zval_ptr_dtor(&property);
17525: } else {
17526: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
17527: }
1.1.1.2 misho 17528: if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
17529: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 17530: }
17531: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
17532:
1.1.1.2 misho 17533: PZVAL_UNLOCK(*EX_T(opline->result.var).var.ptr_ptr, &free_res);
17534: if (EX_T(opline->result.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) {
17535: SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.var).var.ptr_ptr);
1.1 misho 17536: }
1.1.1.2 misho 17537: PZVAL_LOCK(*EX_T(opline->result.var).var.ptr_ptr);
1.1 misho 17538: FREE_OP_VAR_PTR(free_res);
1.1.1.2 misho 17539: CHECK_EXCEPTION();
1.1 misho 17540: ZEND_VM_NEXT_OPCODE();
17541: }
17542:
17543: static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
17544: {
1.1.1.2 misho 17545: USE_OPLINE
1.1 misho 17546: zend_free_op free_op1, free_op2;
1.1.1.2 misho 17547: zval **object_ptr;
17548: zval *property_name;
17549:
17550: SAVE_OPLINE();
17551: object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
17552: property_name = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 17553:
17554: if (0) {
17555: MAKE_REAL_ZVAL_PTR(property_name);
17556: }
1.1.1.2 misho 17557: if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 17558: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
17559: }
1.1.1.2 misho 17560: zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), ZEND_ASSIGN_OBJ, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 17561: if (0) {
17562: zval_ptr_dtor(&property_name);
17563: } else {
17564: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
17565: }
17566: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
17567: /* assign_obj has two opcodes! */
1.1.1.2 misho 17568: CHECK_EXCEPTION();
1.1 misho 17569: ZEND_VM_INC_OPCODE();
17570: ZEND_VM_NEXT_OPCODE();
17571: }
17572:
17573: static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
17574: {
1.1.1.2 misho 17575: USE_OPLINE
1.1 misho 17576: zend_free_op free_op1;
1.1.1.2 misho 17577: zval **object_ptr;
17578:
17579: SAVE_OPLINE();
17580: object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 17581:
1.1.1.2 misho 17582: if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 17583: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
17584: }
17585: if (Z_TYPE_PP(object_ptr) == IS_OBJECT) {
17586: zend_free_op free_op2;
1.1.1.2 misho 17587: zval *property_name = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 17588:
17589: if (0) {
17590: MAKE_REAL_ZVAL_PTR(property_name);
17591: }
1.1.1.2 misho 17592: zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), ZEND_ASSIGN_DIM, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 17593: if (0) {
17594: zval_ptr_dtor(&property_name);
17595: } else {
17596: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
17597: }
17598: } else {
17599: zend_free_op free_op2, free_op_data1, free_op_data2;
17600: zval *value;
1.1.1.2 misho 17601: zval *dim = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 17602: zval **variable_ptr_ptr;
17603:
1.1.1.2 misho 17604: zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), object_ptr, dim, IS_VAR, BP_VAR_W TSRMLS_CC);
1.1 misho 17605: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
17606:
1.1.1.2 misho 17607: value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R);
17608: variable_ptr_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC);
17609: if (UNEXPECTED(variable_ptr_ptr == NULL)) {
17610: if (zend_assign_to_string_offset(&EX_T((opline+1)->op2.var), value, (opline+1)->op1_type TSRMLS_CC)) {
17611: if (RETURN_VALUE_USED(opline)) {
17612: zval *retval;
17613:
17614: ALLOC_ZVAL(retval);
17615: ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T((opline+1)->op2.var).str_offset.str)+EX_T((opline+1)->op2.var).str_offset.offset, 1, 1);
17616: INIT_PZVAL(retval);
17617: AI_SET_PTR(&EX_T(opline->result.var), retval);
17618: }
17619: } else if (RETURN_VALUE_USED(opline)) {
17620: PZVAL_LOCK(&EG(uninitialized_zval));
17621: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
17622: }
17623: } else if (UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) {
17624: if (IS_TMP_FREE(free_op_data1)) {
17625: zval_dtor(value);
17626: }
17627: if (RETURN_VALUE_USED(opline)) {
17628: PZVAL_LOCK(&EG(uninitialized_zval));
17629: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
17630: }
17631: } else {
17632: if ((opline+1)->op1_type == IS_TMP_VAR) {
17633: value = zend_assign_tmp_to_variable(variable_ptr_ptr, value TSRMLS_CC);
17634: } else if ((opline+1)->op1_type == IS_CONST) {
17635: value = zend_assign_const_to_variable(variable_ptr_ptr, value TSRMLS_CC);
17636: } else {
17637: value = zend_assign_to_variable(variable_ptr_ptr, value TSRMLS_CC);
17638: }
17639: if (RETURN_VALUE_USED(opline)) {
1.1 misho 17640: PZVAL_LOCK(value);
1.1.1.2 misho 17641: AI_SET_PTR(&EX_T(opline->result.var), value);
1.1 misho 17642: }
17643: }
17644: FREE_OP_VAR_PTR(free_op_data2);
17645: FREE_OP_IF_VAR(free_op_data1);
17646: }
17647: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
17648: /* assign_dim has two opcodes! */
1.1.1.2 misho 17649: CHECK_EXCEPTION();
1.1 misho 17650: ZEND_VM_INC_OPCODE();
17651: ZEND_VM_NEXT_OPCODE();
17652: }
17653:
17654: static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
17655: {
1.1.1.2 misho 17656: USE_OPLINE
1.1 misho 17657: zend_free_op free_op1, free_op2;
1.1.1.2 misho 17658: zval *value;
17659: zval **variable_ptr_ptr;
1.1 misho 17660:
1.1.1.2 misho 17661: SAVE_OPLINE();
17662: value = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
17663: variable_ptr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
17664:
17665: if (IS_VAR == IS_VAR && UNEXPECTED(variable_ptr_ptr == NULL)) {
17666: if (zend_assign_to_string_offset(&EX_T(opline->op1.var), value, IS_VAR TSRMLS_CC)) {
17667: if (RETURN_VALUE_USED(opline)) {
17668: zval *retval;
17669:
17670: ALLOC_ZVAL(retval);
17671: ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T(opline->op1.var).str_offset.str)+EX_T(opline->op1.var).str_offset.offset, 1, 1);
17672: INIT_PZVAL(retval);
17673: AI_SET_PTR(&EX_T(opline->result.var), retval);
17674: }
17675: } else if (RETURN_VALUE_USED(opline)) {
17676: PZVAL_LOCK(&EG(uninitialized_zval));
17677: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
17678: }
17679: } else if (IS_VAR == IS_VAR && UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) {
17680: if (0) {
17681: zval_dtor(value);
17682: }
17683: if (RETURN_VALUE_USED(opline)) {
17684: PZVAL_LOCK(&EG(uninitialized_zval));
17685: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
17686: }
17687: } else {
17688: if (IS_VAR == IS_TMP_VAR) {
17689: value = zend_assign_tmp_to_variable(variable_ptr_ptr, value TSRMLS_CC);
17690: } else if (IS_VAR == IS_CONST) {
17691: value = zend_assign_const_to_variable(variable_ptr_ptr, value TSRMLS_CC);
17692: } else {
17693: value = zend_assign_to_variable(variable_ptr_ptr, value TSRMLS_CC);
17694: }
17695: if (RETURN_VALUE_USED(opline)) {
1.1 misho 17696: PZVAL_LOCK(value);
1.1.1.2 misho 17697: AI_SET_PTR(&EX_T(opline->result.var), value);
1.1 misho 17698: }
17699: }
17700:
17701: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
17702:
17703: /* zend_assign_to_variable() always takes care of op2, never free it! */
17704: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
17705:
1.1.1.2 misho 17706: CHECK_EXCEPTION();
1.1 misho 17707: ZEND_VM_NEXT_OPCODE();
17708: }
17709:
17710: static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
17711: {
1.1.1.2 misho 17712: USE_OPLINE
1.1 misho 17713: zend_free_op free_op1, free_op2;
17714: zval **variable_ptr_ptr;
1.1.1.2 misho 17715: zval **value_ptr_ptr;
17716:
17717: SAVE_OPLINE();
17718: value_ptr_ptr = _get_zval_ptr_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 17719:
17720: if (IS_VAR == IS_VAR &&
17721: value_ptr_ptr &&
17722: !Z_ISREF_PP(value_ptr_ptr) &&
17723: opline->extended_value == ZEND_RETURNS_FUNCTION &&
1.1.1.2 misho 17724: !EX_T(opline->op2.var).var.fcall_returned_reference) {
1.1 misho 17725: if (free_op2.var == NULL) {
17726: PZVAL_LOCK(*value_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */
17727: }
17728: zend_error(E_STRICT, "Only variables should be assigned by reference");
17729: if (UNEXPECTED(EG(exception) != NULL)) {
17730: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 17731: HANDLE_EXCEPTION();
1.1 misho 17732: }
17733: return ZEND_ASSIGN_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
17734: } else if (IS_VAR == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) {
17735: PZVAL_LOCK(*value_ptr_ptr);
17736: }
1.1.1.2 misho 17737: if (IS_VAR == IS_VAR && UNEXPECTED(EX_T(opline->op1.var).var.ptr_ptr == &EX_T(opline->op1.var).var.ptr)) {
1.1 misho 17738: zend_error_noreturn(E_ERROR, "Cannot assign by reference to overloaded object");
17739: }
17740:
1.1.1.2 misho 17741: variable_ptr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
17742: if ((IS_VAR == IS_VAR && UNEXPECTED(value_ptr_ptr == NULL)) ||
17743: (IS_VAR == IS_VAR && UNEXPECTED(variable_ptr_ptr == NULL))) {
1.1 misho 17744: zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets nor overloaded objects");
17745: }
17746: zend_assign_to_variable_reference(variable_ptr_ptr, value_ptr_ptr TSRMLS_CC);
17747:
17748: if (IS_VAR == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) {
17749: Z_DELREF_PP(variable_ptr_ptr);
17750: }
17751:
1.1.1.2 misho 17752: if (RETURN_VALUE_USED(opline)) {
1.1 misho 17753: PZVAL_LOCK(*variable_ptr_ptr);
1.1.1.2 misho 17754: AI_SET_PTR(&EX_T(opline->result.var), *variable_ptr_ptr);
1.1 misho 17755: }
17756:
17757: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
17758: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
17759:
1.1.1.2 misho 17760: CHECK_EXCEPTION();
1.1 misho 17761: ZEND_VM_NEXT_OPCODE();
17762: }
17763:
17764: static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
17765: {
1.1.1.2 misho 17766: USE_OPLINE
1.1 misho 17767: zval *function_name;
17768: char *function_name_strval;
17769: int function_name_strlen;
17770: zend_free_op free_op1, free_op2;
17771:
1.1.1.2 misho 17772: SAVE_OPLINE();
1.1 misho 17773: zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
17774:
1.1.1.2 misho 17775: function_name = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 17776:
1.1.1.2 misho 17777: if (IS_VAR != IS_CONST &&
17778: UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
1.1 misho 17779: zend_error_noreturn(E_ERROR, "Method name must be a string");
17780: }
17781:
17782: function_name_strval = Z_STRVAL_P(function_name);
17783: function_name_strlen = Z_STRLEN_P(function_name);
17784:
1.1.1.2 misho 17785: EX(object) = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 17786:
1.1.1.2 misho 17787: if (EXPECTED(EX(object) != NULL) &&
17788: EXPECTED(Z_TYPE_P(EX(object)) == IS_OBJECT)) {
17789: EX(called_scope) = Z_OBJCE_P(EX(object));
1.1 misho 17790:
1.1.1.2 misho 17791: if (IS_VAR != IS_CONST ||
17792: (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope))) == NULL) {
17793: zval *object = EX(object);
17794:
17795: if (UNEXPECTED(Z_OBJ_HT_P(EX(object))->get_method == NULL)) {
17796: zend_error_noreturn(E_ERROR, "Object does not support method calls");
17797: }
17798:
17799: /* First, locate the function. */
17800: EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen, ((IS_VAR == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC);
17801: if (UNEXPECTED(EX(fbc) == NULL)) {
17802: zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval);
17803: }
17804: if (IS_VAR == IS_CONST &&
17805: EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) &&
17806: EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) &&
17807: EXPECTED(EX(object) == object)) {
17808: CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope), EX(fbc));
17809: }
1.1 misho 17810: }
17811: } else {
17812: zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval);
17813: }
17814:
17815: if ((EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) != 0) {
17816: EX(object) = NULL;
17817: } else {
17818: if (!PZVAL_IS_REF(EX(object))) {
17819: Z_ADDREF_P(EX(object)); /* For $this pointer */
17820: } else {
17821: zval *this_ptr;
17822: ALLOC_ZVAL(this_ptr);
17823: INIT_PZVAL_COPY(this_ptr, EX(object));
17824: zval_copy_ctor(this_ptr);
17825: EX(object) = this_ptr;
17826: }
17827: }
17828:
17829: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
17830: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
17831:
1.1.1.2 misho 17832: CHECK_EXCEPTION();
1.1 misho 17833: ZEND_VM_NEXT_OPCODE();
17834: }
17835:
17836: static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
17837: {
1.1.1.2 misho 17838: USE_OPLINE
1.1 misho 17839: zval *function_name;
17840: zend_class_entry *ce;
17841:
1.1.1.2 misho 17842: SAVE_OPLINE();
1.1 misho 17843: zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
17844:
17845: if (IS_VAR == IS_CONST) {
17846: /* no function found. try a static method in class */
1.1.1.2 misho 17847: if (CACHED_PTR(opline->op1.literal->cache_slot)) {
17848: ce = CACHED_PTR(opline->op1.literal->cache_slot);
17849: } else {
17850: ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
1.1.1.4 ! misho 17851: if (UNEXPECTED(EG(exception) != NULL)) {
! 17852: HANDLE_EXCEPTION();
! 17853: }
1.1.1.2 misho 17854: if (UNEXPECTED(ce == NULL)) {
1.1.1.4 ! misho 17855: zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv));
1.1.1.2 misho 17856: }
17857: CACHE_PTR(opline->op1.literal->cache_slot, ce);
1.1 misho 17858: }
17859: EX(called_scope) = ce;
17860: } else {
1.1.1.2 misho 17861: ce = EX_T(opline->op1.var).class_entry;
1.1 misho 17862:
1.1.1.2 misho 17863: if (opline->extended_value == ZEND_FETCH_CLASS_PARENT || opline->extended_value == ZEND_FETCH_CLASS_SELF) {
1.1 misho 17864: EX(called_scope) = EG(called_scope);
17865: } else {
17866: EX(called_scope) = ce;
17867: }
17868: }
1.1.1.2 misho 17869:
17870: if (IS_VAR == IS_CONST &&
17871: IS_VAR == IS_CONST &&
17872: CACHED_PTR(opline->op2.literal->cache_slot)) {
17873: EX(fbc) = CACHED_PTR(opline->op2.literal->cache_slot);
17874: } else if (IS_VAR != IS_CONST &&
17875: IS_VAR == IS_CONST &&
17876: (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce))) {
17877: /* do nothing */
17878: } else if (IS_VAR != IS_UNUSED) {
1.1 misho 17879: char *function_name_strval = NULL;
17880: int function_name_strlen = 0;
17881: zend_free_op free_op2;
17882:
17883: if (IS_VAR == IS_CONST) {
1.1.1.2 misho 17884: function_name_strval = Z_STRVAL_P(opline->op2.zv);
17885: function_name_strlen = Z_STRLEN_P(opline->op2.zv);
1.1 misho 17886: } else {
1.1.1.2 misho 17887: function_name = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 17888:
1.1.1.2 misho 17889: if (UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
1.1 misho 17890: zend_error_noreturn(E_ERROR, "Function name must be a string");
17891: } else {
17892: function_name_strval = Z_STRVAL_P(function_name);
17893: function_name_strlen = Z_STRLEN_P(function_name);
17894: }
17895: }
17896:
17897: if (function_name_strval) {
17898: if (ce->get_static_method) {
17899: EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
17900: } else {
1.1.1.2 misho 17901: EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen, ((IS_VAR == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC);
1.1 misho 17902: }
1.1.1.2 misho 17903: if (UNEXPECTED(EX(fbc) == NULL)) {
1.1 misho 17904: zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name, function_name_strval);
17905: }
1.1.1.2 misho 17906: if (IS_VAR == IS_CONST &&
17907: EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) &&
17908: EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0)) {
17909: if (IS_VAR == IS_CONST) {
17910: CACHE_PTR(opline->op2.literal->cache_slot, EX(fbc));
17911: } else {
17912: CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce, EX(fbc));
17913: }
17914: }
1.1 misho 17915: }
17916: if (IS_VAR != IS_CONST) {
17917: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
17918: }
17919: } else {
1.1.1.2 misho 17920: if (UNEXPECTED(ce->constructor == NULL)) {
1.1 misho 17921: zend_error_noreturn(E_ERROR, "Cannot call constructor");
17922: }
17923: if (EG(This) && Z_OBJCE_P(EG(This)) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) {
1.1.1.2 misho 17924: zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name);
1.1 misho 17925: }
17926: EX(fbc) = ce->constructor;
17927: }
17928:
17929: if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) {
17930: EX(object) = NULL;
17931: } else {
17932: if (EG(This) &&
17933: Z_OBJ_HT_P(EG(This))->get_class_entry &&
17934: !instanceof_function(Z_OBJCE_P(EG(This)), ce TSRMLS_CC)) {
17935: /* We are calling method of the other (incompatible) class,
17936: but passing $this. This is done for compatibility with php-4. */
17937: if (EX(fbc)->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
1.1.1.2 misho 17938: zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", EX(fbc)->common.scope->name, EX(fbc)->common.function_name);
1.1 misho 17939: } else {
17940: /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
1.1.1.2 misho 17941: zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", EX(fbc)->common.scope->name, EX(fbc)->common.function_name);
1.1 misho 17942: }
17943: }
17944: if ((EX(object) = EG(This))) {
17945: Z_ADDREF_P(EX(object));
17946: EX(called_scope) = Z_OBJCE_P(EX(object));
17947: }
17948: }
17949:
1.1.1.2 misho 17950: CHECK_EXCEPTION();
1.1 misho 17951: ZEND_VM_NEXT_OPCODE();
17952: }
17953:
17954: static int ZEND_FASTCALL ZEND_CASE_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
17955: {
1.1.1.2 misho 17956: USE_OPLINE
1.1 misho 17957: zend_free_op free_op1, free_op2;
17958:
1.1.1.2 misho 17959: SAVE_OPLINE();
1.1 misho 17960: if (IS_VAR==IS_VAR) {
1.1.1.2 misho 17961: PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
1.1 misho 17962: }
1.1.1.2 misho 17963: is_equal_function(&EX_T(opline->result.var).tmp_var,
17964: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
17965: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 17966:
17967: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 17968: CHECK_EXCEPTION();
1.1 misho 17969: ZEND_VM_NEXT_OPCODE();
17970: }
17971:
17972: static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
17973: {
1.1.1.2 misho 17974: USE_OPLINE
17975: zend_free_op free_op1;
1.1 misho 17976: zval *expr_ptr;
17977:
1.1.1.2 misho 17978: SAVE_OPLINE();
17979: if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && opline->extended_value) {
17980: zval **expr_ptr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 17981:
1.1.1.2 misho 17982: if (IS_VAR == IS_VAR && UNEXPECTED(expr_ptr_ptr == NULL)) {
17983: zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
17984: }
17985: SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr);
1.1 misho 17986: expr_ptr = *expr_ptr_ptr;
1.1.1.2 misho 17987: Z_ADDREF_P(expr_ptr);
1.1 misho 17988: } else {
1.1.1.2 misho 17989: expr_ptr=_get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
17990: if (0) { /* temporary variable */
17991: zval *new_expr;
1.1 misho 17992:
1.1.1.2 misho 17993: ALLOC_ZVAL(new_expr);
17994: INIT_PZVAL_COPY(new_expr, expr_ptr);
17995: expr_ptr = new_expr;
17996: } else if (IS_VAR == IS_CONST || PZVAL_IS_REF(expr_ptr)) {
1.1 misho 17997: zval *new_expr;
17998:
17999: ALLOC_ZVAL(new_expr);
18000: INIT_PZVAL_COPY(new_expr, expr_ptr);
18001: expr_ptr = new_expr;
18002: zendi_zval_copy_ctor(*expr_ptr);
18003: } else {
18004: Z_ADDREF_P(expr_ptr);
18005: }
18006: }
1.1.1.2 misho 18007:
18008: if (IS_VAR != IS_UNUSED) {
18009: zend_free_op free_op2;
18010: zval *offset = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
18011: ulong hval;
18012:
1.1 misho 18013: switch (Z_TYPE_P(offset)) {
18014: case IS_DOUBLE:
1.1.1.2 misho 18015: hval = zend_dval_to_lval(Z_DVAL_P(offset));
18016: goto num_index;
1.1 misho 18017: case IS_LONG:
18018: case IS_BOOL:
1.1.1.2 misho 18019: hval = Z_LVAL_P(offset);
18020: num_index:
18021: zend_hash_index_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), hval, &expr_ptr, sizeof(zval *), NULL);
1.1 misho 18022: break;
18023: case IS_STRING:
1.1.1.2 misho 18024: if (IS_VAR == IS_CONST) {
18025: hval = Z_HASH_P(offset);
18026: } else {
18027: ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
18028: if (IS_INTERNED(Z_STRVAL_P(offset))) {
18029: hval = INTERNED_HASH(Z_STRVAL_P(offset));
18030: } else {
18031: hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
18032: }
18033: }
18034: zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
1.1 misho 18035: break;
18036: case IS_NULL:
1.1.1.2 misho 18037: zend_hash_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
1.1 misho 18038: break;
18039: default:
18040: zend_error(E_WARNING, "Illegal offset type");
18041: zval_ptr_dtor(&expr_ptr);
18042: /* do nothing */
18043: break;
18044: }
18045: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
18046: } else {
1.1.1.2 misho 18047: zend_hash_next_index_insert(Z_ARRVAL(EX_T(opline->result.var).tmp_var), &expr_ptr, sizeof(zval *), NULL);
1.1 misho 18048: }
1.1.1.2 misho 18049: if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && opline->extended_value) {
1.1 misho 18050: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
18051: } else {
18052: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
18053: }
1.1.1.2 misho 18054: CHECK_EXCEPTION();
1.1 misho 18055: ZEND_VM_NEXT_OPCODE();
18056: }
18057:
18058: static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
18059: {
1.1.1.2 misho 18060: USE_OPLINE
1.1 misho 18061:
1.1.1.2 misho 18062: array_init(&EX_T(opline->result.var).tmp_var);
1.1 misho 18063: if (IS_VAR == IS_UNUSED) {
18064: ZEND_VM_NEXT_OPCODE();
18065: #if 0 || IS_VAR != IS_UNUSED
18066: } else {
18067: return ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
18068: #endif
18069: }
18070: }
18071:
1.1.1.2 misho 18072: static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
18073: {
18074: USE_OPLINE
18075: zval tmp, *varname;
18076: HashTable *target_symbol_table;
18077: zend_free_op free_op1;
18078:
18079: SAVE_OPLINE();
18080: if (IS_VAR == IS_CV &&
18081: IS_VAR == IS_UNUSED &&
18082: (opline->extended_value & ZEND_QUICK_SET)) {
18083: if (EG(active_symbol_table)) {
18084: zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.var);
18085:
18086: zend_delete_variable(EX(prev_execute_data), EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value TSRMLS_CC);
18087: EX_CV(opline->op1.var) = NULL;
18088: } else if (EX_CV(opline->op1.var)) {
18089: zval_ptr_dtor(EX_CV(opline->op1.var));
18090: EX_CV(opline->op1.var) = NULL;
18091: }
18092: CHECK_EXCEPTION();
18093: ZEND_VM_NEXT_OPCODE();
18094: }
18095:
18096: varname = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
18097:
18098: if (IS_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
18099: ZVAL_COPY_VALUE(&tmp, varname);
18100: zval_copy_ctor(&tmp);
18101: convert_to_string(&tmp);
18102: varname = &tmp;
18103: } else if (IS_VAR == IS_VAR || IS_VAR == IS_CV) {
18104: Z_ADDREF_P(varname);
18105: }
18106:
18107: if (IS_VAR != IS_UNUSED) {
18108: zend_class_entry *ce;
18109:
18110: if (IS_VAR == IS_CONST) {
18111: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
18112: ce = CACHED_PTR(opline->op2.literal->cache_slot);
18113: } else {
18114: ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
1.1.1.4 ! misho 18115: if (UNEXPECTED(EG(exception) != NULL)) {
1.1.1.2 misho 18116: if (IS_VAR != IS_CONST && varname == &tmp) {
18117: zval_dtor(&tmp);
18118: } else if (IS_VAR == IS_VAR || IS_VAR == IS_CV) {
18119: zval_ptr_dtor(&varname);
18120: }
18121: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.4 ! misho 18122: HANDLE_EXCEPTION();
! 18123: }
! 18124: if (UNEXPECTED(ce == NULL)) {
! 18125: zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op2.zv));
1.1.1.2 misho 18126: }
18127: CACHE_PTR(opline->op2.literal->cache_slot, ce);
18128: }
18129: } else {
18130: ce = EX_T(opline->op2.var).class_entry;
18131: }
18132: zend_std_unset_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), ((IS_VAR == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
18133: } else {
18134: ulong hash_value = zend_inline_hash_func(varname->value.str.val, varname->value.str.len+1);
18135:
18136: target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
18137: zend_delete_variable(execute_data, target_symbol_table, varname->value.str.val, varname->value.str.len+1, hash_value TSRMLS_CC);
18138: }
18139:
18140: if (IS_VAR != IS_CONST && varname == &tmp) {
18141: zval_dtor(&tmp);
18142: } else if (IS_VAR == IS_VAR || IS_VAR == IS_CV) {
18143: zval_ptr_dtor(&varname);
18144: }
18145: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
18146: CHECK_EXCEPTION();
18147: ZEND_VM_NEXT_OPCODE();
18148: }
18149:
1.1 misho 18150: static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
18151: {
1.1.1.2 misho 18152: USE_OPLINE
1.1 misho 18153: zend_free_op free_op1, free_op2;
1.1.1.2 misho 18154: zval **container;
1.1 misho 18155: zval *offset;
1.1.1.2 misho 18156: ulong hval;
1.1 misho 18157:
1.1.1.2 misho 18158: SAVE_OPLINE();
18159: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 18160: if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) {
18161: SEPARATE_ZVAL_IF_NOT_REF(container);
18162: }
1.1.1.2 misho 18163: offset = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 18164:
18165: if (IS_VAR != IS_VAR || container) {
18166: switch (Z_TYPE_PP(container)) {
18167: case IS_ARRAY: {
18168: HashTable *ht = Z_ARRVAL_PP(container);
18169:
18170: switch (Z_TYPE_P(offset)) {
18171: case IS_DOUBLE:
1.1.1.2 misho 18172: hval = zend_dval_to_lval(Z_DVAL_P(offset));
1.1.1.3 misho 18173: zend_hash_index_del(ht, hval);
18174: break;
1.1 misho 18175: case IS_RESOURCE:
18176: case IS_BOOL:
18177: case IS_LONG:
1.1.1.2 misho 18178: hval = Z_LVAL_P(offset);
18179: zend_hash_index_del(ht, hval);
1.1 misho 18180: break;
18181: case IS_STRING:
18182: if (IS_VAR == IS_CV || IS_VAR == IS_VAR) {
18183: Z_ADDREF_P(offset);
18184: }
1.1.1.2 misho 18185: if (IS_VAR == IS_CONST) {
18186: hval = Z_HASH_P(offset);
18187: } else {
18188: ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_dim);
18189: if (IS_INTERNED(Z_STRVAL_P(offset))) {
18190: hval = INTERNED_HASH(Z_STRVAL_P(offset));
18191: } else {
18192: hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
1.1 misho 18193: }
18194: }
1.1.1.2 misho 18195: if (ht == &EG(symbol_table)) {
18196: zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC);
18197: } else {
18198: zend_hash_quick_del(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval);
18199: }
18200: if (IS_VAR == IS_CV || IS_VAR == IS_VAR) {
18201: zval_ptr_dtor(&offset);
18202: }
18203: break;
18204: num_index_dim:
18205: zend_hash_index_del(ht, hval);
1.1 misho 18206: if (IS_VAR == IS_CV || IS_VAR == IS_VAR) {
18207: zval_ptr_dtor(&offset);
18208: }
18209: break;
18210: case IS_NULL:
18211: zend_hash_del(ht, "", sizeof(""));
18212: break;
18213: default:
18214: zend_error(E_WARNING, "Illegal offset type in unset");
18215: break;
18216: }
18217: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
18218: break;
18219: }
18220: case IS_OBJECT:
1.1.1.2 misho 18221: if (UNEXPECTED(Z_OBJ_HT_P(*container)->unset_dimension == NULL)) {
1.1 misho 18222: zend_error_noreturn(E_ERROR, "Cannot use object as array");
18223: }
18224: if (0) {
18225: MAKE_REAL_ZVAL_PTR(offset);
18226: }
18227: Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC);
18228: if (0) {
18229: zval_ptr_dtor(&offset);
18230: } else {
18231: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
18232: }
18233: break;
18234: case IS_STRING:
18235: zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
18236: ZEND_VM_CONTINUE(); /* bailed out before */
18237: default:
18238: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
18239: break;
18240: }
18241: } else {
18242: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
18243: }
18244: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
18245:
1.1.1.2 misho 18246: CHECK_EXCEPTION();
1.1 misho 18247: ZEND_VM_NEXT_OPCODE();
18248: }
18249:
18250: static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
18251: {
1.1.1.2 misho 18252: USE_OPLINE
1.1 misho 18253: zend_free_op free_op1, free_op2;
1.1.1.2 misho 18254: zval **container;
18255: zval *offset;
18256:
18257: SAVE_OPLINE();
18258: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
18259: offset = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 18260:
18261: if (IS_VAR != IS_VAR || container) {
18262: if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) {
18263: SEPARATE_ZVAL_IF_NOT_REF(container);
18264: }
18265: if (Z_TYPE_PP(container) == IS_OBJECT) {
18266: if (0) {
18267: MAKE_REAL_ZVAL_PTR(offset);
18268: }
18269: if (Z_OBJ_HT_P(*container)->unset_property) {
1.1.1.2 misho 18270: Z_OBJ_HT_P(*container)->unset_property(*container, offset, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 18271: } else {
18272: zend_error(E_NOTICE, "Trying to unset property of non-object");
18273: }
18274: if (0) {
18275: zval_ptr_dtor(&offset);
18276: } else {
18277: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
18278: }
18279: } else {
18280: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
18281: }
18282: } else {
18283: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
18284: }
18285: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
18286:
1.1.1.2 misho 18287: CHECK_EXCEPTION();
18288: ZEND_VM_NEXT_OPCODE();
18289: }
18290:
18291: static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
18292: {
18293: USE_OPLINE
18294: zval **value;
18295: zend_bool isset = 1;
18296:
18297: SAVE_OPLINE();
18298: if (IS_VAR == IS_CV &&
18299: IS_VAR == IS_UNUSED &&
18300: (opline->extended_value & ZEND_QUICK_SET)) {
18301: if (EX_CV(opline->op1.var)) {
18302: value = EX_CV(opline->op1.var);
18303: } else if (EG(active_symbol_table)) {
18304: zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.var);
18305:
18306: if (zend_hash_quick_find(EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value, (void **) &value) == FAILURE) {
18307: isset = 0;
18308: }
18309: } else {
18310: isset = 0;
18311: }
18312: } else {
18313: HashTable *target_symbol_table;
18314: zend_free_op free_op1;
18315: zval tmp, *varname = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
18316:
18317: if (IS_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
18318: ZVAL_COPY_VALUE(&tmp, varname);
18319: zval_copy_ctor(&tmp);
18320: convert_to_string(&tmp);
18321: varname = &tmp;
18322: }
18323:
18324: if (IS_VAR != IS_UNUSED) {
18325: zend_class_entry *ce;
18326:
18327: if (IS_VAR == IS_CONST) {
18328: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
18329: ce = CACHED_PTR(opline->op2.literal->cache_slot);
18330: } else {
18331: ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
18332: if (UNEXPECTED(ce == NULL)) {
18333: CHECK_EXCEPTION();
18334: ZEND_VM_NEXT_OPCODE();
18335: }
18336: CACHE_PTR(opline->op2.literal->cache_slot, ce);
18337: }
18338: } else {
18339: ce = EX_T(opline->op2.var).class_entry;
18340: }
18341: value = zend_std_get_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 1, ((IS_VAR == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
18342: if (!value) {
18343: isset = 0;
18344: }
18345: } else {
18346: target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
18347: if (zend_hash_find(target_symbol_table, varname->value.str.val, varname->value.str.len+1, (void **) &value) == FAILURE) {
18348: isset = 0;
18349: }
18350: }
18351:
18352: if (IS_VAR != IS_CONST && varname == &tmp) {
18353: zval_dtor(&tmp);
18354: }
18355: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
18356: }
18357:
18358: if (opline->extended_value & ZEND_ISSET) {
18359: if (isset && Z_TYPE_PP(value) != IS_NULL) {
18360: ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 1);
18361: } else {
18362: ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
18363: }
18364: } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
18365: if (!isset || !i_zend_is_true(*value)) {
18366: ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 1);
18367: } else {
18368: ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
18369: }
18370: }
18371:
18372: CHECK_EXCEPTION();
1.1 misho 18373: ZEND_VM_NEXT_OPCODE();
18374: }
18375:
18376: static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_VAR(int prop_dim, ZEND_OPCODE_HANDLER_ARGS)
18377: {
1.1.1.2 misho 18378: USE_OPLINE
18379: zend_free_op free_op1, free_op2;
18380: zval **container;
1.1 misho 18381: zval **value = NULL;
18382: int result = 0;
1.1.1.2 misho 18383: ulong hval;
18384: zval *offset;
1.1 misho 18385:
1.1.1.2 misho 18386: SAVE_OPLINE();
18387: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 18388:
1.1.1.2 misho 18389: offset = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 18390:
1.1.1.2 misho 18391: if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) {
18392: HashTable *ht;
18393: int isset = 0;
1.1 misho 18394:
1.1.1.2 misho 18395: ht = Z_ARRVAL_PP(container);
18396:
18397: switch (Z_TYPE_P(offset)) {
18398: case IS_DOUBLE:
18399: hval = zend_dval_to_lval(Z_DVAL_P(offset));
18400: goto num_index_prop;
18401: case IS_RESOURCE:
18402: case IS_BOOL:
18403: case IS_LONG:
18404: hval = Z_LVAL_P(offset);
18405: num_index_prop:
18406: if (zend_hash_index_find(ht, hval, (void **) &value) == SUCCESS) {
18407: isset = 1;
18408: }
18409: break;
18410: case IS_STRING:
18411: if (IS_VAR == IS_CONST) {
18412: hval = Z_HASH_P(offset);
18413: } else {
18414: if (!prop_dim) {
18415: ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_prop);
1.1 misho 18416: }
1.1.1.2 misho 18417: if (IS_INTERNED(Z_STRVAL_P(offset))) {
18418: hval = INTERNED_HASH(Z_STRVAL_P(offset));
1.1 misho 18419: } else {
1.1.1.2 misho 18420: hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
1.1 misho 18421: }
1.1.1.2 misho 18422: }
18423: if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) {
18424: isset = 1;
18425: }
18426: break;
18427: case IS_NULL:
18428: if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) {
18429: isset = 1;
18430: }
18431: break;
18432: default:
18433: zend_error(E_WARNING, "Illegal offset type in isset or empty");
18434: break;
18435: }
18436:
18437: if (opline->extended_value & ZEND_ISSET) {
18438: if (isset && Z_TYPE_PP(value) == IS_NULL) {
18439: result = 0;
18440: } else {
18441: result = isset;
1.1 misho 18442: }
1.1.1.2 misho 18443: } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
18444: if (!isset || !i_zend_is_true(*value)) {
18445: result = 0;
18446: } else {
18447: result = 1;
1.1 misho 18448: }
1.1.1.2 misho 18449: }
18450: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
18451: } else if (Z_TYPE_PP(container) == IS_OBJECT) {
18452: if (0) {
18453: MAKE_REAL_ZVAL_PTR(offset);
18454: }
18455: if (prop_dim) {
18456: if (Z_OBJ_HT_P(*container)->has_property) {
18457: result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 18458: } else {
1.1.1.2 misho 18459: zend_error(E_NOTICE, "Trying to check property of non-object");
18460: result = 0;
1.1 misho 18461: }
1.1.1.2 misho 18462: } else {
18463: if (Z_OBJ_HT_P(*container)->has_dimension) {
18464: result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0 TSRMLS_CC);
1.1 misho 18465: } else {
1.1.1.2 misho 18466: zend_error(E_NOTICE, "Trying to check element of non-array");
18467: result = 0;
1.1 misho 18468: }
1.1.1.2 misho 18469: }
18470: if (0) {
18471: zval_ptr_dtor(&offset);
18472: } else {
18473: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
18474: }
18475: } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */
18476: zval tmp;
1.1 misho 18477:
1.1.1.2 misho 18478: if (Z_TYPE_P(offset) != IS_LONG) {
18479: if (Z_TYPE_P(offset) <= IS_BOOL /* simple scalar types */
18480: || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */
18481: && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) {
18482: ZVAL_COPY_VALUE(&tmp, offset);
1.1 misho 18483: zval_copy_ctor(&tmp);
18484: convert_to_long(&tmp);
18485: offset = &tmp;
1.1.1.2 misho 18486: } else {
18487: /* can not be converted to proper offset, return "not set" */
18488: result = 0;
1.1 misho 18489: }
1.1.1.2 misho 18490: }
18491: if (Z_TYPE_P(offset) == IS_LONG) {
18492: if (opline->extended_value & ZEND_ISSET) {
18493: if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
18494: result = 1;
18495: }
18496: } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
18497: if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') {
18498: result = 1;
1.1 misho 18499: }
18500: }
18501: }
1.1.1.2 misho 18502: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
18503: } else {
18504: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1 misho 18505: }
18506:
1.1.1.2 misho 18507: Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
18508: if (opline->extended_value & ZEND_ISSET) {
18509: Z_LVAL(EX_T(opline->result.var).tmp_var) = result;
18510: } else {
18511: Z_LVAL(EX_T(opline->result.var).tmp_var) = !result;
1.1 misho 18512: }
18513:
18514: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
18515:
1.1.1.2 misho 18516: CHECK_EXCEPTION();
1.1 misho 18517: ZEND_VM_NEXT_OPCODE();
18518: }
18519:
18520: static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
18521: {
18522: return zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_VAR(0, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
18523: }
18524:
18525: static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
18526: {
18527: return zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_VAR(1, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
18528: }
18529:
18530: static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_UNUSED(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
18531: {
1.1.1.2 misho 18532: USE_OPLINE
1.1 misho 18533: zend_free_op free_op1, free_op_data1;
1.1.1.2 misho 18534: zval **object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 18535: zval *object;
18536: zval *property = NULL;
1.1.1.2 misho 18537: zval *value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R);
1.1 misho 18538: int have_get_ptr = 0;
18539:
1.1.1.2 misho 18540: if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 18541: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
18542: }
18543:
18544: make_real_object(object_ptr TSRMLS_CC);
18545: object = *object_ptr;
18546:
1.1.1.2 misho 18547: if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
1.1 misho 18548: zend_error(E_WARNING, "Attempt to assign property of non-object");
18549:
18550: FREE_OP(free_op_data1);
18551:
1.1.1.2 misho 18552: if (RETURN_VALUE_USED(opline)) {
18553: PZVAL_LOCK(&EG(uninitialized_zval));
18554: EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
18555: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 18556: }
18557: } else {
18558: /* here we are sure we are dealing with an object */
18559: if (0) {
18560: MAKE_REAL_ZVAL_PTR(property);
18561: }
18562:
18563: /* here property is a string */
18564: if (opline->extended_value == ZEND_ASSIGN_OBJ
18565: && Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
1.1.1.2 misho 18566: zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_UNUSED == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 18567: if (zptr != NULL) { /* NULL means no success in getting PTR */
18568: SEPARATE_ZVAL_IF_NOT_REF(zptr);
18569:
18570: have_get_ptr = 1;
18571: binary_op(*zptr, *zptr, value TSRMLS_CC);
1.1.1.2 misho 18572: if (RETURN_VALUE_USED(opline)) {
1.1 misho 18573: PZVAL_LOCK(*zptr);
1.1.1.2 misho 18574: EX_T(opline->result.var).var.ptr = *zptr;
18575: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 18576: }
18577: }
18578: }
18579:
18580: if (!have_get_ptr) {
18581: zval *z = NULL;
18582:
18583: if (opline->extended_value == ZEND_ASSIGN_OBJ) {
18584: if (Z_OBJ_HT_P(object)->read_property) {
1.1.1.2 misho 18585: z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_UNUSED == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 18586: }
18587: } else /* if (opline->extended_value == ZEND_ASSIGN_DIM) */ {
18588: if (Z_OBJ_HT_P(object)->read_dimension) {
18589: z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC);
18590: }
18591: }
18592: if (z) {
18593: if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
18594: zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
18595:
18596: if (Z_REFCOUNT_P(z) == 0) {
18597: GC_REMOVE_ZVAL_FROM_BUFFER(z);
18598: zval_dtor(z);
18599: FREE_ZVAL(z);
18600: }
18601: z = value;
18602: }
18603: Z_ADDREF_P(z);
18604: SEPARATE_ZVAL_IF_NOT_REF(&z);
18605: binary_op(z, z, value TSRMLS_CC);
18606: if (opline->extended_value == ZEND_ASSIGN_OBJ) {
1.1.1.2 misho 18607: Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_UNUSED == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 18608: } else /* if (opline->extended_value == ZEND_ASSIGN_DIM) */ {
18609: Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC);
18610: }
1.1.1.2 misho 18611: if (RETURN_VALUE_USED(opline)) {
1.1 misho 18612: PZVAL_LOCK(z);
1.1.1.2 misho 18613: EX_T(opline->result.var).var.ptr = z;
18614: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 18615: }
18616: zval_ptr_dtor(&z);
18617: } else {
18618: zend_error(E_WARNING, "Attempt to assign property of non-object");
1.1.1.2 misho 18619: if (RETURN_VALUE_USED(opline)) {
18620: PZVAL_LOCK(&EG(uninitialized_zval));
18621: EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
18622: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 18623: }
18624: }
18625: }
18626:
18627: if (0) {
18628: zval_ptr_dtor(&property);
18629: } else {
18630:
18631: }
18632: FREE_OP(free_op_data1);
18633: }
18634:
18635: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
18636: /* assign_obj has two opcodes! */
1.1.1.2 misho 18637: CHECK_EXCEPTION();
1.1 misho 18638: ZEND_VM_INC_OPCODE();
18639: ZEND_VM_NEXT_OPCODE();
18640: }
18641:
18642: static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_UNUSED(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
18643: {
1.1.1.2 misho 18644: USE_OPLINE
1.1 misho 18645: zend_free_op free_op1, free_op_data2, free_op_data1;
18646: zval **var_ptr;
18647: zval *value;
18648:
1.1.1.2 misho 18649: SAVE_OPLINE();
1.1 misho 18650: switch (opline->extended_value) {
18651: case ZEND_ASSIGN_OBJ:
18652: return zend_binary_assign_op_obj_helper_SPEC_VAR_UNUSED(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
18653: break;
18654: case ZEND_ASSIGN_DIM: {
1.1.1.2 misho 18655: zval **container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 18656:
1.1.1.2 misho 18657: if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 18658: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
1.1.1.2 misho 18659: } else if (UNEXPECTED(Z_TYPE_PP(container) == IS_OBJECT)) {
1.1 misho 18660: if (IS_VAR == IS_VAR && !(free_op1.var != NULL)) {
18661: Z_ADDREF_PP(container); /* undo the effect of get_obj_zval_ptr_ptr() */
18662: }
18663: return zend_binary_assign_op_obj_helper_SPEC_VAR_UNUSED(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
18664: } else {
18665: zval *dim = NULL;
18666:
1.1.1.2 misho 18667: zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), container, dim, IS_UNUSED, BP_VAR_RW TSRMLS_CC);
18668: value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R);
18669: var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC);
1.1 misho 18670: }
18671: }
18672: break;
18673: default:
18674: value = NULL;
1.1.1.2 misho 18675: var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 18676: /* do nothing */
18677: break;
18678: }
18679:
1.1.1.2 misho 18680: if (UNEXPECTED(var_ptr == NULL)) {
1.1 misho 18681: zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets");
18682: }
18683:
1.1.1.2 misho 18684: if (UNEXPECTED(*var_ptr == &EG(error_zval))) {
18685: if (RETURN_VALUE_USED(opline)) {
18686: PZVAL_LOCK(&EG(uninitialized_zval));
18687: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
1.1 misho 18688: }
18689:
18690: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 18691: CHECK_EXCEPTION();
18692: if (opline->extended_value == ZEND_ASSIGN_DIM) {
18693: ZEND_VM_INC_OPCODE();
18694: }
1.1 misho 18695: ZEND_VM_NEXT_OPCODE();
18696: }
18697:
18698: SEPARATE_ZVAL_IF_NOT_REF(var_ptr);
18699:
1.1.1.2 misho 18700: if (UNEXPECTED(Z_TYPE_PP(var_ptr) == IS_OBJECT)
18701: && Z_OBJ_HANDLER_PP(var_ptr, get)
1.1 misho 18702: && Z_OBJ_HANDLER_PP(var_ptr, set)) {
18703: /* proxy object */
18704: zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC);
18705: Z_ADDREF_P(objval);
18706: binary_op(objval, objval, value TSRMLS_CC);
18707: Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC);
18708: zval_ptr_dtor(&objval);
18709: } else {
18710: binary_op(*var_ptr, *var_ptr, value TSRMLS_CC);
18711: }
18712:
1.1.1.2 misho 18713: if (RETURN_VALUE_USED(opline)) {
1.1 misho 18714: PZVAL_LOCK(*var_ptr);
1.1.1.2 misho 18715: AI_SET_PTR(&EX_T(opline->result.var), *var_ptr);
1.1 misho 18716: }
18717:
18718: if (opline->extended_value == ZEND_ASSIGN_DIM) {
18719: FREE_OP(free_op_data1);
18720: FREE_OP_VAR_PTR(free_op_data2);
1.1.1.2 misho 18721: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
18722: CHECK_EXCEPTION();
18723: ZEND_VM_INC_OPCODE();
18724: } else {
18725: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
18726: CHECK_EXCEPTION();
1.1 misho 18727: }
18728: ZEND_VM_NEXT_OPCODE();
18729: }
18730:
18731: static int ZEND_FASTCALL ZEND_ASSIGN_ADD_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
18732: {
18733: return zend_binary_assign_op_helper_SPEC_VAR_UNUSED(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
18734: }
18735:
18736: static int ZEND_FASTCALL ZEND_ASSIGN_SUB_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
18737: {
18738: return zend_binary_assign_op_helper_SPEC_VAR_UNUSED(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
18739: }
18740:
18741: static int ZEND_FASTCALL ZEND_ASSIGN_MUL_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
18742: {
18743: return zend_binary_assign_op_helper_SPEC_VAR_UNUSED(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
18744: }
18745:
18746: static int ZEND_FASTCALL ZEND_ASSIGN_DIV_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
18747: {
18748: return zend_binary_assign_op_helper_SPEC_VAR_UNUSED(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
18749: }
18750:
18751: static int ZEND_FASTCALL ZEND_ASSIGN_MOD_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
18752: {
18753: return zend_binary_assign_op_helper_SPEC_VAR_UNUSED(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
18754: }
18755:
18756: static int ZEND_FASTCALL ZEND_ASSIGN_SL_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
18757: {
18758: return zend_binary_assign_op_helper_SPEC_VAR_UNUSED(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
18759: }
18760:
18761: static int ZEND_FASTCALL ZEND_ASSIGN_SR_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
18762: {
18763: return zend_binary_assign_op_helper_SPEC_VAR_UNUSED(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
18764: }
18765:
18766: static int ZEND_FASTCALL ZEND_ASSIGN_CONCAT_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
18767: {
18768: return zend_binary_assign_op_helper_SPEC_VAR_UNUSED(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
18769: }
18770:
18771: static int ZEND_FASTCALL ZEND_ASSIGN_BW_OR_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
18772: {
18773: return zend_binary_assign_op_helper_SPEC_VAR_UNUSED(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
18774: }
18775:
18776: static int ZEND_FASTCALL ZEND_ASSIGN_BW_AND_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
18777: {
18778: return zend_binary_assign_op_helper_SPEC_VAR_UNUSED(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
18779: }
18780:
18781: static int ZEND_FASTCALL ZEND_ASSIGN_BW_XOR_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
18782: {
18783: return zend_binary_assign_op_helper_SPEC_VAR_UNUSED(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
18784: }
18785:
1.1.1.2 misho 18786: static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_UNUSED(int type, ZEND_OPCODE_HANDLER_ARGS)
18787: {
18788: USE_OPLINE
18789: zend_free_op free_op1;
18790: zval *varname;
18791: zval **retval;
18792: zval tmp_varname;
18793: HashTable *target_symbol_table;
18794: ulong hash_value;
18795:
18796: SAVE_OPLINE();
18797: varname = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
18798:
18799: if (IS_VAR != IS_CONST && UNEXPECTED(Z_TYPE_P(varname) != IS_STRING)) {
18800: ZVAL_COPY_VALUE(&tmp_varname, varname);
18801: zval_copy_ctor(&tmp_varname);
18802: Z_SET_REFCOUNT(tmp_varname, 1);
18803: Z_UNSET_ISREF(tmp_varname);
18804: convert_to_string(&tmp_varname);
18805: varname = &tmp_varname;
18806: }
18807:
18808: if (IS_UNUSED != IS_UNUSED) {
18809: zend_class_entry *ce;
18810:
18811: if (IS_UNUSED == IS_CONST) {
18812: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
18813: ce = CACHED_PTR(opline->op2.literal->cache_slot);
18814: } else {
18815: ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
18816: if (UNEXPECTED(ce == NULL)) {
18817: if (IS_VAR != IS_CONST && varname == &tmp_varname) {
18818: zval_dtor(&tmp_varname);
18819: }
18820: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
18821: CHECK_EXCEPTION();
18822: ZEND_VM_NEXT_OPCODE();
18823: }
18824: CACHE_PTR(opline->op2.literal->cache_slot, ce);
18825: }
18826: } else {
18827: ce = EX_T(opline->op2.var).class_entry;
18828: }
18829: retval = zend_std_get_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 0, ((IS_VAR == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
18830: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
18831: } else {
18832: target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
18833: /*
18834: if (!target_symbol_table) {
18835: CHECK_EXCEPTION();
18836: ZEND_VM_NEXT_OPCODE();
18837: }
18838: */
18839: if (IS_VAR == IS_CONST) {
18840: hash_value = Z_HASH_P(varname);
18841: } else if (IS_INTERNED(Z_STRVAL_P(varname))) {
18842: hash_value = INTERNED_HASH(Z_STRVAL_P(varname));
18843: } else {
18844: hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1);
18845: }
18846:
18847: if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) {
18848: switch (type) {
18849: case BP_VAR_R:
18850: case BP_VAR_UNSET:
18851: zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_P(varname));
18852: /* break missing intentionally */
18853: case BP_VAR_IS:
18854: retval = &EG(uninitialized_zval_ptr);
18855: break;
18856: case BP_VAR_RW:
18857: zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_P(varname));
18858: /* break missing intentionally */
18859: case BP_VAR_W:
18860: Z_ADDREF_P(&EG(uninitialized_zval));
18861: zend_hash_quick_update(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, &EG(uninitialized_zval_ptr), sizeof(zval *), (void **) &retval);
18862: break;
18863: EMPTY_SWITCH_DEFAULT_CASE()
18864: }
18865: }
18866: switch (opline->extended_value & ZEND_FETCH_TYPE_MASK) {
18867: case ZEND_FETCH_GLOBAL:
18868: if (IS_VAR != IS_TMP_VAR) {
18869: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
18870: }
18871: break;
18872: case ZEND_FETCH_LOCAL:
18873: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
18874: break;
18875: case ZEND_FETCH_STATIC:
18876: zval_update_constant(retval, (void*) 1 TSRMLS_CC);
18877: break;
18878: case ZEND_FETCH_GLOBAL_LOCK:
18879: if (IS_VAR == IS_VAR && !free_op1.var) {
18880: PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
18881: }
18882: break;
18883: }
18884: }
18885:
18886:
18887: if (IS_VAR != IS_CONST && varname == &tmp_varname) {
18888: zval_dtor(&tmp_varname);
18889: }
18890: if (opline->extended_value & ZEND_FETCH_MAKE_REF) {
18891: SEPARATE_ZVAL_TO_MAKE_IS_REF(retval);
18892: }
18893: PZVAL_LOCK(*retval);
18894: switch (type) {
18895: case BP_VAR_R:
18896: case BP_VAR_IS:
18897: AI_SET_PTR(&EX_T(opline->result.var), *retval);
18898: break;
18899: case BP_VAR_UNSET: {
18900: zend_free_op free_res;
18901:
18902: PZVAL_UNLOCK(*retval, &free_res);
18903: if (retval != &EG(uninitialized_zval_ptr)) {
18904: SEPARATE_ZVAL_IF_NOT_REF(retval);
18905: }
18906: PZVAL_LOCK(*retval);
18907: FREE_OP_VAR_PTR(free_res);
18908: }
18909: /* break missing intentionally */
18910: default:
18911: EX_T(opline->result.var).var.ptr_ptr = retval;
18912: break;
18913: }
18914: CHECK_EXCEPTION();
18915: ZEND_VM_NEXT_OPCODE();
18916: }
18917:
18918: static int ZEND_FASTCALL ZEND_FETCH_R_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
18919: {
18920: return zend_fetch_var_address_helper_SPEC_VAR_UNUSED(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
18921: }
18922:
18923: static int ZEND_FASTCALL ZEND_FETCH_W_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
18924: {
18925: return zend_fetch_var_address_helper_SPEC_VAR_UNUSED(BP_VAR_W, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
18926: }
18927:
18928: static int ZEND_FASTCALL ZEND_FETCH_RW_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
18929: {
18930: return zend_fetch_var_address_helper_SPEC_VAR_UNUSED(BP_VAR_RW, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
18931: }
18932:
18933: static int ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
18934: {
18935: USE_OPLINE
18936:
18937: return zend_fetch_var_address_helper_SPEC_VAR_UNUSED(ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
18938: }
18939:
18940: static int ZEND_FASTCALL ZEND_FETCH_UNSET_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
18941: {
18942: return zend_fetch_var_address_helper_SPEC_VAR_UNUSED(BP_VAR_UNSET, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
18943: }
18944:
18945: static int ZEND_FASTCALL ZEND_FETCH_IS_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
18946: {
18947: return zend_fetch_var_address_helper_SPEC_VAR_UNUSED(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
18948: }
18949:
1.1 misho 18950: static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
18951: {
1.1.1.2 misho 18952: USE_OPLINE
1.1 misho 18953: zend_free_op free_op1;
1.1.1.2 misho 18954: zval **container;
18955:
18956: SAVE_OPLINE();
18957: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 18958:
1.1.1.2 misho 18959: if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 18960: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
18961: }
1.1.1.2 misho 18962: zend_fetch_dimension_address(&EX_T(opline->result.var), container, NULL, IS_UNUSED, BP_VAR_W TSRMLS_CC);
1.1 misho 18963:
1.1.1.2 misho 18964: if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
18965: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 18966: }
18967: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
18968:
18969: /* We are going to assign the result by reference */
1.1.1.2 misho 18970: if (UNEXPECTED(opline->extended_value != 0)) {
18971: zval **retval_ptr = EX_T(opline->result.var).var.ptr_ptr;
18972:
18973: if (retval_ptr) {
18974: Z_DELREF_PP(retval_ptr);
18975: SEPARATE_ZVAL_TO_MAKE_IS_REF(retval_ptr);
18976: Z_ADDREF_PP(retval_ptr);
18977: }
1.1 misho 18978: }
18979:
1.1.1.2 misho 18980: CHECK_EXCEPTION();
1.1 misho 18981: ZEND_VM_NEXT_OPCODE();
18982: }
18983:
18984: static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
18985: {
1.1.1.2 misho 18986: USE_OPLINE
1.1 misho 18987: zend_free_op free_op1;
1.1.1.2 misho 18988: zval **container;
1.1 misho 18989:
1.1.1.2 misho 18990: SAVE_OPLINE();
18991: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
18992:
18993: if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 18994: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
18995: }
1.1.1.2 misho 18996: zend_fetch_dimension_address(&EX_T(opline->result.var), container, NULL, IS_UNUSED, BP_VAR_RW TSRMLS_CC);
1.1 misho 18997:
1.1.1.2 misho 18998: if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
18999: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 19000: }
19001: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 19002: CHECK_EXCEPTION();
1.1 misho 19003: ZEND_VM_NEXT_OPCODE();
19004: }
19005:
19006: static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
19007: {
1.1.1.2 misho 19008: USE_OPLINE
1.1 misho 19009: zend_free_op free_op1;
19010: zval **container;
19011:
1.1.1.2 misho 19012: SAVE_OPLINE();
19013:
19014: if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
19015: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
19016: if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 19017: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
19018: }
1.1.1.2 misho 19019: zend_fetch_dimension_address(&EX_T(opline->result.var), container, NULL, IS_UNUSED, BP_VAR_W TSRMLS_CC);
19020: if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
19021: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 19022: }
19023: } else {
19024: if (IS_UNUSED == IS_UNUSED) {
19025: zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
19026: }
1.1.1.2 misho 19027: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
19028: zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, NULL, IS_UNUSED, BP_VAR_R TSRMLS_CC);
1.1 misho 19029: }
19030:
19031: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 19032: CHECK_EXCEPTION();
1.1 misho 19033: ZEND_VM_NEXT_OPCODE();
19034: }
19035:
19036: static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
19037: {
1.1.1.2 misho 19038: USE_OPLINE
1.1 misho 19039: zend_free_op free_op1;
1.1.1.2 misho 19040: zval **object_ptr;
1.1 misho 19041:
1.1.1.2 misho 19042: SAVE_OPLINE();
19043: object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
19044:
19045: if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 19046: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
19047: }
19048: if (Z_TYPE_PP(object_ptr) == IS_OBJECT) {
19049:
19050: zval *property_name = NULL;
19051:
19052: if (0) {
19053: MAKE_REAL_ZVAL_PTR(property_name);
19054: }
1.1.1.2 misho 19055: zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), ZEND_ASSIGN_DIM, ((IS_UNUSED == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 19056: if (0) {
19057: zval_ptr_dtor(&property_name);
19058: } else {
19059:
19060: }
19061: } else {
19062: zend_free_op free_op_data1, free_op_data2;
19063: zval *value;
19064: zval *dim = NULL;
19065: zval **variable_ptr_ptr;
19066:
1.1.1.2 misho 19067: zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), object_ptr, dim, IS_UNUSED, BP_VAR_W TSRMLS_CC);
19068:
19069: value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R);
19070: variable_ptr_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC);
19071: if (UNEXPECTED(variable_ptr_ptr == NULL)) {
19072: if (zend_assign_to_string_offset(&EX_T((opline+1)->op2.var), value, (opline+1)->op1_type TSRMLS_CC)) {
19073: if (RETURN_VALUE_USED(opline)) {
19074: zval *retval;
1.1 misho 19075:
1.1.1.2 misho 19076: ALLOC_ZVAL(retval);
19077: ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T((opline+1)->op2.var).str_offset.str)+EX_T((opline+1)->op2.var).str_offset.offset, 1, 1);
19078: INIT_PZVAL(retval);
19079: AI_SET_PTR(&EX_T(opline->result.var), retval);
19080: }
19081: } else if (RETURN_VALUE_USED(opline)) {
19082: PZVAL_LOCK(&EG(uninitialized_zval));
19083: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
19084: }
19085: } else if (UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) {
19086: if (IS_TMP_FREE(free_op_data1)) {
19087: zval_dtor(value);
19088: }
19089: if (RETURN_VALUE_USED(opline)) {
19090: PZVAL_LOCK(&EG(uninitialized_zval));
19091: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
19092: }
19093: } else {
19094: if ((opline+1)->op1_type == IS_TMP_VAR) {
19095: value = zend_assign_tmp_to_variable(variable_ptr_ptr, value TSRMLS_CC);
19096: } else if ((opline+1)->op1_type == IS_CONST) {
19097: value = zend_assign_const_to_variable(variable_ptr_ptr, value TSRMLS_CC);
19098: } else {
19099: value = zend_assign_to_variable(variable_ptr_ptr, value TSRMLS_CC);
19100: }
19101: if (RETURN_VALUE_USED(opline)) {
1.1 misho 19102: PZVAL_LOCK(value);
1.1.1.2 misho 19103: AI_SET_PTR(&EX_T(opline->result.var), value);
1.1 misho 19104: }
19105: }
19106: FREE_OP_VAR_PTR(free_op_data2);
19107: FREE_OP_IF_VAR(free_op_data1);
19108: }
19109: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
19110: /* assign_dim has two opcodes! */
1.1.1.2 misho 19111: CHECK_EXCEPTION();
1.1 misho 19112: ZEND_VM_INC_OPCODE();
19113: ZEND_VM_NEXT_OPCODE();
19114: }
19115:
19116: static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
19117: {
1.1.1.2 misho 19118: USE_OPLINE
1.1 misho 19119: zval *function_name;
19120: zend_class_entry *ce;
19121:
1.1.1.2 misho 19122: SAVE_OPLINE();
1.1 misho 19123: zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
19124:
19125: if (IS_VAR == IS_CONST) {
19126: /* no function found. try a static method in class */
1.1.1.2 misho 19127: if (CACHED_PTR(opline->op1.literal->cache_slot)) {
19128: ce = CACHED_PTR(opline->op1.literal->cache_slot);
19129: } else {
19130: ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
1.1.1.4 ! misho 19131: if (UNEXPECTED(EG(exception) != NULL)) {
! 19132: HANDLE_EXCEPTION();
! 19133: }
1.1.1.2 misho 19134: if (UNEXPECTED(ce == NULL)) {
1.1.1.4 ! misho 19135: zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv));
1.1.1.2 misho 19136: }
19137: CACHE_PTR(opline->op1.literal->cache_slot, ce);
1.1 misho 19138: }
19139: EX(called_scope) = ce;
19140: } else {
1.1.1.2 misho 19141: ce = EX_T(opline->op1.var).class_entry;
1.1 misho 19142:
1.1.1.2 misho 19143: if (opline->extended_value == ZEND_FETCH_CLASS_PARENT || opline->extended_value == ZEND_FETCH_CLASS_SELF) {
1.1 misho 19144: EX(called_scope) = EG(called_scope);
19145: } else {
19146: EX(called_scope) = ce;
19147: }
19148: }
1.1.1.2 misho 19149:
19150: if (IS_VAR == IS_CONST &&
19151: IS_UNUSED == IS_CONST &&
19152: CACHED_PTR(opline->op2.literal->cache_slot)) {
19153: EX(fbc) = CACHED_PTR(opline->op2.literal->cache_slot);
19154: } else if (IS_VAR != IS_CONST &&
19155: IS_UNUSED == IS_CONST &&
19156: (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce))) {
19157: /* do nothing */
19158: } else if (IS_UNUSED != IS_UNUSED) {
1.1 misho 19159: char *function_name_strval = NULL;
19160: int function_name_strlen = 0;
19161:
19162:
19163: if (IS_UNUSED == IS_CONST) {
1.1.1.2 misho 19164: function_name_strval = Z_STRVAL_P(opline->op2.zv);
19165: function_name_strlen = Z_STRLEN_P(opline->op2.zv);
1.1 misho 19166: } else {
19167: function_name = NULL;
19168:
1.1.1.2 misho 19169: if (UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
1.1 misho 19170: zend_error_noreturn(E_ERROR, "Function name must be a string");
19171: } else {
19172: function_name_strval = Z_STRVAL_P(function_name);
19173: function_name_strlen = Z_STRLEN_P(function_name);
19174: }
19175: }
19176:
19177: if (function_name_strval) {
19178: if (ce->get_static_method) {
19179: EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
19180: } else {
1.1.1.2 misho 19181: EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen, ((IS_UNUSED == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC);
1.1 misho 19182: }
1.1.1.2 misho 19183: if (UNEXPECTED(EX(fbc) == NULL)) {
1.1 misho 19184: zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name, function_name_strval);
19185: }
1.1.1.2 misho 19186: if (IS_UNUSED == IS_CONST &&
19187: EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) &&
19188: EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0)) {
19189: if (IS_VAR == IS_CONST) {
19190: CACHE_PTR(opline->op2.literal->cache_slot, EX(fbc));
19191: } else {
19192: CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce, EX(fbc));
19193: }
19194: }
1.1 misho 19195: }
19196: if (IS_UNUSED != IS_CONST) {
19197:
19198: }
19199: } else {
1.1.1.2 misho 19200: if (UNEXPECTED(ce->constructor == NULL)) {
1.1 misho 19201: zend_error_noreturn(E_ERROR, "Cannot call constructor");
19202: }
19203: if (EG(This) && Z_OBJCE_P(EG(This)) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) {
1.1.1.2 misho 19204: zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name);
1.1 misho 19205: }
19206: EX(fbc) = ce->constructor;
19207: }
19208:
19209: if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) {
19210: EX(object) = NULL;
19211: } else {
19212: if (EG(This) &&
19213: Z_OBJ_HT_P(EG(This))->get_class_entry &&
19214: !instanceof_function(Z_OBJCE_P(EG(This)), ce TSRMLS_CC)) {
19215: /* We are calling method of the other (incompatible) class,
19216: but passing $this. This is done for compatibility with php-4. */
19217: if (EX(fbc)->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
1.1.1.2 misho 19218: zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", EX(fbc)->common.scope->name, EX(fbc)->common.function_name);
1.1 misho 19219: } else {
19220: /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
1.1.1.2 misho 19221: zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", EX(fbc)->common.scope->name, EX(fbc)->common.function_name);
1.1 misho 19222: }
19223: }
19224: if ((EX(object) = EG(This))) {
19225: Z_ADDREF_P(EX(object));
19226: EX(called_scope) = Z_OBJCE_P(EX(object));
19227: }
19228: }
19229:
1.1.1.2 misho 19230: CHECK_EXCEPTION();
1.1 misho 19231: ZEND_VM_NEXT_OPCODE();
19232: }
19233:
19234: static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
19235: {
1.1.1.2 misho 19236: USE_OPLINE
1.1 misho 19237: zend_free_op free_op1;
19238: zval *expr_ptr;
19239:
1.1.1.2 misho 19240: SAVE_OPLINE();
19241: if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && opline->extended_value) {
19242: zval **expr_ptr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 19243:
1.1.1.2 misho 19244: if (IS_VAR == IS_VAR && UNEXPECTED(expr_ptr_ptr == NULL)) {
19245: zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
19246: }
19247: SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr);
1.1 misho 19248: expr_ptr = *expr_ptr_ptr;
1.1.1.2 misho 19249: Z_ADDREF_P(expr_ptr);
1.1 misho 19250: } else {
1.1.1.2 misho 19251: expr_ptr=_get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
19252: if (0) { /* temporary variable */
19253: zval *new_expr;
1.1 misho 19254:
1.1.1.2 misho 19255: ALLOC_ZVAL(new_expr);
19256: INIT_PZVAL_COPY(new_expr, expr_ptr);
19257: expr_ptr = new_expr;
19258: } else if (IS_VAR == IS_CONST || PZVAL_IS_REF(expr_ptr)) {
1.1 misho 19259: zval *new_expr;
19260:
19261: ALLOC_ZVAL(new_expr);
19262: INIT_PZVAL_COPY(new_expr, expr_ptr);
19263: expr_ptr = new_expr;
19264: zendi_zval_copy_ctor(*expr_ptr);
19265: } else {
19266: Z_ADDREF_P(expr_ptr);
19267: }
19268: }
1.1.1.2 misho 19269:
19270: if (IS_UNUSED != IS_UNUSED) {
19271:
19272: zval *offset = NULL;
19273: ulong hval;
19274:
1.1 misho 19275: switch (Z_TYPE_P(offset)) {
19276: case IS_DOUBLE:
1.1.1.2 misho 19277: hval = zend_dval_to_lval(Z_DVAL_P(offset));
19278: goto num_index;
1.1 misho 19279: case IS_LONG:
19280: case IS_BOOL:
1.1.1.2 misho 19281: hval = Z_LVAL_P(offset);
19282: num_index:
19283: zend_hash_index_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), hval, &expr_ptr, sizeof(zval *), NULL);
1.1 misho 19284: break;
19285: case IS_STRING:
1.1.1.2 misho 19286: if (IS_UNUSED == IS_CONST) {
19287: hval = Z_HASH_P(offset);
19288: } else {
19289: ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
19290: if (IS_INTERNED(Z_STRVAL_P(offset))) {
19291: hval = INTERNED_HASH(Z_STRVAL_P(offset));
19292: } else {
19293: hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
19294: }
19295: }
19296: zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
1.1 misho 19297: break;
19298: case IS_NULL:
1.1.1.2 misho 19299: zend_hash_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
1.1 misho 19300: break;
19301: default:
19302: zend_error(E_WARNING, "Illegal offset type");
19303: zval_ptr_dtor(&expr_ptr);
19304: /* do nothing */
19305: break;
19306: }
1.1.1.2 misho 19307:
19308: } else {
19309: zend_hash_next_index_insert(Z_ARRVAL(EX_T(opline->result.var).tmp_var), &expr_ptr, sizeof(zval *), NULL);
19310: }
19311: if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && opline->extended_value) {
19312: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
19313: } else {
19314: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
19315: }
19316: CHECK_EXCEPTION();
19317: ZEND_VM_NEXT_OPCODE();
19318: }
19319:
19320: static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
19321: {
19322: USE_OPLINE
19323:
19324: array_init(&EX_T(opline->result.var).tmp_var);
19325: if (IS_VAR == IS_UNUSED) {
19326: ZEND_VM_NEXT_OPCODE();
19327: #if 0 || IS_VAR != IS_UNUSED
19328: } else {
19329: return ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
19330: #endif
19331: }
19332: }
19333:
19334: static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
19335: {
19336: USE_OPLINE
19337: zval tmp, *varname;
19338: HashTable *target_symbol_table;
19339: zend_free_op free_op1;
19340:
19341: SAVE_OPLINE();
19342: if (IS_VAR == IS_CV &&
19343: IS_UNUSED == IS_UNUSED &&
19344: (opline->extended_value & ZEND_QUICK_SET)) {
19345: if (EG(active_symbol_table)) {
19346: zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.var);
19347:
19348: zend_delete_variable(EX(prev_execute_data), EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value TSRMLS_CC);
19349: EX_CV(opline->op1.var) = NULL;
19350: } else if (EX_CV(opline->op1.var)) {
19351: zval_ptr_dtor(EX_CV(opline->op1.var));
19352: EX_CV(opline->op1.var) = NULL;
19353: }
19354: CHECK_EXCEPTION();
19355: ZEND_VM_NEXT_OPCODE();
19356: }
19357:
19358: varname = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
19359:
19360: if (IS_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
19361: ZVAL_COPY_VALUE(&tmp, varname);
19362: zval_copy_ctor(&tmp);
19363: convert_to_string(&tmp);
19364: varname = &tmp;
19365: } else if (IS_VAR == IS_VAR || IS_VAR == IS_CV) {
19366: Z_ADDREF_P(varname);
19367: }
19368:
19369: if (IS_UNUSED != IS_UNUSED) {
19370: zend_class_entry *ce;
19371:
19372: if (IS_UNUSED == IS_CONST) {
19373: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
19374: ce = CACHED_PTR(opline->op2.literal->cache_slot);
19375: } else {
19376: ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
1.1.1.4 ! misho 19377: if (UNEXPECTED(EG(exception) != NULL)) {
1.1.1.2 misho 19378: if (IS_VAR != IS_CONST && varname == &tmp) {
19379: zval_dtor(&tmp);
19380: } else if (IS_VAR == IS_VAR || IS_VAR == IS_CV) {
19381: zval_ptr_dtor(&varname);
19382: }
19383: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.4 ! misho 19384: HANDLE_EXCEPTION();
! 19385: }
! 19386: if (UNEXPECTED(ce == NULL)) {
! 19387: zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op2.zv));
1.1.1.2 misho 19388: }
19389: CACHE_PTR(opline->op2.literal->cache_slot, ce);
19390: }
19391: } else {
19392: ce = EX_T(opline->op2.var).class_entry;
19393: }
19394: zend_std_unset_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), ((IS_VAR == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
19395: } else {
19396: ulong hash_value = zend_inline_hash_func(varname->value.str.val, varname->value.str.len+1);
19397:
19398: target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
19399: zend_delete_variable(execute_data, target_symbol_table, varname->value.str.val, varname->value.str.len+1, hash_value TSRMLS_CC);
19400: }
19401:
19402: if (IS_VAR != IS_CONST && varname == &tmp) {
19403: zval_dtor(&tmp);
19404: } else if (IS_VAR == IS_VAR || IS_VAR == IS_CV) {
19405: zval_ptr_dtor(&varname);
19406: }
19407: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
19408: CHECK_EXCEPTION();
19409: ZEND_VM_NEXT_OPCODE();
19410: }
19411:
19412: static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
19413: {
19414: USE_OPLINE
19415: zval **value;
19416: zend_bool isset = 1;
19417:
19418: SAVE_OPLINE();
19419: if (IS_VAR == IS_CV &&
19420: IS_UNUSED == IS_UNUSED &&
19421: (opline->extended_value & ZEND_QUICK_SET)) {
19422: if (EX_CV(opline->op1.var)) {
19423: value = EX_CV(opline->op1.var);
19424: } else if (EG(active_symbol_table)) {
19425: zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.var);
19426:
19427: if (zend_hash_quick_find(EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value, (void **) &value) == FAILURE) {
19428: isset = 0;
19429: }
19430: } else {
19431: isset = 0;
19432: }
19433: } else {
19434: HashTable *target_symbol_table;
19435: zend_free_op free_op1;
19436: zval tmp, *varname = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
19437:
19438: if (IS_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
19439: ZVAL_COPY_VALUE(&tmp, varname);
19440: zval_copy_ctor(&tmp);
19441: convert_to_string(&tmp);
19442: varname = &tmp;
19443: }
19444:
19445: if (IS_UNUSED != IS_UNUSED) {
19446: zend_class_entry *ce;
19447:
19448: if (IS_UNUSED == IS_CONST) {
19449: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
19450: ce = CACHED_PTR(opline->op2.literal->cache_slot);
19451: } else {
19452: ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
19453: if (UNEXPECTED(ce == NULL)) {
19454: CHECK_EXCEPTION();
19455: ZEND_VM_NEXT_OPCODE();
19456: }
19457: CACHE_PTR(opline->op2.literal->cache_slot, ce);
19458: }
19459: } else {
19460: ce = EX_T(opline->op2.var).class_entry;
19461: }
19462: value = zend_std_get_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 1, ((IS_VAR == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
19463: if (!value) {
19464: isset = 0;
19465: }
19466: } else {
19467: target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
19468: if (zend_hash_find(target_symbol_table, varname->value.str.val, varname->value.str.len+1, (void **) &value) == FAILURE) {
19469: isset = 0;
19470: }
19471: }
19472:
19473: if (IS_VAR != IS_CONST && varname == &tmp) {
19474: zval_dtor(&tmp);
19475: }
1.1 misho 19476: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
19477: }
1.1.1.2 misho 19478:
19479: if (opline->extended_value & ZEND_ISSET) {
19480: if (isset && Z_TYPE_PP(value) != IS_NULL) {
19481: ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 1);
19482: } else {
19483: ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
19484: }
19485: } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
19486: if (!isset || !i_zend_is_true(*value)) {
19487: ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 1);
19488: } else {
19489: ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
19490: }
19491: }
19492:
19493: CHECK_EXCEPTION();
1.1 misho 19494: ZEND_VM_NEXT_OPCODE();
19495: }
19496:
1.1.1.2 misho 19497: static int ZEND_FASTCALL ZEND_SEPARATE_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 19498: {
1.1.1.2 misho 19499: USE_OPLINE
19500: zval *var_ptr, *new_zv;
1.1 misho 19501:
1.1.1.2 misho 19502: SAVE_OPLINE();
19503: var_ptr = EX_T(opline->op1.var).var.ptr;
19504: if (Z_TYPE_P(var_ptr) != IS_OBJECT &&
19505: !PZVAL_IS_REF(var_ptr) &&
19506: Z_REFCOUNT_P(var_ptr) > 1) {
19507:
19508: Z_DELREF_P(var_ptr);
19509: ALLOC_ZVAL(new_zv);
19510: INIT_PZVAL_COPY(new_zv, var_ptr);
19511: var_ptr = new_zv;
19512: zval_copy_ctor(var_ptr);
19513: EX_T(opline->op1.var).var.ptr = var_ptr;
1.1 misho 19514: }
1.1.1.2 misho 19515: ZEND_VM_NEXT_OPCODE();
1.1 misho 19516: }
19517:
19518: static int ZEND_FASTCALL ZEND_ADD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
19519: {
1.1.1.2 misho 19520: USE_OPLINE
1.1 misho 19521: zend_free_op free_op1;
19522:
1.1.1.2 misho 19523: SAVE_OPLINE();
19524: fast_add_function(&EX_T(opline->result.var).tmp_var,
19525: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
19526: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
1.1 misho 19527: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
19528:
1.1.1.2 misho 19529: CHECK_EXCEPTION();
1.1 misho 19530: ZEND_VM_NEXT_OPCODE();
19531: }
19532:
19533: static int ZEND_FASTCALL ZEND_SUB_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
19534: {
1.1.1.2 misho 19535: USE_OPLINE
1.1 misho 19536: zend_free_op free_op1;
19537:
1.1.1.2 misho 19538: SAVE_OPLINE();
19539: fast_sub_function(&EX_T(opline->result.var).tmp_var,
19540: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
19541: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
1.1 misho 19542: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
19543:
1.1.1.2 misho 19544: CHECK_EXCEPTION();
1.1 misho 19545: ZEND_VM_NEXT_OPCODE();
19546: }
19547:
19548: static int ZEND_FASTCALL ZEND_MUL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
19549: {
1.1.1.2 misho 19550: USE_OPLINE
1.1 misho 19551: zend_free_op free_op1;
19552:
1.1.1.2 misho 19553: SAVE_OPLINE();
19554: fast_mul_function(&EX_T(opline->result.var).tmp_var,
19555: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
19556: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
1.1 misho 19557: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
19558:
1.1.1.2 misho 19559: CHECK_EXCEPTION();
1.1 misho 19560: ZEND_VM_NEXT_OPCODE();
19561: }
19562:
19563: static int ZEND_FASTCALL ZEND_DIV_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
19564: {
1.1.1.2 misho 19565: USE_OPLINE
1.1 misho 19566: zend_free_op free_op1;
19567:
1.1.1.2 misho 19568: SAVE_OPLINE();
19569: fast_div_function(&EX_T(opline->result.var).tmp_var,
19570: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
19571: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
1.1 misho 19572: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
19573:
1.1.1.2 misho 19574: CHECK_EXCEPTION();
1.1 misho 19575: ZEND_VM_NEXT_OPCODE();
19576: }
19577:
19578: static int ZEND_FASTCALL ZEND_MOD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
19579: {
1.1.1.2 misho 19580: USE_OPLINE
1.1 misho 19581: zend_free_op free_op1;
19582:
1.1.1.2 misho 19583: SAVE_OPLINE();
19584: fast_mod_function(&EX_T(opline->result.var).tmp_var,
19585: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
19586: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
1.1 misho 19587: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
19588:
1.1.1.2 misho 19589: CHECK_EXCEPTION();
1.1 misho 19590: ZEND_VM_NEXT_OPCODE();
19591: }
19592:
19593: static int ZEND_FASTCALL ZEND_SL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
19594: {
1.1.1.2 misho 19595: USE_OPLINE
1.1 misho 19596: zend_free_op free_op1;
19597:
1.1.1.2 misho 19598: SAVE_OPLINE();
19599: shift_left_function(&EX_T(opline->result.var).tmp_var,
19600: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
19601: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
1.1 misho 19602: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
19603:
1.1.1.2 misho 19604: CHECK_EXCEPTION();
1.1 misho 19605: ZEND_VM_NEXT_OPCODE();
19606: }
19607:
19608: static int ZEND_FASTCALL ZEND_SR_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
19609: {
1.1.1.2 misho 19610: USE_OPLINE
1.1 misho 19611: zend_free_op free_op1;
19612:
1.1.1.2 misho 19613: SAVE_OPLINE();
19614: shift_right_function(&EX_T(opline->result.var).tmp_var,
19615: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
19616: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
1.1 misho 19617: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
19618:
1.1.1.2 misho 19619: CHECK_EXCEPTION();
1.1 misho 19620: ZEND_VM_NEXT_OPCODE();
19621: }
19622:
19623: static int ZEND_FASTCALL ZEND_CONCAT_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
19624: {
1.1.1.2 misho 19625: USE_OPLINE
1.1 misho 19626: zend_free_op free_op1;
19627:
1.1.1.2 misho 19628: SAVE_OPLINE();
19629: concat_function(&EX_T(opline->result.var).tmp_var,
19630: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
19631: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
1.1 misho 19632: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
19633:
1.1.1.2 misho 19634: CHECK_EXCEPTION();
1.1 misho 19635: ZEND_VM_NEXT_OPCODE();
19636: }
19637:
19638: static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
19639: {
1.1.1.2 misho 19640: USE_OPLINE
1.1 misho 19641: zend_free_op free_op1;
19642:
1.1.1.2 misho 19643: SAVE_OPLINE();
19644: is_identical_function(&EX_T(opline->result.var).tmp_var,
19645: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
19646: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
1.1 misho 19647: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
19648:
1.1.1.2 misho 19649: CHECK_EXCEPTION();
1.1 misho 19650: ZEND_VM_NEXT_OPCODE();
19651: }
19652:
19653: static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
19654: {
1.1.1.2 misho 19655: USE_OPLINE
1.1 misho 19656: zend_free_op free_op1;
1.1.1.2 misho 19657: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 19658:
1.1.1.2 misho 19659: SAVE_OPLINE();
1.1 misho 19660: is_identical_function(result,
1.1.1.2 misho 19661: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
19662: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
1.1 misho 19663: Z_LVAL_P(result) = !Z_LVAL_P(result);
19664: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
19665:
1.1.1.2 misho 19666: CHECK_EXCEPTION();
1.1 misho 19667: ZEND_VM_NEXT_OPCODE();
19668: }
19669:
19670: static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
19671: {
1.1.1.2 misho 19672: USE_OPLINE
1.1 misho 19673: zend_free_op free_op1;
1.1.1.2 misho 19674: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 19675:
1.1.1.2 misho 19676: SAVE_OPLINE();
19677: ZVAL_BOOL(result, fast_equal_function(result,
19678: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
19679: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC));
1.1 misho 19680: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
19681:
1.1.1.2 misho 19682: CHECK_EXCEPTION();
1.1 misho 19683: ZEND_VM_NEXT_OPCODE();
19684: }
19685:
19686: static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
19687: {
1.1.1.2 misho 19688: USE_OPLINE
1.1 misho 19689: zend_free_op free_op1;
1.1.1.2 misho 19690: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 19691:
1.1.1.2 misho 19692: SAVE_OPLINE();
19693: ZVAL_BOOL(result, fast_not_equal_function(result,
19694: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
19695: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC));
1.1 misho 19696: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
19697:
1.1.1.2 misho 19698: CHECK_EXCEPTION();
1.1 misho 19699: ZEND_VM_NEXT_OPCODE();
19700: }
19701:
19702: static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
19703: {
1.1.1.2 misho 19704: USE_OPLINE
1.1 misho 19705: zend_free_op free_op1;
1.1.1.2 misho 19706: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 19707:
1.1.1.2 misho 19708: SAVE_OPLINE();
19709: ZVAL_BOOL(result, fast_is_smaller_function(result,
19710: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
19711: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC));
1.1 misho 19712: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
19713:
1.1.1.2 misho 19714: CHECK_EXCEPTION();
1.1 misho 19715: ZEND_VM_NEXT_OPCODE();
19716: }
19717:
19718: static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
19719: {
1.1.1.2 misho 19720: USE_OPLINE
1.1 misho 19721: zend_free_op free_op1;
1.1.1.2 misho 19722: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 19723:
1.1.1.2 misho 19724: SAVE_OPLINE();
19725: ZVAL_BOOL(result, fast_is_smaller_or_equal_function(result,
19726: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
19727: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC));
1.1 misho 19728: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
19729:
1.1.1.2 misho 19730: CHECK_EXCEPTION();
1.1 misho 19731: ZEND_VM_NEXT_OPCODE();
19732: }
19733:
19734: static int ZEND_FASTCALL ZEND_BW_OR_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
19735: {
1.1.1.2 misho 19736: USE_OPLINE
1.1 misho 19737: zend_free_op free_op1;
19738:
1.1.1.2 misho 19739: SAVE_OPLINE();
19740: bitwise_or_function(&EX_T(opline->result.var).tmp_var,
19741: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
19742: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
1.1 misho 19743: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
19744:
1.1.1.2 misho 19745: CHECK_EXCEPTION();
1.1 misho 19746: ZEND_VM_NEXT_OPCODE();
19747: }
19748:
19749: static int ZEND_FASTCALL ZEND_BW_AND_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
19750: {
1.1.1.2 misho 19751: USE_OPLINE
1.1 misho 19752: zend_free_op free_op1;
19753:
1.1.1.2 misho 19754: SAVE_OPLINE();
19755: bitwise_and_function(&EX_T(opline->result.var).tmp_var,
19756: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
19757: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
1.1 misho 19758: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
19759:
1.1.1.2 misho 19760: CHECK_EXCEPTION();
1.1 misho 19761: ZEND_VM_NEXT_OPCODE();
19762: }
19763:
19764: static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
19765: {
1.1.1.2 misho 19766: USE_OPLINE
1.1 misho 19767: zend_free_op free_op1;
19768:
1.1.1.2 misho 19769: SAVE_OPLINE();
19770: bitwise_xor_function(&EX_T(opline->result.var).tmp_var,
19771: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
19772: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
1.1 misho 19773: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
19774:
1.1.1.2 misho 19775: CHECK_EXCEPTION();
1.1 misho 19776: ZEND_VM_NEXT_OPCODE();
19777: }
19778:
19779: static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
19780: {
1.1.1.2 misho 19781: USE_OPLINE
1.1 misho 19782: zend_free_op free_op1;
19783:
1.1.1.2 misho 19784: SAVE_OPLINE();
19785: boolean_xor_function(&EX_T(opline->result.var).tmp_var,
19786: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
19787: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
1.1 misho 19788: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
19789:
1.1.1.2 misho 19790: CHECK_EXCEPTION();
1.1 misho 19791: ZEND_VM_NEXT_OPCODE();
19792: }
19793:
19794: static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CV(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
19795: {
1.1.1.2 misho 19796: USE_OPLINE
1.1 misho 19797: zend_free_op free_op1, free_op_data1;
1.1.1.2 misho 19798: zval **object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 19799: zval *object;
1.1.1.2 misho 19800: zval *property = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
19801: zval *value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R);
1.1 misho 19802: int have_get_ptr = 0;
19803:
1.1.1.2 misho 19804: if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 19805: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
19806: }
19807:
19808: make_real_object(object_ptr TSRMLS_CC);
19809: object = *object_ptr;
19810:
1.1.1.2 misho 19811: if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
1.1 misho 19812: zend_error(E_WARNING, "Attempt to assign property of non-object");
19813:
19814: FREE_OP(free_op_data1);
19815:
1.1.1.2 misho 19816: if (RETURN_VALUE_USED(opline)) {
19817: PZVAL_LOCK(&EG(uninitialized_zval));
19818: EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
19819: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 19820: }
19821: } else {
19822: /* here we are sure we are dealing with an object */
19823: if (0) {
19824: MAKE_REAL_ZVAL_PTR(property);
19825: }
19826:
19827: /* here property is a string */
19828: if (opline->extended_value == ZEND_ASSIGN_OBJ
19829: && Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
1.1.1.2 misho 19830: zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 19831: if (zptr != NULL) { /* NULL means no success in getting PTR */
19832: SEPARATE_ZVAL_IF_NOT_REF(zptr);
19833:
19834: have_get_ptr = 1;
19835: binary_op(*zptr, *zptr, value TSRMLS_CC);
1.1.1.2 misho 19836: if (RETURN_VALUE_USED(opline)) {
1.1 misho 19837: PZVAL_LOCK(*zptr);
1.1.1.2 misho 19838: EX_T(opline->result.var).var.ptr = *zptr;
19839: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 19840: }
19841: }
19842: }
19843:
19844: if (!have_get_ptr) {
19845: zval *z = NULL;
19846:
19847: if (opline->extended_value == ZEND_ASSIGN_OBJ) {
19848: if (Z_OBJ_HT_P(object)->read_property) {
1.1.1.2 misho 19849: z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 19850: }
19851: } else /* if (opline->extended_value == ZEND_ASSIGN_DIM) */ {
19852: if (Z_OBJ_HT_P(object)->read_dimension) {
19853: z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC);
19854: }
19855: }
19856: if (z) {
19857: if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
19858: zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
19859:
19860: if (Z_REFCOUNT_P(z) == 0) {
19861: GC_REMOVE_ZVAL_FROM_BUFFER(z);
19862: zval_dtor(z);
19863: FREE_ZVAL(z);
19864: }
19865: z = value;
19866: }
19867: Z_ADDREF_P(z);
19868: SEPARATE_ZVAL_IF_NOT_REF(&z);
19869: binary_op(z, z, value TSRMLS_CC);
19870: if (opline->extended_value == ZEND_ASSIGN_OBJ) {
1.1.1.2 misho 19871: Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 19872: } else /* if (opline->extended_value == ZEND_ASSIGN_DIM) */ {
19873: Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC);
19874: }
1.1.1.2 misho 19875: if (RETURN_VALUE_USED(opline)) {
1.1 misho 19876: PZVAL_LOCK(z);
1.1.1.2 misho 19877: EX_T(opline->result.var).var.ptr = z;
19878: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 19879: }
19880: zval_ptr_dtor(&z);
19881: } else {
19882: zend_error(E_WARNING, "Attempt to assign property of non-object");
1.1.1.2 misho 19883: if (RETURN_VALUE_USED(opline)) {
19884: PZVAL_LOCK(&EG(uninitialized_zval));
19885: EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
19886: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 19887: }
19888: }
19889: }
19890:
19891: if (0) {
19892: zval_ptr_dtor(&property);
19893: } else {
19894:
19895: }
19896: FREE_OP(free_op_data1);
19897: }
19898:
19899: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
19900: /* assign_obj has two opcodes! */
1.1.1.2 misho 19901: CHECK_EXCEPTION();
1.1 misho 19902: ZEND_VM_INC_OPCODE();
19903: ZEND_VM_NEXT_OPCODE();
19904: }
19905:
19906: static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_CV(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
19907: {
1.1.1.2 misho 19908: USE_OPLINE
1.1 misho 19909: zend_free_op free_op1, free_op_data2, free_op_data1;
19910: zval **var_ptr;
19911: zval *value;
19912:
1.1.1.2 misho 19913: SAVE_OPLINE();
1.1 misho 19914: switch (opline->extended_value) {
19915: case ZEND_ASSIGN_OBJ:
19916: return zend_binary_assign_op_obj_helper_SPEC_VAR_CV(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
19917: break;
19918: case ZEND_ASSIGN_DIM: {
1.1.1.2 misho 19919: zval **container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 19920:
1.1.1.2 misho 19921: if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 19922: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
1.1.1.2 misho 19923: } else if (UNEXPECTED(Z_TYPE_PP(container) == IS_OBJECT)) {
1.1 misho 19924: if (IS_VAR == IS_VAR && !(free_op1.var != NULL)) {
19925: Z_ADDREF_PP(container); /* undo the effect of get_obj_zval_ptr_ptr() */
19926: }
19927: return zend_binary_assign_op_obj_helper_SPEC_VAR_CV(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
19928: } else {
1.1.1.2 misho 19929: zval *dim = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
1.1 misho 19930:
1.1.1.2 misho 19931: zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), container, dim, IS_CV, BP_VAR_RW TSRMLS_CC);
19932: value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R);
19933: var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC);
1.1 misho 19934: }
19935: }
19936: break;
19937: default:
1.1.1.2 misho 19938: value = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
19939: var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 19940: /* do nothing */
19941: break;
19942: }
19943:
1.1.1.2 misho 19944: if (UNEXPECTED(var_ptr == NULL)) {
1.1 misho 19945: zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets");
19946: }
19947:
1.1.1.2 misho 19948: if (UNEXPECTED(*var_ptr == &EG(error_zval))) {
19949: if (RETURN_VALUE_USED(opline)) {
19950: PZVAL_LOCK(&EG(uninitialized_zval));
19951: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
1.1 misho 19952: }
19953:
19954: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 19955: CHECK_EXCEPTION();
19956: if (opline->extended_value == ZEND_ASSIGN_DIM) {
19957: ZEND_VM_INC_OPCODE();
19958: }
1.1 misho 19959: ZEND_VM_NEXT_OPCODE();
19960: }
19961:
19962: SEPARATE_ZVAL_IF_NOT_REF(var_ptr);
19963:
1.1.1.2 misho 19964: if (UNEXPECTED(Z_TYPE_PP(var_ptr) == IS_OBJECT)
19965: && Z_OBJ_HANDLER_PP(var_ptr, get)
1.1 misho 19966: && Z_OBJ_HANDLER_PP(var_ptr, set)) {
19967: /* proxy object */
19968: zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC);
19969: Z_ADDREF_P(objval);
19970: binary_op(objval, objval, value TSRMLS_CC);
19971: Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC);
19972: zval_ptr_dtor(&objval);
19973: } else {
19974: binary_op(*var_ptr, *var_ptr, value TSRMLS_CC);
19975: }
19976:
1.1.1.2 misho 19977: if (RETURN_VALUE_USED(opline)) {
1.1 misho 19978: PZVAL_LOCK(*var_ptr);
1.1.1.2 misho 19979: AI_SET_PTR(&EX_T(opline->result.var), *var_ptr);
1.1 misho 19980: }
19981:
19982: if (opline->extended_value == ZEND_ASSIGN_DIM) {
19983: FREE_OP(free_op_data1);
19984: FREE_OP_VAR_PTR(free_op_data2);
1.1.1.2 misho 19985: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
19986: CHECK_EXCEPTION();
19987: ZEND_VM_INC_OPCODE();
19988: } else {
19989: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
19990: CHECK_EXCEPTION();
1.1 misho 19991: }
19992: ZEND_VM_NEXT_OPCODE();
19993: }
19994:
19995: static int ZEND_FASTCALL ZEND_ASSIGN_ADD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
19996: {
19997: return zend_binary_assign_op_helper_SPEC_VAR_CV(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
19998: }
19999:
20000: static int ZEND_FASTCALL ZEND_ASSIGN_SUB_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
20001: {
20002: return zend_binary_assign_op_helper_SPEC_VAR_CV(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
20003: }
20004:
20005: static int ZEND_FASTCALL ZEND_ASSIGN_MUL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
20006: {
20007: return zend_binary_assign_op_helper_SPEC_VAR_CV(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
20008: }
20009:
20010: static int ZEND_FASTCALL ZEND_ASSIGN_DIV_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
20011: {
20012: return zend_binary_assign_op_helper_SPEC_VAR_CV(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
20013: }
20014:
20015: static int ZEND_FASTCALL ZEND_ASSIGN_MOD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
20016: {
20017: return zend_binary_assign_op_helper_SPEC_VAR_CV(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
20018: }
20019:
20020: static int ZEND_FASTCALL ZEND_ASSIGN_SL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
20021: {
20022: return zend_binary_assign_op_helper_SPEC_VAR_CV(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
20023: }
20024:
20025: static int ZEND_FASTCALL ZEND_ASSIGN_SR_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
20026: {
20027: return zend_binary_assign_op_helper_SPEC_VAR_CV(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
20028: }
20029:
20030: static int ZEND_FASTCALL ZEND_ASSIGN_CONCAT_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
20031: {
20032: return zend_binary_assign_op_helper_SPEC_VAR_CV(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
20033: }
20034:
20035: static int ZEND_FASTCALL ZEND_ASSIGN_BW_OR_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
20036: {
20037: return zend_binary_assign_op_helper_SPEC_VAR_CV(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
20038: }
20039:
20040: static int ZEND_FASTCALL ZEND_ASSIGN_BW_AND_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
20041: {
20042: return zend_binary_assign_op_helper_SPEC_VAR_CV(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
20043: }
20044:
20045: static int ZEND_FASTCALL ZEND_ASSIGN_BW_XOR_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
20046: {
20047: return zend_binary_assign_op_helper_SPEC_VAR_CV(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
20048: }
20049:
20050: static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_CV(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS)
20051: {
1.1.1.2 misho 20052: USE_OPLINE
1.1 misho 20053: zend_free_op free_op1;
1.1.1.2 misho 20054: zval **object_ptr;
1.1 misho 20055: zval *object;
1.1.1.2 misho 20056: zval *property;
20057: zval **retval;
1.1 misho 20058: int have_get_ptr = 0;
20059:
1.1.1.2 misho 20060: SAVE_OPLINE();
20061: object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
20062: property = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
20063: retval = &EX_T(opline->result.var).var.ptr;
20064:
20065: if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 20066: zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
20067: }
20068:
20069: make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
20070: object = *object_ptr;
20071:
1.1.1.2 misho 20072: if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
1.1 misho 20073: zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
20074:
1.1.1.2 misho 20075: if (RETURN_VALUE_USED(opline)) {
20076: PZVAL_LOCK(&EG(uninitialized_zval));
20077: *retval = &EG(uninitialized_zval);
1.1 misho 20078: }
20079: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 20080: CHECK_EXCEPTION();
1.1 misho 20081: ZEND_VM_NEXT_OPCODE();
20082: }
20083:
20084: /* here we are sure we are dealing with an object */
20085:
20086: if (0) {
20087: MAKE_REAL_ZVAL_PTR(property);
20088: }
20089:
20090: if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
1.1.1.2 misho 20091: zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 20092: if (zptr != NULL) { /* NULL means no success in getting PTR */
20093: SEPARATE_ZVAL_IF_NOT_REF(zptr);
20094:
20095: have_get_ptr = 1;
20096: incdec_op(*zptr);
1.1.1.2 misho 20097: if (RETURN_VALUE_USED(opline)) {
1.1 misho 20098: *retval = *zptr;
20099: PZVAL_LOCK(*retval);
20100: }
20101: }
20102: }
20103:
20104: if (!have_get_ptr) {
20105: if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
1.1.1.2 misho 20106: zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 20107:
1.1.1.2 misho 20108: if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
1.1 misho 20109: zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
20110:
20111: if (Z_REFCOUNT_P(z) == 0) {
20112: GC_REMOVE_ZVAL_FROM_BUFFER(z);
20113: zval_dtor(z);
20114: FREE_ZVAL(z);
20115: }
20116: z = value;
20117: }
20118: Z_ADDREF_P(z);
20119: SEPARATE_ZVAL_IF_NOT_REF(&z);
20120: incdec_op(z);
20121: *retval = z;
1.1.1.2 misho 20122: Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
20123: SELECTIVE_PZVAL_LOCK(*retval, opline);
1.1 misho 20124: zval_ptr_dtor(&z);
20125: } else {
20126: zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
1.1.1.2 misho 20127: if (RETURN_VALUE_USED(opline)) {
20128: PZVAL_LOCK(&EG(uninitialized_zval));
20129: *retval = &EG(uninitialized_zval);
1.1 misho 20130: }
20131: }
20132: }
20133:
20134: if (0) {
20135: zval_ptr_dtor(&property);
20136: } else {
20137:
20138: }
20139: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 20140: CHECK_EXCEPTION();
1.1 misho 20141: ZEND_VM_NEXT_OPCODE();
20142: }
20143:
20144: static int ZEND_FASTCALL ZEND_PRE_INC_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
20145: {
20146: return zend_pre_incdec_property_helper_SPEC_VAR_CV(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
20147: }
20148:
20149: static int ZEND_FASTCALL ZEND_PRE_DEC_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
20150: {
20151: return zend_pre_incdec_property_helper_SPEC_VAR_CV(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
20152: }
20153:
20154: static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_CV(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS)
20155: {
1.1.1.2 misho 20156: USE_OPLINE
1.1 misho 20157: zend_free_op free_op1;
1.1.1.2 misho 20158: zval **object_ptr;
1.1 misho 20159: zval *object;
1.1.1.2 misho 20160: zval *property;
20161: zval *retval;
1.1 misho 20162: int have_get_ptr = 0;
20163:
1.1.1.2 misho 20164: SAVE_OPLINE();
20165: object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
20166: property = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
20167: retval = &EX_T(opline->result.var).tmp_var;
20168:
20169: if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 20170: zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
20171: }
20172:
20173: make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
20174: object = *object_ptr;
20175:
1.1.1.2 misho 20176: if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
1.1 misho 20177: zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
20178:
1.1.1.2 misho 20179: ZVAL_NULL(retval);
1.1 misho 20180: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 20181: CHECK_EXCEPTION();
1.1 misho 20182: ZEND_VM_NEXT_OPCODE();
20183: }
20184:
20185: /* here we are sure we are dealing with an object */
20186:
20187: if (0) {
20188: MAKE_REAL_ZVAL_PTR(property);
20189: }
20190:
20191: if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
1.1.1.2 misho 20192: zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 20193: if (zptr != NULL) { /* NULL means no success in getting PTR */
20194: have_get_ptr = 1;
20195: SEPARATE_ZVAL_IF_NOT_REF(zptr);
20196:
1.1.1.2 misho 20197: ZVAL_COPY_VALUE(retval, *zptr);
1.1 misho 20198: zendi_zval_copy_ctor(*retval);
20199:
20200: incdec_op(*zptr);
20201:
20202: }
20203: }
20204:
20205: if (!have_get_ptr) {
20206: if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
1.1.1.2 misho 20207: zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 20208: zval *z_copy;
20209:
1.1.1.2 misho 20210: if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
1.1 misho 20211: zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
20212:
20213: if (Z_REFCOUNT_P(z) == 0) {
20214: GC_REMOVE_ZVAL_FROM_BUFFER(z);
20215: zval_dtor(z);
20216: FREE_ZVAL(z);
20217: }
20218: z = value;
20219: }
1.1.1.2 misho 20220: ZVAL_COPY_VALUE(retval, z);
1.1 misho 20221: zendi_zval_copy_ctor(*retval);
20222: ALLOC_ZVAL(z_copy);
1.1.1.2 misho 20223: INIT_PZVAL_COPY(z_copy, z);
1.1 misho 20224: zendi_zval_copy_ctor(*z_copy);
20225: incdec_op(z_copy);
20226: Z_ADDREF_P(z);
1.1.1.2 misho 20227: Z_OBJ_HT_P(object)->write_property(object, property, z_copy, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 20228: zval_ptr_dtor(&z_copy);
20229: zval_ptr_dtor(&z);
20230: } else {
20231: zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
1.1.1.2 misho 20232: ZVAL_NULL(retval);
1.1 misho 20233: }
20234: }
20235:
20236: if (0) {
20237: zval_ptr_dtor(&property);
20238: } else {
20239:
20240: }
20241: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 20242: CHECK_EXCEPTION();
1.1 misho 20243: ZEND_VM_NEXT_OPCODE();
20244: }
20245:
20246: static int ZEND_FASTCALL ZEND_POST_INC_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
20247: {
20248: return zend_post_incdec_property_helper_SPEC_VAR_CV(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
20249: }
20250:
20251: static int ZEND_FASTCALL ZEND_POST_DEC_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
20252: {
20253: return zend_post_incdec_property_helper_SPEC_VAR_CV(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
20254: }
20255:
20256: static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
20257: {
1.1.1.2 misho 20258: USE_OPLINE
1.1 misho 20259: zend_free_op free_op1;
20260: zval **container;
20261:
1.1.1.2 misho 20262: SAVE_OPLINE();
20263:
20264: if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) &&
1.1 misho 20265: IS_VAR != IS_CV &&
1.1.1.2 misho 20266: EX_T(opline->op1.var).var.ptr_ptr) {
20267: PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
1.1 misho 20268: }
1.1.1.2 misho 20269: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
20270: zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC);
1.1 misho 20271:
20272: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 20273: CHECK_EXCEPTION();
1.1 misho 20274: ZEND_VM_NEXT_OPCODE();
20275: }
20276:
20277: static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
20278: {
1.1.1.2 misho 20279: USE_OPLINE
1.1 misho 20280: zend_free_op free_op1;
1.1.1.2 misho 20281: zval **container;
1.1 misho 20282:
1.1.1.2 misho 20283: SAVE_OPLINE();
20284: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
20285:
20286: if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 20287: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
20288: }
1.1.1.2 misho 20289: zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_W TSRMLS_CC);
1.1 misho 20290:
1.1.1.2 misho 20291: if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
20292: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 20293: }
20294: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
20295:
20296: /* We are going to assign the result by reference */
1.1.1.2 misho 20297: if (UNEXPECTED(opline->extended_value != 0)) {
20298: zval **retval_ptr = EX_T(opline->result.var).var.ptr_ptr;
20299:
20300: if (retval_ptr) {
20301: Z_DELREF_PP(retval_ptr);
20302: SEPARATE_ZVAL_TO_MAKE_IS_REF(retval_ptr);
20303: Z_ADDREF_PP(retval_ptr);
20304: }
1.1 misho 20305: }
20306:
1.1.1.2 misho 20307: CHECK_EXCEPTION();
1.1 misho 20308: ZEND_VM_NEXT_OPCODE();
20309: }
20310:
20311: static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
20312: {
1.1.1.2 misho 20313: USE_OPLINE
1.1 misho 20314: zend_free_op free_op1;
1.1.1.2 misho 20315: zval **container;
20316:
20317: SAVE_OPLINE();
20318: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 20319:
1.1.1.2 misho 20320: if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 20321: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
20322: }
1.1.1.2 misho 20323: zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_RW TSRMLS_CC);
1.1 misho 20324:
1.1.1.2 misho 20325: if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
20326: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 20327: }
20328: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 20329: CHECK_EXCEPTION();
1.1 misho 20330: ZEND_VM_NEXT_OPCODE();
20331: }
20332:
20333: static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
20334: {
1.1.1.2 misho 20335: USE_OPLINE
1.1 misho 20336: zend_free_op free_op1;
1.1.1.2 misho 20337: zval **container;
1.1 misho 20338:
1.1.1.2 misho 20339: SAVE_OPLINE();
20340: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
20341: zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_IS TSRMLS_CC);
1.1 misho 20342:
20343: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 20344: CHECK_EXCEPTION();
1.1 misho 20345: ZEND_VM_NEXT_OPCODE();
20346: }
20347:
20348: static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
20349: {
1.1.1.2 misho 20350: USE_OPLINE
1.1 misho 20351: zend_free_op free_op1;
20352: zval **container;
20353:
1.1.1.2 misho 20354: SAVE_OPLINE();
20355:
20356: if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
20357: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
20358: if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 20359: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
20360: }
1.1.1.2 misho 20361: zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_W TSRMLS_CC);
20362: if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
20363: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 20364: }
20365: } else {
20366: if (IS_CV == IS_UNUSED) {
20367: zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
20368: }
1.1.1.2 misho 20369: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
20370: zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC);
1.1 misho 20371: }
20372:
20373: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 20374: CHECK_EXCEPTION();
1.1 misho 20375: ZEND_VM_NEXT_OPCODE();
20376: }
20377:
20378: static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
20379: {
1.1.1.2 misho 20380: USE_OPLINE
1.1 misho 20381: zend_free_op free_op1;
1.1.1.2 misho 20382: zval **container;
20383:
20384: SAVE_OPLINE();
20385: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 20386:
20387: if (IS_VAR == IS_CV) {
20388: if (container != &EG(uninitialized_zval_ptr)) {
20389: SEPARATE_ZVAL_IF_NOT_REF(container);
20390: }
20391: }
1.1.1.2 misho 20392: if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 20393: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
20394: }
1.1.1.2 misho 20395: zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_UNSET TSRMLS_CC);
1.1 misho 20396:
1.1.1.2 misho 20397: if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
20398: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 20399: }
20400: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 20401: if (UNEXPECTED(EX_T(opline->result.var).var.ptr_ptr == NULL)) {
1.1 misho 20402: zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
20403: } else {
20404: zend_free_op free_res;
1.1.1.2 misho 20405: zval **retval_ptr = EX_T(opline->result.var).var.ptr_ptr;
1.1 misho 20406:
1.1.1.2 misho 20407: PZVAL_UNLOCK(*retval_ptr, &free_res);
20408: if (retval_ptr != &EG(uninitialized_zval_ptr)) {
20409: SEPARATE_ZVAL_IF_NOT_REF(retval_ptr);
1.1 misho 20410: }
1.1.1.2 misho 20411: PZVAL_LOCK(*retval_ptr);
1.1 misho 20412: FREE_OP_VAR_PTR(free_res);
1.1.1.2 misho 20413: CHECK_EXCEPTION();
20414: ZEND_VM_NEXT_OPCODE();
1.1 misho 20415: }
20416: }
20417:
1.1.1.2 misho 20418: static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_VAR_CV(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 20419: {
1.1.1.2 misho 20420: USE_OPLINE
1.1 misho 20421: zend_free_op free_op1;
1.1.1.2 misho 20422: zval *container;
1.1 misho 20423:
1.1.1.2 misho 20424: zval *offset;
1.1 misho 20425:
1.1.1.2 misho 20426: SAVE_OPLINE();
20427: container = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
20428: offset = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
20429:
20430: if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
20431: UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
20432: zend_error(E_NOTICE, "Trying to get property of non-object");
20433: PZVAL_LOCK(&EG(uninitialized_zval));
20434: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
1.1 misho 20435:
20436: } else {
20437: zval *retval;
20438:
20439: if (0) {
20440: MAKE_REAL_ZVAL_PTR(offset);
20441: }
20442:
20443: /* here we are sure we are dealing with an object */
1.1.1.2 misho 20444: retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 20445:
1.1.1.2 misho 20446: PZVAL_LOCK(retval);
20447: AI_SET_PTR(&EX_T(opline->result.var), retval);
1.1 misho 20448:
20449: if (0) {
20450: zval_ptr_dtor(&offset);
20451: } else {
20452:
20453: }
20454: }
20455:
20456: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 20457: CHECK_EXCEPTION();
1.1 misho 20458: ZEND_VM_NEXT_OPCODE();
20459: }
20460:
20461: static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
20462: {
1.1.1.2 misho 20463: return zend_fetch_property_address_read_helper_SPEC_VAR_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
1.1 misho 20464: }
20465:
20466: static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
20467: {
1.1.1.2 misho 20468: USE_OPLINE
1.1 misho 20469: zend_free_op free_op1;
1.1.1.2 misho 20470: zval *property;
1.1 misho 20471: zval **container;
20472:
1.1.1.2 misho 20473: SAVE_OPLINE();
20474: property = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
20475:
1.1 misho 20476: if (IS_VAR == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
1.1.1.2 misho 20477: PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
20478: EX_T(opline->op1.var).var.ptr = *EX_T(opline->op1.var).var.ptr_ptr;
1.1 misho 20479: }
20480:
20481: if (0) {
20482: MAKE_REAL_ZVAL_PTR(property);
20483: }
1.1.1.2 misho 20484: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
20485: if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 20486: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
20487: }
1.1.1.2 misho 20488:
20489: zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_W TSRMLS_CC);
1.1 misho 20490: if (0) {
20491: zval_ptr_dtor(&property);
20492: } else {
20493:
20494: }
1.1.1.2 misho 20495: if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
20496: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 20497: }
20498: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
20499:
20500: /* We are going to assign the result by reference */
20501: if (opline->extended_value & ZEND_FETCH_MAKE_REF) {
1.1.1.2 misho 20502: zval **retval_ptr = EX_T(opline->result.var).var.ptr_ptr;
20503:
20504: Z_DELREF_PP(retval_ptr);
20505: SEPARATE_ZVAL_TO_MAKE_IS_REF(retval_ptr);
20506: Z_ADDREF_PP(retval_ptr);
20507: EX_T(opline->result.var).var.ptr = *EX_T(opline->result.var).var.ptr_ptr;
20508: EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
1.1 misho 20509: }
20510:
1.1.1.2 misho 20511: CHECK_EXCEPTION();
1.1 misho 20512: ZEND_VM_NEXT_OPCODE();
20513: }
20514:
20515: static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
20516: {
1.1.1.2 misho 20517: USE_OPLINE
1.1 misho 20518: zend_free_op free_op1;
1.1.1.2 misho 20519: zval *property;
20520: zval **container;
20521:
20522: SAVE_OPLINE();
20523: property = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
20524: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 20525:
20526: if (0) {
20527: MAKE_REAL_ZVAL_PTR(property);
20528: }
1.1.1.2 misho 20529: if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 20530: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
20531: }
1.1.1.2 misho 20532: zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_RW TSRMLS_CC);
1.1 misho 20533: if (0) {
20534: zval_ptr_dtor(&property);
20535: } else {
20536:
20537: }
1.1.1.2 misho 20538: if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
20539: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 20540: }
20541: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 20542: CHECK_EXCEPTION();
1.1 misho 20543: ZEND_VM_NEXT_OPCODE();
20544: }
20545:
20546: static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
20547: {
1.1.1.2 misho 20548: USE_OPLINE
20549: zend_free_op free_op1;
20550: zval *container;
20551:
20552: zval *offset;
20553:
20554: SAVE_OPLINE();
20555: container = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
20556: offset = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
20557:
20558: if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
20559: UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
20560: PZVAL_LOCK(&EG(uninitialized_zval));
20561: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
20562:
20563: } else {
20564: zval *retval;
20565:
20566: if (0) {
20567: MAKE_REAL_ZVAL_PTR(offset);
20568: }
20569:
20570: /* here we are sure we are dealing with an object */
20571: retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
20572:
20573: PZVAL_LOCK(retval);
20574: AI_SET_PTR(&EX_T(opline->result.var), retval);
20575:
20576: if (0) {
20577: zval_ptr_dtor(&offset);
20578: } else {
20579:
20580: }
20581: }
20582:
20583: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
20584: CHECK_EXCEPTION();
20585: ZEND_VM_NEXT_OPCODE();
1.1 misho 20586: }
20587:
20588: static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
20589: {
1.1.1.2 misho 20590: USE_OPLINE
1.1 misho 20591:
1.1.1.2 misho 20592: if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
1.1 misho 20593: /* Behave like FETCH_OBJ_W */
20594: zend_free_op free_op1;
1.1.1.2 misho 20595: zval *property;
20596: zval **container;
20597:
20598: SAVE_OPLINE();
20599: property = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
20600: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 20601:
20602: if (0) {
20603: MAKE_REAL_ZVAL_PTR(property);
20604: }
1.1.1.2 misho 20605: if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 20606: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
20607: }
1.1.1.2 misho 20608: zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_W TSRMLS_CC);
1.1 misho 20609: if (0) {
20610: zval_ptr_dtor(&property);
20611: } else {
20612:
20613: }
1.1.1.2 misho 20614: if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
20615: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 20616: }
20617: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
1.1.1.2 misho 20618: CHECK_EXCEPTION();
1.1 misho 20619: ZEND_VM_NEXT_OPCODE();
20620: } else {
1.1.1.2 misho 20621: return zend_fetch_property_address_read_helper_SPEC_VAR_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
1.1 misho 20622: }
20623: }
20624:
20625: static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
20626: {
1.1.1.2 misho 20627: USE_OPLINE
1.1 misho 20628: zend_free_op free_op1, free_res;
1.1.1.2 misho 20629: zval **container;
20630: zval *property;
20631:
20632: SAVE_OPLINE();
20633: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
20634: property = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
1.1 misho 20635:
20636: if (IS_VAR == IS_CV) {
20637: if (container != &EG(uninitialized_zval_ptr)) {
20638: SEPARATE_ZVAL_IF_NOT_REF(container);
20639: }
20640: }
20641: if (0) {
20642: MAKE_REAL_ZVAL_PTR(property);
20643: }
1.1.1.2 misho 20644: if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 20645: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
20646: }
1.1.1.2 misho 20647: zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_UNSET TSRMLS_CC);
1.1 misho 20648: if (0) {
20649: zval_ptr_dtor(&property);
20650: } else {
20651:
20652: }
1.1.1.2 misho 20653: if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
20654: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 20655: }
20656: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
20657:
1.1.1.2 misho 20658: PZVAL_UNLOCK(*EX_T(opline->result.var).var.ptr_ptr, &free_res);
20659: if (EX_T(opline->result.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) {
20660: SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.var).var.ptr_ptr);
1.1 misho 20661: }
1.1.1.2 misho 20662: PZVAL_LOCK(*EX_T(opline->result.var).var.ptr_ptr);
1.1 misho 20663: FREE_OP_VAR_PTR(free_res);
1.1.1.2 misho 20664: CHECK_EXCEPTION();
1.1 misho 20665: ZEND_VM_NEXT_OPCODE();
20666: }
20667:
20668: static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
20669: {
1.1.1.2 misho 20670: USE_OPLINE
1.1 misho 20671: zend_free_op free_op1;
1.1.1.2 misho 20672: zval **object_ptr;
20673: zval *property_name;
20674:
20675: SAVE_OPLINE();
20676: object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
20677: property_name = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
1.1 misho 20678:
20679: if (0) {
20680: MAKE_REAL_ZVAL_PTR(property_name);
20681: }
1.1.1.2 misho 20682: if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 20683: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
20684: }
1.1.1.2 misho 20685: zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), ZEND_ASSIGN_OBJ, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 20686: if (0) {
20687: zval_ptr_dtor(&property_name);
20688: } else {
20689:
20690: }
20691: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
20692: /* assign_obj has two opcodes! */
1.1.1.2 misho 20693: CHECK_EXCEPTION();
1.1 misho 20694: ZEND_VM_INC_OPCODE();
20695: ZEND_VM_NEXT_OPCODE();
20696: }
20697:
20698: static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
20699: {
1.1.1.2 misho 20700: USE_OPLINE
1.1 misho 20701: zend_free_op free_op1;
1.1.1.2 misho 20702: zval **object_ptr;
20703:
20704: SAVE_OPLINE();
20705: object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 20706:
1.1.1.2 misho 20707: if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 20708: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
20709: }
20710: if (Z_TYPE_PP(object_ptr) == IS_OBJECT) {
20711:
1.1.1.2 misho 20712: zval *property_name = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
1.1 misho 20713:
20714: if (0) {
20715: MAKE_REAL_ZVAL_PTR(property_name);
20716: }
1.1.1.2 misho 20717: zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), ZEND_ASSIGN_DIM, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 20718: if (0) {
20719: zval_ptr_dtor(&property_name);
20720: } else {
20721:
20722: }
20723: } else {
20724: zend_free_op free_op_data1, free_op_data2;
20725: zval *value;
1.1.1.2 misho 20726: zval *dim = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
1.1 misho 20727: zval **variable_ptr_ptr;
20728:
1.1.1.2 misho 20729: zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), object_ptr, dim, IS_CV, BP_VAR_W TSRMLS_CC);
1.1 misho 20730:
1.1.1.2 misho 20731: value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R);
20732: variable_ptr_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC);
20733: if (UNEXPECTED(variable_ptr_ptr == NULL)) {
20734: if (zend_assign_to_string_offset(&EX_T((opline+1)->op2.var), value, (opline+1)->op1_type TSRMLS_CC)) {
20735: if (RETURN_VALUE_USED(opline)) {
20736: zval *retval;
20737:
20738: ALLOC_ZVAL(retval);
20739: ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T((opline+1)->op2.var).str_offset.str)+EX_T((opline+1)->op2.var).str_offset.offset, 1, 1);
20740: INIT_PZVAL(retval);
20741: AI_SET_PTR(&EX_T(opline->result.var), retval);
20742: }
20743: } else if (RETURN_VALUE_USED(opline)) {
20744: PZVAL_LOCK(&EG(uninitialized_zval));
20745: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
20746: }
20747: } else if (UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) {
20748: if (IS_TMP_FREE(free_op_data1)) {
20749: zval_dtor(value);
20750: }
20751: if (RETURN_VALUE_USED(opline)) {
20752: PZVAL_LOCK(&EG(uninitialized_zval));
20753: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
20754: }
20755: } else {
20756: if ((opline+1)->op1_type == IS_TMP_VAR) {
20757: value = zend_assign_tmp_to_variable(variable_ptr_ptr, value TSRMLS_CC);
20758: } else if ((opline+1)->op1_type == IS_CONST) {
20759: value = zend_assign_const_to_variable(variable_ptr_ptr, value TSRMLS_CC);
20760: } else {
20761: value = zend_assign_to_variable(variable_ptr_ptr, value TSRMLS_CC);
20762: }
20763: if (RETURN_VALUE_USED(opline)) {
1.1 misho 20764: PZVAL_LOCK(value);
1.1.1.2 misho 20765: AI_SET_PTR(&EX_T(opline->result.var), value);
1.1 misho 20766: }
20767: }
20768: FREE_OP_VAR_PTR(free_op_data2);
20769: FREE_OP_IF_VAR(free_op_data1);
20770: }
20771: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
20772: /* assign_dim has two opcodes! */
1.1.1.2 misho 20773: CHECK_EXCEPTION();
1.1 misho 20774: ZEND_VM_INC_OPCODE();
20775: ZEND_VM_NEXT_OPCODE();
20776: }
20777:
20778: static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
20779: {
1.1.1.2 misho 20780: USE_OPLINE
1.1 misho 20781: zend_free_op free_op1;
1.1.1.2 misho 20782: zval *value;
20783: zval **variable_ptr_ptr;
1.1 misho 20784:
1.1.1.2 misho 20785: SAVE_OPLINE();
20786: value = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
20787: variable_ptr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
20788:
20789: if (IS_VAR == IS_VAR && UNEXPECTED(variable_ptr_ptr == NULL)) {
20790: if (zend_assign_to_string_offset(&EX_T(opline->op1.var), value, IS_CV TSRMLS_CC)) {
20791: if (RETURN_VALUE_USED(opline)) {
20792: zval *retval;
20793:
20794: ALLOC_ZVAL(retval);
20795: ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T(opline->op1.var).str_offset.str)+EX_T(opline->op1.var).str_offset.offset, 1, 1);
20796: INIT_PZVAL(retval);
20797: AI_SET_PTR(&EX_T(opline->result.var), retval);
20798: }
20799: } else if (RETURN_VALUE_USED(opline)) {
20800: PZVAL_LOCK(&EG(uninitialized_zval));
20801: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
20802: }
20803: } else if (IS_VAR == IS_VAR && UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) {
20804: if (0) {
20805: zval_dtor(value);
20806: }
20807: if (RETURN_VALUE_USED(opline)) {
20808: PZVAL_LOCK(&EG(uninitialized_zval));
20809: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
20810: }
20811: } else {
20812: if (IS_CV == IS_TMP_VAR) {
20813: value = zend_assign_tmp_to_variable(variable_ptr_ptr, value TSRMLS_CC);
20814: } else if (IS_CV == IS_CONST) {
20815: value = zend_assign_const_to_variable(variable_ptr_ptr, value TSRMLS_CC);
20816: } else {
20817: value = zend_assign_to_variable(variable_ptr_ptr, value TSRMLS_CC);
20818: }
20819: if (RETURN_VALUE_USED(opline)) {
1.1 misho 20820: PZVAL_LOCK(value);
1.1.1.2 misho 20821: AI_SET_PTR(&EX_T(opline->result.var), value);
1.1 misho 20822: }
20823: }
20824:
20825: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
20826:
20827: /* zend_assign_to_variable() always takes care of op2, never free it! */
20828:
1.1.1.2 misho 20829: CHECK_EXCEPTION();
1.1 misho 20830: ZEND_VM_NEXT_OPCODE();
20831: }
20832:
20833: static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
20834: {
1.1.1.2 misho 20835: USE_OPLINE
1.1 misho 20836: zend_free_op free_op1, free_op2;
20837: zval **variable_ptr_ptr;
1.1.1.2 misho 20838: zval **value_ptr_ptr;
20839:
20840: SAVE_OPLINE();
20841: value_ptr_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op2.var TSRMLS_CC);
1.1 misho 20842:
20843: if (IS_CV == IS_VAR &&
20844: value_ptr_ptr &&
20845: !Z_ISREF_PP(value_ptr_ptr) &&
20846: opline->extended_value == ZEND_RETURNS_FUNCTION &&
1.1.1.2 misho 20847: !EX_T(opline->op2.var).var.fcall_returned_reference) {
1.1 misho 20848: if (free_op2.var == NULL) {
20849: PZVAL_LOCK(*value_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */
20850: }
20851: zend_error(E_STRICT, "Only variables should be assigned by reference");
20852: if (UNEXPECTED(EG(exception) != NULL)) {
20853:
1.1.1.2 misho 20854: HANDLE_EXCEPTION();
1.1 misho 20855: }
20856: return ZEND_ASSIGN_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
20857: } else if (IS_CV == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) {
20858: PZVAL_LOCK(*value_ptr_ptr);
20859: }
1.1.1.2 misho 20860: if (IS_VAR == IS_VAR && UNEXPECTED(EX_T(opline->op1.var).var.ptr_ptr == &EX_T(opline->op1.var).var.ptr)) {
1.1 misho 20861: zend_error_noreturn(E_ERROR, "Cannot assign by reference to overloaded object");
20862: }
20863:
1.1.1.2 misho 20864: variable_ptr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
20865: if ((IS_CV == IS_VAR && UNEXPECTED(value_ptr_ptr == NULL)) ||
20866: (IS_VAR == IS_VAR && UNEXPECTED(variable_ptr_ptr == NULL))) {
1.1 misho 20867: zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets nor overloaded objects");
20868: }
20869: zend_assign_to_variable_reference(variable_ptr_ptr, value_ptr_ptr TSRMLS_CC);
20870:
20871: if (IS_CV == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) {
20872: Z_DELREF_PP(variable_ptr_ptr);
20873: }
20874:
1.1.1.2 misho 20875: if (RETURN_VALUE_USED(opline)) {
1.1 misho 20876: PZVAL_LOCK(*variable_ptr_ptr);
1.1.1.2 misho 20877: AI_SET_PTR(&EX_T(opline->result.var), *variable_ptr_ptr);
1.1 misho 20878: }
20879:
20880: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
20881:
1.1.1.2 misho 20882: CHECK_EXCEPTION();
1.1 misho 20883: ZEND_VM_NEXT_OPCODE();
20884: }
20885:
20886: static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
20887: {
1.1.1.2 misho 20888: USE_OPLINE
1.1 misho 20889: zval *function_name;
20890: char *function_name_strval;
20891: int function_name_strlen;
20892: zend_free_op free_op1;
20893:
1.1.1.2 misho 20894: SAVE_OPLINE();
1.1 misho 20895: zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
20896:
1.1.1.2 misho 20897: function_name = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
1.1 misho 20898:
1.1.1.2 misho 20899: if (IS_CV != IS_CONST &&
20900: UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
1.1 misho 20901: zend_error_noreturn(E_ERROR, "Method name must be a string");
20902: }
20903:
20904: function_name_strval = Z_STRVAL_P(function_name);
20905: function_name_strlen = Z_STRLEN_P(function_name);
20906:
1.1.1.2 misho 20907: EX(object) = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 20908:
1.1.1.2 misho 20909: if (EXPECTED(EX(object) != NULL) &&
20910: EXPECTED(Z_TYPE_P(EX(object)) == IS_OBJECT)) {
20911: EX(called_scope) = Z_OBJCE_P(EX(object));
1.1 misho 20912:
1.1.1.2 misho 20913: if (IS_CV != IS_CONST ||
20914: (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope))) == NULL) {
20915: zval *object = EX(object);
20916:
20917: if (UNEXPECTED(Z_OBJ_HT_P(EX(object))->get_method == NULL)) {
20918: zend_error_noreturn(E_ERROR, "Object does not support method calls");
20919: }
20920:
20921: /* First, locate the function. */
20922: EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen, ((IS_CV == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC);
20923: if (UNEXPECTED(EX(fbc) == NULL)) {
20924: zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval);
20925: }
20926: if (IS_CV == IS_CONST &&
20927: EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) &&
20928: EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) &&
20929: EXPECTED(EX(object) == object)) {
20930: CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope), EX(fbc));
20931: }
1.1 misho 20932: }
20933: } else {
20934: zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval);
20935: }
20936:
20937: if ((EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) != 0) {
20938: EX(object) = NULL;
20939: } else {
20940: if (!PZVAL_IS_REF(EX(object))) {
20941: Z_ADDREF_P(EX(object)); /* For $this pointer */
20942: } else {
20943: zval *this_ptr;
20944: ALLOC_ZVAL(this_ptr);
20945: INIT_PZVAL_COPY(this_ptr, EX(object));
20946: zval_copy_ctor(this_ptr);
20947: EX(object) = this_ptr;
20948: }
20949: }
20950:
20951: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
20952:
1.1.1.2 misho 20953: CHECK_EXCEPTION();
1.1 misho 20954: ZEND_VM_NEXT_OPCODE();
20955: }
20956:
20957: static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
20958: {
1.1.1.2 misho 20959: USE_OPLINE
1.1 misho 20960: zval *function_name;
20961: zend_class_entry *ce;
20962:
1.1.1.2 misho 20963: SAVE_OPLINE();
1.1 misho 20964: zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
20965:
20966: if (IS_VAR == IS_CONST) {
20967: /* no function found. try a static method in class */
1.1.1.2 misho 20968: if (CACHED_PTR(opline->op1.literal->cache_slot)) {
20969: ce = CACHED_PTR(opline->op1.literal->cache_slot);
20970: } else {
20971: ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
1.1.1.4 ! misho 20972: if (UNEXPECTED(EG(exception) != NULL)) {
! 20973: HANDLE_EXCEPTION();
! 20974: }
1.1.1.2 misho 20975: if (UNEXPECTED(ce == NULL)) {
1.1.1.4 ! misho 20976: zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv));
1.1.1.2 misho 20977: }
20978: CACHE_PTR(opline->op1.literal->cache_slot, ce);
1.1 misho 20979: }
20980: EX(called_scope) = ce;
20981: } else {
1.1.1.2 misho 20982: ce = EX_T(opline->op1.var).class_entry;
1.1 misho 20983:
1.1.1.2 misho 20984: if (opline->extended_value == ZEND_FETCH_CLASS_PARENT || opline->extended_value == ZEND_FETCH_CLASS_SELF) {
1.1 misho 20985: EX(called_scope) = EG(called_scope);
20986: } else {
20987: EX(called_scope) = ce;
20988: }
20989: }
1.1.1.2 misho 20990:
20991: if (IS_VAR == IS_CONST &&
20992: IS_CV == IS_CONST &&
20993: CACHED_PTR(opline->op2.literal->cache_slot)) {
20994: EX(fbc) = CACHED_PTR(opline->op2.literal->cache_slot);
20995: } else if (IS_VAR != IS_CONST &&
20996: IS_CV == IS_CONST &&
20997: (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce))) {
20998: /* do nothing */
20999: } else if (IS_CV != IS_UNUSED) {
1.1 misho 21000: char *function_name_strval = NULL;
21001: int function_name_strlen = 0;
21002:
21003:
21004: if (IS_CV == IS_CONST) {
1.1.1.2 misho 21005: function_name_strval = Z_STRVAL_P(opline->op2.zv);
21006: function_name_strlen = Z_STRLEN_P(opline->op2.zv);
1.1 misho 21007: } else {
1.1.1.2 misho 21008: function_name = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
1.1 misho 21009:
1.1.1.2 misho 21010: if (UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
1.1 misho 21011: zend_error_noreturn(E_ERROR, "Function name must be a string");
21012: } else {
21013: function_name_strval = Z_STRVAL_P(function_name);
21014: function_name_strlen = Z_STRLEN_P(function_name);
21015: }
21016: }
21017:
21018: if (function_name_strval) {
21019: if (ce->get_static_method) {
21020: EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
21021: } else {
1.1.1.2 misho 21022: EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen, ((IS_CV == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC);
1.1 misho 21023: }
1.1.1.2 misho 21024: if (UNEXPECTED(EX(fbc) == NULL)) {
1.1 misho 21025: zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name, function_name_strval);
21026: }
1.1.1.2 misho 21027: if (IS_CV == IS_CONST &&
21028: EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) &&
21029: EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0)) {
21030: if (IS_VAR == IS_CONST) {
21031: CACHE_PTR(opline->op2.literal->cache_slot, EX(fbc));
21032: } else {
21033: CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce, EX(fbc));
21034: }
21035: }
1.1 misho 21036: }
21037: if (IS_CV != IS_CONST) {
21038:
21039: }
21040: } else {
1.1.1.2 misho 21041: if (UNEXPECTED(ce->constructor == NULL)) {
1.1 misho 21042: zend_error_noreturn(E_ERROR, "Cannot call constructor");
21043: }
21044: if (EG(This) && Z_OBJCE_P(EG(This)) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) {
1.1.1.2 misho 21045: zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name);
1.1 misho 21046: }
21047: EX(fbc) = ce->constructor;
21048: }
21049:
21050: if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) {
21051: EX(object) = NULL;
21052: } else {
21053: if (EG(This) &&
21054: Z_OBJ_HT_P(EG(This))->get_class_entry &&
21055: !instanceof_function(Z_OBJCE_P(EG(This)), ce TSRMLS_CC)) {
21056: /* We are calling method of the other (incompatible) class,
21057: but passing $this. This is done for compatibility with php-4. */
21058: if (EX(fbc)->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
1.1.1.2 misho 21059: zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", EX(fbc)->common.scope->name, EX(fbc)->common.function_name);
1.1 misho 21060: } else {
21061: /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
1.1.1.2 misho 21062: zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", EX(fbc)->common.scope->name, EX(fbc)->common.function_name);
1.1 misho 21063: }
21064: }
21065: if ((EX(object) = EG(This))) {
21066: Z_ADDREF_P(EX(object));
21067: EX(called_scope) = Z_OBJCE_P(EX(object));
21068: }
21069: }
21070:
1.1.1.2 misho 21071: CHECK_EXCEPTION();
1.1 misho 21072: ZEND_VM_NEXT_OPCODE();
21073: }
21074:
21075: static int ZEND_FASTCALL ZEND_CASE_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
21076: {
1.1.1.2 misho 21077: USE_OPLINE
1.1 misho 21078: zend_free_op free_op1;
21079:
1.1.1.2 misho 21080: SAVE_OPLINE();
1.1 misho 21081: if (IS_VAR==IS_VAR) {
1.1.1.2 misho 21082: PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
1.1 misho 21083: }
1.1.1.2 misho 21084: is_equal_function(&EX_T(opline->result.var).tmp_var,
21085: _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC),
21086: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
21087:
21088: CHECK_EXCEPTION();
1.1 misho 21089: ZEND_VM_NEXT_OPCODE();
21090: }
21091:
21092: static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
21093: {
1.1.1.2 misho 21094: USE_OPLINE
1.1 misho 21095: zend_free_op free_op1;
21096: zval *expr_ptr;
21097:
1.1.1.2 misho 21098: SAVE_OPLINE();
21099: if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && opline->extended_value) {
21100: zval **expr_ptr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 21101:
1.1.1.2 misho 21102: if (IS_VAR == IS_VAR && UNEXPECTED(expr_ptr_ptr == NULL)) {
21103: zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
21104: }
21105: SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr);
1.1 misho 21106: expr_ptr = *expr_ptr_ptr;
1.1.1.2 misho 21107: Z_ADDREF_P(expr_ptr);
1.1 misho 21108: } else {
1.1.1.2 misho 21109: expr_ptr=_get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
21110: if (0) { /* temporary variable */
21111: zval *new_expr;
1.1 misho 21112:
1.1.1.2 misho 21113: ALLOC_ZVAL(new_expr);
21114: INIT_PZVAL_COPY(new_expr, expr_ptr);
21115: expr_ptr = new_expr;
21116: } else if (IS_VAR == IS_CONST || PZVAL_IS_REF(expr_ptr)) {
1.1 misho 21117: zval *new_expr;
21118:
21119: ALLOC_ZVAL(new_expr);
21120: INIT_PZVAL_COPY(new_expr, expr_ptr);
21121: expr_ptr = new_expr;
21122: zendi_zval_copy_ctor(*expr_ptr);
21123: } else {
21124: Z_ADDREF_P(expr_ptr);
21125: }
21126: }
1.1.1.2 misho 21127:
21128: if (IS_CV != IS_UNUSED) {
21129:
21130: zval *offset = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
21131: ulong hval;
21132:
1.1 misho 21133: switch (Z_TYPE_P(offset)) {
21134: case IS_DOUBLE:
1.1.1.2 misho 21135: hval = zend_dval_to_lval(Z_DVAL_P(offset));
21136: goto num_index;
1.1 misho 21137: case IS_LONG:
21138: case IS_BOOL:
1.1.1.2 misho 21139: hval = Z_LVAL_P(offset);
21140: num_index:
21141: zend_hash_index_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), hval, &expr_ptr, sizeof(zval *), NULL);
1.1 misho 21142: break;
21143: case IS_STRING:
1.1.1.2 misho 21144: if (IS_CV == IS_CONST) {
21145: hval = Z_HASH_P(offset);
21146: } else {
21147: ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
21148: if (IS_INTERNED(Z_STRVAL_P(offset))) {
21149: hval = INTERNED_HASH(Z_STRVAL_P(offset));
21150: } else {
21151: hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
21152: }
21153: }
21154: zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
1.1 misho 21155: break;
21156: case IS_NULL:
1.1.1.2 misho 21157: zend_hash_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
1.1 misho 21158: break;
21159: default:
21160: zend_error(E_WARNING, "Illegal offset type");
21161: zval_ptr_dtor(&expr_ptr);
21162: /* do nothing */
21163: break;
21164: }
21165:
21166: } else {
1.1.1.2 misho 21167: zend_hash_next_index_insert(Z_ARRVAL(EX_T(opline->result.var).tmp_var), &expr_ptr, sizeof(zval *), NULL);
1.1 misho 21168: }
1.1.1.2 misho 21169: if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && opline->extended_value) {
1.1 misho 21170: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
21171: } else {
21172: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
21173: }
1.1.1.2 misho 21174: CHECK_EXCEPTION();
1.1 misho 21175: ZEND_VM_NEXT_OPCODE();
21176: }
21177:
21178: static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
21179: {
1.1.1.2 misho 21180: USE_OPLINE
1.1 misho 21181:
1.1.1.2 misho 21182: array_init(&EX_T(opline->result.var).tmp_var);
1.1 misho 21183: if (IS_VAR == IS_UNUSED) {
21184: ZEND_VM_NEXT_OPCODE();
21185: #if 0 || IS_VAR != IS_UNUSED
21186: } else {
21187: return ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
21188: #endif
21189: }
21190: }
21191:
21192: static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
21193: {
1.1.1.2 misho 21194: USE_OPLINE
1.1 misho 21195: zend_free_op free_op1;
1.1.1.2 misho 21196: zval **container;
1.1 misho 21197: zval *offset;
1.1.1.2 misho 21198: ulong hval;
1.1 misho 21199:
1.1.1.2 misho 21200: SAVE_OPLINE();
21201: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 21202: if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) {
21203: SEPARATE_ZVAL_IF_NOT_REF(container);
21204: }
1.1.1.2 misho 21205: offset = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
1.1 misho 21206:
21207: if (IS_VAR != IS_VAR || container) {
21208: switch (Z_TYPE_PP(container)) {
21209: case IS_ARRAY: {
21210: HashTable *ht = Z_ARRVAL_PP(container);
21211:
21212: switch (Z_TYPE_P(offset)) {
21213: case IS_DOUBLE:
1.1.1.2 misho 21214: hval = zend_dval_to_lval(Z_DVAL_P(offset));
1.1.1.3 misho 21215: zend_hash_index_del(ht, hval);
21216: break;
1.1 misho 21217: case IS_RESOURCE:
21218: case IS_BOOL:
21219: case IS_LONG:
1.1.1.2 misho 21220: hval = Z_LVAL_P(offset);
21221: zend_hash_index_del(ht, hval);
1.1 misho 21222: break;
21223: case IS_STRING:
21224: if (IS_CV == IS_CV || IS_CV == IS_VAR) {
21225: Z_ADDREF_P(offset);
21226: }
1.1.1.2 misho 21227: if (IS_CV == IS_CONST) {
21228: hval = Z_HASH_P(offset);
21229: } else {
21230: ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_dim);
21231: if (IS_INTERNED(Z_STRVAL_P(offset))) {
21232: hval = INTERNED_HASH(Z_STRVAL_P(offset));
21233: } else {
21234: hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
1.1 misho 21235: }
21236: }
1.1.1.2 misho 21237: if (ht == &EG(symbol_table)) {
21238: zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC);
21239: } else {
21240: zend_hash_quick_del(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval);
21241: }
21242: if (IS_CV == IS_CV || IS_CV == IS_VAR) {
21243: zval_ptr_dtor(&offset);
21244: }
21245: break;
21246: num_index_dim:
21247: zend_hash_index_del(ht, hval);
1.1 misho 21248: if (IS_CV == IS_CV || IS_CV == IS_VAR) {
21249: zval_ptr_dtor(&offset);
21250: }
21251: break;
21252: case IS_NULL:
21253: zend_hash_del(ht, "", sizeof(""));
21254: break;
21255: default:
21256: zend_error(E_WARNING, "Illegal offset type in unset");
21257: break;
21258: }
21259:
21260: break;
21261: }
21262: case IS_OBJECT:
1.1.1.2 misho 21263: if (UNEXPECTED(Z_OBJ_HT_P(*container)->unset_dimension == NULL)) {
1.1 misho 21264: zend_error_noreturn(E_ERROR, "Cannot use object as array");
21265: }
21266: if (0) {
21267: MAKE_REAL_ZVAL_PTR(offset);
21268: }
21269: Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC);
21270: if (0) {
21271: zval_ptr_dtor(&offset);
21272: } else {
21273:
21274: }
21275: break;
21276: case IS_STRING:
21277: zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
21278: ZEND_VM_CONTINUE(); /* bailed out before */
21279: default:
21280:
21281: break;
21282: }
21283: } else {
21284:
21285: }
21286: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
21287:
1.1.1.2 misho 21288: CHECK_EXCEPTION();
1.1 misho 21289: ZEND_VM_NEXT_OPCODE();
21290: }
21291:
21292: static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
21293: {
1.1.1.2 misho 21294: USE_OPLINE
1.1 misho 21295: zend_free_op free_op1;
1.1.1.2 misho 21296: zval **container;
21297: zval *offset;
21298:
21299: SAVE_OPLINE();
21300: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
21301: offset = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
1.1 misho 21302:
21303: if (IS_VAR != IS_VAR || container) {
21304: if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) {
21305: SEPARATE_ZVAL_IF_NOT_REF(container);
21306: }
21307: if (Z_TYPE_PP(container) == IS_OBJECT) {
21308: if (0) {
21309: MAKE_REAL_ZVAL_PTR(offset);
21310: }
21311: if (Z_OBJ_HT_P(*container)->unset_property) {
1.1.1.2 misho 21312: Z_OBJ_HT_P(*container)->unset_property(*container, offset, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 21313: } else {
21314: zend_error(E_NOTICE, "Trying to unset property of non-object");
21315: }
21316: if (0) {
21317: zval_ptr_dtor(&offset);
21318: } else {
21319:
21320: }
21321: } else {
21322:
21323: }
21324: } else {
21325:
21326: }
21327: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
21328:
1.1.1.2 misho 21329: CHECK_EXCEPTION();
1.1 misho 21330: ZEND_VM_NEXT_OPCODE();
21331: }
21332:
21333: static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_CV(int prop_dim, ZEND_OPCODE_HANDLER_ARGS)
21334: {
1.1.1.2 misho 21335: USE_OPLINE
1.1 misho 21336: zend_free_op free_op1;
1.1.1.2 misho 21337: zval **container;
1.1 misho 21338: zval **value = NULL;
21339: int result = 0;
1.1.1.2 misho 21340: ulong hval;
21341: zval *offset;
1.1 misho 21342:
1.1.1.2 misho 21343: SAVE_OPLINE();
21344: container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
1.1 misho 21345:
1.1.1.2 misho 21346: offset = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
1.1 misho 21347:
1.1.1.2 misho 21348: if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) {
21349: HashTable *ht;
21350: int isset = 0;
1.1 misho 21351:
1.1.1.2 misho 21352: ht = Z_ARRVAL_PP(container);
1.1 misho 21353:
1.1.1.2 misho 21354: switch (Z_TYPE_P(offset)) {
21355: case IS_DOUBLE:
21356: hval = zend_dval_to_lval(Z_DVAL_P(offset));
21357: goto num_index_prop;
21358: case IS_RESOURCE:
21359: case IS_BOOL:
21360: case IS_LONG:
21361: hval = Z_LVAL_P(offset);
21362: num_index_prop:
21363: if (zend_hash_index_find(ht, hval, (void **) &value) == SUCCESS) {
21364: isset = 1;
21365: }
21366: break;
21367: case IS_STRING:
21368: if (IS_CV == IS_CONST) {
21369: hval = Z_HASH_P(offset);
21370: } else {
21371: if (!prop_dim) {
21372: ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_prop);
1.1 misho 21373: }
1.1.1.2 misho 21374: if (IS_INTERNED(Z_STRVAL_P(offset))) {
21375: hval = INTERNED_HASH(Z_STRVAL_P(offset));
1.1 misho 21376: } else {
1.1.1.2 misho 21377: hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
1.1 misho 21378: }
21379: }
1.1.1.2 misho 21380: if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) {
21381: isset = 1;
21382: }
21383: break;
21384: case IS_NULL:
21385: if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) {
21386: isset = 1;
1.1 misho 21387: }
1.1.1.2 misho 21388: break;
21389: default:
21390: zend_error(E_WARNING, "Illegal offset type in isset or empty");
21391: break;
21392: }
21393:
21394: if (opline->extended_value & ZEND_ISSET) {
21395: if (isset && Z_TYPE_PP(value) == IS_NULL) {
21396: result = 0;
21397: } else {
21398: result = isset;
1.1 misho 21399: }
1.1.1.2 misho 21400: } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
21401: if (!isset || !i_zend_is_true(*value)) {
21402: result = 0;
1.1 misho 21403: } else {
1.1.1.2 misho 21404: result = 1;
21405: }
21406: }
1.1 misho 21407:
1.1.1.2 misho 21408: } else if (Z_TYPE_PP(container) == IS_OBJECT) {
21409: if (0) {
21410: MAKE_REAL_ZVAL_PTR(offset);
21411: }
21412: if (prop_dim) {
21413: if (Z_OBJ_HT_P(*container)->has_property) {
21414: result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
21415: } else {
21416: zend_error(E_NOTICE, "Trying to check property of non-object");
21417: result = 0;
21418: }
21419: } else {
21420: if (Z_OBJ_HT_P(*container)->has_dimension) {
21421: result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0 TSRMLS_CC);
21422: } else {
21423: zend_error(E_NOTICE, "Trying to check element of non-array");
21424: result = 0;
1.1 misho 21425: }
1.1.1.2 misho 21426: }
21427: if (0) {
21428: zval_ptr_dtor(&offset);
21429: } else {
21430:
21431: }
21432: } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */
21433: zval tmp;
1.1 misho 21434:
1.1.1.2 misho 21435: if (Z_TYPE_P(offset) != IS_LONG) {
21436: if (Z_TYPE_P(offset) <= IS_BOOL /* simple scalar types */
21437: || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */
21438: && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) {
21439: ZVAL_COPY_VALUE(&tmp, offset);
1.1 misho 21440: zval_copy_ctor(&tmp);
21441: convert_to_long(&tmp);
21442: offset = &tmp;
1.1.1.2 misho 21443: } else {
21444: /* can not be converted to proper offset, return "not set" */
21445: result = 0;
1.1 misho 21446: }
1.1.1.2 misho 21447: }
21448: if (Z_TYPE_P(offset) == IS_LONG) {
21449: if (opline->extended_value & ZEND_ISSET) {
21450: if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
21451: result = 1;
21452: }
21453: } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
21454: if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') {
21455: result = 1;
1.1 misho 21456: }
21457: }
1.1.1.2 misho 21458: }
1.1 misho 21459:
1.1.1.2 misho 21460: } else {
1.1 misho 21461:
21462: }
21463:
1.1.1.2 misho 21464: Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
21465: if (opline->extended_value & ZEND_ISSET) {
21466: Z_LVAL(EX_T(opline->result.var).tmp_var) = result;
21467: } else {
21468: Z_LVAL(EX_T(opline->result.var).tmp_var) = !result;
1.1 misho 21469: }
21470:
21471: if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
21472:
1.1.1.2 misho 21473: CHECK_EXCEPTION();
1.1 misho 21474: ZEND_VM_NEXT_OPCODE();
21475: }
21476:
21477: static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
21478: {
21479: return zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_CV(0, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
21480: }
21481:
21482: static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
21483: {
21484: return zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_CV(1, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
21485: }
21486:
21487: static int ZEND_FASTCALL ZEND_CLONE_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
21488: {
1.1.1.2 misho 21489: USE_OPLINE
1.1 misho 21490:
1.1.1.2 misho 21491: zval *obj;
1.1 misho 21492: zend_class_entry *ce;
21493: zend_function *clone;
21494: zend_object_clone_obj_t clone_call;
21495:
1.1.1.2 misho 21496: SAVE_OPLINE();
21497: obj = _get_obj_zval_ptr_unused(TSRMLS_C);
21498:
1.1 misho 21499: if (IS_UNUSED == IS_CONST ||
1.1.1.2 misho 21500: UNEXPECTED(Z_TYPE_P(obj) != IS_OBJECT)) {
1.1 misho 21501: zend_error_noreturn(E_ERROR, "__clone method called on non-object");
21502: }
21503:
21504: ce = Z_OBJCE_P(obj);
21505: clone = ce ? ce->clone : NULL;
21506: clone_call = Z_OBJ_HT_P(obj)->clone_obj;
1.1.1.2 misho 21507: if (UNEXPECTED(clone_call == NULL)) {
1.1 misho 21508: if (ce) {
21509: zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s", ce->name);
21510: } else {
21511: zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object");
21512: }
21513: }
21514:
21515: if (ce && clone) {
21516: if (clone->op_array.fn_flags & ZEND_ACC_PRIVATE) {
21517: /* Ensure that if we're calling a private function, we're allowed to do so.
21518: */
1.1.1.2 misho 21519: if (UNEXPECTED(ce != EG(scope))) {
1.1 misho 21520: zend_error_noreturn(E_ERROR, "Call to private %s::__clone() from context '%s'", ce->name, EG(scope) ? EG(scope)->name : "");
21521: }
21522: } else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) {
21523: /* Ensure that if we're calling a protected function, we're allowed to do so.
21524: */
1.1.1.3 misho 21525: if (UNEXPECTED(!zend_check_protected(zend_get_function_root_class(clone), EG(scope)))) {
1.1 misho 21526: zend_error_noreturn(E_ERROR, "Call to protected %s::__clone() from context '%s'", ce->name, EG(scope) ? EG(scope)->name : "");
21527: }
21528: }
21529: }
21530:
1.1.1.2 misho 21531: if (EXPECTED(EG(exception) == NULL)) {
21532: zval *retval;
21533:
21534: ALLOC_ZVAL(retval);
21535: Z_OBJVAL_P(retval) = clone_call(obj TSRMLS_CC);
21536: Z_TYPE_P(retval) = IS_OBJECT;
21537: Z_SET_REFCOUNT_P(retval, 1);
21538: Z_SET_ISREF_P(retval);
21539: if (!RETURN_VALUE_USED(opline) || UNEXPECTED(EG(exception) != NULL)) {
21540: zval_ptr_dtor(&retval);
21541: } else {
21542: AI_SET_PTR(&EX_T(opline->result.var), retval);
1.1 misho 21543: }
21544: }
21545:
1.1.1.2 misho 21546: CHECK_EXCEPTION();
1.1 misho 21547: ZEND_VM_NEXT_OPCODE();
21548: }
21549:
21550: static int ZEND_FASTCALL ZEND_EXIT_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
21551: {
21552: #if 0 || (IS_UNUSED != IS_UNUSED)
1.1.1.2 misho 21553: USE_OPLINE
21554:
21555: SAVE_OPLINE();
1.1 misho 21556: if (IS_UNUSED != IS_UNUSED) {
21557:
21558: zval *ptr = NULL;
21559:
21560: if (Z_TYPE_P(ptr) == IS_LONG) {
21561: EG(exit_status) = Z_LVAL_P(ptr);
21562: } else {
21563: zend_print_variable(ptr);
21564: }
21565:
21566: }
21567: #endif
21568: zend_bailout();
1.1.1.2 misho 21569: ZEND_VM_NEXT_OPCODE(); /* Never reached */
1.1 misho 21570: }
21571:
21572: static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CONST(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
21573: {
1.1.1.2 misho 21574: USE_OPLINE
1.1 misho 21575: zend_free_op free_op_data1;
21576: zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
21577: zval *object;
1.1.1.2 misho 21578: zval *property = opline->op2.zv;
21579: zval *value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R);
1.1 misho 21580: int have_get_ptr = 0;
21581:
1.1.1.2 misho 21582: if (IS_UNUSED == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 21583: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
21584: }
21585:
21586: make_real_object(object_ptr TSRMLS_CC);
21587: object = *object_ptr;
21588:
1.1.1.2 misho 21589: if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
1.1 misho 21590: zend_error(E_WARNING, "Attempt to assign property of non-object");
21591:
21592: FREE_OP(free_op_data1);
21593:
1.1.1.2 misho 21594: if (RETURN_VALUE_USED(opline)) {
21595: PZVAL_LOCK(&EG(uninitialized_zval));
21596: EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
21597: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 21598: }
21599: } else {
21600: /* here we are sure we are dealing with an object */
21601: if (0) {
21602: MAKE_REAL_ZVAL_PTR(property);
21603: }
21604:
21605: /* here property is a string */
21606: if (opline->extended_value == ZEND_ASSIGN_OBJ
21607: && Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
1.1.1.2 misho 21608: zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 21609: if (zptr != NULL) { /* NULL means no success in getting PTR */
21610: SEPARATE_ZVAL_IF_NOT_REF(zptr);
21611:
21612: have_get_ptr = 1;
21613: binary_op(*zptr, *zptr, value TSRMLS_CC);
1.1.1.2 misho 21614: if (RETURN_VALUE_USED(opline)) {
1.1 misho 21615: PZVAL_LOCK(*zptr);
1.1.1.2 misho 21616: EX_T(opline->result.var).var.ptr = *zptr;
21617: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 21618: }
21619: }
21620: }
21621:
21622: if (!have_get_ptr) {
21623: zval *z = NULL;
21624:
21625: if (opline->extended_value == ZEND_ASSIGN_OBJ) {
21626: if (Z_OBJ_HT_P(object)->read_property) {
1.1.1.2 misho 21627: z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 21628: }
21629: } else /* if (opline->extended_value == ZEND_ASSIGN_DIM) */ {
21630: if (Z_OBJ_HT_P(object)->read_dimension) {
21631: z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC);
21632: }
21633: }
21634: if (z) {
21635: if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
21636: zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
21637:
21638: if (Z_REFCOUNT_P(z) == 0) {
21639: GC_REMOVE_ZVAL_FROM_BUFFER(z);
21640: zval_dtor(z);
21641: FREE_ZVAL(z);
21642: }
21643: z = value;
21644: }
21645: Z_ADDREF_P(z);
21646: SEPARATE_ZVAL_IF_NOT_REF(&z);
21647: binary_op(z, z, value TSRMLS_CC);
21648: if (opline->extended_value == ZEND_ASSIGN_OBJ) {
1.1.1.2 misho 21649: Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 21650: } else /* if (opline->extended_value == ZEND_ASSIGN_DIM) */ {
21651: Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC);
21652: }
1.1.1.2 misho 21653: if (RETURN_VALUE_USED(opline)) {
1.1 misho 21654: PZVAL_LOCK(z);
1.1.1.2 misho 21655: EX_T(opline->result.var).var.ptr = z;
21656: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 21657: }
21658: zval_ptr_dtor(&z);
21659: } else {
21660: zend_error(E_WARNING, "Attempt to assign property of non-object");
1.1.1.2 misho 21661: if (RETURN_VALUE_USED(opline)) {
21662: PZVAL_LOCK(&EG(uninitialized_zval));
21663: EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
21664: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 21665: }
21666: }
21667: }
21668:
21669: if (0) {
21670: zval_ptr_dtor(&property);
21671: } else {
21672:
21673: }
21674: FREE_OP(free_op_data1);
21675: }
21676:
21677: /* assign_obj has two opcodes! */
1.1.1.2 misho 21678: CHECK_EXCEPTION();
1.1 misho 21679: ZEND_VM_INC_OPCODE();
21680: ZEND_VM_NEXT_OPCODE();
21681: }
21682:
21683: static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_UNUSED_CONST(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
21684: {
1.1.1.2 misho 21685: USE_OPLINE
1.1 misho 21686: zend_free_op free_op_data2, free_op_data1;
21687: zval **var_ptr;
21688: zval *value;
21689:
1.1.1.2 misho 21690: SAVE_OPLINE();
1.1 misho 21691: switch (opline->extended_value) {
21692: case ZEND_ASSIGN_OBJ:
21693: return zend_binary_assign_op_obj_helper_SPEC_UNUSED_CONST(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
21694: break;
21695: case ZEND_ASSIGN_DIM: {
21696: zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
21697:
1.1.1.2 misho 21698: if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 21699: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
1.1.1.2 misho 21700: } else if (UNEXPECTED(Z_TYPE_PP(container) == IS_OBJECT)) {
1.1 misho 21701: if (IS_UNUSED == IS_VAR && !0) {
21702: Z_ADDREF_PP(container); /* undo the effect of get_obj_zval_ptr_ptr() */
21703: }
21704: return zend_binary_assign_op_obj_helper_SPEC_UNUSED_CONST(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
21705: } else {
1.1.1.2 misho 21706: zval *dim = opline->op2.zv;
1.1 misho 21707:
1.1.1.2 misho 21708: zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), container, dim, IS_CONST, BP_VAR_RW TSRMLS_CC);
21709: value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R);
21710: var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC);
1.1 misho 21711: }
21712: }
21713: break;
21714: default:
1.1.1.2 misho 21715: value = opline->op2.zv;
1.1 misho 21716: var_ptr = NULL;
21717: /* do nothing */
21718: break;
21719: }
21720:
1.1.1.2 misho 21721: if (UNEXPECTED(var_ptr == NULL)) {
1.1 misho 21722: zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets");
21723: }
21724:
1.1.1.2 misho 21725: if (UNEXPECTED(*var_ptr == &EG(error_zval))) {
21726: if (RETURN_VALUE_USED(opline)) {
21727: PZVAL_LOCK(&EG(uninitialized_zval));
21728: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
1.1 misho 21729: }
21730:
21731:
1.1.1.2 misho 21732: CHECK_EXCEPTION();
21733: if (opline->extended_value == ZEND_ASSIGN_DIM) {
21734: ZEND_VM_INC_OPCODE();
21735: }
1.1 misho 21736: ZEND_VM_NEXT_OPCODE();
21737: }
21738:
21739: SEPARATE_ZVAL_IF_NOT_REF(var_ptr);
21740:
1.1.1.2 misho 21741: if (UNEXPECTED(Z_TYPE_PP(var_ptr) == IS_OBJECT)
21742: && Z_OBJ_HANDLER_PP(var_ptr, get)
1.1 misho 21743: && Z_OBJ_HANDLER_PP(var_ptr, set)) {
21744: /* proxy object */
21745: zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC);
21746: Z_ADDREF_P(objval);
21747: binary_op(objval, objval, value TSRMLS_CC);
21748: Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC);
21749: zval_ptr_dtor(&objval);
21750: } else {
21751: binary_op(*var_ptr, *var_ptr, value TSRMLS_CC);
21752: }
21753:
1.1.1.2 misho 21754: if (RETURN_VALUE_USED(opline)) {
1.1 misho 21755: PZVAL_LOCK(*var_ptr);
1.1.1.2 misho 21756: AI_SET_PTR(&EX_T(opline->result.var), *var_ptr);
1.1 misho 21757: }
21758:
21759: if (opline->extended_value == ZEND_ASSIGN_DIM) {
21760: FREE_OP(free_op_data1);
21761: FREE_OP_VAR_PTR(free_op_data2);
21762:
1.1.1.2 misho 21763: CHECK_EXCEPTION();
21764: ZEND_VM_INC_OPCODE();
21765: } else {
21766:
21767: CHECK_EXCEPTION();
21768: }
1.1 misho 21769: ZEND_VM_NEXT_OPCODE();
21770: }
21771:
21772: static int ZEND_FASTCALL ZEND_ASSIGN_ADD_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
21773: {
21774: return zend_binary_assign_op_helper_SPEC_UNUSED_CONST(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
21775: }
21776:
21777: static int ZEND_FASTCALL ZEND_ASSIGN_SUB_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
21778: {
21779: return zend_binary_assign_op_helper_SPEC_UNUSED_CONST(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
21780: }
21781:
21782: static int ZEND_FASTCALL ZEND_ASSIGN_MUL_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
21783: {
21784: return zend_binary_assign_op_helper_SPEC_UNUSED_CONST(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
21785: }
21786:
21787: static int ZEND_FASTCALL ZEND_ASSIGN_DIV_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
21788: {
21789: return zend_binary_assign_op_helper_SPEC_UNUSED_CONST(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
21790: }
21791:
21792: static int ZEND_FASTCALL ZEND_ASSIGN_MOD_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
21793: {
21794: return zend_binary_assign_op_helper_SPEC_UNUSED_CONST(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
21795: }
21796:
21797: static int ZEND_FASTCALL ZEND_ASSIGN_SL_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
21798: {
21799: return zend_binary_assign_op_helper_SPEC_UNUSED_CONST(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
21800: }
21801:
21802: static int ZEND_FASTCALL ZEND_ASSIGN_SR_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
21803: {
21804: return zend_binary_assign_op_helper_SPEC_UNUSED_CONST(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
21805: }
21806:
21807: static int ZEND_FASTCALL ZEND_ASSIGN_CONCAT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
21808: {
21809: return zend_binary_assign_op_helper_SPEC_UNUSED_CONST(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
21810: }
21811:
21812: static int ZEND_FASTCALL ZEND_ASSIGN_BW_OR_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
21813: {
21814: return zend_binary_assign_op_helper_SPEC_UNUSED_CONST(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
21815: }
21816:
21817: static int ZEND_FASTCALL ZEND_ASSIGN_BW_AND_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
21818: {
21819: return zend_binary_assign_op_helper_SPEC_UNUSED_CONST(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
21820: }
21821:
21822: static int ZEND_FASTCALL ZEND_ASSIGN_BW_XOR_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
21823: {
21824: return zend_binary_assign_op_helper_SPEC_UNUSED_CONST(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
21825: }
21826:
21827: static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_CONST(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS)
21828: {
1.1.1.2 misho 21829: USE_OPLINE
1.1 misho 21830:
1.1.1.2 misho 21831: zval **object_ptr;
1.1 misho 21832: zval *object;
1.1.1.2 misho 21833: zval *property;
21834: zval **retval;
1.1 misho 21835: int have_get_ptr = 0;
21836:
1.1.1.2 misho 21837: SAVE_OPLINE();
21838: object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
21839: property = opline->op2.zv;
21840: retval = &EX_T(opline->result.var).var.ptr;
21841:
21842: if (IS_UNUSED == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 21843: zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
21844: }
21845:
21846: make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
21847: object = *object_ptr;
21848:
1.1.1.2 misho 21849: if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
1.1 misho 21850: zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
21851:
1.1.1.2 misho 21852: if (RETURN_VALUE_USED(opline)) {
21853: PZVAL_LOCK(&EG(uninitialized_zval));
21854: *retval = &EG(uninitialized_zval);
1.1 misho 21855: }
21856:
1.1.1.2 misho 21857: CHECK_EXCEPTION();
1.1 misho 21858: ZEND_VM_NEXT_OPCODE();
21859: }
21860:
21861: /* here we are sure we are dealing with an object */
21862:
21863: if (0) {
21864: MAKE_REAL_ZVAL_PTR(property);
21865: }
21866:
21867: if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
1.1.1.2 misho 21868: zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 21869: if (zptr != NULL) { /* NULL means no success in getting PTR */
21870: SEPARATE_ZVAL_IF_NOT_REF(zptr);
21871:
21872: have_get_ptr = 1;
21873: incdec_op(*zptr);
1.1.1.2 misho 21874: if (RETURN_VALUE_USED(opline)) {
1.1 misho 21875: *retval = *zptr;
21876: PZVAL_LOCK(*retval);
21877: }
21878: }
21879: }
21880:
21881: if (!have_get_ptr) {
21882: if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
1.1.1.2 misho 21883: zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 21884:
1.1.1.2 misho 21885: if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
1.1 misho 21886: zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
21887:
21888: if (Z_REFCOUNT_P(z) == 0) {
21889: GC_REMOVE_ZVAL_FROM_BUFFER(z);
21890: zval_dtor(z);
21891: FREE_ZVAL(z);
21892: }
21893: z = value;
21894: }
21895: Z_ADDREF_P(z);
21896: SEPARATE_ZVAL_IF_NOT_REF(&z);
21897: incdec_op(z);
21898: *retval = z;
1.1.1.2 misho 21899: Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
21900: SELECTIVE_PZVAL_LOCK(*retval, opline);
1.1 misho 21901: zval_ptr_dtor(&z);
21902: } else {
21903: zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
1.1.1.2 misho 21904: if (RETURN_VALUE_USED(opline)) {
21905: PZVAL_LOCK(&EG(uninitialized_zval));
21906: *retval = &EG(uninitialized_zval);
1.1 misho 21907: }
21908: }
21909: }
21910:
21911: if (0) {
21912: zval_ptr_dtor(&property);
21913: } else {
21914:
21915: }
21916:
1.1.1.2 misho 21917: CHECK_EXCEPTION();
1.1 misho 21918: ZEND_VM_NEXT_OPCODE();
21919: }
21920:
21921: static int ZEND_FASTCALL ZEND_PRE_INC_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
21922: {
21923: return zend_pre_incdec_property_helper_SPEC_UNUSED_CONST(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
21924: }
21925:
21926: static int ZEND_FASTCALL ZEND_PRE_DEC_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
21927: {
21928: return zend_pre_incdec_property_helper_SPEC_UNUSED_CONST(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
21929: }
21930:
21931: static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_CONST(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS)
21932: {
1.1.1.2 misho 21933: USE_OPLINE
1.1 misho 21934:
1.1.1.2 misho 21935: zval **object_ptr;
1.1 misho 21936: zval *object;
1.1.1.2 misho 21937: zval *property;
21938: zval *retval;
1.1 misho 21939: int have_get_ptr = 0;
21940:
1.1.1.2 misho 21941: SAVE_OPLINE();
21942: object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
21943: property = opline->op2.zv;
21944: retval = &EX_T(opline->result.var).tmp_var;
21945:
21946: if (IS_UNUSED == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 21947: zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
21948: }
21949:
21950: make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
21951: object = *object_ptr;
21952:
1.1.1.2 misho 21953: if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
1.1 misho 21954: zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
21955:
1.1.1.2 misho 21956: ZVAL_NULL(retval);
1.1 misho 21957:
1.1.1.2 misho 21958: CHECK_EXCEPTION();
1.1 misho 21959: ZEND_VM_NEXT_OPCODE();
21960: }
21961:
21962: /* here we are sure we are dealing with an object */
21963:
21964: if (0) {
21965: MAKE_REAL_ZVAL_PTR(property);
21966: }
21967:
21968: if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
1.1.1.2 misho 21969: zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 21970: if (zptr != NULL) { /* NULL means no success in getting PTR */
21971: have_get_ptr = 1;
21972: SEPARATE_ZVAL_IF_NOT_REF(zptr);
21973:
1.1.1.2 misho 21974: ZVAL_COPY_VALUE(retval, *zptr);
1.1 misho 21975: zendi_zval_copy_ctor(*retval);
21976:
21977: incdec_op(*zptr);
21978:
21979: }
21980: }
21981:
21982: if (!have_get_ptr) {
21983: if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
1.1.1.2 misho 21984: zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 21985: zval *z_copy;
21986:
1.1.1.2 misho 21987: if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
1.1 misho 21988: zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
21989:
21990: if (Z_REFCOUNT_P(z) == 0) {
21991: GC_REMOVE_ZVAL_FROM_BUFFER(z);
21992: zval_dtor(z);
21993: FREE_ZVAL(z);
21994: }
21995: z = value;
21996: }
1.1.1.2 misho 21997: ZVAL_COPY_VALUE(retval, z);
1.1 misho 21998: zendi_zval_copy_ctor(*retval);
21999: ALLOC_ZVAL(z_copy);
1.1.1.2 misho 22000: INIT_PZVAL_COPY(z_copy, z);
1.1 misho 22001: zendi_zval_copy_ctor(*z_copy);
22002: incdec_op(z_copy);
22003: Z_ADDREF_P(z);
1.1.1.2 misho 22004: Z_OBJ_HT_P(object)->write_property(object, property, z_copy, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 22005: zval_ptr_dtor(&z_copy);
22006: zval_ptr_dtor(&z);
22007: } else {
22008: zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
1.1.1.2 misho 22009: ZVAL_NULL(retval);
1.1 misho 22010: }
22011: }
22012:
22013: if (0) {
22014: zval_ptr_dtor(&property);
22015: } else {
22016:
22017: }
22018:
1.1.1.2 misho 22019: CHECK_EXCEPTION();
1.1 misho 22020: ZEND_VM_NEXT_OPCODE();
22021: }
22022:
22023: static int ZEND_FASTCALL ZEND_POST_INC_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
22024: {
22025: return zend_post_incdec_property_helper_SPEC_UNUSED_CONST(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
22026: }
22027:
22028: static int ZEND_FASTCALL ZEND_POST_DEC_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
22029: {
22030: return zend_post_incdec_property_helper_SPEC_UNUSED_CONST(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
22031: }
22032:
1.1.1.2 misho 22033: static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_UNUSED_CONST(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 22034: {
1.1.1.2 misho 22035: USE_OPLINE
1.1 misho 22036:
1.1.1.2 misho 22037: zval *container;
1.1 misho 22038:
1.1.1.2 misho 22039: zval *offset;
1.1 misho 22040:
1.1.1.2 misho 22041: SAVE_OPLINE();
22042: container = _get_obj_zval_ptr_unused(TSRMLS_C);
22043: offset = opline->op2.zv;
22044:
22045: if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
22046: UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
22047: zend_error(E_NOTICE, "Trying to get property of non-object");
22048: PZVAL_LOCK(&EG(uninitialized_zval));
22049: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
1.1 misho 22050:
22051: } else {
22052: zval *retval;
22053:
22054: if (0) {
22055: MAKE_REAL_ZVAL_PTR(offset);
22056: }
22057:
22058: /* here we are sure we are dealing with an object */
1.1.1.2 misho 22059: retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 22060:
1.1.1.2 misho 22061: PZVAL_LOCK(retval);
22062: AI_SET_PTR(&EX_T(opline->result.var), retval);
1.1 misho 22063:
22064: if (0) {
22065: zval_ptr_dtor(&offset);
22066: } else {
22067:
22068: }
22069: }
22070:
1.1.1.2 misho 22071: CHECK_EXCEPTION();
1.1 misho 22072: ZEND_VM_NEXT_OPCODE();
22073: }
22074:
22075: static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
22076: {
1.1.1.2 misho 22077: return zend_fetch_property_address_read_helper_SPEC_UNUSED_CONST(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
1.1 misho 22078: }
22079:
22080: static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
22081: {
1.1.1.2 misho 22082: USE_OPLINE
1.1 misho 22083: zend_free_op free_op1;
1.1.1.2 misho 22084: zval *property;
1.1 misho 22085: zval **container;
22086:
1.1.1.2 misho 22087: SAVE_OPLINE();
22088: property = opline->op2.zv;
22089:
1.1 misho 22090: if (IS_UNUSED == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
1.1.1.2 misho 22091: PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
22092: EX_T(opline->op1.var).var.ptr = *EX_T(opline->op1.var).var.ptr_ptr;
1.1 misho 22093: }
22094:
22095: if (0) {
22096: MAKE_REAL_ZVAL_PTR(property);
22097: }
22098: container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
1.1.1.2 misho 22099: if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 22100: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
22101: }
1.1.1.2 misho 22102:
22103: zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_W TSRMLS_CC);
1.1 misho 22104: if (0) {
22105: zval_ptr_dtor(&property);
22106: } else {
22107:
22108: }
1.1.1.2 misho 22109: if (IS_UNUSED == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
22110: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 22111: }
22112:
22113: /* We are going to assign the result by reference */
22114: if (opline->extended_value & ZEND_FETCH_MAKE_REF) {
1.1.1.2 misho 22115: zval **retval_ptr = EX_T(opline->result.var).var.ptr_ptr;
22116:
22117: Z_DELREF_PP(retval_ptr);
22118: SEPARATE_ZVAL_TO_MAKE_IS_REF(retval_ptr);
22119: Z_ADDREF_PP(retval_ptr);
22120: EX_T(opline->result.var).var.ptr = *EX_T(opline->result.var).var.ptr_ptr;
22121: EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
1.1 misho 22122: }
22123:
1.1.1.2 misho 22124: CHECK_EXCEPTION();
1.1 misho 22125: ZEND_VM_NEXT_OPCODE();
22126: }
22127:
22128: static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
22129: {
1.1.1.2 misho 22130: USE_OPLINE
1.1 misho 22131: zend_free_op free_op1;
1.1.1.2 misho 22132: zval *property;
22133: zval **container;
22134:
22135: SAVE_OPLINE();
22136: property = opline->op2.zv;
22137: container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
1.1 misho 22138:
22139: if (0) {
22140: MAKE_REAL_ZVAL_PTR(property);
22141: }
1.1.1.2 misho 22142: if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 22143: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
22144: }
1.1.1.2 misho 22145: zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_RW TSRMLS_CC);
1.1 misho 22146: if (0) {
22147: zval_ptr_dtor(&property);
22148: } else {
22149:
22150: }
1.1.1.2 misho 22151: if (IS_UNUSED == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
22152: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 22153: }
22154:
1.1.1.2 misho 22155: CHECK_EXCEPTION();
1.1 misho 22156: ZEND_VM_NEXT_OPCODE();
22157: }
22158:
22159: static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
22160: {
1.1.1.2 misho 22161: USE_OPLINE
22162:
22163: zval *container;
22164:
22165: zval *offset;
22166:
22167: SAVE_OPLINE();
22168: container = _get_obj_zval_ptr_unused(TSRMLS_C);
22169: offset = opline->op2.zv;
22170:
22171: if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
22172: UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
22173: PZVAL_LOCK(&EG(uninitialized_zval));
22174: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
22175:
22176: } else {
22177: zval *retval;
22178:
22179: if (0) {
22180: MAKE_REAL_ZVAL_PTR(offset);
22181: }
22182:
22183: /* here we are sure we are dealing with an object */
22184: retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
22185:
22186: PZVAL_LOCK(retval);
22187: AI_SET_PTR(&EX_T(opline->result.var), retval);
22188:
22189: if (0) {
22190: zval_ptr_dtor(&offset);
22191: } else {
22192:
22193: }
22194: }
22195:
22196: CHECK_EXCEPTION();
22197: ZEND_VM_NEXT_OPCODE();
1.1 misho 22198: }
22199:
22200: static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
22201: {
1.1.1.2 misho 22202: USE_OPLINE
1.1 misho 22203:
1.1.1.2 misho 22204: if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
1.1 misho 22205: /* Behave like FETCH_OBJ_W */
22206: zend_free_op free_op1;
1.1.1.2 misho 22207: zval *property;
22208: zval **container;
22209:
22210: SAVE_OPLINE();
22211: property = opline->op2.zv;
22212: container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
1.1 misho 22213:
22214: if (0) {
22215: MAKE_REAL_ZVAL_PTR(property);
22216: }
1.1.1.2 misho 22217: if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 22218: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
22219: }
1.1.1.2 misho 22220: zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_W TSRMLS_CC);
1.1 misho 22221: if (0) {
22222: zval_ptr_dtor(&property);
22223: } else {
22224:
22225: }
1.1.1.2 misho 22226: if (IS_UNUSED == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
22227: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 22228: }
22229:
1.1.1.2 misho 22230: CHECK_EXCEPTION();
1.1 misho 22231: ZEND_VM_NEXT_OPCODE();
22232: } else {
1.1.1.2 misho 22233: return zend_fetch_property_address_read_helper_SPEC_UNUSED_CONST(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
1.1 misho 22234: }
22235: }
22236:
22237: static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
22238: {
1.1.1.2 misho 22239: USE_OPLINE
1.1 misho 22240: zend_free_op free_op1, free_res;
1.1.1.2 misho 22241: zval **container;
22242: zval *property;
22243:
22244: SAVE_OPLINE();
22245: container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
22246: property = opline->op2.zv;
1.1 misho 22247:
22248: if (IS_UNUSED == IS_CV) {
22249: if (container != &EG(uninitialized_zval_ptr)) {
22250: SEPARATE_ZVAL_IF_NOT_REF(container);
22251: }
22252: }
22253: if (0) {
22254: MAKE_REAL_ZVAL_PTR(property);
22255: }
1.1.1.2 misho 22256: if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 22257: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
22258: }
1.1.1.2 misho 22259: zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_UNSET TSRMLS_CC);
1.1 misho 22260: if (0) {
22261: zval_ptr_dtor(&property);
22262: } else {
22263:
22264: }
1.1.1.2 misho 22265: if (IS_UNUSED == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
22266: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 22267: }
22268:
1.1.1.2 misho 22269: PZVAL_UNLOCK(*EX_T(opline->result.var).var.ptr_ptr, &free_res);
22270: if (EX_T(opline->result.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) {
22271: SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.var).var.ptr_ptr);
1.1 misho 22272: }
1.1.1.2 misho 22273: PZVAL_LOCK(*EX_T(opline->result.var).var.ptr_ptr);
1.1 misho 22274: FREE_OP_VAR_PTR(free_res);
1.1.1.2 misho 22275: CHECK_EXCEPTION();
1.1 misho 22276: ZEND_VM_NEXT_OPCODE();
22277: }
22278:
22279: static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
22280: {
1.1.1.2 misho 22281: USE_OPLINE
1.1 misho 22282:
1.1.1.2 misho 22283: zval **object_ptr;
22284: zval *property_name;
22285:
22286: SAVE_OPLINE();
22287: object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
22288: property_name = opline->op2.zv;
1.1 misho 22289:
22290: if (0) {
22291: MAKE_REAL_ZVAL_PTR(property_name);
22292: }
1.1.1.2 misho 22293: if (IS_UNUSED == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 22294: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
22295: }
1.1.1.2 misho 22296: zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), ZEND_ASSIGN_OBJ, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 22297: if (0) {
22298: zval_ptr_dtor(&property_name);
22299: } else {
22300:
22301: }
22302:
22303: /* assign_obj has two opcodes! */
1.1.1.2 misho 22304: CHECK_EXCEPTION();
1.1 misho 22305: ZEND_VM_INC_OPCODE();
22306: ZEND_VM_NEXT_OPCODE();
22307: }
22308:
22309: static int ZEND_FASTCALL ZEND_ADD_CHAR_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
22310: {
1.1.1.2 misho 22311: USE_OPLINE
22312: zval *str = &EX_T(opline->result.var).tmp_var;
22313:
22314: SAVE_OPLINE();
1.1 misho 22315:
22316: if (IS_UNUSED == IS_UNUSED) {
22317: /* Initialize for erealloc in add_char_to_string */
22318: Z_STRVAL_P(str) = NULL;
22319: Z_STRLEN_P(str) = 0;
22320: Z_TYPE_P(str) = IS_STRING;
22321:
22322: INIT_PZVAL(str);
22323: }
22324:
1.1.1.2 misho 22325: add_char_to_string(str, str, opline->op2.zv);
1.1 misho 22326:
22327: /* FREE_OP is missing intentionally here - we're always working on the same temporary variable */
1.1.1.2 misho 22328: /*CHECK_EXCEPTION();*/
1.1 misho 22329: ZEND_VM_NEXT_OPCODE();
22330: }
22331:
22332: static int ZEND_FASTCALL ZEND_ADD_STRING_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
22333: {
1.1.1.2 misho 22334: USE_OPLINE
22335: zval *str = &EX_T(opline->result.var).tmp_var;
22336:
22337: SAVE_OPLINE();
1.1 misho 22338:
22339: if (IS_UNUSED == IS_UNUSED) {
22340: /* Initialize for erealloc in add_string_to_string */
22341: Z_STRVAL_P(str) = NULL;
22342: Z_STRLEN_P(str) = 0;
22343: Z_TYPE_P(str) = IS_STRING;
22344:
22345: INIT_PZVAL(str);
22346: }
22347:
1.1.1.2 misho 22348: add_string_to_string(str, str, opline->op2.zv);
1.1 misho 22349:
22350: /* FREE_OP is missing intentionally here - we're always working on the same temporary variable */
1.1.1.2 misho 22351: /*CHECK_EXCEPTION();*/
1.1 misho 22352: ZEND_VM_NEXT_OPCODE();
22353: }
22354:
22355: static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
22356: {
1.1.1.2 misho 22357: USE_OPLINE
1.1 misho 22358: zval *function_name;
22359: char *function_name_strval;
22360: int function_name_strlen;
22361:
22362:
1.1.1.2 misho 22363: SAVE_OPLINE();
1.1 misho 22364: zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
22365:
1.1.1.2 misho 22366: function_name = opline->op2.zv;
1.1 misho 22367:
1.1.1.2 misho 22368: if (IS_CONST != IS_CONST &&
22369: UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
1.1 misho 22370: zend_error_noreturn(E_ERROR, "Method name must be a string");
22371: }
22372:
22373: function_name_strval = Z_STRVAL_P(function_name);
22374: function_name_strlen = Z_STRLEN_P(function_name);
22375:
22376: EX(object) = _get_obj_zval_ptr_unused(TSRMLS_C);
22377:
1.1.1.2 misho 22378: if (EXPECTED(EX(object) != NULL) &&
22379: EXPECTED(Z_TYPE_P(EX(object)) == IS_OBJECT)) {
22380: EX(called_scope) = Z_OBJCE_P(EX(object));
1.1 misho 22381:
1.1.1.2 misho 22382: if (IS_CONST != IS_CONST ||
22383: (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope))) == NULL) {
22384: zval *object = EX(object);
22385:
22386: if (UNEXPECTED(Z_OBJ_HT_P(EX(object))->get_method == NULL)) {
22387: zend_error_noreturn(E_ERROR, "Object does not support method calls");
22388: }
22389:
22390: /* First, locate the function. */
22391: EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen, ((IS_CONST == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC);
22392: if (UNEXPECTED(EX(fbc) == NULL)) {
22393: zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval);
22394: }
22395: if (IS_CONST == IS_CONST &&
22396: EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) &&
22397: EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) &&
22398: EXPECTED(EX(object) == object)) {
22399: CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope), EX(fbc));
22400: }
1.1 misho 22401: }
22402: } else {
22403: zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval);
22404: }
22405:
22406: if ((EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) != 0) {
22407: EX(object) = NULL;
22408: } else {
22409: if (!PZVAL_IS_REF(EX(object))) {
22410: Z_ADDREF_P(EX(object)); /* For $this pointer */
22411: } else {
22412: zval *this_ptr;
22413: ALLOC_ZVAL(this_ptr);
22414: INIT_PZVAL_COPY(this_ptr, EX(object));
22415: zval_copy_ctor(this_ptr);
22416: EX(object) = this_ptr;
22417: }
22418: }
22419:
22420:
1.1.1.2 misho 22421: CHECK_EXCEPTION();
1.1 misho 22422: ZEND_VM_NEXT_OPCODE();
22423: }
22424:
22425: static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
22426: {
1.1.1.2 misho 22427: USE_OPLINE
1.1 misho 22428:
1.1.1.2 misho 22429: SAVE_OPLINE();
1.1 misho 22430: if (IS_UNUSED == IS_UNUSED) {
1.1.1.2 misho 22431: zend_constant *c;
22432: zval *retval;
22433:
22434: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
22435: c = CACHED_PTR(opline->op2.literal->cache_slot);
22436: } else if ((c = zend_quick_get_constant(opline->op2.literal + 1, opline->extended_value TSRMLS_CC)) == NULL) {
1.1 misho 22437: if ((opline->extended_value & IS_CONSTANT_UNQUALIFIED) != 0) {
1.1.1.2 misho 22438: char *actual = (char *)zend_memrchr(Z_STRVAL_P(opline->op2.zv), '\\', Z_STRLEN_P(opline->op2.zv));
1.1 misho 22439: if(!actual) {
1.1.1.2 misho 22440: actual = Z_STRVAL_P(opline->op2.zv);
1.1 misho 22441: } else {
22442: actual++;
22443: }
22444: /* non-qualified constant - allow text substitution */
22445: zend_error(E_NOTICE, "Use of undefined constant %s - assumed '%s'", actual, actual);
1.1.1.2 misho 22446: ZVAL_STRINGL(&EX_T(opline->result.var).tmp_var, actual, Z_STRLEN_P(opline->op2.zv)-(actual - Z_STRVAL_P(opline->op2.zv)), 1);
22447: CHECK_EXCEPTION();
22448: ZEND_VM_NEXT_OPCODE();
1.1 misho 22449: } else {
1.1.1.2 misho 22450: zend_error_noreturn(E_ERROR, "Undefined constant '%s'", Z_STRVAL_P(opline->op2.zv));
1.1 misho 22451: }
1.1.1.2 misho 22452: } else {
22453: CACHE_PTR(opline->op2.literal->cache_slot, c);
1.1 misho 22454: }
1.1.1.2 misho 22455: retval = &EX_T(opline->result.var).tmp_var;
22456: ZVAL_COPY_VALUE(retval, &c->value);
22457: zval_copy_ctor(retval);
22458: CHECK_EXCEPTION();
1.1 misho 22459: ZEND_VM_NEXT_OPCODE();
22460: } else {
22461: /* class constant */
22462: zend_class_entry *ce;
22463: zval **value;
22464:
22465: if (IS_UNUSED == IS_CONST) {
1.1.1.2 misho 22466: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
22467: value = CACHED_PTR(opline->op2.literal->cache_slot);
22468: ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, *value);
22469: zval_copy_ctor(&EX_T(opline->result.var).tmp_var);
22470: CHECK_EXCEPTION();
22471: ZEND_VM_NEXT_OPCODE();
22472: } else if (CACHED_PTR(opline->op1.literal->cache_slot)) {
22473: ce = CACHED_PTR(opline->op1.literal->cache_slot);
22474: } else {
22475: ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
1.1.1.4 ! misho 22476: if (UNEXPECTED(EG(exception) != NULL)) {
! 22477: HANDLE_EXCEPTION();
! 22478: }
1.1.1.2 misho 22479: if (UNEXPECTED(ce == NULL)) {
1.1.1.4 ! misho 22480: zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv));
1.1.1.2 misho 22481: }
22482: CACHE_PTR(opline->op1.literal->cache_slot, ce);
1.1 misho 22483: }
22484: } else {
1.1.1.2 misho 22485: ce = EX_T(opline->op1.var).class_entry;
22486: if ((value = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce)) != NULL) {
22487: ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, *value);
22488: zval_copy_ctor(&EX_T(opline->result.var).tmp_var);
22489: CHECK_EXCEPTION();
22490: ZEND_VM_NEXT_OPCODE();
22491: }
1.1 misho 22492: }
22493:
1.1.1.2 misho 22494: if (EXPECTED(zend_hash_quick_find(&ce->constants_table, Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv)+1, Z_HASH_P(opline->op2.zv), (void **) &value) == SUCCESS)) {
1.1 misho 22495: if (Z_TYPE_PP(value) == IS_CONSTANT_ARRAY ||
22496: (Z_TYPE_PP(value) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT) {
22497: zend_class_entry *old_scope = EG(scope);
22498:
22499: EG(scope) = ce;
22500: zval_update_constant(value, (void *) 1 TSRMLS_CC);
22501: EG(scope) = old_scope;
22502: }
1.1.1.2 misho 22503: if (IS_UNUSED == IS_CONST) {
22504: CACHE_PTR(opline->op2.literal->cache_slot, value);
22505: } else {
22506: CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce, value);
22507: }
22508: ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, *value);
22509: zval_copy_ctor(&EX_T(opline->result.var).tmp_var);
1.1 misho 22510: } else {
1.1.1.2 misho 22511: zend_error_noreturn(E_ERROR, "Undefined class constant '%s'", Z_STRVAL_P(opline->op2.zv));
1.1 misho 22512: }
22513:
1.1.1.2 misho 22514: CHECK_EXCEPTION();
1.1 misho 22515: ZEND_VM_NEXT_OPCODE();
22516: }
22517: }
22518:
22519: static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
22520: {
1.1.1.2 misho 22521: USE_OPLINE
1.1 misho 22522:
1.1.1.2 misho 22523: array_init(&EX_T(opline->result.var).tmp_var);
1.1 misho 22524: if (IS_UNUSED == IS_UNUSED) {
22525: ZEND_VM_NEXT_OPCODE();
22526: #if 0 || IS_UNUSED != IS_UNUSED
22527: } else {
22528: return ZEND_ADD_ARRAY_ELEMENT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
22529: #endif
22530: }
22531: }
22532:
22533: static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
22534: {
1.1.1.2 misho 22535: USE_OPLINE
1.1 misho 22536:
1.1.1.2 misho 22537: zval **container;
1.1 misho 22538: zval *offset;
1.1.1.2 misho 22539: ulong hval;
1.1 misho 22540:
1.1.1.2 misho 22541: SAVE_OPLINE();
22542: container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
1.1 misho 22543: if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) {
22544: SEPARATE_ZVAL_IF_NOT_REF(container);
22545: }
1.1.1.2 misho 22546: offset = opline->op2.zv;
1.1 misho 22547:
22548: if (IS_UNUSED != IS_VAR || container) {
22549: switch (Z_TYPE_PP(container)) {
22550: case IS_ARRAY: {
22551: HashTable *ht = Z_ARRVAL_PP(container);
22552:
22553: switch (Z_TYPE_P(offset)) {
22554: case IS_DOUBLE:
1.1.1.2 misho 22555: hval = zend_dval_to_lval(Z_DVAL_P(offset));
1.1.1.3 misho 22556: zend_hash_index_del(ht, hval);
22557: break;
1.1 misho 22558: case IS_RESOURCE:
22559: case IS_BOOL:
22560: case IS_LONG:
1.1.1.2 misho 22561: hval = Z_LVAL_P(offset);
22562: zend_hash_index_del(ht, hval);
1.1 misho 22563: break;
22564: case IS_STRING:
22565: if (IS_CONST == IS_CV || IS_CONST == IS_VAR) {
22566: Z_ADDREF_P(offset);
22567: }
1.1.1.2 misho 22568: if (IS_CONST == IS_CONST) {
22569: hval = Z_HASH_P(offset);
22570: } else {
22571: ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_dim);
22572: if (IS_INTERNED(Z_STRVAL_P(offset))) {
22573: hval = INTERNED_HASH(Z_STRVAL_P(offset));
22574: } else {
22575: hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
1.1 misho 22576: }
22577: }
1.1.1.2 misho 22578: if (ht == &EG(symbol_table)) {
22579: zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC);
22580: } else {
22581: zend_hash_quick_del(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval);
22582: }
22583: if (IS_CONST == IS_CV || IS_CONST == IS_VAR) {
22584: zval_ptr_dtor(&offset);
22585: }
22586: break;
22587: num_index_dim:
22588: zend_hash_index_del(ht, hval);
1.1 misho 22589: if (IS_CONST == IS_CV || IS_CONST == IS_VAR) {
22590: zval_ptr_dtor(&offset);
22591: }
22592: break;
22593: case IS_NULL:
22594: zend_hash_del(ht, "", sizeof(""));
22595: break;
22596: default:
22597: zend_error(E_WARNING, "Illegal offset type in unset");
22598: break;
22599: }
22600:
22601: break;
22602: }
22603: case IS_OBJECT:
1.1.1.2 misho 22604: if (UNEXPECTED(Z_OBJ_HT_P(*container)->unset_dimension == NULL)) {
1.1 misho 22605: zend_error_noreturn(E_ERROR, "Cannot use object as array");
22606: }
22607: if (0) {
22608: MAKE_REAL_ZVAL_PTR(offset);
22609: }
22610: Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC);
22611: if (0) {
22612: zval_ptr_dtor(&offset);
22613: } else {
22614:
22615: }
22616: break;
22617: case IS_STRING:
22618: zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
22619: ZEND_VM_CONTINUE(); /* bailed out before */
22620: default:
22621:
22622: break;
22623: }
22624: } else {
22625:
22626: }
22627:
1.1.1.2 misho 22628: CHECK_EXCEPTION();
1.1 misho 22629: ZEND_VM_NEXT_OPCODE();
22630: }
22631:
22632: static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
22633: {
1.1.1.2 misho 22634: USE_OPLINE
22635:
22636: zval **container;
22637: zval *offset;
1.1 misho 22638:
1.1.1.2 misho 22639: SAVE_OPLINE();
22640: container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
22641: offset = opline->op2.zv;
1.1 misho 22642:
22643: if (IS_UNUSED != IS_VAR || container) {
22644: if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) {
22645: SEPARATE_ZVAL_IF_NOT_REF(container);
22646: }
22647: if (Z_TYPE_PP(container) == IS_OBJECT) {
22648: if (0) {
22649: MAKE_REAL_ZVAL_PTR(offset);
22650: }
22651: if (Z_OBJ_HT_P(*container)->unset_property) {
1.1.1.2 misho 22652: Z_OBJ_HT_P(*container)->unset_property(*container, offset, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 22653: } else {
22654: zend_error(E_NOTICE, "Trying to unset property of non-object");
22655: }
22656: if (0) {
22657: zval_ptr_dtor(&offset);
22658: } else {
22659:
22660: }
22661: } else {
22662:
22663: }
22664: } else {
22665:
22666: }
22667:
1.1.1.2 misho 22668: CHECK_EXCEPTION();
1.1 misho 22669: ZEND_VM_NEXT_OPCODE();
22670: }
22671:
22672: static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_CONST(int prop_dim, ZEND_OPCODE_HANDLER_ARGS)
22673: {
1.1.1.2 misho 22674: USE_OPLINE
1.1 misho 22675:
1.1.1.2 misho 22676: zval **container;
1.1 misho 22677: zval **value = NULL;
22678: int result = 0;
1.1.1.2 misho 22679: ulong hval;
22680: zval *offset;
1.1 misho 22681:
1.1.1.2 misho 22682: SAVE_OPLINE();
22683: container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
1.1 misho 22684:
1.1.1.2 misho 22685: offset = opline->op2.zv;
1.1 misho 22686:
1.1.1.2 misho 22687: if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) {
22688: HashTable *ht;
22689: int isset = 0;
1.1 misho 22690:
1.1.1.2 misho 22691: ht = Z_ARRVAL_PP(container);
1.1 misho 22692:
1.1.1.2 misho 22693: switch (Z_TYPE_P(offset)) {
22694: case IS_DOUBLE:
22695: hval = zend_dval_to_lval(Z_DVAL_P(offset));
22696: goto num_index_prop;
22697: case IS_RESOURCE:
22698: case IS_BOOL:
22699: case IS_LONG:
22700: hval = Z_LVAL_P(offset);
22701: num_index_prop:
22702: if (zend_hash_index_find(ht, hval, (void **) &value) == SUCCESS) {
22703: isset = 1;
22704: }
22705: break;
22706: case IS_STRING:
22707: if (IS_CONST == IS_CONST) {
22708: hval = Z_HASH_P(offset);
22709: } else {
22710: if (!prop_dim) {
22711: ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_prop);
1.1 misho 22712: }
1.1.1.2 misho 22713: if (IS_INTERNED(Z_STRVAL_P(offset))) {
22714: hval = INTERNED_HASH(Z_STRVAL_P(offset));
1.1 misho 22715: } else {
1.1.1.2 misho 22716: hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
1.1 misho 22717: }
22718: }
1.1.1.2 misho 22719: if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) {
22720: isset = 1;
22721: }
22722: break;
22723: case IS_NULL:
22724: if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) {
22725: isset = 1;
1.1 misho 22726: }
1.1.1.2 misho 22727: break;
22728: default:
22729: zend_error(E_WARNING, "Illegal offset type in isset or empty");
22730: break;
22731: }
22732:
22733: if (opline->extended_value & ZEND_ISSET) {
22734: if (isset && Z_TYPE_PP(value) == IS_NULL) {
22735: result = 0;
22736: } else {
22737: result = isset;
1.1 misho 22738: }
1.1.1.2 misho 22739: } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
22740: if (!isset || !i_zend_is_true(*value)) {
22741: result = 0;
1.1 misho 22742: } else {
1.1.1.2 misho 22743: result = 1;
22744: }
22745: }
1.1 misho 22746:
1.1.1.2 misho 22747: } else if (Z_TYPE_PP(container) == IS_OBJECT) {
22748: if (0) {
22749: MAKE_REAL_ZVAL_PTR(offset);
22750: }
22751: if (prop_dim) {
22752: if (Z_OBJ_HT_P(*container)->has_property) {
22753: result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
22754: } else {
22755: zend_error(E_NOTICE, "Trying to check property of non-object");
22756: result = 0;
22757: }
22758: } else {
22759: if (Z_OBJ_HT_P(*container)->has_dimension) {
22760: result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0 TSRMLS_CC);
22761: } else {
22762: zend_error(E_NOTICE, "Trying to check element of non-array");
22763: result = 0;
1.1 misho 22764: }
1.1.1.2 misho 22765: }
22766: if (0) {
22767: zval_ptr_dtor(&offset);
22768: } else {
22769:
22770: }
22771: } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */
22772: zval tmp;
1.1 misho 22773:
1.1.1.2 misho 22774: if (Z_TYPE_P(offset) != IS_LONG) {
22775: if (Z_TYPE_P(offset) <= IS_BOOL /* simple scalar types */
22776: || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */
22777: && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) {
22778: ZVAL_COPY_VALUE(&tmp, offset);
1.1 misho 22779: zval_copy_ctor(&tmp);
22780: convert_to_long(&tmp);
22781: offset = &tmp;
1.1.1.2 misho 22782: } else {
22783: /* can not be converted to proper offset, return "not set" */
22784: result = 0;
1.1 misho 22785: }
1.1.1.2 misho 22786: }
22787: if (Z_TYPE_P(offset) == IS_LONG) {
22788: if (opline->extended_value & ZEND_ISSET) {
22789: if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
22790: result = 1;
22791: }
22792: } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
22793: if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') {
22794: result = 1;
1.1 misho 22795: }
22796: }
1.1.1.2 misho 22797: }
1.1 misho 22798:
1.1.1.2 misho 22799: } else {
1.1 misho 22800:
22801: }
22802:
1.1.1.2 misho 22803: Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
22804: if (opline->extended_value & ZEND_ISSET) {
22805: Z_LVAL(EX_T(opline->result.var).tmp_var) = result;
22806: } else {
22807: Z_LVAL(EX_T(opline->result.var).tmp_var) = !result;
1.1 misho 22808: }
22809:
1.1.1.2 misho 22810: CHECK_EXCEPTION();
1.1 misho 22811: ZEND_VM_NEXT_OPCODE();
22812: }
22813:
22814: static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
22815: {
22816: return zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_CONST(0, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
22817: }
22818:
22819: static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
22820: {
22821: return zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_CONST(1, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
22822: }
22823:
22824: static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_TMP(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
22825: {
1.1.1.2 misho 22826: USE_OPLINE
1.1 misho 22827: zend_free_op free_op2, free_op_data1;
22828: zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
22829: zval *object;
1.1.1.2 misho 22830: zval *property = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
22831: zval *value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R);
1.1 misho 22832: int have_get_ptr = 0;
22833:
1.1.1.2 misho 22834: if (IS_UNUSED == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 22835: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
22836: }
22837:
22838: make_real_object(object_ptr TSRMLS_CC);
22839: object = *object_ptr;
22840:
1.1.1.2 misho 22841: if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
1.1 misho 22842: zend_error(E_WARNING, "Attempt to assign property of non-object");
22843: zval_dtor(free_op2.var);
22844: FREE_OP(free_op_data1);
22845:
1.1.1.2 misho 22846: if (RETURN_VALUE_USED(opline)) {
22847: PZVAL_LOCK(&EG(uninitialized_zval));
22848: EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
22849: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 22850: }
22851: } else {
22852: /* here we are sure we are dealing with an object */
22853: if (1) {
22854: MAKE_REAL_ZVAL_PTR(property);
22855: }
22856:
22857: /* here property is a string */
22858: if (opline->extended_value == ZEND_ASSIGN_OBJ
22859: && Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
1.1.1.2 misho 22860: zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 22861: if (zptr != NULL) { /* NULL means no success in getting PTR */
22862: SEPARATE_ZVAL_IF_NOT_REF(zptr);
22863:
22864: have_get_ptr = 1;
22865: binary_op(*zptr, *zptr, value TSRMLS_CC);
1.1.1.2 misho 22866: if (RETURN_VALUE_USED(opline)) {
1.1 misho 22867: PZVAL_LOCK(*zptr);
1.1.1.2 misho 22868: EX_T(opline->result.var).var.ptr = *zptr;
22869: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 22870: }
22871: }
22872: }
22873:
22874: if (!have_get_ptr) {
22875: zval *z = NULL;
22876:
22877: if (opline->extended_value == ZEND_ASSIGN_OBJ) {
22878: if (Z_OBJ_HT_P(object)->read_property) {
1.1.1.2 misho 22879: z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 22880: }
22881: } else /* if (opline->extended_value == ZEND_ASSIGN_DIM) */ {
22882: if (Z_OBJ_HT_P(object)->read_dimension) {
22883: z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC);
22884: }
22885: }
22886: if (z) {
22887: if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
22888: zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
22889:
22890: if (Z_REFCOUNT_P(z) == 0) {
22891: GC_REMOVE_ZVAL_FROM_BUFFER(z);
22892: zval_dtor(z);
22893: FREE_ZVAL(z);
22894: }
22895: z = value;
22896: }
22897: Z_ADDREF_P(z);
22898: SEPARATE_ZVAL_IF_NOT_REF(&z);
22899: binary_op(z, z, value TSRMLS_CC);
22900: if (opline->extended_value == ZEND_ASSIGN_OBJ) {
1.1.1.2 misho 22901: Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 22902: } else /* if (opline->extended_value == ZEND_ASSIGN_DIM) */ {
22903: Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC);
22904: }
1.1.1.2 misho 22905: if (RETURN_VALUE_USED(opline)) {
1.1 misho 22906: PZVAL_LOCK(z);
1.1.1.2 misho 22907: EX_T(opline->result.var).var.ptr = z;
22908: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 22909: }
22910: zval_ptr_dtor(&z);
22911: } else {
22912: zend_error(E_WARNING, "Attempt to assign property of non-object");
1.1.1.2 misho 22913: if (RETURN_VALUE_USED(opline)) {
22914: PZVAL_LOCK(&EG(uninitialized_zval));
22915: EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
22916: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 22917: }
22918: }
22919: }
22920:
22921: if (1) {
22922: zval_ptr_dtor(&property);
22923: } else {
22924: zval_dtor(free_op2.var);
22925: }
22926: FREE_OP(free_op_data1);
22927: }
22928:
22929: /* assign_obj has two opcodes! */
1.1.1.2 misho 22930: CHECK_EXCEPTION();
1.1 misho 22931: ZEND_VM_INC_OPCODE();
22932: ZEND_VM_NEXT_OPCODE();
22933: }
22934:
22935: static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_UNUSED_TMP(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
22936: {
1.1.1.2 misho 22937: USE_OPLINE
1.1 misho 22938: zend_free_op free_op2, free_op_data2, free_op_data1;
22939: zval **var_ptr;
22940: zval *value;
22941:
1.1.1.2 misho 22942: SAVE_OPLINE();
1.1 misho 22943: switch (opline->extended_value) {
22944: case ZEND_ASSIGN_OBJ:
22945: return zend_binary_assign_op_obj_helper_SPEC_UNUSED_TMP(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
22946: break;
22947: case ZEND_ASSIGN_DIM: {
22948: zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
22949:
1.1.1.2 misho 22950: if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 22951: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
1.1.1.2 misho 22952: } else if (UNEXPECTED(Z_TYPE_PP(container) == IS_OBJECT)) {
1.1 misho 22953: if (IS_UNUSED == IS_VAR && !0) {
22954: Z_ADDREF_PP(container); /* undo the effect of get_obj_zval_ptr_ptr() */
22955: }
22956: return zend_binary_assign_op_obj_helper_SPEC_UNUSED_TMP(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
22957: } else {
1.1.1.2 misho 22958: zval *dim = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 22959:
1.1.1.2 misho 22960: zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), container, dim, IS_TMP_VAR, BP_VAR_RW TSRMLS_CC);
22961: value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R);
22962: var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC);
1.1 misho 22963: }
22964: }
22965: break;
22966: default:
1.1.1.2 misho 22967: value = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 22968: var_ptr = NULL;
22969: /* do nothing */
22970: break;
22971: }
22972:
1.1.1.2 misho 22973: if (UNEXPECTED(var_ptr == NULL)) {
1.1 misho 22974: zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets");
22975: }
22976:
1.1.1.2 misho 22977: if (UNEXPECTED(*var_ptr == &EG(error_zval))) {
22978: if (RETURN_VALUE_USED(opline)) {
22979: PZVAL_LOCK(&EG(uninitialized_zval));
22980: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
1.1 misho 22981: }
22982: zval_dtor(free_op2.var);
22983:
1.1.1.2 misho 22984: CHECK_EXCEPTION();
22985: if (opline->extended_value == ZEND_ASSIGN_DIM) {
22986: ZEND_VM_INC_OPCODE();
22987: }
1.1 misho 22988: ZEND_VM_NEXT_OPCODE();
22989: }
22990:
22991: SEPARATE_ZVAL_IF_NOT_REF(var_ptr);
22992:
1.1.1.2 misho 22993: if (UNEXPECTED(Z_TYPE_PP(var_ptr) == IS_OBJECT)
22994: && Z_OBJ_HANDLER_PP(var_ptr, get)
1.1 misho 22995: && Z_OBJ_HANDLER_PP(var_ptr, set)) {
22996: /* proxy object */
22997: zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC);
22998: Z_ADDREF_P(objval);
22999: binary_op(objval, objval, value TSRMLS_CC);
23000: Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC);
23001: zval_ptr_dtor(&objval);
23002: } else {
23003: binary_op(*var_ptr, *var_ptr, value TSRMLS_CC);
23004: }
23005:
1.1.1.2 misho 23006: if (RETURN_VALUE_USED(opline)) {
1.1 misho 23007: PZVAL_LOCK(*var_ptr);
1.1.1.2 misho 23008: AI_SET_PTR(&EX_T(opline->result.var), *var_ptr);
1.1 misho 23009: }
23010: zval_dtor(free_op2.var);
23011:
23012: if (opline->extended_value == ZEND_ASSIGN_DIM) {
23013: FREE_OP(free_op_data1);
23014: FREE_OP_VAR_PTR(free_op_data2);
23015:
1.1.1.2 misho 23016: CHECK_EXCEPTION();
23017: ZEND_VM_INC_OPCODE();
23018: } else {
23019:
23020: CHECK_EXCEPTION();
23021: }
1.1 misho 23022: ZEND_VM_NEXT_OPCODE();
23023: }
23024:
23025: static int ZEND_FASTCALL ZEND_ASSIGN_ADD_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
23026: {
23027: return zend_binary_assign_op_helper_SPEC_UNUSED_TMP(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
23028: }
23029:
23030: static int ZEND_FASTCALL ZEND_ASSIGN_SUB_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
23031: {
23032: return zend_binary_assign_op_helper_SPEC_UNUSED_TMP(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
23033: }
23034:
23035: static int ZEND_FASTCALL ZEND_ASSIGN_MUL_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
23036: {
23037: return zend_binary_assign_op_helper_SPEC_UNUSED_TMP(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
23038: }
23039:
23040: static int ZEND_FASTCALL ZEND_ASSIGN_DIV_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
23041: {
23042: return zend_binary_assign_op_helper_SPEC_UNUSED_TMP(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
23043: }
23044:
23045: static int ZEND_FASTCALL ZEND_ASSIGN_MOD_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
23046: {
23047: return zend_binary_assign_op_helper_SPEC_UNUSED_TMP(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
23048: }
23049:
23050: static int ZEND_FASTCALL ZEND_ASSIGN_SL_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
23051: {
23052: return zend_binary_assign_op_helper_SPEC_UNUSED_TMP(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
23053: }
23054:
23055: static int ZEND_FASTCALL ZEND_ASSIGN_SR_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
23056: {
23057: return zend_binary_assign_op_helper_SPEC_UNUSED_TMP(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
23058: }
23059:
23060: static int ZEND_FASTCALL ZEND_ASSIGN_CONCAT_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
23061: {
23062: return zend_binary_assign_op_helper_SPEC_UNUSED_TMP(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
23063: }
23064:
23065: static int ZEND_FASTCALL ZEND_ASSIGN_BW_OR_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
23066: {
23067: return zend_binary_assign_op_helper_SPEC_UNUSED_TMP(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
23068: }
23069:
23070: static int ZEND_FASTCALL ZEND_ASSIGN_BW_AND_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
23071: {
23072: return zend_binary_assign_op_helper_SPEC_UNUSED_TMP(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
23073: }
23074:
23075: static int ZEND_FASTCALL ZEND_ASSIGN_BW_XOR_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
23076: {
23077: return zend_binary_assign_op_helper_SPEC_UNUSED_TMP(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
23078: }
23079:
23080: static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_TMP(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS)
23081: {
1.1.1.2 misho 23082: USE_OPLINE
1.1 misho 23083: zend_free_op free_op2;
1.1.1.2 misho 23084: zval **object_ptr;
1.1 misho 23085: zval *object;
1.1.1.2 misho 23086: zval *property;
23087: zval **retval;
1.1 misho 23088: int have_get_ptr = 0;
23089:
1.1.1.2 misho 23090: SAVE_OPLINE();
23091: object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
23092: property = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
23093: retval = &EX_T(opline->result.var).var.ptr;
23094:
23095: if (IS_UNUSED == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 23096: zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
23097: }
23098:
23099: make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
23100: object = *object_ptr;
23101:
1.1.1.2 misho 23102: if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
1.1 misho 23103: zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
23104: zval_dtor(free_op2.var);
1.1.1.2 misho 23105: if (RETURN_VALUE_USED(opline)) {
23106: PZVAL_LOCK(&EG(uninitialized_zval));
23107: *retval = &EG(uninitialized_zval);
1.1 misho 23108: }
23109:
1.1.1.2 misho 23110: CHECK_EXCEPTION();
1.1 misho 23111: ZEND_VM_NEXT_OPCODE();
23112: }
23113:
23114: /* here we are sure we are dealing with an object */
23115:
23116: if (1) {
23117: MAKE_REAL_ZVAL_PTR(property);
23118: }
23119:
23120: if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
1.1.1.2 misho 23121: zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 23122: if (zptr != NULL) { /* NULL means no success in getting PTR */
23123: SEPARATE_ZVAL_IF_NOT_REF(zptr);
23124:
23125: have_get_ptr = 1;
23126: incdec_op(*zptr);
1.1.1.2 misho 23127: if (RETURN_VALUE_USED(opline)) {
1.1 misho 23128: *retval = *zptr;
23129: PZVAL_LOCK(*retval);
23130: }
23131: }
23132: }
23133:
23134: if (!have_get_ptr) {
23135: if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
1.1.1.2 misho 23136: zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 23137:
1.1.1.2 misho 23138: if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
1.1 misho 23139: zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
23140:
23141: if (Z_REFCOUNT_P(z) == 0) {
23142: GC_REMOVE_ZVAL_FROM_BUFFER(z);
23143: zval_dtor(z);
23144: FREE_ZVAL(z);
23145: }
23146: z = value;
23147: }
23148: Z_ADDREF_P(z);
23149: SEPARATE_ZVAL_IF_NOT_REF(&z);
23150: incdec_op(z);
23151: *retval = z;
1.1.1.2 misho 23152: Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
23153: SELECTIVE_PZVAL_LOCK(*retval, opline);
1.1 misho 23154: zval_ptr_dtor(&z);
23155: } else {
23156: zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
1.1.1.2 misho 23157: if (RETURN_VALUE_USED(opline)) {
23158: PZVAL_LOCK(&EG(uninitialized_zval));
23159: *retval = &EG(uninitialized_zval);
1.1 misho 23160: }
23161: }
23162: }
23163:
23164: if (1) {
23165: zval_ptr_dtor(&property);
23166: } else {
23167: zval_dtor(free_op2.var);
23168: }
23169:
1.1.1.2 misho 23170: CHECK_EXCEPTION();
1.1 misho 23171: ZEND_VM_NEXT_OPCODE();
23172: }
23173:
23174: static int ZEND_FASTCALL ZEND_PRE_INC_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
23175: {
23176: return zend_pre_incdec_property_helper_SPEC_UNUSED_TMP(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
23177: }
23178:
23179: static int ZEND_FASTCALL ZEND_PRE_DEC_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
23180: {
23181: return zend_pre_incdec_property_helper_SPEC_UNUSED_TMP(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
23182: }
23183:
23184: static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_TMP(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS)
23185: {
1.1.1.2 misho 23186: USE_OPLINE
1.1 misho 23187: zend_free_op free_op2;
1.1.1.2 misho 23188: zval **object_ptr;
1.1 misho 23189: zval *object;
1.1.1.2 misho 23190: zval *property;
23191: zval *retval;
1.1 misho 23192: int have_get_ptr = 0;
23193:
1.1.1.2 misho 23194: SAVE_OPLINE();
23195: object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
23196: property = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
23197: retval = &EX_T(opline->result.var).tmp_var;
23198:
23199: if (IS_UNUSED == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 23200: zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
23201: }
23202:
23203: make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
23204: object = *object_ptr;
23205:
1.1.1.2 misho 23206: if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
1.1 misho 23207: zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
23208: zval_dtor(free_op2.var);
1.1.1.2 misho 23209: ZVAL_NULL(retval);
1.1 misho 23210:
1.1.1.2 misho 23211: CHECK_EXCEPTION();
1.1 misho 23212: ZEND_VM_NEXT_OPCODE();
23213: }
23214:
23215: /* here we are sure we are dealing with an object */
23216:
23217: if (1) {
23218: MAKE_REAL_ZVAL_PTR(property);
23219: }
23220:
23221: if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
1.1.1.2 misho 23222: zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 23223: if (zptr != NULL) { /* NULL means no success in getting PTR */
23224: have_get_ptr = 1;
23225: SEPARATE_ZVAL_IF_NOT_REF(zptr);
23226:
1.1.1.2 misho 23227: ZVAL_COPY_VALUE(retval, *zptr);
1.1 misho 23228: zendi_zval_copy_ctor(*retval);
23229:
23230: incdec_op(*zptr);
23231:
23232: }
23233: }
23234:
23235: if (!have_get_ptr) {
23236: if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
1.1.1.2 misho 23237: zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 23238: zval *z_copy;
23239:
1.1.1.2 misho 23240: if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
1.1 misho 23241: zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
23242:
23243: if (Z_REFCOUNT_P(z) == 0) {
23244: GC_REMOVE_ZVAL_FROM_BUFFER(z);
23245: zval_dtor(z);
23246: FREE_ZVAL(z);
23247: }
23248: z = value;
23249: }
1.1.1.2 misho 23250: ZVAL_COPY_VALUE(retval, z);
1.1 misho 23251: zendi_zval_copy_ctor(*retval);
23252: ALLOC_ZVAL(z_copy);
1.1.1.2 misho 23253: INIT_PZVAL_COPY(z_copy, z);
1.1 misho 23254: zendi_zval_copy_ctor(*z_copy);
23255: incdec_op(z_copy);
23256: Z_ADDREF_P(z);
1.1.1.2 misho 23257: Z_OBJ_HT_P(object)->write_property(object, property, z_copy, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 23258: zval_ptr_dtor(&z_copy);
23259: zval_ptr_dtor(&z);
23260: } else {
23261: zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
1.1.1.2 misho 23262: ZVAL_NULL(retval);
1.1 misho 23263: }
23264: }
23265:
23266: if (1) {
23267: zval_ptr_dtor(&property);
23268: } else {
23269: zval_dtor(free_op2.var);
23270: }
23271:
1.1.1.2 misho 23272: CHECK_EXCEPTION();
1.1 misho 23273: ZEND_VM_NEXT_OPCODE();
23274: }
23275:
23276: static int ZEND_FASTCALL ZEND_POST_INC_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
23277: {
23278: return zend_post_incdec_property_helper_SPEC_UNUSED_TMP(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
23279: }
23280:
23281: static int ZEND_FASTCALL ZEND_POST_DEC_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
23282: {
23283: return zend_post_incdec_property_helper_SPEC_UNUSED_TMP(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
23284: }
23285:
1.1.1.2 misho 23286: static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_UNUSED_TMP(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 23287: {
1.1.1.2 misho 23288: USE_OPLINE
1.1 misho 23289:
1.1.1.2 misho 23290: zval *container;
1.1 misho 23291: zend_free_op free_op2;
1.1.1.2 misho 23292: zval *offset;
1.1 misho 23293:
1.1.1.2 misho 23294: SAVE_OPLINE();
23295: container = _get_obj_zval_ptr_unused(TSRMLS_C);
23296: offset = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
23297:
23298: if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
23299: UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
23300: zend_error(E_NOTICE, "Trying to get property of non-object");
23301: PZVAL_LOCK(&EG(uninitialized_zval));
23302: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
1.1 misho 23303: zval_dtor(free_op2.var);
23304: } else {
23305: zval *retval;
23306:
23307: if (1) {
23308: MAKE_REAL_ZVAL_PTR(offset);
23309: }
23310:
23311: /* here we are sure we are dealing with an object */
1.1.1.2 misho 23312: retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 23313:
1.1.1.2 misho 23314: PZVAL_LOCK(retval);
23315: AI_SET_PTR(&EX_T(opline->result.var), retval);
1.1 misho 23316:
23317: if (1) {
23318: zval_ptr_dtor(&offset);
23319: } else {
23320: zval_dtor(free_op2.var);
23321: }
23322: }
23323:
1.1.1.2 misho 23324: CHECK_EXCEPTION();
1.1 misho 23325: ZEND_VM_NEXT_OPCODE();
23326: }
23327:
23328: static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
23329: {
1.1.1.2 misho 23330: return zend_fetch_property_address_read_helper_SPEC_UNUSED_TMP(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
1.1 misho 23331: }
23332:
23333: static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
23334: {
1.1.1.2 misho 23335: USE_OPLINE
1.1 misho 23336: zend_free_op free_op1, free_op2;
1.1.1.2 misho 23337: zval *property;
1.1 misho 23338: zval **container;
23339:
1.1.1.2 misho 23340: SAVE_OPLINE();
23341: property = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
23342:
1.1 misho 23343: if (IS_UNUSED == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
1.1.1.2 misho 23344: PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
23345: EX_T(opline->op1.var).var.ptr = *EX_T(opline->op1.var).var.ptr_ptr;
1.1 misho 23346: }
23347:
23348: if (1) {
23349: MAKE_REAL_ZVAL_PTR(property);
23350: }
23351: container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
1.1.1.2 misho 23352: if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 23353: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
23354: }
1.1.1.2 misho 23355:
23356: zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_W TSRMLS_CC);
1.1 misho 23357: if (1) {
23358: zval_ptr_dtor(&property);
23359: } else {
23360: zval_dtor(free_op2.var);
23361: }
1.1.1.2 misho 23362: if (IS_UNUSED == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
23363: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 23364: }
23365:
23366: /* We are going to assign the result by reference */
23367: if (opline->extended_value & ZEND_FETCH_MAKE_REF) {
1.1.1.2 misho 23368: zval **retval_ptr = EX_T(opline->result.var).var.ptr_ptr;
23369:
23370: Z_DELREF_PP(retval_ptr);
23371: SEPARATE_ZVAL_TO_MAKE_IS_REF(retval_ptr);
23372: Z_ADDREF_PP(retval_ptr);
23373: EX_T(opline->result.var).var.ptr = *EX_T(opline->result.var).var.ptr_ptr;
23374: EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
1.1 misho 23375: }
23376:
1.1.1.2 misho 23377: CHECK_EXCEPTION();
1.1 misho 23378: ZEND_VM_NEXT_OPCODE();
23379: }
23380:
23381: static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
23382: {
1.1.1.2 misho 23383: USE_OPLINE
1.1 misho 23384: zend_free_op free_op1, free_op2;
1.1.1.2 misho 23385: zval *property;
23386: zval **container;
23387:
23388: SAVE_OPLINE();
23389: property = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
23390: container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
1.1 misho 23391:
23392: if (1) {
23393: MAKE_REAL_ZVAL_PTR(property);
23394: }
1.1.1.2 misho 23395: if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 23396: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
23397: }
1.1.1.2 misho 23398: zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_RW TSRMLS_CC);
1.1 misho 23399: if (1) {
23400: zval_ptr_dtor(&property);
23401: } else {
23402: zval_dtor(free_op2.var);
23403: }
1.1.1.2 misho 23404: if (IS_UNUSED == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
23405: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 23406: }
23407:
1.1.1.2 misho 23408: CHECK_EXCEPTION();
1.1 misho 23409: ZEND_VM_NEXT_OPCODE();
23410: }
23411:
23412: static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
23413: {
1.1.1.2 misho 23414: USE_OPLINE
23415:
23416: zval *container;
23417: zend_free_op free_op2;
23418: zval *offset;
23419:
23420: SAVE_OPLINE();
23421: container = _get_obj_zval_ptr_unused(TSRMLS_C);
23422: offset = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
23423:
23424: if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
23425: UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
23426: PZVAL_LOCK(&EG(uninitialized_zval));
23427: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
23428: zval_dtor(free_op2.var);
23429: } else {
23430: zval *retval;
23431:
23432: if (1) {
23433: MAKE_REAL_ZVAL_PTR(offset);
23434: }
23435:
23436: /* here we are sure we are dealing with an object */
23437: retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
23438:
23439: PZVAL_LOCK(retval);
23440: AI_SET_PTR(&EX_T(opline->result.var), retval);
23441:
23442: if (1) {
23443: zval_ptr_dtor(&offset);
23444: } else {
23445: zval_dtor(free_op2.var);
23446: }
23447: }
23448:
23449: CHECK_EXCEPTION();
23450: ZEND_VM_NEXT_OPCODE();
1.1 misho 23451: }
23452:
23453: static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
23454: {
1.1.1.2 misho 23455: USE_OPLINE
1.1 misho 23456:
1.1.1.2 misho 23457: if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
1.1 misho 23458: /* Behave like FETCH_OBJ_W */
23459: zend_free_op free_op1, free_op2;
1.1.1.2 misho 23460: zval *property;
23461: zval **container;
23462:
23463: SAVE_OPLINE();
23464: property = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
23465: container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
1.1 misho 23466:
23467: if (1) {
23468: MAKE_REAL_ZVAL_PTR(property);
23469: }
1.1.1.2 misho 23470: if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 23471: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
23472: }
1.1.1.2 misho 23473: zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_W TSRMLS_CC);
1.1 misho 23474: if (1) {
23475: zval_ptr_dtor(&property);
23476: } else {
23477: zval_dtor(free_op2.var);
23478: }
1.1.1.2 misho 23479: if (IS_UNUSED == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
23480: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 23481: }
23482:
1.1.1.2 misho 23483: CHECK_EXCEPTION();
1.1 misho 23484: ZEND_VM_NEXT_OPCODE();
23485: } else {
1.1.1.2 misho 23486: return zend_fetch_property_address_read_helper_SPEC_UNUSED_TMP(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
1.1 misho 23487: }
23488: }
23489:
23490: static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
23491: {
1.1.1.2 misho 23492: USE_OPLINE
1.1 misho 23493: zend_free_op free_op1, free_op2, free_res;
1.1.1.2 misho 23494: zval **container;
23495: zval *property;
23496:
23497: SAVE_OPLINE();
23498: container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
23499: property = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 23500:
23501: if (IS_UNUSED == IS_CV) {
23502: if (container != &EG(uninitialized_zval_ptr)) {
23503: SEPARATE_ZVAL_IF_NOT_REF(container);
23504: }
23505: }
23506: if (1) {
23507: MAKE_REAL_ZVAL_PTR(property);
23508: }
1.1.1.2 misho 23509: if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 23510: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
23511: }
1.1.1.2 misho 23512: zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_UNSET TSRMLS_CC);
1.1 misho 23513: if (1) {
23514: zval_ptr_dtor(&property);
23515: } else {
23516: zval_dtor(free_op2.var);
23517: }
1.1.1.2 misho 23518: if (IS_UNUSED == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
23519: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 23520: }
23521:
1.1.1.2 misho 23522: PZVAL_UNLOCK(*EX_T(opline->result.var).var.ptr_ptr, &free_res);
23523: if (EX_T(opline->result.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) {
23524: SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.var).var.ptr_ptr);
1.1 misho 23525: }
1.1.1.2 misho 23526: PZVAL_LOCK(*EX_T(opline->result.var).var.ptr_ptr);
1.1 misho 23527: FREE_OP_VAR_PTR(free_res);
1.1.1.2 misho 23528: CHECK_EXCEPTION();
1.1 misho 23529: ZEND_VM_NEXT_OPCODE();
23530: }
23531:
23532: static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
23533: {
1.1.1.2 misho 23534: USE_OPLINE
1.1 misho 23535: zend_free_op free_op2;
1.1.1.2 misho 23536: zval **object_ptr;
23537: zval *property_name;
23538:
23539: SAVE_OPLINE();
23540: object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
23541: property_name = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 23542:
23543: if (1) {
23544: MAKE_REAL_ZVAL_PTR(property_name);
23545: }
1.1.1.2 misho 23546: if (IS_UNUSED == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 23547: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
23548: }
1.1.1.2 misho 23549: zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), ZEND_ASSIGN_OBJ, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 23550: if (1) {
23551: zval_ptr_dtor(&property_name);
23552: } else {
23553: zval_dtor(free_op2.var);
23554: }
23555:
23556: /* assign_obj has two opcodes! */
1.1.1.2 misho 23557: CHECK_EXCEPTION();
1.1 misho 23558: ZEND_VM_INC_OPCODE();
23559: ZEND_VM_NEXT_OPCODE();
23560: }
23561:
23562: static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
23563: {
1.1.1.2 misho 23564: USE_OPLINE
1.1 misho 23565: zend_free_op free_op2;
1.1.1.2 misho 23566: zval *str = &EX_T(opline->result.var).tmp_var;
23567: zval *var;
1.1 misho 23568: zval var_copy;
23569: int use_copy = 0;
23570:
1.1.1.2 misho 23571: SAVE_OPLINE();
23572: var = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
23573:
1.1 misho 23574: if (IS_UNUSED == IS_UNUSED) {
23575: /* Initialize for erealloc in add_string_to_string */
23576: Z_STRVAL_P(str) = NULL;
23577: Z_STRLEN_P(str) = 0;
23578: Z_TYPE_P(str) = IS_STRING;
23579:
23580: INIT_PZVAL(str);
23581: }
23582:
23583: if (Z_TYPE_P(var) != IS_STRING) {
23584: zend_make_printable_zval(var, &var_copy, &use_copy);
23585:
23586: if (use_copy) {
23587: var = &var_copy;
23588: }
23589: }
23590: add_string_to_string(str, str, var);
23591:
23592: if (use_copy) {
23593: zval_dtor(var);
23594: }
23595: /* original comment, possibly problematic:
23596: * FREE_OP is missing intentionally here - we're always working on the same temporary variable
23597: * (Zeev): I don't think it's problematic, we only use variables
23598: * which aren't affected by FREE_OP(Ts, )'s anyway, unless they're
23599: * string offsets or overloaded objects
23600: */
23601: zval_dtor(free_op2.var);
23602:
1.1.1.2 misho 23603: CHECK_EXCEPTION();
1.1 misho 23604: ZEND_VM_NEXT_OPCODE();
23605: }
23606:
23607: static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
23608: {
1.1.1.2 misho 23609: USE_OPLINE
1.1 misho 23610: zval *function_name;
23611: char *function_name_strval;
23612: int function_name_strlen;
23613: zend_free_op free_op2;
23614:
1.1.1.2 misho 23615: SAVE_OPLINE();
1.1 misho 23616: zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
23617:
1.1.1.2 misho 23618: function_name = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 23619:
1.1.1.2 misho 23620: if (IS_TMP_VAR != IS_CONST &&
23621: UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
1.1 misho 23622: zend_error_noreturn(E_ERROR, "Method name must be a string");
23623: }
23624:
23625: function_name_strval = Z_STRVAL_P(function_name);
23626: function_name_strlen = Z_STRLEN_P(function_name);
23627:
23628: EX(object) = _get_obj_zval_ptr_unused(TSRMLS_C);
23629:
1.1.1.2 misho 23630: if (EXPECTED(EX(object) != NULL) &&
23631: EXPECTED(Z_TYPE_P(EX(object)) == IS_OBJECT)) {
23632: EX(called_scope) = Z_OBJCE_P(EX(object));
1.1 misho 23633:
1.1.1.2 misho 23634: if (IS_TMP_VAR != IS_CONST ||
23635: (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope))) == NULL) {
23636: zval *object = EX(object);
23637:
23638: if (UNEXPECTED(Z_OBJ_HT_P(EX(object))->get_method == NULL)) {
23639: zend_error_noreturn(E_ERROR, "Object does not support method calls");
23640: }
23641:
23642: /* First, locate the function. */
23643: EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen, ((IS_TMP_VAR == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC);
23644: if (UNEXPECTED(EX(fbc) == NULL)) {
23645: zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval);
23646: }
23647: if (IS_TMP_VAR == IS_CONST &&
23648: EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) &&
23649: EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) &&
23650: EXPECTED(EX(object) == object)) {
23651: CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope), EX(fbc));
23652: }
1.1 misho 23653: }
23654: } else {
23655: zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval);
23656: }
23657:
23658: if ((EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) != 0) {
23659: EX(object) = NULL;
23660: } else {
23661: if (!PZVAL_IS_REF(EX(object))) {
23662: Z_ADDREF_P(EX(object)); /* For $this pointer */
23663: } else {
23664: zval *this_ptr;
23665: ALLOC_ZVAL(this_ptr);
23666: INIT_PZVAL_COPY(this_ptr, EX(object));
23667: zval_copy_ctor(this_ptr);
23668: EX(object) = this_ptr;
23669: }
23670: }
23671:
23672: zval_dtor(free_op2.var);
23673:
1.1.1.2 misho 23674: CHECK_EXCEPTION();
1.1 misho 23675: ZEND_VM_NEXT_OPCODE();
23676: }
23677:
23678: static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
23679: {
1.1.1.2 misho 23680: USE_OPLINE
1.1 misho 23681:
1.1.1.2 misho 23682: array_init(&EX_T(opline->result.var).tmp_var);
1.1 misho 23683: if (IS_UNUSED == IS_UNUSED) {
23684: ZEND_VM_NEXT_OPCODE();
23685: #if 0 || IS_UNUSED != IS_UNUSED
23686: } else {
23687: return ZEND_ADD_ARRAY_ELEMENT_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
23688: #endif
23689: }
23690: }
23691:
23692: static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
23693: {
1.1.1.2 misho 23694: USE_OPLINE
1.1 misho 23695: zend_free_op free_op2;
1.1.1.2 misho 23696: zval **container;
1.1 misho 23697: zval *offset;
1.1.1.2 misho 23698: ulong hval;
1.1 misho 23699:
1.1.1.2 misho 23700: SAVE_OPLINE();
23701: container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
1.1 misho 23702: if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) {
23703: SEPARATE_ZVAL_IF_NOT_REF(container);
23704: }
1.1.1.2 misho 23705: offset = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 23706:
23707: if (IS_UNUSED != IS_VAR || container) {
23708: switch (Z_TYPE_PP(container)) {
23709: case IS_ARRAY: {
23710: HashTable *ht = Z_ARRVAL_PP(container);
23711:
23712: switch (Z_TYPE_P(offset)) {
23713: case IS_DOUBLE:
1.1.1.2 misho 23714: hval = zend_dval_to_lval(Z_DVAL_P(offset));
1.1.1.3 misho 23715: zend_hash_index_del(ht, hval);
23716: break;
1.1 misho 23717: case IS_RESOURCE:
23718: case IS_BOOL:
23719: case IS_LONG:
1.1.1.2 misho 23720: hval = Z_LVAL_P(offset);
23721: zend_hash_index_del(ht, hval);
1.1 misho 23722: break;
23723: case IS_STRING:
23724: if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) {
23725: Z_ADDREF_P(offset);
23726: }
1.1.1.2 misho 23727: if (IS_TMP_VAR == IS_CONST) {
23728: hval = Z_HASH_P(offset);
23729: } else {
23730: ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_dim);
23731: if (IS_INTERNED(Z_STRVAL_P(offset))) {
23732: hval = INTERNED_HASH(Z_STRVAL_P(offset));
23733: } else {
23734: hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
1.1 misho 23735: }
23736: }
1.1.1.2 misho 23737: if (ht == &EG(symbol_table)) {
23738: zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC);
23739: } else {
23740: zend_hash_quick_del(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval);
23741: }
23742: if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) {
23743: zval_ptr_dtor(&offset);
23744: }
23745: break;
23746: num_index_dim:
23747: zend_hash_index_del(ht, hval);
1.1 misho 23748: if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) {
23749: zval_ptr_dtor(&offset);
23750: }
23751: break;
23752: case IS_NULL:
23753: zend_hash_del(ht, "", sizeof(""));
23754: break;
23755: default:
23756: zend_error(E_WARNING, "Illegal offset type in unset");
23757: break;
23758: }
23759: zval_dtor(free_op2.var);
23760: break;
23761: }
23762: case IS_OBJECT:
1.1.1.2 misho 23763: if (UNEXPECTED(Z_OBJ_HT_P(*container)->unset_dimension == NULL)) {
1.1 misho 23764: zend_error_noreturn(E_ERROR, "Cannot use object as array");
23765: }
23766: if (1) {
23767: MAKE_REAL_ZVAL_PTR(offset);
23768: }
23769: Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC);
23770: if (1) {
23771: zval_ptr_dtor(&offset);
23772: } else {
23773: zval_dtor(free_op2.var);
23774: }
23775: break;
23776: case IS_STRING:
23777: zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
23778: ZEND_VM_CONTINUE(); /* bailed out before */
23779: default:
23780: zval_dtor(free_op2.var);
23781: break;
23782: }
23783: } else {
23784: zval_dtor(free_op2.var);
23785: }
23786:
1.1.1.2 misho 23787: CHECK_EXCEPTION();
1.1 misho 23788: ZEND_VM_NEXT_OPCODE();
23789: }
23790:
23791: static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
23792: {
1.1.1.2 misho 23793: USE_OPLINE
1.1 misho 23794: zend_free_op free_op2;
1.1.1.2 misho 23795: zval **container;
23796: zval *offset;
23797:
23798: SAVE_OPLINE();
23799: container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
23800: offset = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 23801:
23802: if (IS_UNUSED != IS_VAR || container) {
23803: if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) {
23804: SEPARATE_ZVAL_IF_NOT_REF(container);
23805: }
23806: if (Z_TYPE_PP(container) == IS_OBJECT) {
23807: if (1) {
23808: MAKE_REAL_ZVAL_PTR(offset);
23809: }
23810: if (Z_OBJ_HT_P(*container)->unset_property) {
1.1.1.2 misho 23811: Z_OBJ_HT_P(*container)->unset_property(*container, offset, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 23812: } else {
23813: zend_error(E_NOTICE, "Trying to unset property of non-object");
23814: }
23815: if (1) {
23816: zval_ptr_dtor(&offset);
23817: } else {
23818: zval_dtor(free_op2.var);
23819: }
23820: } else {
23821: zval_dtor(free_op2.var);
23822: }
23823: } else {
23824: zval_dtor(free_op2.var);
23825: }
23826:
1.1.1.2 misho 23827: CHECK_EXCEPTION();
1.1 misho 23828: ZEND_VM_NEXT_OPCODE();
23829: }
23830:
23831: static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_TMP(int prop_dim, ZEND_OPCODE_HANDLER_ARGS)
23832: {
1.1.1.2 misho 23833: USE_OPLINE
23834: zend_free_op free_op2;
23835: zval **container;
1.1 misho 23836: zval **value = NULL;
23837: int result = 0;
1.1.1.2 misho 23838: ulong hval;
23839: zval *offset;
1.1 misho 23840:
1.1.1.2 misho 23841: SAVE_OPLINE();
23842: container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
1.1 misho 23843:
1.1.1.2 misho 23844: offset = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 23845:
1.1.1.2 misho 23846: if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) {
23847: HashTable *ht;
23848: int isset = 0;
1.1 misho 23849:
1.1.1.2 misho 23850: ht = Z_ARRVAL_PP(container);
23851:
23852: switch (Z_TYPE_P(offset)) {
23853: case IS_DOUBLE:
23854: hval = zend_dval_to_lval(Z_DVAL_P(offset));
23855: goto num_index_prop;
23856: case IS_RESOURCE:
23857: case IS_BOOL:
23858: case IS_LONG:
23859: hval = Z_LVAL_P(offset);
23860: num_index_prop:
23861: if (zend_hash_index_find(ht, hval, (void **) &value) == SUCCESS) {
23862: isset = 1;
23863: }
23864: break;
23865: case IS_STRING:
23866: if (IS_TMP_VAR == IS_CONST) {
23867: hval = Z_HASH_P(offset);
23868: } else {
23869: if (!prop_dim) {
23870: ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_prop);
1.1 misho 23871: }
1.1.1.2 misho 23872: if (IS_INTERNED(Z_STRVAL_P(offset))) {
23873: hval = INTERNED_HASH(Z_STRVAL_P(offset));
1.1 misho 23874: } else {
1.1.1.2 misho 23875: hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
1.1 misho 23876: }
1.1.1.2 misho 23877: }
23878: if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) {
23879: isset = 1;
23880: }
23881: break;
23882: case IS_NULL:
23883: if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) {
23884: isset = 1;
23885: }
23886: break;
23887: default:
23888: zend_error(E_WARNING, "Illegal offset type in isset or empty");
23889: break;
23890: }
23891:
23892: if (opline->extended_value & ZEND_ISSET) {
23893: if (isset && Z_TYPE_PP(value) == IS_NULL) {
23894: result = 0;
23895: } else {
23896: result = isset;
1.1 misho 23897: }
1.1.1.2 misho 23898: } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
23899: if (!isset || !i_zend_is_true(*value)) {
23900: result = 0;
23901: } else {
23902: result = 1;
1.1 misho 23903: }
1.1.1.2 misho 23904: }
23905: zval_dtor(free_op2.var);
23906: } else if (Z_TYPE_PP(container) == IS_OBJECT) {
23907: if (1) {
23908: MAKE_REAL_ZVAL_PTR(offset);
23909: }
23910: if (prop_dim) {
23911: if (Z_OBJ_HT_P(*container)->has_property) {
23912: result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 23913: } else {
1.1.1.2 misho 23914: zend_error(E_NOTICE, "Trying to check property of non-object");
23915: result = 0;
1.1 misho 23916: }
1.1.1.2 misho 23917: } else {
23918: if (Z_OBJ_HT_P(*container)->has_dimension) {
23919: result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0 TSRMLS_CC);
1.1 misho 23920: } else {
1.1.1.2 misho 23921: zend_error(E_NOTICE, "Trying to check element of non-array");
23922: result = 0;
1.1 misho 23923: }
1.1.1.2 misho 23924: }
23925: if (1) {
23926: zval_ptr_dtor(&offset);
23927: } else {
23928: zval_dtor(free_op2.var);
23929: }
23930: } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */
23931: zval tmp;
1.1 misho 23932:
1.1.1.2 misho 23933: if (Z_TYPE_P(offset) != IS_LONG) {
23934: if (Z_TYPE_P(offset) <= IS_BOOL /* simple scalar types */
23935: || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */
23936: && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) {
23937: ZVAL_COPY_VALUE(&tmp, offset);
1.1 misho 23938: zval_copy_ctor(&tmp);
23939: convert_to_long(&tmp);
23940: offset = &tmp;
1.1.1.2 misho 23941: } else {
23942: /* can not be converted to proper offset, return "not set" */
23943: result = 0;
1.1 misho 23944: }
1.1.1.2 misho 23945: }
23946: if (Z_TYPE_P(offset) == IS_LONG) {
23947: if (opline->extended_value & ZEND_ISSET) {
23948: if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
23949: result = 1;
23950: }
23951: } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
23952: if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') {
23953: result = 1;
1.1 misho 23954: }
23955: }
23956: }
1.1.1.2 misho 23957: zval_dtor(free_op2.var);
23958: } else {
23959: zval_dtor(free_op2.var);
1.1 misho 23960: }
23961:
1.1.1.2 misho 23962: Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
23963: if (opline->extended_value & ZEND_ISSET) {
23964: Z_LVAL(EX_T(opline->result.var).tmp_var) = result;
23965: } else {
23966: Z_LVAL(EX_T(opline->result.var).tmp_var) = !result;
1.1 misho 23967: }
23968:
1.1.1.2 misho 23969: CHECK_EXCEPTION();
1.1 misho 23970: ZEND_VM_NEXT_OPCODE();
23971: }
23972:
23973: static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
23974: {
23975: return zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_TMP(0, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
23976: }
23977:
23978: static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
23979: {
23980: return zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_TMP(1, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
23981: }
23982:
23983: static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_VAR(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
23984: {
1.1.1.2 misho 23985: USE_OPLINE
1.1 misho 23986: zend_free_op free_op2, free_op_data1;
23987: zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
23988: zval *object;
1.1.1.2 misho 23989: zval *property = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
23990: zval *value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R);
1.1 misho 23991: int have_get_ptr = 0;
23992:
1.1.1.2 misho 23993: if (IS_UNUSED == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 23994: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
23995: }
23996:
23997: make_real_object(object_ptr TSRMLS_CC);
23998: object = *object_ptr;
23999:
1.1.1.2 misho 24000: if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
1.1 misho 24001: zend_error(E_WARNING, "Attempt to assign property of non-object");
24002: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
24003: FREE_OP(free_op_data1);
24004:
1.1.1.2 misho 24005: if (RETURN_VALUE_USED(opline)) {
24006: PZVAL_LOCK(&EG(uninitialized_zval));
24007: EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
24008: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 24009: }
24010: } else {
24011: /* here we are sure we are dealing with an object */
24012: if (0) {
24013: MAKE_REAL_ZVAL_PTR(property);
24014: }
24015:
24016: /* here property is a string */
24017: if (opline->extended_value == ZEND_ASSIGN_OBJ
24018: && Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
1.1.1.2 misho 24019: zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 24020: if (zptr != NULL) { /* NULL means no success in getting PTR */
24021: SEPARATE_ZVAL_IF_NOT_REF(zptr);
24022:
24023: have_get_ptr = 1;
24024: binary_op(*zptr, *zptr, value TSRMLS_CC);
1.1.1.2 misho 24025: if (RETURN_VALUE_USED(opline)) {
1.1 misho 24026: PZVAL_LOCK(*zptr);
1.1.1.2 misho 24027: EX_T(opline->result.var).var.ptr = *zptr;
24028: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 24029: }
24030: }
24031: }
24032:
24033: if (!have_get_ptr) {
24034: zval *z = NULL;
24035:
24036: if (opline->extended_value == ZEND_ASSIGN_OBJ) {
24037: if (Z_OBJ_HT_P(object)->read_property) {
1.1.1.2 misho 24038: z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 24039: }
24040: } else /* if (opline->extended_value == ZEND_ASSIGN_DIM) */ {
24041: if (Z_OBJ_HT_P(object)->read_dimension) {
24042: z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC);
24043: }
24044: }
24045: if (z) {
24046: if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
24047: zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
24048:
24049: if (Z_REFCOUNT_P(z) == 0) {
24050: GC_REMOVE_ZVAL_FROM_BUFFER(z);
24051: zval_dtor(z);
24052: FREE_ZVAL(z);
24053: }
24054: z = value;
24055: }
24056: Z_ADDREF_P(z);
24057: SEPARATE_ZVAL_IF_NOT_REF(&z);
24058: binary_op(z, z, value TSRMLS_CC);
24059: if (opline->extended_value == ZEND_ASSIGN_OBJ) {
1.1.1.2 misho 24060: Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 24061: } else /* if (opline->extended_value == ZEND_ASSIGN_DIM) */ {
24062: Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC);
24063: }
1.1.1.2 misho 24064: if (RETURN_VALUE_USED(opline)) {
1.1 misho 24065: PZVAL_LOCK(z);
1.1.1.2 misho 24066: EX_T(opline->result.var).var.ptr = z;
24067: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 24068: }
24069: zval_ptr_dtor(&z);
24070: } else {
24071: zend_error(E_WARNING, "Attempt to assign property of non-object");
1.1.1.2 misho 24072: if (RETURN_VALUE_USED(opline)) {
24073: PZVAL_LOCK(&EG(uninitialized_zval));
24074: EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
24075: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 24076: }
24077: }
24078: }
24079:
24080: if (0) {
24081: zval_ptr_dtor(&property);
24082: } else {
24083: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
24084: }
24085: FREE_OP(free_op_data1);
24086: }
24087:
24088: /* assign_obj has two opcodes! */
1.1.1.2 misho 24089: CHECK_EXCEPTION();
1.1 misho 24090: ZEND_VM_INC_OPCODE();
24091: ZEND_VM_NEXT_OPCODE();
24092: }
24093:
24094: static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_UNUSED_VAR(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
24095: {
1.1.1.2 misho 24096: USE_OPLINE
1.1 misho 24097: zend_free_op free_op2, free_op_data2, free_op_data1;
24098: zval **var_ptr;
24099: zval *value;
24100:
1.1.1.2 misho 24101: SAVE_OPLINE();
1.1 misho 24102: switch (opline->extended_value) {
24103: case ZEND_ASSIGN_OBJ:
24104: return zend_binary_assign_op_obj_helper_SPEC_UNUSED_VAR(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
24105: break;
24106: case ZEND_ASSIGN_DIM: {
24107: zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
24108:
1.1.1.2 misho 24109: if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 24110: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
1.1.1.2 misho 24111: } else if (UNEXPECTED(Z_TYPE_PP(container) == IS_OBJECT)) {
1.1 misho 24112: if (IS_UNUSED == IS_VAR && !0) {
24113: Z_ADDREF_PP(container); /* undo the effect of get_obj_zval_ptr_ptr() */
24114: }
24115: return zend_binary_assign_op_obj_helper_SPEC_UNUSED_VAR(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
24116: } else {
1.1.1.2 misho 24117: zval *dim = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 24118:
1.1.1.2 misho 24119: zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), container, dim, IS_VAR, BP_VAR_RW TSRMLS_CC);
24120: value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R);
24121: var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC);
1.1 misho 24122: }
24123: }
24124: break;
24125: default:
1.1.1.2 misho 24126: value = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 24127: var_ptr = NULL;
24128: /* do nothing */
24129: break;
24130: }
24131:
1.1.1.2 misho 24132: if (UNEXPECTED(var_ptr == NULL)) {
1.1 misho 24133: zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets");
24134: }
24135:
1.1.1.2 misho 24136: if (UNEXPECTED(*var_ptr == &EG(error_zval))) {
24137: if (RETURN_VALUE_USED(opline)) {
24138: PZVAL_LOCK(&EG(uninitialized_zval));
24139: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
1.1 misho 24140: }
24141: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
24142:
1.1.1.2 misho 24143: CHECK_EXCEPTION();
24144: if (opline->extended_value == ZEND_ASSIGN_DIM) {
24145: ZEND_VM_INC_OPCODE();
24146: }
1.1 misho 24147: ZEND_VM_NEXT_OPCODE();
24148: }
24149:
24150: SEPARATE_ZVAL_IF_NOT_REF(var_ptr);
24151:
1.1.1.2 misho 24152: if (UNEXPECTED(Z_TYPE_PP(var_ptr) == IS_OBJECT)
24153: && Z_OBJ_HANDLER_PP(var_ptr, get)
1.1 misho 24154: && Z_OBJ_HANDLER_PP(var_ptr, set)) {
24155: /* proxy object */
24156: zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC);
24157: Z_ADDREF_P(objval);
24158: binary_op(objval, objval, value TSRMLS_CC);
24159: Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC);
24160: zval_ptr_dtor(&objval);
24161: } else {
24162: binary_op(*var_ptr, *var_ptr, value TSRMLS_CC);
24163: }
24164:
1.1.1.2 misho 24165: if (RETURN_VALUE_USED(opline)) {
1.1 misho 24166: PZVAL_LOCK(*var_ptr);
1.1.1.2 misho 24167: AI_SET_PTR(&EX_T(opline->result.var), *var_ptr);
1.1 misho 24168: }
24169: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
24170:
24171: if (opline->extended_value == ZEND_ASSIGN_DIM) {
24172: FREE_OP(free_op_data1);
24173: FREE_OP_VAR_PTR(free_op_data2);
24174:
1.1.1.2 misho 24175: CHECK_EXCEPTION();
24176: ZEND_VM_INC_OPCODE();
24177: } else {
24178:
24179: CHECK_EXCEPTION();
24180: }
1.1 misho 24181: ZEND_VM_NEXT_OPCODE();
24182: }
24183:
24184: static int ZEND_FASTCALL ZEND_ASSIGN_ADD_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
24185: {
24186: return zend_binary_assign_op_helper_SPEC_UNUSED_VAR(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
24187: }
24188:
24189: static int ZEND_FASTCALL ZEND_ASSIGN_SUB_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
24190: {
24191: return zend_binary_assign_op_helper_SPEC_UNUSED_VAR(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
24192: }
24193:
24194: static int ZEND_FASTCALL ZEND_ASSIGN_MUL_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
24195: {
24196: return zend_binary_assign_op_helper_SPEC_UNUSED_VAR(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
24197: }
24198:
24199: static int ZEND_FASTCALL ZEND_ASSIGN_DIV_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
24200: {
24201: return zend_binary_assign_op_helper_SPEC_UNUSED_VAR(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
24202: }
24203:
24204: static int ZEND_FASTCALL ZEND_ASSIGN_MOD_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
24205: {
24206: return zend_binary_assign_op_helper_SPEC_UNUSED_VAR(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
24207: }
24208:
24209: static int ZEND_FASTCALL ZEND_ASSIGN_SL_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
24210: {
24211: return zend_binary_assign_op_helper_SPEC_UNUSED_VAR(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
24212: }
24213:
24214: static int ZEND_FASTCALL ZEND_ASSIGN_SR_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
24215: {
24216: return zend_binary_assign_op_helper_SPEC_UNUSED_VAR(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
24217: }
24218:
24219: static int ZEND_FASTCALL ZEND_ASSIGN_CONCAT_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
24220: {
24221: return zend_binary_assign_op_helper_SPEC_UNUSED_VAR(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
24222: }
24223:
24224: static int ZEND_FASTCALL ZEND_ASSIGN_BW_OR_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
24225: {
24226: return zend_binary_assign_op_helper_SPEC_UNUSED_VAR(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
24227: }
24228:
24229: static int ZEND_FASTCALL ZEND_ASSIGN_BW_AND_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
24230: {
24231: return zend_binary_assign_op_helper_SPEC_UNUSED_VAR(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
24232: }
24233:
24234: static int ZEND_FASTCALL ZEND_ASSIGN_BW_XOR_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
24235: {
24236: return zend_binary_assign_op_helper_SPEC_UNUSED_VAR(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
24237: }
24238:
24239: static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_VAR(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS)
24240: {
1.1.1.2 misho 24241: USE_OPLINE
1.1 misho 24242: zend_free_op free_op2;
1.1.1.2 misho 24243: zval **object_ptr;
1.1 misho 24244: zval *object;
1.1.1.2 misho 24245: zval *property;
24246: zval **retval;
1.1 misho 24247: int have_get_ptr = 0;
24248:
1.1.1.2 misho 24249: SAVE_OPLINE();
24250: object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
24251: property = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
24252: retval = &EX_T(opline->result.var).var.ptr;
24253:
24254: if (IS_UNUSED == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 24255: zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
24256: }
24257:
24258: make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
24259: object = *object_ptr;
24260:
1.1.1.2 misho 24261: if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
1.1 misho 24262: zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
24263: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 24264: if (RETURN_VALUE_USED(opline)) {
24265: PZVAL_LOCK(&EG(uninitialized_zval));
24266: *retval = &EG(uninitialized_zval);
1.1 misho 24267: }
24268:
1.1.1.2 misho 24269: CHECK_EXCEPTION();
1.1 misho 24270: ZEND_VM_NEXT_OPCODE();
24271: }
24272:
24273: /* here we are sure we are dealing with an object */
24274:
24275: if (0) {
24276: MAKE_REAL_ZVAL_PTR(property);
24277: }
24278:
24279: if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
1.1.1.2 misho 24280: zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 24281: if (zptr != NULL) { /* NULL means no success in getting PTR */
24282: SEPARATE_ZVAL_IF_NOT_REF(zptr);
24283:
24284: have_get_ptr = 1;
24285: incdec_op(*zptr);
1.1.1.2 misho 24286: if (RETURN_VALUE_USED(opline)) {
1.1 misho 24287: *retval = *zptr;
24288: PZVAL_LOCK(*retval);
24289: }
24290: }
24291: }
24292:
24293: if (!have_get_ptr) {
24294: if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
1.1.1.2 misho 24295: zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 24296:
1.1.1.2 misho 24297: if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
1.1 misho 24298: zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
24299:
24300: if (Z_REFCOUNT_P(z) == 0) {
24301: GC_REMOVE_ZVAL_FROM_BUFFER(z);
24302: zval_dtor(z);
24303: FREE_ZVAL(z);
24304: }
24305: z = value;
24306: }
24307: Z_ADDREF_P(z);
24308: SEPARATE_ZVAL_IF_NOT_REF(&z);
24309: incdec_op(z);
24310: *retval = z;
1.1.1.2 misho 24311: Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
24312: SELECTIVE_PZVAL_LOCK(*retval, opline);
1.1 misho 24313: zval_ptr_dtor(&z);
24314: } else {
24315: zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
1.1.1.2 misho 24316: if (RETURN_VALUE_USED(opline)) {
24317: PZVAL_LOCK(&EG(uninitialized_zval));
24318: *retval = &EG(uninitialized_zval);
1.1 misho 24319: }
24320: }
24321: }
24322:
24323: if (0) {
24324: zval_ptr_dtor(&property);
24325: } else {
24326: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
24327: }
24328:
1.1.1.2 misho 24329: CHECK_EXCEPTION();
1.1 misho 24330: ZEND_VM_NEXT_OPCODE();
24331: }
24332:
24333: static int ZEND_FASTCALL ZEND_PRE_INC_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
24334: {
24335: return zend_pre_incdec_property_helper_SPEC_UNUSED_VAR(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
24336: }
24337:
24338: static int ZEND_FASTCALL ZEND_PRE_DEC_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
24339: {
24340: return zend_pre_incdec_property_helper_SPEC_UNUSED_VAR(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
24341: }
24342:
24343: static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_VAR(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS)
24344: {
1.1.1.2 misho 24345: USE_OPLINE
1.1 misho 24346: zend_free_op free_op2;
1.1.1.2 misho 24347: zval **object_ptr;
1.1 misho 24348: zval *object;
1.1.1.2 misho 24349: zval *property;
24350: zval *retval;
1.1 misho 24351: int have_get_ptr = 0;
24352:
1.1.1.2 misho 24353: SAVE_OPLINE();
24354: object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
24355: property = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
24356: retval = &EX_T(opline->result.var).tmp_var;
24357:
24358: if (IS_UNUSED == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 24359: zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
24360: }
24361:
24362: make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
24363: object = *object_ptr;
24364:
1.1.1.2 misho 24365: if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
1.1 misho 24366: zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
24367: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 24368: ZVAL_NULL(retval);
1.1 misho 24369:
1.1.1.2 misho 24370: CHECK_EXCEPTION();
1.1 misho 24371: ZEND_VM_NEXT_OPCODE();
24372: }
24373:
24374: /* here we are sure we are dealing with an object */
24375:
24376: if (0) {
24377: MAKE_REAL_ZVAL_PTR(property);
24378: }
24379:
24380: if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
1.1.1.2 misho 24381: zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 24382: if (zptr != NULL) { /* NULL means no success in getting PTR */
24383: have_get_ptr = 1;
24384: SEPARATE_ZVAL_IF_NOT_REF(zptr);
24385:
1.1.1.2 misho 24386: ZVAL_COPY_VALUE(retval, *zptr);
1.1 misho 24387: zendi_zval_copy_ctor(*retval);
24388:
24389: incdec_op(*zptr);
24390:
24391: }
24392: }
24393:
24394: if (!have_get_ptr) {
24395: if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
1.1.1.2 misho 24396: zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 24397: zval *z_copy;
24398:
1.1.1.2 misho 24399: if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
1.1 misho 24400: zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
24401:
24402: if (Z_REFCOUNT_P(z) == 0) {
24403: GC_REMOVE_ZVAL_FROM_BUFFER(z);
24404: zval_dtor(z);
24405: FREE_ZVAL(z);
24406: }
24407: z = value;
24408: }
1.1.1.2 misho 24409: ZVAL_COPY_VALUE(retval, z);
1.1 misho 24410: zendi_zval_copy_ctor(*retval);
24411: ALLOC_ZVAL(z_copy);
1.1.1.2 misho 24412: INIT_PZVAL_COPY(z_copy, z);
1.1 misho 24413: zendi_zval_copy_ctor(*z_copy);
24414: incdec_op(z_copy);
24415: Z_ADDREF_P(z);
1.1.1.2 misho 24416: Z_OBJ_HT_P(object)->write_property(object, property, z_copy, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 24417: zval_ptr_dtor(&z_copy);
24418: zval_ptr_dtor(&z);
24419: } else {
24420: zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
1.1.1.2 misho 24421: ZVAL_NULL(retval);
1.1 misho 24422: }
24423: }
24424:
24425: if (0) {
24426: zval_ptr_dtor(&property);
24427: } else {
24428: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
24429: }
24430:
1.1.1.2 misho 24431: CHECK_EXCEPTION();
1.1 misho 24432: ZEND_VM_NEXT_OPCODE();
24433: }
24434:
24435: static int ZEND_FASTCALL ZEND_POST_INC_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
24436: {
24437: return zend_post_incdec_property_helper_SPEC_UNUSED_VAR(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
24438: }
24439:
24440: static int ZEND_FASTCALL ZEND_POST_DEC_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
24441: {
24442: return zend_post_incdec_property_helper_SPEC_UNUSED_VAR(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
24443: }
24444:
1.1.1.2 misho 24445: static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_UNUSED_VAR(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 24446: {
1.1.1.2 misho 24447: USE_OPLINE
1.1 misho 24448:
1.1.1.2 misho 24449: zval *container;
1.1 misho 24450: zend_free_op free_op2;
1.1.1.2 misho 24451: zval *offset;
1.1 misho 24452:
1.1.1.2 misho 24453: SAVE_OPLINE();
24454: container = _get_obj_zval_ptr_unused(TSRMLS_C);
24455: offset = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
24456:
24457: if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
24458: UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
24459: zend_error(E_NOTICE, "Trying to get property of non-object");
24460: PZVAL_LOCK(&EG(uninitialized_zval));
24461: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
1.1 misho 24462: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
24463: } else {
24464: zval *retval;
24465:
24466: if (0) {
24467: MAKE_REAL_ZVAL_PTR(offset);
24468: }
24469:
24470: /* here we are sure we are dealing with an object */
1.1.1.2 misho 24471: retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 24472:
1.1.1.2 misho 24473: PZVAL_LOCK(retval);
24474: AI_SET_PTR(&EX_T(opline->result.var), retval);
1.1 misho 24475:
24476: if (0) {
24477: zval_ptr_dtor(&offset);
24478: } else {
24479: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
24480: }
24481: }
24482:
1.1.1.2 misho 24483: CHECK_EXCEPTION();
1.1 misho 24484: ZEND_VM_NEXT_OPCODE();
24485: }
24486:
24487: static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
24488: {
1.1.1.2 misho 24489: return zend_fetch_property_address_read_helper_SPEC_UNUSED_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
1.1 misho 24490: }
24491:
24492: static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
24493: {
1.1.1.2 misho 24494: USE_OPLINE
1.1 misho 24495: zend_free_op free_op1, free_op2;
1.1.1.2 misho 24496: zval *property;
1.1 misho 24497: zval **container;
24498:
1.1.1.2 misho 24499: SAVE_OPLINE();
24500: property = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
24501:
1.1 misho 24502: if (IS_UNUSED == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
1.1.1.2 misho 24503: PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
24504: EX_T(opline->op1.var).var.ptr = *EX_T(opline->op1.var).var.ptr_ptr;
1.1 misho 24505: }
24506:
24507: if (0) {
24508: MAKE_REAL_ZVAL_PTR(property);
24509: }
24510: container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
1.1.1.2 misho 24511: if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 24512: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
24513: }
1.1.1.2 misho 24514:
24515: zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_W TSRMLS_CC);
1.1 misho 24516: if (0) {
24517: zval_ptr_dtor(&property);
24518: } else {
24519: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
24520: }
1.1.1.2 misho 24521: if (IS_UNUSED == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
24522: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 24523: }
24524:
24525: /* We are going to assign the result by reference */
24526: if (opline->extended_value & ZEND_FETCH_MAKE_REF) {
1.1.1.2 misho 24527: zval **retval_ptr = EX_T(opline->result.var).var.ptr_ptr;
24528:
24529: Z_DELREF_PP(retval_ptr);
24530: SEPARATE_ZVAL_TO_MAKE_IS_REF(retval_ptr);
24531: Z_ADDREF_PP(retval_ptr);
24532: EX_T(opline->result.var).var.ptr = *EX_T(opline->result.var).var.ptr_ptr;
24533: EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
1.1 misho 24534: }
24535:
1.1.1.2 misho 24536: CHECK_EXCEPTION();
1.1 misho 24537: ZEND_VM_NEXT_OPCODE();
24538: }
24539:
24540: static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
24541: {
1.1.1.2 misho 24542: USE_OPLINE
1.1 misho 24543: zend_free_op free_op1, free_op2;
1.1.1.2 misho 24544: zval *property;
24545: zval **container;
24546:
24547: SAVE_OPLINE();
24548: property = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
24549: container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
1.1 misho 24550:
24551: if (0) {
24552: MAKE_REAL_ZVAL_PTR(property);
24553: }
1.1.1.2 misho 24554: if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 24555: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
24556: }
1.1.1.2 misho 24557: zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_RW TSRMLS_CC);
1.1 misho 24558: if (0) {
24559: zval_ptr_dtor(&property);
24560: } else {
24561: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
24562: }
1.1.1.2 misho 24563: if (IS_UNUSED == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
24564: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 24565: }
24566:
1.1.1.2 misho 24567: CHECK_EXCEPTION();
1.1 misho 24568: ZEND_VM_NEXT_OPCODE();
24569: }
24570:
24571: static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
24572: {
1.1.1.2 misho 24573: USE_OPLINE
24574:
24575: zval *container;
24576: zend_free_op free_op2;
24577: zval *offset;
24578:
24579: SAVE_OPLINE();
24580: container = _get_obj_zval_ptr_unused(TSRMLS_C);
24581: offset = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
24582:
24583: if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
24584: UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
24585: PZVAL_LOCK(&EG(uninitialized_zval));
24586: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
24587: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
24588: } else {
24589: zval *retval;
24590:
24591: if (0) {
24592: MAKE_REAL_ZVAL_PTR(offset);
24593: }
24594:
24595: /* here we are sure we are dealing with an object */
24596: retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
24597:
24598: PZVAL_LOCK(retval);
24599: AI_SET_PTR(&EX_T(opline->result.var), retval);
24600:
24601: if (0) {
24602: zval_ptr_dtor(&offset);
24603: } else {
24604: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
24605: }
24606: }
24607:
24608: CHECK_EXCEPTION();
24609: ZEND_VM_NEXT_OPCODE();
1.1 misho 24610: }
24611:
24612: static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
24613: {
1.1.1.2 misho 24614: USE_OPLINE
1.1 misho 24615:
1.1.1.2 misho 24616: if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
1.1 misho 24617: /* Behave like FETCH_OBJ_W */
24618: zend_free_op free_op1, free_op2;
1.1.1.2 misho 24619: zval *property;
24620: zval **container;
24621:
24622: SAVE_OPLINE();
24623: property = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
24624: container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
1.1 misho 24625:
24626: if (0) {
24627: MAKE_REAL_ZVAL_PTR(property);
24628: }
1.1.1.2 misho 24629: if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 24630: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
24631: }
1.1.1.2 misho 24632: zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_W TSRMLS_CC);
1.1 misho 24633: if (0) {
24634: zval_ptr_dtor(&property);
24635: } else {
24636: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
24637: }
1.1.1.2 misho 24638: if (IS_UNUSED == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
24639: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 24640: }
24641:
1.1.1.2 misho 24642: CHECK_EXCEPTION();
1.1 misho 24643: ZEND_VM_NEXT_OPCODE();
24644: } else {
1.1.1.2 misho 24645: return zend_fetch_property_address_read_helper_SPEC_UNUSED_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
1.1 misho 24646: }
24647: }
24648:
24649: static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
24650: {
1.1.1.2 misho 24651: USE_OPLINE
1.1 misho 24652: zend_free_op free_op1, free_op2, free_res;
1.1.1.2 misho 24653: zval **container;
24654: zval *property;
24655:
24656: SAVE_OPLINE();
24657: container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
24658: property = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 24659:
24660: if (IS_UNUSED == IS_CV) {
24661: if (container != &EG(uninitialized_zval_ptr)) {
24662: SEPARATE_ZVAL_IF_NOT_REF(container);
24663: }
24664: }
24665: if (0) {
24666: MAKE_REAL_ZVAL_PTR(property);
24667: }
1.1.1.2 misho 24668: if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 24669: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
24670: }
1.1.1.2 misho 24671: zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_UNSET TSRMLS_CC);
1.1 misho 24672: if (0) {
24673: zval_ptr_dtor(&property);
24674: } else {
24675: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
24676: }
1.1.1.2 misho 24677: if (IS_UNUSED == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
24678: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 24679: }
24680:
1.1.1.2 misho 24681: PZVAL_UNLOCK(*EX_T(opline->result.var).var.ptr_ptr, &free_res);
24682: if (EX_T(opline->result.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) {
24683: SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.var).var.ptr_ptr);
1.1 misho 24684: }
1.1.1.2 misho 24685: PZVAL_LOCK(*EX_T(opline->result.var).var.ptr_ptr);
1.1 misho 24686: FREE_OP_VAR_PTR(free_res);
1.1.1.2 misho 24687: CHECK_EXCEPTION();
1.1 misho 24688: ZEND_VM_NEXT_OPCODE();
24689: }
24690:
24691: static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
24692: {
1.1.1.2 misho 24693: USE_OPLINE
1.1 misho 24694: zend_free_op free_op2;
1.1.1.2 misho 24695: zval **object_ptr;
24696: zval *property_name;
24697:
24698: SAVE_OPLINE();
24699: object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
24700: property_name = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 24701:
24702: if (0) {
24703: MAKE_REAL_ZVAL_PTR(property_name);
24704: }
1.1.1.2 misho 24705: if (IS_UNUSED == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 24706: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
24707: }
1.1.1.2 misho 24708: zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), ZEND_ASSIGN_OBJ, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 24709: if (0) {
24710: zval_ptr_dtor(&property_name);
24711: } else {
24712: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
24713: }
24714:
24715: /* assign_obj has two opcodes! */
1.1.1.2 misho 24716: CHECK_EXCEPTION();
1.1 misho 24717: ZEND_VM_INC_OPCODE();
24718: ZEND_VM_NEXT_OPCODE();
24719: }
24720:
24721: static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
24722: {
1.1.1.2 misho 24723: USE_OPLINE
1.1 misho 24724: zend_free_op free_op2;
1.1.1.2 misho 24725: zval *str = &EX_T(opline->result.var).tmp_var;
24726: zval *var;
1.1 misho 24727: zval var_copy;
24728: int use_copy = 0;
24729:
1.1.1.2 misho 24730: SAVE_OPLINE();
24731: var = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
24732:
1.1 misho 24733: if (IS_UNUSED == IS_UNUSED) {
24734: /* Initialize for erealloc in add_string_to_string */
24735: Z_STRVAL_P(str) = NULL;
24736: Z_STRLEN_P(str) = 0;
24737: Z_TYPE_P(str) = IS_STRING;
24738:
24739: INIT_PZVAL(str);
24740: }
24741:
24742: if (Z_TYPE_P(var) != IS_STRING) {
24743: zend_make_printable_zval(var, &var_copy, &use_copy);
24744:
24745: if (use_copy) {
24746: var = &var_copy;
24747: }
24748: }
24749: add_string_to_string(str, str, var);
24750:
24751: if (use_copy) {
24752: zval_dtor(var);
24753: }
24754: /* original comment, possibly problematic:
24755: * FREE_OP is missing intentionally here - we're always working on the same temporary variable
24756: * (Zeev): I don't think it's problematic, we only use variables
24757: * which aren't affected by FREE_OP(Ts, )'s anyway, unless they're
24758: * string offsets or overloaded objects
24759: */
24760: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
24761:
1.1.1.2 misho 24762: CHECK_EXCEPTION();
1.1 misho 24763: ZEND_VM_NEXT_OPCODE();
24764: }
24765:
24766: static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
24767: {
1.1.1.2 misho 24768: USE_OPLINE
1.1 misho 24769: zval *function_name;
24770: char *function_name_strval;
24771: int function_name_strlen;
24772: zend_free_op free_op2;
24773:
1.1.1.2 misho 24774: SAVE_OPLINE();
1.1 misho 24775: zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
24776:
1.1.1.2 misho 24777: function_name = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 24778:
1.1.1.2 misho 24779: if (IS_VAR != IS_CONST &&
24780: UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
1.1 misho 24781: zend_error_noreturn(E_ERROR, "Method name must be a string");
24782: }
24783:
24784: function_name_strval = Z_STRVAL_P(function_name);
24785: function_name_strlen = Z_STRLEN_P(function_name);
24786:
24787: EX(object) = _get_obj_zval_ptr_unused(TSRMLS_C);
24788:
1.1.1.2 misho 24789: if (EXPECTED(EX(object) != NULL) &&
24790: EXPECTED(Z_TYPE_P(EX(object)) == IS_OBJECT)) {
24791: EX(called_scope) = Z_OBJCE_P(EX(object));
1.1 misho 24792:
1.1.1.2 misho 24793: if (IS_VAR != IS_CONST ||
24794: (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope))) == NULL) {
24795: zval *object = EX(object);
24796:
24797: if (UNEXPECTED(Z_OBJ_HT_P(EX(object))->get_method == NULL)) {
24798: zend_error_noreturn(E_ERROR, "Object does not support method calls");
24799: }
24800:
24801: /* First, locate the function. */
24802: EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen, ((IS_VAR == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC);
24803: if (UNEXPECTED(EX(fbc) == NULL)) {
24804: zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval);
24805: }
24806: if (IS_VAR == IS_CONST &&
24807: EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) &&
24808: EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) &&
24809: EXPECTED(EX(object) == object)) {
24810: CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope), EX(fbc));
24811: }
1.1 misho 24812: }
24813: } else {
24814: zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval);
24815: }
24816:
24817: if ((EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) != 0) {
24818: EX(object) = NULL;
24819: } else {
24820: if (!PZVAL_IS_REF(EX(object))) {
24821: Z_ADDREF_P(EX(object)); /* For $this pointer */
24822: } else {
24823: zval *this_ptr;
24824: ALLOC_ZVAL(this_ptr);
24825: INIT_PZVAL_COPY(this_ptr, EX(object));
24826: zval_copy_ctor(this_ptr);
24827: EX(object) = this_ptr;
24828: }
24829: }
24830:
24831: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
24832:
1.1.1.2 misho 24833: CHECK_EXCEPTION();
1.1 misho 24834: ZEND_VM_NEXT_OPCODE();
24835: }
24836:
24837: static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
24838: {
1.1.1.2 misho 24839: USE_OPLINE
1.1 misho 24840:
1.1.1.2 misho 24841: array_init(&EX_T(opline->result.var).tmp_var);
1.1 misho 24842: if (IS_UNUSED == IS_UNUSED) {
24843: ZEND_VM_NEXT_OPCODE();
24844: #if 0 || IS_UNUSED != IS_UNUSED
24845: } else {
24846: return ZEND_ADD_ARRAY_ELEMENT_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
24847: #endif
24848: }
24849: }
24850:
24851: static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
24852: {
1.1.1.2 misho 24853: USE_OPLINE
1.1 misho 24854: zend_free_op free_op2;
1.1.1.2 misho 24855: zval **container;
1.1 misho 24856: zval *offset;
1.1.1.2 misho 24857: ulong hval;
1.1 misho 24858:
1.1.1.2 misho 24859: SAVE_OPLINE();
24860: container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
1.1 misho 24861: if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) {
24862: SEPARATE_ZVAL_IF_NOT_REF(container);
24863: }
1.1.1.2 misho 24864: offset = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 24865:
24866: if (IS_UNUSED != IS_VAR || container) {
24867: switch (Z_TYPE_PP(container)) {
24868: case IS_ARRAY: {
24869: HashTable *ht = Z_ARRVAL_PP(container);
24870:
24871: switch (Z_TYPE_P(offset)) {
24872: case IS_DOUBLE:
1.1.1.2 misho 24873: hval = zend_dval_to_lval(Z_DVAL_P(offset));
1.1.1.3 misho 24874: zend_hash_index_del(ht, hval);
24875: break;
1.1 misho 24876: case IS_RESOURCE:
24877: case IS_BOOL:
24878: case IS_LONG:
1.1.1.2 misho 24879: hval = Z_LVAL_P(offset);
24880: zend_hash_index_del(ht, hval);
1.1 misho 24881: break;
24882: case IS_STRING:
24883: if (IS_VAR == IS_CV || IS_VAR == IS_VAR) {
24884: Z_ADDREF_P(offset);
24885: }
1.1.1.2 misho 24886: if (IS_VAR == IS_CONST) {
24887: hval = Z_HASH_P(offset);
24888: } else {
24889: ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_dim);
24890: if (IS_INTERNED(Z_STRVAL_P(offset))) {
24891: hval = INTERNED_HASH(Z_STRVAL_P(offset));
24892: } else {
24893: hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
1.1 misho 24894: }
24895: }
1.1.1.2 misho 24896: if (ht == &EG(symbol_table)) {
24897: zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC);
24898: } else {
24899: zend_hash_quick_del(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval);
24900: }
24901: if (IS_VAR == IS_CV || IS_VAR == IS_VAR) {
24902: zval_ptr_dtor(&offset);
24903: }
24904: break;
24905: num_index_dim:
24906: zend_hash_index_del(ht, hval);
1.1 misho 24907: if (IS_VAR == IS_CV || IS_VAR == IS_VAR) {
24908: zval_ptr_dtor(&offset);
24909: }
24910: break;
24911: case IS_NULL:
24912: zend_hash_del(ht, "", sizeof(""));
24913: break;
24914: default:
24915: zend_error(E_WARNING, "Illegal offset type in unset");
24916: break;
24917: }
24918: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
24919: break;
24920: }
24921: case IS_OBJECT:
1.1.1.2 misho 24922: if (UNEXPECTED(Z_OBJ_HT_P(*container)->unset_dimension == NULL)) {
1.1 misho 24923: zend_error_noreturn(E_ERROR, "Cannot use object as array");
24924: }
24925: if (0) {
24926: MAKE_REAL_ZVAL_PTR(offset);
24927: }
24928: Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC);
24929: if (0) {
24930: zval_ptr_dtor(&offset);
24931: } else {
24932: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
24933: }
24934: break;
24935: case IS_STRING:
24936: zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
24937: ZEND_VM_CONTINUE(); /* bailed out before */
24938: default:
24939: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
24940: break;
24941: }
24942: } else {
24943: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
24944: }
24945:
1.1.1.2 misho 24946: CHECK_EXCEPTION();
1.1 misho 24947: ZEND_VM_NEXT_OPCODE();
24948: }
24949:
24950: static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
24951: {
1.1.1.2 misho 24952: USE_OPLINE
1.1 misho 24953: zend_free_op free_op2;
1.1.1.2 misho 24954: zval **container;
24955: zval *offset;
24956:
24957: SAVE_OPLINE();
24958: container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
24959: offset = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 24960:
24961: if (IS_UNUSED != IS_VAR || container) {
24962: if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) {
24963: SEPARATE_ZVAL_IF_NOT_REF(container);
24964: }
24965: if (Z_TYPE_PP(container) == IS_OBJECT) {
24966: if (0) {
24967: MAKE_REAL_ZVAL_PTR(offset);
24968: }
24969: if (Z_OBJ_HT_P(*container)->unset_property) {
1.1.1.2 misho 24970: Z_OBJ_HT_P(*container)->unset_property(*container, offset, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 24971: } else {
24972: zend_error(E_NOTICE, "Trying to unset property of non-object");
24973: }
24974: if (0) {
24975: zval_ptr_dtor(&offset);
24976: } else {
24977: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
24978: }
24979: } else {
24980: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
24981: }
24982: } else {
24983: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
24984: }
24985:
1.1.1.2 misho 24986: CHECK_EXCEPTION();
1.1 misho 24987: ZEND_VM_NEXT_OPCODE();
24988: }
24989:
24990: static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_VAR(int prop_dim, ZEND_OPCODE_HANDLER_ARGS)
24991: {
1.1.1.2 misho 24992: USE_OPLINE
24993: zend_free_op free_op2;
24994: zval **container;
1.1 misho 24995: zval **value = NULL;
24996: int result = 0;
1.1.1.2 misho 24997: ulong hval;
24998: zval *offset;
1.1 misho 24999:
1.1.1.2 misho 25000: SAVE_OPLINE();
25001: container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
1.1 misho 25002:
1.1.1.2 misho 25003: offset = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 25004:
1.1.1.2 misho 25005: if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) {
25006: HashTable *ht;
25007: int isset = 0;
1.1 misho 25008:
1.1.1.2 misho 25009: ht = Z_ARRVAL_PP(container);
25010:
25011: switch (Z_TYPE_P(offset)) {
25012: case IS_DOUBLE:
25013: hval = zend_dval_to_lval(Z_DVAL_P(offset));
25014: goto num_index_prop;
25015: case IS_RESOURCE:
25016: case IS_BOOL:
25017: case IS_LONG:
25018: hval = Z_LVAL_P(offset);
25019: num_index_prop:
25020: if (zend_hash_index_find(ht, hval, (void **) &value) == SUCCESS) {
25021: isset = 1;
25022: }
25023: break;
25024: case IS_STRING:
25025: if (IS_VAR == IS_CONST) {
25026: hval = Z_HASH_P(offset);
25027: } else {
25028: if (!prop_dim) {
25029: ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_prop);
1.1 misho 25030: }
1.1.1.2 misho 25031: if (IS_INTERNED(Z_STRVAL_P(offset))) {
25032: hval = INTERNED_HASH(Z_STRVAL_P(offset));
1.1 misho 25033: } else {
1.1.1.2 misho 25034: hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
1.1 misho 25035: }
1.1.1.2 misho 25036: }
25037: if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) {
25038: isset = 1;
25039: }
25040: break;
25041: case IS_NULL:
25042: if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) {
25043: isset = 1;
25044: }
25045: break;
25046: default:
25047: zend_error(E_WARNING, "Illegal offset type in isset or empty");
25048: break;
25049: }
25050:
25051: if (opline->extended_value & ZEND_ISSET) {
25052: if (isset && Z_TYPE_PP(value) == IS_NULL) {
25053: result = 0;
25054: } else {
25055: result = isset;
1.1 misho 25056: }
1.1.1.2 misho 25057: } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
25058: if (!isset || !i_zend_is_true(*value)) {
25059: result = 0;
25060: } else {
25061: result = 1;
1.1 misho 25062: }
1.1.1.2 misho 25063: }
25064: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
25065: } else if (Z_TYPE_PP(container) == IS_OBJECT) {
25066: if (0) {
25067: MAKE_REAL_ZVAL_PTR(offset);
25068: }
25069: if (prop_dim) {
25070: if (Z_OBJ_HT_P(*container)->has_property) {
25071: result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 25072: } else {
1.1.1.2 misho 25073: zend_error(E_NOTICE, "Trying to check property of non-object");
25074: result = 0;
1.1 misho 25075: }
1.1.1.2 misho 25076: } else {
25077: if (Z_OBJ_HT_P(*container)->has_dimension) {
25078: result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0 TSRMLS_CC);
1.1 misho 25079: } else {
1.1.1.2 misho 25080: zend_error(E_NOTICE, "Trying to check element of non-array");
25081: result = 0;
1.1 misho 25082: }
1.1.1.2 misho 25083: }
25084: if (0) {
25085: zval_ptr_dtor(&offset);
25086: } else {
25087: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
25088: }
25089: } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */
25090: zval tmp;
1.1 misho 25091:
1.1.1.2 misho 25092: if (Z_TYPE_P(offset) != IS_LONG) {
25093: if (Z_TYPE_P(offset) <= IS_BOOL /* simple scalar types */
25094: || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */
25095: && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) {
25096: ZVAL_COPY_VALUE(&tmp, offset);
1.1 misho 25097: zval_copy_ctor(&tmp);
25098: convert_to_long(&tmp);
25099: offset = &tmp;
1.1.1.2 misho 25100: } else {
25101: /* can not be converted to proper offset, return "not set" */
25102: result = 0;
1.1 misho 25103: }
1.1.1.2 misho 25104: }
25105: if (Z_TYPE_P(offset) == IS_LONG) {
25106: if (opline->extended_value & ZEND_ISSET) {
25107: if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
25108: result = 1;
25109: }
25110: } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
25111: if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') {
25112: result = 1;
1.1 misho 25113: }
25114: }
25115: }
1.1.1.2 misho 25116: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
25117: } else {
25118: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1 misho 25119: }
25120:
1.1.1.2 misho 25121: Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
25122: if (opline->extended_value & ZEND_ISSET) {
25123: Z_LVAL(EX_T(opline->result.var).tmp_var) = result;
25124: } else {
25125: Z_LVAL(EX_T(opline->result.var).tmp_var) = !result;
1.1 misho 25126: }
25127:
1.1.1.2 misho 25128: CHECK_EXCEPTION();
1.1 misho 25129: ZEND_VM_NEXT_OPCODE();
25130: }
25131:
25132: static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
25133: {
25134: return zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_VAR(0, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
25135: }
25136:
25137: static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
25138: {
25139: return zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_VAR(1, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
25140: }
25141:
25142: static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_UNUSED(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
25143: {
1.1.1.2 misho 25144: USE_OPLINE
1.1 misho 25145: zend_free_op free_op_data1;
25146: zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
25147: zval *object;
25148: zval *property = NULL;
1.1.1.2 misho 25149: zval *value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R);
1.1 misho 25150: int have_get_ptr = 0;
25151:
1.1.1.2 misho 25152: if (IS_UNUSED == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 25153: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
25154: }
25155:
25156: make_real_object(object_ptr TSRMLS_CC);
25157: object = *object_ptr;
25158:
1.1.1.2 misho 25159: if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
1.1 misho 25160: zend_error(E_WARNING, "Attempt to assign property of non-object");
25161:
25162: FREE_OP(free_op_data1);
25163:
1.1.1.2 misho 25164: if (RETURN_VALUE_USED(opline)) {
25165: PZVAL_LOCK(&EG(uninitialized_zval));
25166: EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
25167: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 25168: }
25169: } else {
25170: /* here we are sure we are dealing with an object */
25171: if (0) {
25172: MAKE_REAL_ZVAL_PTR(property);
25173: }
25174:
25175: /* here property is a string */
25176: if (opline->extended_value == ZEND_ASSIGN_OBJ
25177: && Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
1.1.1.2 misho 25178: zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_UNUSED == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 25179: if (zptr != NULL) { /* NULL means no success in getting PTR */
25180: SEPARATE_ZVAL_IF_NOT_REF(zptr);
25181:
25182: have_get_ptr = 1;
25183: binary_op(*zptr, *zptr, value TSRMLS_CC);
1.1.1.2 misho 25184: if (RETURN_VALUE_USED(opline)) {
1.1 misho 25185: PZVAL_LOCK(*zptr);
1.1.1.2 misho 25186: EX_T(opline->result.var).var.ptr = *zptr;
25187: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 25188: }
25189: }
25190: }
25191:
25192: if (!have_get_ptr) {
25193: zval *z = NULL;
25194:
25195: if (opline->extended_value == ZEND_ASSIGN_OBJ) {
25196: if (Z_OBJ_HT_P(object)->read_property) {
1.1.1.2 misho 25197: z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_UNUSED == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 25198: }
25199: } else /* if (opline->extended_value == ZEND_ASSIGN_DIM) */ {
25200: if (Z_OBJ_HT_P(object)->read_dimension) {
25201: z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC);
25202: }
25203: }
25204: if (z) {
25205: if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
25206: zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
25207:
25208: if (Z_REFCOUNT_P(z) == 0) {
25209: GC_REMOVE_ZVAL_FROM_BUFFER(z);
25210: zval_dtor(z);
25211: FREE_ZVAL(z);
25212: }
25213: z = value;
25214: }
25215: Z_ADDREF_P(z);
25216: SEPARATE_ZVAL_IF_NOT_REF(&z);
25217: binary_op(z, z, value TSRMLS_CC);
25218: if (opline->extended_value == ZEND_ASSIGN_OBJ) {
1.1.1.2 misho 25219: Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_UNUSED == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 25220: } else /* if (opline->extended_value == ZEND_ASSIGN_DIM) */ {
25221: Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC);
25222: }
1.1.1.2 misho 25223: if (RETURN_VALUE_USED(opline)) {
1.1 misho 25224: PZVAL_LOCK(z);
1.1.1.2 misho 25225: EX_T(opline->result.var).var.ptr = z;
25226: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 25227: }
25228: zval_ptr_dtor(&z);
25229: } else {
25230: zend_error(E_WARNING, "Attempt to assign property of non-object");
1.1.1.2 misho 25231: if (RETURN_VALUE_USED(opline)) {
25232: PZVAL_LOCK(&EG(uninitialized_zval));
25233: EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
25234: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 25235: }
25236: }
25237: }
25238:
25239: if (0) {
25240: zval_ptr_dtor(&property);
25241: } else {
25242:
25243: }
25244: FREE_OP(free_op_data1);
25245: }
25246:
25247: /* assign_obj has two opcodes! */
1.1.1.2 misho 25248: CHECK_EXCEPTION();
1.1 misho 25249: ZEND_VM_INC_OPCODE();
25250: ZEND_VM_NEXT_OPCODE();
25251: }
25252:
25253: static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
25254: {
1.1.1.2 misho 25255: USE_OPLINE
1.1 misho 25256: zend_free_op free_op_data2, free_op_data1;
25257: zval **var_ptr;
25258: zval *value;
25259:
1.1.1.2 misho 25260: SAVE_OPLINE();
1.1 misho 25261: switch (opline->extended_value) {
25262: case ZEND_ASSIGN_OBJ:
25263: return zend_binary_assign_op_obj_helper_SPEC_UNUSED_UNUSED(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
25264: break;
25265: case ZEND_ASSIGN_DIM: {
25266: zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
25267:
1.1.1.2 misho 25268: if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 25269: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
1.1.1.2 misho 25270: } else if (UNEXPECTED(Z_TYPE_PP(container) == IS_OBJECT)) {
1.1 misho 25271: if (IS_UNUSED == IS_VAR && !0) {
25272: Z_ADDREF_PP(container); /* undo the effect of get_obj_zval_ptr_ptr() */
25273: }
25274: return zend_binary_assign_op_obj_helper_SPEC_UNUSED_UNUSED(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
25275: } else {
25276: zval *dim = NULL;
25277:
1.1.1.2 misho 25278: zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), container, dim, IS_UNUSED, BP_VAR_RW TSRMLS_CC);
25279: value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R);
25280: var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC);
1.1 misho 25281: }
25282: }
25283: break;
25284: default:
25285: value = NULL;
25286: var_ptr = NULL;
25287: /* do nothing */
25288: break;
25289: }
25290:
1.1.1.2 misho 25291: if (UNEXPECTED(var_ptr == NULL)) {
1.1 misho 25292: zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets");
25293: }
25294:
1.1.1.2 misho 25295: if (UNEXPECTED(*var_ptr == &EG(error_zval))) {
25296: if (RETURN_VALUE_USED(opline)) {
25297: PZVAL_LOCK(&EG(uninitialized_zval));
25298: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
1.1 misho 25299: }
25300:
25301:
1.1.1.2 misho 25302: CHECK_EXCEPTION();
25303: if (opline->extended_value == ZEND_ASSIGN_DIM) {
25304: ZEND_VM_INC_OPCODE();
25305: }
1.1 misho 25306: ZEND_VM_NEXT_OPCODE();
25307: }
25308:
25309: SEPARATE_ZVAL_IF_NOT_REF(var_ptr);
25310:
1.1.1.2 misho 25311: if (UNEXPECTED(Z_TYPE_PP(var_ptr) == IS_OBJECT)
25312: && Z_OBJ_HANDLER_PP(var_ptr, get)
1.1 misho 25313: && Z_OBJ_HANDLER_PP(var_ptr, set)) {
25314: /* proxy object */
25315: zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC);
25316: Z_ADDREF_P(objval);
25317: binary_op(objval, objval, value TSRMLS_CC);
25318: Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC);
25319: zval_ptr_dtor(&objval);
25320: } else {
25321: binary_op(*var_ptr, *var_ptr, value TSRMLS_CC);
25322: }
25323:
1.1.1.2 misho 25324: if (RETURN_VALUE_USED(opline)) {
1.1 misho 25325: PZVAL_LOCK(*var_ptr);
1.1.1.2 misho 25326: AI_SET_PTR(&EX_T(opline->result.var), *var_ptr);
1.1 misho 25327: }
25328:
25329: if (opline->extended_value == ZEND_ASSIGN_DIM) {
25330: FREE_OP(free_op_data1);
25331: FREE_OP_VAR_PTR(free_op_data2);
25332:
1.1.1.2 misho 25333: CHECK_EXCEPTION();
25334: ZEND_VM_INC_OPCODE();
25335: } else {
25336:
25337: CHECK_EXCEPTION();
25338: }
1.1 misho 25339: ZEND_VM_NEXT_OPCODE();
25340: }
25341:
25342: static int ZEND_FASTCALL ZEND_ASSIGN_ADD_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
25343: {
25344: return zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
25345: }
25346:
25347: static int ZEND_FASTCALL ZEND_ASSIGN_SUB_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
25348: {
25349: return zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
25350: }
25351:
25352: static int ZEND_FASTCALL ZEND_ASSIGN_MUL_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
25353: {
25354: return zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
25355: }
25356:
25357: static int ZEND_FASTCALL ZEND_ASSIGN_DIV_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
25358: {
25359: return zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
25360: }
25361:
25362: static int ZEND_FASTCALL ZEND_ASSIGN_MOD_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
25363: {
25364: return zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
25365: }
25366:
25367: static int ZEND_FASTCALL ZEND_ASSIGN_SL_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
25368: {
25369: return zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
25370: }
25371:
25372: static int ZEND_FASTCALL ZEND_ASSIGN_SR_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
25373: {
25374: return zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
25375: }
25376:
25377: static int ZEND_FASTCALL ZEND_ASSIGN_CONCAT_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
25378: {
25379: return zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
25380: }
25381:
25382: static int ZEND_FASTCALL ZEND_ASSIGN_BW_OR_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
25383: {
25384: return zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
25385: }
25386:
25387: static int ZEND_FASTCALL ZEND_ASSIGN_BW_AND_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
25388: {
25389: return zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
25390: }
25391:
25392: static int ZEND_FASTCALL ZEND_ASSIGN_BW_XOR_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
25393: {
25394: return zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
25395: }
25396:
25397: static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
25398: {
1.1.1.2 misho 25399: USE_OPLINE
1.1 misho 25400:
1.1.1.2 misho 25401: array_init(&EX_T(opline->result.var).tmp_var);
1.1 misho 25402: if (IS_UNUSED == IS_UNUSED) {
25403: ZEND_VM_NEXT_OPCODE();
25404: #if 0 || IS_UNUSED != IS_UNUSED
25405: } else {
25406: return ZEND_ADD_ARRAY_ELEMENT_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
25407: #endif
25408: }
25409: }
25410:
25411: static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CV(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
25412: {
1.1.1.2 misho 25413: USE_OPLINE
1.1 misho 25414: zend_free_op free_op_data1;
25415: zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
25416: zval *object;
1.1.1.2 misho 25417: zval *property = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
25418: zval *value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R);
1.1 misho 25419: int have_get_ptr = 0;
25420:
1.1.1.2 misho 25421: if (IS_UNUSED == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 25422: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
25423: }
25424:
25425: make_real_object(object_ptr TSRMLS_CC);
25426: object = *object_ptr;
25427:
1.1.1.2 misho 25428: if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
1.1 misho 25429: zend_error(E_WARNING, "Attempt to assign property of non-object");
25430:
25431: FREE_OP(free_op_data1);
25432:
1.1.1.2 misho 25433: if (RETURN_VALUE_USED(opline)) {
25434: PZVAL_LOCK(&EG(uninitialized_zval));
25435: EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
25436: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 25437: }
25438: } else {
25439: /* here we are sure we are dealing with an object */
25440: if (0) {
25441: MAKE_REAL_ZVAL_PTR(property);
25442: }
25443:
25444: /* here property is a string */
25445: if (opline->extended_value == ZEND_ASSIGN_OBJ
25446: && Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
1.1.1.2 misho 25447: zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 25448: if (zptr != NULL) { /* NULL means no success in getting PTR */
25449: SEPARATE_ZVAL_IF_NOT_REF(zptr);
25450:
25451: have_get_ptr = 1;
25452: binary_op(*zptr, *zptr, value TSRMLS_CC);
1.1.1.2 misho 25453: if (RETURN_VALUE_USED(opline)) {
1.1 misho 25454: PZVAL_LOCK(*zptr);
1.1.1.2 misho 25455: EX_T(opline->result.var).var.ptr = *zptr;
25456: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 25457: }
25458: }
25459: }
25460:
25461: if (!have_get_ptr) {
25462: zval *z = NULL;
25463:
25464: if (opline->extended_value == ZEND_ASSIGN_OBJ) {
25465: if (Z_OBJ_HT_P(object)->read_property) {
1.1.1.2 misho 25466: z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 25467: }
25468: } else /* if (opline->extended_value == ZEND_ASSIGN_DIM) */ {
25469: if (Z_OBJ_HT_P(object)->read_dimension) {
25470: z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC);
25471: }
25472: }
25473: if (z) {
25474: if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
25475: zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
25476:
25477: if (Z_REFCOUNT_P(z) == 0) {
25478: GC_REMOVE_ZVAL_FROM_BUFFER(z);
25479: zval_dtor(z);
25480: FREE_ZVAL(z);
25481: }
25482: z = value;
25483: }
25484: Z_ADDREF_P(z);
25485: SEPARATE_ZVAL_IF_NOT_REF(&z);
25486: binary_op(z, z, value TSRMLS_CC);
25487: if (opline->extended_value == ZEND_ASSIGN_OBJ) {
1.1.1.2 misho 25488: Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 25489: } else /* if (opline->extended_value == ZEND_ASSIGN_DIM) */ {
25490: Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC);
25491: }
1.1.1.2 misho 25492: if (RETURN_VALUE_USED(opline)) {
1.1 misho 25493: PZVAL_LOCK(z);
1.1.1.2 misho 25494: EX_T(opline->result.var).var.ptr = z;
25495: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 25496: }
25497: zval_ptr_dtor(&z);
25498: } else {
25499: zend_error(E_WARNING, "Attempt to assign property of non-object");
1.1.1.2 misho 25500: if (RETURN_VALUE_USED(opline)) {
25501: PZVAL_LOCK(&EG(uninitialized_zval));
25502: EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
25503: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 25504: }
25505: }
25506: }
25507:
25508: if (0) {
25509: zval_ptr_dtor(&property);
25510: } else {
25511:
25512: }
25513: FREE_OP(free_op_data1);
25514: }
25515:
25516: /* assign_obj has two opcodes! */
1.1.1.2 misho 25517: CHECK_EXCEPTION();
1.1 misho 25518: ZEND_VM_INC_OPCODE();
25519: ZEND_VM_NEXT_OPCODE();
25520: }
25521:
25522: static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_UNUSED_CV(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
25523: {
1.1.1.2 misho 25524: USE_OPLINE
1.1 misho 25525: zend_free_op free_op_data2, free_op_data1;
25526: zval **var_ptr;
25527: zval *value;
25528:
1.1.1.2 misho 25529: SAVE_OPLINE();
1.1 misho 25530: switch (opline->extended_value) {
25531: case ZEND_ASSIGN_OBJ:
25532: return zend_binary_assign_op_obj_helper_SPEC_UNUSED_CV(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
25533: break;
25534: case ZEND_ASSIGN_DIM: {
25535: zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
25536:
1.1.1.2 misho 25537: if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 25538: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
1.1.1.2 misho 25539: } else if (UNEXPECTED(Z_TYPE_PP(container) == IS_OBJECT)) {
1.1 misho 25540: if (IS_UNUSED == IS_VAR && !0) {
25541: Z_ADDREF_PP(container); /* undo the effect of get_obj_zval_ptr_ptr() */
25542: }
25543: return zend_binary_assign_op_obj_helper_SPEC_UNUSED_CV(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
25544: } else {
1.1.1.2 misho 25545: zval *dim = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
1.1 misho 25546:
1.1.1.2 misho 25547: zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), container, dim, IS_CV, BP_VAR_RW TSRMLS_CC);
25548: value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R);
25549: var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC);
1.1 misho 25550: }
25551: }
25552: break;
25553: default:
1.1.1.2 misho 25554: value = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
1.1 misho 25555: var_ptr = NULL;
25556: /* do nothing */
25557: break;
25558: }
25559:
1.1.1.2 misho 25560: if (UNEXPECTED(var_ptr == NULL)) {
1.1 misho 25561: zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets");
25562: }
25563:
1.1.1.2 misho 25564: if (UNEXPECTED(*var_ptr == &EG(error_zval))) {
25565: if (RETURN_VALUE_USED(opline)) {
25566: PZVAL_LOCK(&EG(uninitialized_zval));
25567: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
1.1 misho 25568: }
25569:
25570:
1.1.1.2 misho 25571: CHECK_EXCEPTION();
25572: if (opline->extended_value == ZEND_ASSIGN_DIM) {
25573: ZEND_VM_INC_OPCODE();
25574: }
1.1 misho 25575: ZEND_VM_NEXT_OPCODE();
25576: }
25577:
25578: SEPARATE_ZVAL_IF_NOT_REF(var_ptr);
25579:
1.1.1.2 misho 25580: if (UNEXPECTED(Z_TYPE_PP(var_ptr) == IS_OBJECT)
25581: && Z_OBJ_HANDLER_PP(var_ptr, get)
1.1 misho 25582: && Z_OBJ_HANDLER_PP(var_ptr, set)) {
25583: /* proxy object */
25584: zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC);
25585: Z_ADDREF_P(objval);
25586: binary_op(objval, objval, value TSRMLS_CC);
25587: Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC);
25588: zval_ptr_dtor(&objval);
25589: } else {
25590: binary_op(*var_ptr, *var_ptr, value TSRMLS_CC);
25591: }
25592:
1.1.1.2 misho 25593: if (RETURN_VALUE_USED(opline)) {
1.1 misho 25594: PZVAL_LOCK(*var_ptr);
1.1.1.2 misho 25595: AI_SET_PTR(&EX_T(opline->result.var), *var_ptr);
1.1 misho 25596: }
25597:
25598: if (opline->extended_value == ZEND_ASSIGN_DIM) {
25599: FREE_OP(free_op_data1);
25600: FREE_OP_VAR_PTR(free_op_data2);
25601:
1.1.1.2 misho 25602: CHECK_EXCEPTION();
25603: ZEND_VM_INC_OPCODE();
25604: } else {
25605:
25606: CHECK_EXCEPTION();
25607: }
1.1 misho 25608: ZEND_VM_NEXT_OPCODE();
25609: }
25610:
25611: static int ZEND_FASTCALL ZEND_ASSIGN_ADD_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
25612: {
25613: return zend_binary_assign_op_helper_SPEC_UNUSED_CV(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
25614: }
25615:
25616: static int ZEND_FASTCALL ZEND_ASSIGN_SUB_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
25617: {
25618: return zend_binary_assign_op_helper_SPEC_UNUSED_CV(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
25619: }
25620:
25621: static int ZEND_FASTCALL ZEND_ASSIGN_MUL_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
25622: {
25623: return zend_binary_assign_op_helper_SPEC_UNUSED_CV(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
25624: }
25625:
25626: static int ZEND_FASTCALL ZEND_ASSIGN_DIV_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
25627: {
25628: return zend_binary_assign_op_helper_SPEC_UNUSED_CV(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
25629: }
25630:
25631: static int ZEND_FASTCALL ZEND_ASSIGN_MOD_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
25632: {
25633: return zend_binary_assign_op_helper_SPEC_UNUSED_CV(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
25634: }
25635:
25636: static int ZEND_FASTCALL ZEND_ASSIGN_SL_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
25637: {
25638: return zend_binary_assign_op_helper_SPEC_UNUSED_CV(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
25639: }
25640:
25641: static int ZEND_FASTCALL ZEND_ASSIGN_SR_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
25642: {
25643: return zend_binary_assign_op_helper_SPEC_UNUSED_CV(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
25644: }
25645:
25646: static int ZEND_FASTCALL ZEND_ASSIGN_CONCAT_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
25647: {
25648: return zend_binary_assign_op_helper_SPEC_UNUSED_CV(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
25649: }
25650:
25651: static int ZEND_FASTCALL ZEND_ASSIGN_BW_OR_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
25652: {
25653: return zend_binary_assign_op_helper_SPEC_UNUSED_CV(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
25654: }
25655:
25656: static int ZEND_FASTCALL ZEND_ASSIGN_BW_AND_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
25657: {
25658: return zend_binary_assign_op_helper_SPEC_UNUSED_CV(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
25659: }
25660:
25661: static int ZEND_FASTCALL ZEND_ASSIGN_BW_XOR_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
25662: {
25663: return zend_binary_assign_op_helper_SPEC_UNUSED_CV(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
25664: }
25665:
25666: static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_CV(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS)
25667: {
1.1.1.2 misho 25668: USE_OPLINE
1.1 misho 25669:
1.1.1.2 misho 25670: zval **object_ptr;
1.1 misho 25671: zval *object;
1.1.1.2 misho 25672: zval *property;
25673: zval **retval;
1.1 misho 25674: int have_get_ptr = 0;
25675:
1.1.1.2 misho 25676: SAVE_OPLINE();
25677: object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
25678: property = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
25679: retval = &EX_T(opline->result.var).var.ptr;
25680:
25681: if (IS_UNUSED == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 25682: zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
25683: }
25684:
25685: make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
25686: object = *object_ptr;
25687:
1.1.1.2 misho 25688: if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
1.1 misho 25689: zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
25690:
1.1.1.2 misho 25691: if (RETURN_VALUE_USED(opline)) {
25692: PZVAL_LOCK(&EG(uninitialized_zval));
25693: *retval = &EG(uninitialized_zval);
1.1 misho 25694: }
25695:
1.1.1.2 misho 25696: CHECK_EXCEPTION();
1.1 misho 25697: ZEND_VM_NEXT_OPCODE();
25698: }
25699:
25700: /* here we are sure we are dealing with an object */
25701:
25702: if (0) {
25703: MAKE_REAL_ZVAL_PTR(property);
25704: }
25705:
25706: if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
1.1.1.2 misho 25707: zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 25708: if (zptr != NULL) { /* NULL means no success in getting PTR */
25709: SEPARATE_ZVAL_IF_NOT_REF(zptr);
25710:
25711: have_get_ptr = 1;
25712: incdec_op(*zptr);
1.1.1.2 misho 25713: if (RETURN_VALUE_USED(opline)) {
1.1 misho 25714: *retval = *zptr;
25715: PZVAL_LOCK(*retval);
25716: }
25717: }
25718: }
25719:
25720: if (!have_get_ptr) {
25721: if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
1.1.1.2 misho 25722: zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 25723:
1.1.1.2 misho 25724: if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
1.1 misho 25725: zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
25726:
25727: if (Z_REFCOUNT_P(z) == 0) {
25728: GC_REMOVE_ZVAL_FROM_BUFFER(z);
25729: zval_dtor(z);
25730: FREE_ZVAL(z);
25731: }
25732: z = value;
25733: }
25734: Z_ADDREF_P(z);
25735: SEPARATE_ZVAL_IF_NOT_REF(&z);
25736: incdec_op(z);
25737: *retval = z;
1.1.1.2 misho 25738: Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
25739: SELECTIVE_PZVAL_LOCK(*retval, opline);
1.1 misho 25740: zval_ptr_dtor(&z);
25741: } else {
25742: zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
1.1.1.2 misho 25743: if (RETURN_VALUE_USED(opline)) {
25744: PZVAL_LOCK(&EG(uninitialized_zval));
25745: *retval = &EG(uninitialized_zval);
1.1 misho 25746: }
25747: }
25748: }
25749:
25750: if (0) {
25751: zval_ptr_dtor(&property);
25752: } else {
25753:
25754: }
25755:
1.1.1.2 misho 25756: CHECK_EXCEPTION();
1.1 misho 25757: ZEND_VM_NEXT_OPCODE();
25758: }
25759:
25760: static int ZEND_FASTCALL ZEND_PRE_INC_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
25761: {
25762: return zend_pre_incdec_property_helper_SPEC_UNUSED_CV(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
25763: }
25764:
25765: static int ZEND_FASTCALL ZEND_PRE_DEC_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
25766: {
25767: return zend_pre_incdec_property_helper_SPEC_UNUSED_CV(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
25768: }
25769:
25770: static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_CV(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS)
25771: {
1.1.1.2 misho 25772: USE_OPLINE
1.1 misho 25773:
1.1.1.2 misho 25774: zval **object_ptr;
1.1 misho 25775: zval *object;
1.1.1.2 misho 25776: zval *property;
25777: zval *retval;
1.1 misho 25778: int have_get_ptr = 0;
25779:
1.1.1.2 misho 25780: SAVE_OPLINE();
25781: object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
25782: property = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
25783: retval = &EX_T(opline->result.var).tmp_var;
25784:
25785: if (IS_UNUSED == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 25786: zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
25787: }
25788:
25789: make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
25790: object = *object_ptr;
25791:
1.1.1.2 misho 25792: if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
1.1 misho 25793: zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
25794:
1.1.1.2 misho 25795: ZVAL_NULL(retval);
1.1 misho 25796:
1.1.1.2 misho 25797: CHECK_EXCEPTION();
1.1 misho 25798: ZEND_VM_NEXT_OPCODE();
25799: }
25800:
25801: /* here we are sure we are dealing with an object */
25802:
25803: if (0) {
25804: MAKE_REAL_ZVAL_PTR(property);
25805: }
25806:
25807: if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
1.1.1.2 misho 25808: zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 25809: if (zptr != NULL) { /* NULL means no success in getting PTR */
25810: have_get_ptr = 1;
25811: SEPARATE_ZVAL_IF_NOT_REF(zptr);
25812:
1.1.1.2 misho 25813: ZVAL_COPY_VALUE(retval, *zptr);
1.1 misho 25814: zendi_zval_copy_ctor(*retval);
25815:
25816: incdec_op(*zptr);
25817:
25818: }
25819: }
25820:
25821: if (!have_get_ptr) {
25822: if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
1.1.1.2 misho 25823: zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 25824: zval *z_copy;
25825:
1.1.1.2 misho 25826: if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
1.1 misho 25827: zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
25828:
25829: if (Z_REFCOUNT_P(z) == 0) {
25830: GC_REMOVE_ZVAL_FROM_BUFFER(z);
25831: zval_dtor(z);
25832: FREE_ZVAL(z);
25833: }
25834: z = value;
25835: }
1.1.1.2 misho 25836: ZVAL_COPY_VALUE(retval, z);
1.1 misho 25837: zendi_zval_copy_ctor(*retval);
25838: ALLOC_ZVAL(z_copy);
1.1.1.2 misho 25839: INIT_PZVAL_COPY(z_copy, z);
1.1 misho 25840: zendi_zval_copy_ctor(*z_copy);
25841: incdec_op(z_copy);
25842: Z_ADDREF_P(z);
1.1.1.2 misho 25843: Z_OBJ_HT_P(object)->write_property(object, property, z_copy, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 25844: zval_ptr_dtor(&z_copy);
25845: zval_ptr_dtor(&z);
25846: } else {
25847: zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
1.1.1.2 misho 25848: ZVAL_NULL(retval);
1.1 misho 25849: }
25850: }
25851:
25852: if (0) {
25853: zval_ptr_dtor(&property);
25854: } else {
25855:
25856: }
25857:
1.1.1.2 misho 25858: CHECK_EXCEPTION();
1.1 misho 25859: ZEND_VM_NEXT_OPCODE();
25860: }
25861:
25862: static int ZEND_FASTCALL ZEND_POST_INC_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
25863: {
25864: return zend_post_incdec_property_helper_SPEC_UNUSED_CV(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
25865: }
25866:
25867: static int ZEND_FASTCALL ZEND_POST_DEC_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
25868: {
25869: return zend_post_incdec_property_helper_SPEC_UNUSED_CV(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
25870: }
25871:
1.1.1.2 misho 25872: static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_UNUSED_CV(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 25873: {
1.1.1.2 misho 25874: USE_OPLINE
1.1 misho 25875:
1.1.1.2 misho 25876: zval *container;
1.1 misho 25877:
1.1.1.2 misho 25878: zval *offset;
1.1 misho 25879:
1.1.1.2 misho 25880: SAVE_OPLINE();
25881: container = _get_obj_zval_ptr_unused(TSRMLS_C);
25882: offset = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
25883:
25884: if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
25885: UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
25886: zend_error(E_NOTICE, "Trying to get property of non-object");
25887: PZVAL_LOCK(&EG(uninitialized_zval));
25888: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
1.1 misho 25889:
25890: } else {
25891: zval *retval;
25892:
25893: if (0) {
25894: MAKE_REAL_ZVAL_PTR(offset);
25895: }
25896:
25897: /* here we are sure we are dealing with an object */
1.1.1.2 misho 25898: retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 25899:
1.1.1.2 misho 25900: PZVAL_LOCK(retval);
25901: AI_SET_PTR(&EX_T(opline->result.var), retval);
1.1 misho 25902:
25903: if (0) {
25904: zval_ptr_dtor(&offset);
25905: } else {
25906:
25907: }
25908: }
25909:
1.1.1.2 misho 25910: CHECK_EXCEPTION();
1.1 misho 25911: ZEND_VM_NEXT_OPCODE();
25912: }
25913:
25914: static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
25915: {
1.1.1.2 misho 25916: return zend_fetch_property_address_read_helper_SPEC_UNUSED_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
1.1 misho 25917: }
25918:
25919: static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
25920: {
1.1.1.2 misho 25921: USE_OPLINE
1.1 misho 25922: zend_free_op free_op1;
1.1.1.2 misho 25923: zval *property;
1.1 misho 25924: zval **container;
25925:
1.1.1.2 misho 25926: SAVE_OPLINE();
25927: property = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
25928:
1.1 misho 25929: if (IS_UNUSED == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
1.1.1.2 misho 25930: PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
25931: EX_T(opline->op1.var).var.ptr = *EX_T(opline->op1.var).var.ptr_ptr;
1.1 misho 25932: }
25933:
25934: if (0) {
25935: MAKE_REAL_ZVAL_PTR(property);
25936: }
25937: container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
1.1.1.2 misho 25938: if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 25939: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
25940: }
1.1.1.2 misho 25941:
25942: zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_W TSRMLS_CC);
1.1 misho 25943: if (0) {
25944: zval_ptr_dtor(&property);
25945: } else {
25946:
25947: }
1.1.1.2 misho 25948: if (IS_UNUSED == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
25949: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 25950: }
25951:
25952: /* We are going to assign the result by reference */
25953: if (opline->extended_value & ZEND_FETCH_MAKE_REF) {
1.1.1.2 misho 25954: zval **retval_ptr = EX_T(opline->result.var).var.ptr_ptr;
25955:
25956: Z_DELREF_PP(retval_ptr);
25957: SEPARATE_ZVAL_TO_MAKE_IS_REF(retval_ptr);
25958: Z_ADDREF_PP(retval_ptr);
25959: EX_T(opline->result.var).var.ptr = *EX_T(opline->result.var).var.ptr_ptr;
25960: EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
1.1 misho 25961: }
25962:
1.1.1.2 misho 25963: CHECK_EXCEPTION();
1.1 misho 25964: ZEND_VM_NEXT_OPCODE();
25965: }
25966:
25967: static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
25968: {
1.1.1.2 misho 25969: USE_OPLINE
1.1 misho 25970: zend_free_op free_op1;
1.1.1.2 misho 25971: zval *property;
25972: zval **container;
25973:
25974: SAVE_OPLINE();
25975: property = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
25976: container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
1.1 misho 25977:
25978: if (0) {
25979: MAKE_REAL_ZVAL_PTR(property);
25980: }
1.1.1.2 misho 25981: if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 25982: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
25983: }
1.1.1.2 misho 25984: zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_RW TSRMLS_CC);
1.1 misho 25985: if (0) {
25986: zval_ptr_dtor(&property);
25987: } else {
25988:
25989: }
1.1.1.2 misho 25990: if (IS_UNUSED == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
25991: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 25992: }
25993:
1.1.1.2 misho 25994: CHECK_EXCEPTION();
1.1 misho 25995: ZEND_VM_NEXT_OPCODE();
25996: }
25997:
25998: static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
25999: {
1.1.1.2 misho 26000: USE_OPLINE
26001:
26002: zval *container;
26003:
26004: zval *offset;
26005:
26006: SAVE_OPLINE();
26007: container = _get_obj_zval_ptr_unused(TSRMLS_C);
26008: offset = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
26009:
26010: if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
26011: UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
26012: PZVAL_LOCK(&EG(uninitialized_zval));
26013: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
26014:
26015: } else {
26016: zval *retval;
26017:
26018: if (0) {
26019: MAKE_REAL_ZVAL_PTR(offset);
26020: }
26021:
26022: /* here we are sure we are dealing with an object */
26023: retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
26024:
26025: PZVAL_LOCK(retval);
26026: AI_SET_PTR(&EX_T(opline->result.var), retval);
26027:
26028: if (0) {
26029: zval_ptr_dtor(&offset);
26030: } else {
26031:
26032: }
26033: }
26034:
26035: CHECK_EXCEPTION();
26036: ZEND_VM_NEXT_OPCODE();
1.1 misho 26037: }
26038:
26039: static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
26040: {
1.1.1.2 misho 26041: USE_OPLINE
1.1 misho 26042:
1.1.1.2 misho 26043: if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
1.1 misho 26044: /* Behave like FETCH_OBJ_W */
26045: zend_free_op free_op1;
1.1.1.2 misho 26046: zval *property;
26047: zval **container;
26048:
26049: SAVE_OPLINE();
26050: property = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
26051: container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
1.1 misho 26052:
26053: if (0) {
26054: MAKE_REAL_ZVAL_PTR(property);
26055: }
1.1.1.2 misho 26056: if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 26057: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
26058: }
1.1.1.2 misho 26059: zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_W TSRMLS_CC);
1.1 misho 26060: if (0) {
26061: zval_ptr_dtor(&property);
26062: } else {
26063:
26064: }
1.1.1.2 misho 26065: if (IS_UNUSED == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
26066: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 26067: }
26068:
1.1.1.2 misho 26069: CHECK_EXCEPTION();
1.1 misho 26070: ZEND_VM_NEXT_OPCODE();
26071: } else {
1.1.1.2 misho 26072: return zend_fetch_property_address_read_helper_SPEC_UNUSED_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
1.1 misho 26073: }
26074: }
26075:
26076: static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
26077: {
1.1.1.2 misho 26078: USE_OPLINE
1.1 misho 26079: zend_free_op free_op1, free_res;
1.1.1.2 misho 26080: zval **container;
26081: zval *property;
26082:
26083: SAVE_OPLINE();
26084: container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
26085: property = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
1.1 misho 26086:
26087: if (IS_UNUSED == IS_CV) {
26088: if (container != &EG(uninitialized_zval_ptr)) {
26089: SEPARATE_ZVAL_IF_NOT_REF(container);
26090: }
26091: }
26092: if (0) {
26093: MAKE_REAL_ZVAL_PTR(property);
26094: }
1.1.1.2 misho 26095: if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 26096: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
26097: }
1.1.1.2 misho 26098: zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_UNSET TSRMLS_CC);
1.1 misho 26099: if (0) {
26100: zval_ptr_dtor(&property);
26101: } else {
26102:
26103: }
1.1.1.2 misho 26104: if (IS_UNUSED == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
26105: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 26106: }
26107:
1.1.1.2 misho 26108: PZVAL_UNLOCK(*EX_T(opline->result.var).var.ptr_ptr, &free_res);
26109: if (EX_T(opline->result.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) {
26110: SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.var).var.ptr_ptr);
1.1 misho 26111: }
1.1.1.2 misho 26112: PZVAL_LOCK(*EX_T(opline->result.var).var.ptr_ptr);
1.1 misho 26113: FREE_OP_VAR_PTR(free_res);
1.1.1.2 misho 26114: CHECK_EXCEPTION();
1.1 misho 26115: ZEND_VM_NEXT_OPCODE();
26116: }
26117:
26118: static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
26119: {
1.1.1.2 misho 26120: USE_OPLINE
1.1 misho 26121:
1.1.1.2 misho 26122: zval **object_ptr;
26123: zval *property_name;
26124:
26125: SAVE_OPLINE();
26126: object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
26127: property_name = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
1.1 misho 26128:
26129: if (0) {
26130: MAKE_REAL_ZVAL_PTR(property_name);
26131: }
1.1.1.2 misho 26132: if (IS_UNUSED == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 26133: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
26134: }
1.1.1.2 misho 26135: zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), ZEND_ASSIGN_OBJ, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 26136: if (0) {
26137: zval_ptr_dtor(&property_name);
26138: } else {
26139:
26140: }
26141:
26142: /* assign_obj has two opcodes! */
1.1.1.2 misho 26143: CHECK_EXCEPTION();
1.1 misho 26144: ZEND_VM_INC_OPCODE();
26145: ZEND_VM_NEXT_OPCODE();
26146: }
26147:
26148: static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
26149: {
1.1.1.2 misho 26150: USE_OPLINE
1.1 misho 26151:
1.1.1.2 misho 26152: zval *str = &EX_T(opline->result.var).tmp_var;
26153: zval *var;
1.1 misho 26154: zval var_copy;
26155: int use_copy = 0;
26156:
1.1.1.2 misho 26157: SAVE_OPLINE();
26158: var = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
26159:
1.1 misho 26160: if (IS_UNUSED == IS_UNUSED) {
26161: /* Initialize for erealloc in add_string_to_string */
26162: Z_STRVAL_P(str) = NULL;
26163: Z_STRLEN_P(str) = 0;
26164: Z_TYPE_P(str) = IS_STRING;
26165:
26166: INIT_PZVAL(str);
26167: }
26168:
26169: if (Z_TYPE_P(var) != IS_STRING) {
26170: zend_make_printable_zval(var, &var_copy, &use_copy);
26171:
26172: if (use_copy) {
26173: var = &var_copy;
26174: }
26175: }
26176: add_string_to_string(str, str, var);
26177:
26178: if (use_copy) {
26179: zval_dtor(var);
26180: }
26181: /* original comment, possibly problematic:
26182: * FREE_OP is missing intentionally here - we're always working on the same temporary variable
26183: * (Zeev): I don't think it's problematic, we only use variables
26184: * which aren't affected by FREE_OP(Ts, )'s anyway, unless they're
26185: * string offsets or overloaded objects
26186: */
26187:
1.1.1.2 misho 26188: CHECK_EXCEPTION();
1.1 misho 26189: ZEND_VM_NEXT_OPCODE();
26190: }
26191:
26192: static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
26193: {
1.1.1.2 misho 26194: USE_OPLINE
1.1 misho 26195: zval *function_name;
26196: char *function_name_strval;
26197: int function_name_strlen;
26198:
26199:
1.1.1.2 misho 26200: SAVE_OPLINE();
1.1 misho 26201: zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
26202:
1.1.1.2 misho 26203: function_name = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
1.1 misho 26204:
1.1.1.2 misho 26205: if (IS_CV != IS_CONST &&
26206: UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
1.1 misho 26207: zend_error_noreturn(E_ERROR, "Method name must be a string");
26208: }
26209:
26210: function_name_strval = Z_STRVAL_P(function_name);
26211: function_name_strlen = Z_STRLEN_P(function_name);
26212:
26213: EX(object) = _get_obj_zval_ptr_unused(TSRMLS_C);
26214:
1.1.1.2 misho 26215: if (EXPECTED(EX(object) != NULL) &&
26216: EXPECTED(Z_TYPE_P(EX(object)) == IS_OBJECT)) {
26217: EX(called_scope) = Z_OBJCE_P(EX(object));
1.1 misho 26218:
1.1.1.2 misho 26219: if (IS_CV != IS_CONST ||
26220: (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope))) == NULL) {
26221: zval *object = EX(object);
26222:
26223: if (UNEXPECTED(Z_OBJ_HT_P(EX(object))->get_method == NULL)) {
26224: zend_error_noreturn(E_ERROR, "Object does not support method calls");
26225: }
26226:
26227: /* First, locate the function. */
26228: EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen, ((IS_CV == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC);
26229: if (UNEXPECTED(EX(fbc) == NULL)) {
26230: zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval);
26231: }
26232: if (IS_CV == IS_CONST &&
26233: EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) &&
26234: EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) &&
26235: EXPECTED(EX(object) == object)) {
26236: CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope), EX(fbc));
26237: }
1.1 misho 26238: }
26239: } else {
26240: zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval);
26241: }
26242:
26243: if ((EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) != 0) {
26244: EX(object) = NULL;
26245: } else {
26246: if (!PZVAL_IS_REF(EX(object))) {
26247: Z_ADDREF_P(EX(object)); /* For $this pointer */
26248: } else {
26249: zval *this_ptr;
26250: ALLOC_ZVAL(this_ptr);
26251: INIT_PZVAL_COPY(this_ptr, EX(object));
26252: zval_copy_ctor(this_ptr);
26253: EX(object) = this_ptr;
26254: }
26255: }
26256:
26257:
1.1.1.2 misho 26258: CHECK_EXCEPTION();
1.1 misho 26259: ZEND_VM_NEXT_OPCODE();
26260: }
26261:
26262: static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
26263: {
1.1.1.2 misho 26264: USE_OPLINE
1.1 misho 26265:
1.1.1.2 misho 26266: array_init(&EX_T(opline->result.var).tmp_var);
1.1 misho 26267: if (IS_UNUSED == IS_UNUSED) {
26268: ZEND_VM_NEXT_OPCODE();
26269: #if 0 || IS_UNUSED != IS_UNUSED
26270: } else {
26271: return ZEND_ADD_ARRAY_ELEMENT_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
26272: #endif
26273: }
26274: }
26275:
26276: static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
26277: {
1.1.1.2 misho 26278: USE_OPLINE
1.1 misho 26279:
1.1.1.2 misho 26280: zval **container;
1.1 misho 26281: zval *offset;
1.1.1.2 misho 26282: ulong hval;
1.1 misho 26283:
1.1.1.2 misho 26284: SAVE_OPLINE();
26285: container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
1.1 misho 26286: if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) {
26287: SEPARATE_ZVAL_IF_NOT_REF(container);
26288: }
1.1.1.2 misho 26289: offset = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
1.1 misho 26290:
26291: if (IS_UNUSED != IS_VAR || container) {
26292: switch (Z_TYPE_PP(container)) {
26293: case IS_ARRAY: {
26294: HashTable *ht = Z_ARRVAL_PP(container);
26295:
26296: switch (Z_TYPE_P(offset)) {
26297: case IS_DOUBLE:
1.1.1.2 misho 26298: hval = zend_dval_to_lval(Z_DVAL_P(offset));
1.1.1.3 misho 26299: zend_hash_index_del(ht, hval);
26300: break;
1.1 misho 26301: case IS_RESOURCE:
26302: case IS_BOOL:
26303: case IS_LONG:
1.1.1.2 misho 26304: hval = Z_LVAL_P(offset);
26305: zend_hash_index_del(ht, hval);
1.1 misho 26306: break;
26307: case IS_STRING:
26308: if (IS_CV == IS_CV || IS_CV == IS_VAR) {
26309: Z_ADDREF_P(offset);
26310: }
1.1.1.2 misho 26311: if (IS_CV == IS_CONST) {
26312: hval = Z_HASH_P(offset);
26313: } else {
26314: ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_dim);
26315: if (IS_INTERNED(Z_STRVAL_P(offset))) {
26316: hval = INTERNED_HASH(Z_STRVAL_P(offset));
26317: } else {
26318: hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
1.1 misho 26319: }
26320: }
1.1.1.2 misho 26321: if (ht == &EG(symbol_table)) {
26322: zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC);
26323: } else {
26324: zend_hash_quick_del(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval);
26325: }
26326: if (IS_CV == IS_CV || IS_CV == IS_VAR) {
26327: zval_ptr_dtor(&offset);
26328: }
26329: break;
26330: num_index_dim:
26331: zend_hash_index_del(ht, hval);
1.1 misho 26332: if (IS_CV == IS_CV || IS_CV == IS_VAR) {
26333: zval_ptr_dtor(&offset);
26334: }
26335: break;
26336: case IS_NULL:
26337: zend_hash_del(ht, "", sizeof(""));
26338: break;
26339: default:
26340: zend_error(E_WARNING, "Illegal offset type in unset");
26341: break;
26342: }
26343:
26344: break;
26345: }
26346: case IS_OBJECT:
1.1.1.2 misho 26347: if (UNEXPECTED(Z_OBJ_HT_P(*container)->unset_dimension == NULL)) {
1.1 misho 26348: zend_error_noreturn(E_ERROR, "Cannot use object as array");
26349: }
26350: if (0) {
26351: MAKE_REAL_ZVAL_PTR(offset);
26352: }
26353: Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC);
26354: if (0) {
26355: zval_ptr_dtor(&offset);
26356: } else {
26357:
26358: }
26359: break;
26360: case IS_STRING:
26361: zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
26362: ZEND_VM_CONTINUE(); /* bailed out before */
26363: default:
26364:
26365: break;
26366: }
26367: } else {
26368:
26369: }
26370:
1.1.1.2 misho 26371: CHECK_EXCEPTION();
1.1 misho 26372: ZEND_VM_NEXT_OPCODE();
26373: }
26374:
26375: static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
26376: {
1.1.1.2 misho 26377: USE_OPLINE
26378:
26379: zval **container;
26380: zval *offset;
1.1 misho 26381:
1.1.1.2 misho 26382: SAVE_OPLINE();
26383: container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
26384: offset = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
1.1 misho 26385:
26386: if (IS_UNUSED != IS_VAR || container) {
26387: if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) {
26388: SEPARATE_ZVAL_IF_NOT_REF(container);
26389: }
26390: if (Z_TYPE_PP(container) == IS_OBJECT) {
26391: if (0) {
26392: MAKE_REAL_ZVAL_PTR(offset);
26393: }
26394: if (Z_OBJ_HT_P(*container)->unset_property) {
1.1.1.2 misho 26395: Z_OBJ_HT_P(*container)->unset_property(*container, offset, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 26396: } else {
26397: zend_error(E_NOTICE, "Trying to unset property of non-object");
26398: }
26399: if (0) {
26400: zval_ptr_dtor(&offset);
26401: } else {
26402:
26403: }
26404: } else {
26405:
26406: }
26407: } else {
26408:
26409: }
26410:
1.1.1.2 misho 26411: CHECK_EXCEPTION();
1.1 misho 26412: ZEND_VM_NEXT_OPCODE();
26413: }
26414:
26415: static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_CV(int prop_dim, ZEND_OPCODE_HANDLER_ARGS)
26416: {
1.1.1.2 misho 26417: USE_OPLINE
1.1 misho 26418:
1.1.1.2 misho 26419: zval **container;
1.1 misho 26420: zval **value = NULL;
26421: int result = 0;
1.1.1.2 misho 26422: ulong hval;
26423: zval *offset;
1.1 misho 26424:
1.1.1.2 misho 26425: SAVE_OPLINE();
26426: container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
1.1 misho 26427:
1.1.1.2 misho 26428: offset = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
1.1 misho 26429:
1.1.1.2 misho 26430: if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) {
26431: HashTable *ht;
26432: int isset = 0;
1.1 misho 26433:
1.1.1.2 misho 26434: ht = Z_ARRVAL_PP(container);
1.1 misho 26435:
1.1.1.2 misho 26436: switch (Z_TYPE_P(offset)) {
26437: case IS_DOUBLE:
26438: hval = zend_dval_to_lval(Z_DVAL_P(offset));
26439: goto num_index_prop;
26440: case IS_RESOURCE:
26441: case IS_BOOL:
26442: case IS_LONG:
26443: hval = Z_LVAL_P(offset);
26444: num_index_prop:
26445: if (zend_hash_index_find(ht, hval, (void **) &value) == SUCCESS) {
26446: isset = 1;
26447: }
26448: break;
26449: case IS_STRING:
26450: if (IS_CV == IS_CONST) {
26451: hval = Z_HASH_P(offset);
26452: } else {
26453: if (!prop_dim) {
26454: ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_prop);
1.1 misho 26455: }
1.1.1.2 misho 26456: if (IS_INTERNED(Z_STRVAL_P(offset))) {
26457: hval = INTERNED_HASH(Z_STRVAL_P(offset));
1.1 misho 26458: } else {
1.1.1.2 misho 26459: hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
1.1 misho 26460: }
26461: }
1.1.1.2 misho 26462: if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) {
26463: isset = 1;
26464: }
26465: break;
26466: case IS_NULL:
26467: if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) {
26468: isset = 1;
1.1 misho 26469: }
1.1.1.2 misho 26470: break;
26471: default:
26472: zend_error(E_WARNING, "Illegal offset type in isset or empty");
26473: break;
26474: }
26475:
26476: if (opline->extended_value & ZEND_ISSET) {
26477: if (isset && Z_TYPE_PP(value) == IS_NULL) {
26478: result = 0;
26479: } else {
26480: result = isset;
1.1 misho 26481: }
1.1.1.2 misho 26482: } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
26483: if (!isset || !i_zend_is_true(*value)) {
26484: result = 0;
1.1 misho 26485: } else {
1.1.1.2 misho 26486: result = 1;
26487: }
26488: }
1.1 misho 26489:
1.1.1.2 misho 26490: } else if (Z_TYPE_PP(container) == IS_OBJECT) {
26491: if (0) {
26492: MAKE_REAL_ZVAL_PTR(offset);
26493: }
26494: if (prop_dim) {
26495: if (Z_OBJ_HT_P(*container)->has_property) {
26496: result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
26497: } else {
26498: zend_error(E_NOTICE, "Trying to check property of non-object");
26499: result = 0;
1.1 misho 26500: }
1.1.1.2 misho 26501: } else {
26502: if (Z_OBJ_HT_P(*container)->has_dimension) {
26503: result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0 TSRMLS_CC);
26504: } else {
26505: zend_error(E_NOTICE, "Trying to check element of non-array");
26506: result = 0;
26507: }
26508: }
26509: if (0) {
26510: zval_ptr_dtor(&offset);
26511: } else {
26512:
26513: }
26514: } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */
26515: zval tmp;
1.1 misho 26516:
1.1.1.2 misho 26517: if (Z_TYPE_P(offset) != IS_LONG) {
26518: if (Z_TYPE_P(offset) <= IS_BOOL /* simple scalar types */
26519: || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */
26520: && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) {
26521: ZVAL_COPY_VALUE(&tmp, offset);
1.1 misho 26522: zval_copy_ctor(&tmp);
26523: convert_to_long(&tmp);
26524: offset = &tmp;
1.1.1.2 misho 26525: } else {
26526: /* can not be converted to proper offset, return "not set" */
26527: result = 0;
1.1 misho 26528: }
1.1.1.2 misho 26529: }
26530: if (Z_TYPE_P(offset) == IS_LONG) {
26531: if (opline->extended_value & ZEND_ISSET) {
26532: if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
26533: result = 1;
26534: }
26535: } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
26536: if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') {
26537: result = 1;
1.1 misho 26538: }
26539: }
1.1.1.2 misho 26540: }
1.1 misho 26541:
1.1.1.2 misho 26542: } else {
1.1 misho 26543:
26544: }
26545:
1.1.1.2 misho 26546: Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
26547: if (opline->extended_value & ZEND_ISSET) {
26548: Z_LVAL(EX_T(opline->result.var).tmp_var) = result;
26549: } else {
26550: Z_LVAL(EX_T(opline->result.var).tmp_var) = !result;
1.1 misho 26551: }
26552:
1.1.1.2 misho 26553: CHECK_EXCEPTION();
1.1 misho 26554: ZEND_VM_NEXT_OPCODE();
26555: }
26556:
26557: static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
26558: {
26559: return zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_CV(0, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
26560: }
26561:
26562: static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
26563: {
26564: return zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_CV(1, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
26565: }
26566:
26567: static int ZEND_FASTCALL ZEND_BW_NOT_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
26568: {
1.1.1.2 misho 26569: USE_OPLINE
1.1 misho 26570:
26571:
1.1.1.2 misho 26572: SAVE_OPLINE();
26573: bitwise_not_function(&EX_T(opline->result.var).tmp_var,
26574: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC) TSRMLS_CC);
1.1 misho 26575:
1.1.1.2 misho 26576: CHECK_EXCEPTION();
1.1 misho 26577: ZEND_VM_NEXT_OPCODE();
26578: }
26579:
26580: static int ZEND_FASTCALL ZEND_BOOL_NOT_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
26581: {
1.1.1.2 misho 26582: USE_OPLINE
1.1 misho 26583:
26584:
1.1.1.2 misho 26585: SAVE_OPLINE();
26586: boolean_not_function(&EX_T(opline->result.var).tmp_var,
26587: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC) TSRMLS_CC);
1.1 misho 26588:
1.1.1.2 misho 26589: CHECK_EXCEPTION();
1.1 misho 26590: ZEND_VM_NEXT_OPCODE();
26591: }
26592:
26593: static int ZEND_FASTCALL ZEND_PRE_INC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
26594: {
1.1.1.2 misho 26595: USE_OPLINE
26596:
26597: zval **var_ptr;
1.1 misho 26598:
1.1.1.2 misho 26599: SAVE_OPLINE();
26600: var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 26601:
1.1.1.2 misho 26602: if (IS_CV == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
1.1 misho 26603: zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
26604: }
1.1.1.2 misho 26605: if (IS_CV == IS_VAR && UNEXPECTED(*var_ptr == &EG(error_zval))) {
26606: if (RETURN_VALUE_USED(opline)) {
26607: PZVAL_LOCK(&EG(uninitialized_zval));
26608: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
1.1 misho 26609: }
26610:
1.1.1.2 misho 26611: CHECK_EXCEPTION();
1.1 misho 26612: ZEND_VM_NEXT_OPCODE();
26613: }
26614:
26615: SEPARATE_ZVAL_IF_NOT_REF(var_ptr);
26616:
1.1.1.2 misho 26617: if (UNEXPECTED(Z_TYPE_PP(var_ptr) == IS_OBJECT)
26618: && Z_OBJ_HANDLER_PP(var_ptr, get)
1.1 misho 26619: && Z_OBJ_HANDLER_PP(var_ptr, set)) {
26620: /* proxy object */
26621: zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC);
26622: Z_ADDREF_P(val);
1.1.1.2 misho 26623: fast_increment_function(val);
1.1 misho 26624: Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC);
26625: zval_ptr_dtor(&val);
26626: } else {
1.1.1.2 misho 26627: fast_increment_function(*var_ptr);
1.1 misho 26628: }
26629:
1.1.1.2 misho 26630: if (RETURN_VALUE_USED(opline)) {
1.1 misho 26631: PZVAL_LOCK(*var_ptr);
1.1.1.2 misho 26632: AI_SET_PTR(&EX_T(opline->result.var), *var_ptr);
1.1 misho 26633: }
26634:
1.1.1.2 misho 26635: CHECK_EXCEPTION();
1.1 misho 26636: ZEND_VM_NEXT_OPCODE();
26637: }
26638:
26639: static int ZEND_FASTCALL ZEND_PRE_DEC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
26640: {
1.1.1.2 misho 26641: USE_OPLINE
1.1 misho 26642:
1.1.1.2 misho 26643: zval **var_ptr;
26644:
26645: SAVE_OPLINE();
26646: var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 26647:
1.1.1.2 misho 26648: if (IS_CV == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
1.1 misho 26649: zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
26650: }
1.1.1.2 misho 26651: if (IS_CV == IS_VAR && UNEXPECTED(*var_ptr == &EG(error_zval))) {
26652: if (RETURN_VALUE_USED(opline)) {
26653: PZVAL_LOCK(&EG(uninitialized_zval));
26654: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
1.1 misho 26655: }
26656:
1.1.1.2 misho 26657: CHECK_EXCEPTION();
1.1 misho 26658: ZEND_VM_NEXT_OPCODE();
26659: }
26660:
26661: SEPARATE_ZVAL_IF_NOT_REF(var_ptr);
26662:
1.1.1.2 misho 26663: if (UNEXPECTED(Z_TYPE_PP(var_ptr) == IS_OBJECT)
26664: && Z_OBJ_HANDLER_PP(var_ptr, get)
1.1 misho 26665: && Z_OBJ_HANDLER_PP(var_ptr, set)) {
26666: /* proxy object */
26667: zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC);
26668: Z_ADDREF_P(val);
1.1.1.2 misho 26669: fast_decrement_function(val);
1.1 misho 26670: Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC);
26671: zval_ptr_dtor(&val);
26672: } else {
1.1.1.2 misho 26673: fast_decrement_function(*var_ptr);
1.1 misho 26674: }
26675:
1.1.1.2 misho 26676: if (RETURN_VALUE_USED(opline)) {
1.1 misho 26677: PZVAL_LOCK(*var_ptr);
1.1.1.2 misho 26678: AI_SET_PTR(&EX_T(opline->result.var), *var_ptr);
1.1 misho 26679: }
26680:
1.1.1.2 misho 26681: CHECK_EXCEPTION();
1.1 misho 26682: ZEND_VM_NEXT_OPCODE();
26683: }
26684:
26685: static int ZEND_FASTCALL ZEND_POST_INC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
26686: {
1.1.1.2 misho 26687: USE_OPLINE
26688:
26689: zval **var_ptr, *retval;
1.1 misho 26690:
1.1.1.2 misho 26691: SAVE_OPLINE();
26692: var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 26693:
1.1.1.2 misho 26694: if (IS_CV == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
1.1 misho 26695: zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
26696: }
1.1.1.2 misho 26697: if (IS_CV == IS_VAR && UNEXPECTED(*var_ptr == &EG(error_zval))) {
26698: ZVAL_NULL(&EX_T(opline->result.var).tmp_var);
1.1 misho 26699:
1.1.1.2 misho 26700: CHECK_EXCEPTION();
1.1 misho 26701: ZEND_VM_NEXT_OPCODE();
26702: }
26703:
1.1.1.2 misho 26704: retval = &EX_T(opline->result.var).tmp_var;
26705: ZVAL_COPY_VALUE(retval, *var_ptr);
26706: zendi_zval_copy_ctor(*retval);
1.1 misho 26707:
26708: SEPARATE_ZVAL_IF_NOT_REF(var_ptr);
26709:
1.1.1.2 misho 26710: if (UNEXPECTED(Z_TYPE_PP(var_ptr) == IS_OBJECT)
26711: && Z_OBJ_HANDLER_PP(var_ptr, get)
1.1 misho 26712: && Z_OBJ_HANDLER_PP(var_ptr, set)) {
26713: /* proxy object */
26714: zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC);
26715: Z_ADDREF_P(val);
1.1.1.2 misho 26716: fast_increment_function(val);
1.1 misho 26717: Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC);
26718: zval_ptr_dtor(&val);
26719: } else {
1.1.1.2 misho 26720: fast_increment_function(*var_ptr);
1.1 misho 26721: }
26722:
1.1.1.2 misho 26723: CHECK_EXCEPTION();
1.1 misho 26724: ZEND_VM_NEXT_OPCODE();
26725: }
26726:
26727: static int ZEND_FASTCALL ZEND_POST_DEC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
26728: {
1.1.1.2 misho 26729: USE_OPLINE
26730:
26731: zval **var_ptr, *retval;
1.1 misho 26732:
1.1.1.2 misho 26733: SAVE_OPLINE();
26734: var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 26735:
1.1.1.2 misho 26736: if (IS_CV == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
1.1 misho 26737: zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
26738: }
1.1.1.2 misho 26739: if (IS_CV == IS_VAR && UNEXPECTED(*var_ptr == &EG(error_zval))) {
26740: ZVAL_NULL(&EX_T(opline->result.var).tmp_var);
1.1 misho 26741:
1.1.1.2 misho 26742: CHECK_EXCEPTION();
1.1 misho 26743: ZEND_VM_NEXT_OPCODE();
26744: }
26745:
1.1.1.2 misho 26746: retval = &EX_T(opline->result.var).tmp_var;
26747: ZVAL_COPY_VALUE(retval, *var_ptr);
26748: zendi_zval_copy_ctor(*retval);
1.1 misho 26749:
26750: SEPARATE_ZVAL_IF_NOT_REF(var_ptr);
26751:
1.1.1.2 misho 26752: if (UNEXPECTED(Z_TYPE_PP(var_ptr) == IS_OBJECT)
26753: && Z_OBJ_HANDLER_PP(var_ptr, get)
1.1 misho 26754: && Z_OBJ_HANDLER_PP(var_ptr, set)) {
26755: /* proxy object */
26756: zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC);
26757: Z_ADDREF_P(val);
1.1.1.2 misho 26758: fast_decrement_function(val);
1.1 misho 26759: Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC);
26760: zval_ptr_dtor(&val);
26761: } else {
1.1.1.2 misho 26762: fast_decrement_function(*var_ptr);
1.1 misho 26763: }
26764:
1.1.1.2 misho 26765: CHECK_EXCEPTION();
1.1 misho 26766: ZEND_VM_NEXT_OPCODE();
26767: }
26768:
26769: static int ZEND_FASTCALL ZEND_ECHO_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
26770: {
1.1.1.2 misho 26771: USE_OPLINE
1.1 misho 26772:
1.1.1.2 misho 26773: zval *z;
26774:
26775: SAVE_OPLINE();
26776: z = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 26777:
1.1.1.3 misho 26778: if (IS_CV == IS_TMP_VAR && Z_TYPE_P(z) == IS_OBJECT) {
26779: INIT_PZVAL(z);
1.1 misho 26780: }
1.1.1.3 misho 26781: zend_print_variable(z);
1.1 misho 26782:
1.1.1.2 misho 26783: CHECK_EXCEPTION();
1.1 misho 26784: ZEND_VM_NEXT_OPCODE();
26785: }
26786:
26787: static int ZEND_FASTCALL ZEND_PRINT_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
26788: {
1.1.1.2 misho 26789: USE_OPLINE
1.1 misho 26790:
1.1.1.2 misho 26791: ZVAL_LONG(&EX_T(opline->result.var).tmp_var, 1);
1.1 misho 26792: return ZEND_ECHO_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
26793: }
26794:
26795: static int ZEND_FASTCALL ZEND_JMPZ_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
26796: {
1.1.1.2 misho 26797: USE_OPLINE
1.1 misho 26798:
1.1.1.2 misho 26799: zval *val;
1.1 misho 26800: int ret;
26801:
1.1.1.2 misho 26802: SAVE_OPLINE();
26803: val = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
26804:
26805: if (IS_CV == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) {
1.1 misho 26806: ret = Z_LVAL_P(val);
26807: } else {
26808: ret = i_zend_is_true(val);
26809:
26810: if (UNEXPECTED(EG(exception) != NULL)) {
1.1.1.2 misho 26811: HANDLE_EXCEPTION();
1.1 misho 26812: }
26813: }
26814: if (!ret) {
26815: #if DEBUG_ZEND>=2
1.1.1.2 misho 26816: printf("Conditional jmp to %d\n", opline->op2.opline_num);
1.1 misho 26817: #endif
1.1.1.2 misho 26818: ZEND_VM_SET_OPCODE(opline->op2.jmp_addr);
1.1 misho 26819: ZEND_VM_CONTINUE();
26820: }
26821:
26822: ZEND_VM_NEXT_OPCODE();
26823: }
26824:
26825: static int ZEND_FASTCALL ZEND_JMPNZ_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
26826: {
1.1.1.2 misho 26827: USE_OPLINE
1.1 misho 26828:
1.1.1.2 misho 26829: zval *val;
1.1 misho 26830: int ret;
26831:
1.1.1.2 misho 26832: SAVE_OPLINE();
26833: val = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
26834:
26835: if (IS_CV == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) {
1.1 misho 26836: ret = Z_LVAL_P(val);
26837: } else {
26838: ret = i_zend_is_true(val);
26839:
26840: if (UNEXPECTED(EG(exception) != NULL)) {
1.1.1.2 misho 26841: HANDLE_EXCEPTION();
1.1 misho 26842: }
26843: }
26844: if (ret) {
26845: #if DEBUG_ZEND>=2
1.1.1.2 misho 26846: printf("Conditional jmp to %d\n", opline->op2.opline_num);
1.1 misho 26847: #endif
1.1.1.2 misho 26848: ZEND_VM_SET_OPCODE(opline->op2.jmp_addr);
1.1 misho 26849: ZEND_VM_CONTINUE();
26850: }
26851:
26852: ZEND_VM_NEXT_OPCODE();
26853: }
26854:
26855: static int ZEND_FASTCALL ZEND_JMPZNZ_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
26856: {
1.1.1.2 misho 26857: USE_OPLINE
1.1 misho 26858:
1.1.1.2 misho 26859: zval *val;
1.1 misho 26860: int retval;
26861:
1.1.1.2 misho 26862: SAVE_OPLINE();
26863: val = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
26864:
26865: if (IS_CV == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) {
1.1 misho 26866: retval = Z_LVAL_P(val);
26867: } else {
26868: retval = i_zend_is_true(val);
26869:
26870: if (UNEXPECTED(EG(exception) != NULL)) {
1.1.1.2 misho 26871: HANDLE_EXCEPTION();
1.1 misho 26872: }
26873: }
26874: if (EXPECTED(retval != 0)) {
26875: #if DEBUG_ZEND>=2
26876: printf("Conditional jmp on true to %d\n", opline->extended_value);
26877: #endif
26878: ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->extended_value]);
26879: ZEND_VM_CONTINUE(); /* CHECK_ME */
26880: } else {
26881: #if DEBUG_ZEND>=2
1.1.1.2 misho 26882: printf("Conditional jmp on false to %d\n", opline->op2.opline_num);
1.1 misho 26883: #endif
1.1.1.2 misho 26884: ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->op2.opline_num]);
1.1 misho 26885: ZEND_VM_CONTINUE(); /* CHECK_ME */
26886: }
26887: }
26888:
26889: static int ZEND_FASTCALL ZEND_JMPZ_EX_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
26890: {
1.1.1.2 misho 26891: USE_OPLINE
1.1 misho 26892:
1.1.1.2 misho 26893: zval *val;
1.1 misho 26894: int retval;
26895:
1.1.1.2 misho 26896: SAVE_OPLINE();
26897: val = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
26898:
26899: if (IS_CV == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) {
1.1 misho 26900: retval = Z_LVAL_P(val);
26901: } else {
26902: retval = i_zend_is_true(val);
26903:
26904: if (UNEXPECTED(EG(exception) != NULL)) {
1.1.1.2 misho 26905: HANDLE_EXCEPTION();
1.1 misho 26906: }
26907: }
1.1.1.2 misho 26908: Z_LVAL(EX_T(opline->result.var).tmp_var) = retval;
26909: Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
1.1 misho 26910: if (!retval) {
26911: #if DEBUG_ZEND>=2
1.1.1.2 misho 26912: printf("Conditional jmp to %d\n", opline->op2.opline_num);
1.1 misho 26913: #endif
1.1.1.2 misho 26914: ZEND_VM_SET_OPCODE(opline->op2.jmp_addr);
1.1 misho 26915: ZEND_VM_CONTINUE();
26916: }
26917: ZEND_VM_NEXT_OPCODE();
26918: }
26919:
26920: static int ZEND_FASTCALL ZEND_JMPNZ_EX_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
26921: {
1.1.1.2 misho 26922: USE_OPLINE
1.1 misho 26923:
1.1.1.2 misho 26924: zval *val;
1.1 misho 26925: int retval;
26926:
1.1.1.2 misho 26927: SAVE_OPLINE();
26928: val = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
26929:
26930: if (IS_CV == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) {
1.1 misho 26931: retval = Z_LVAL_P(val);
26932: } else {
26933: retval = i_zend_is_true(val);
26934:
26935: if (UNEXPECTED(EG(exception) != NULL)) {
1.1.1.2 misho 26936: HANDLE_EXCEPTION();
1.1 misho 26937: }
26938: }
1.1.1.2 misho 26939: Z_LVAL(EX_T(opline->result.var).tmp_var) = retval;
26940: Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
1.1 misho 26941: if (retval) {
26942: #if DEBUG_ZEND>=2
1.1.1.2 misho 26943: printf("Conditional jmp to %d\n", opline->op2.opline_num);
1.1 misho 26944: #endif
1.1.1.2 misho 26945: ZEND_VM_SET_OPCODE(opline->op2.jmp_addr);
1.1 misho 26946: ZEND_VM_CONTINUE();
26947: }
26948: ZEND_VM_NEXT_OPCODE();
26949: }
26950:
26951: static int ZEND_FASTCALL ZEND_RETURN_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
26952: {
1.1.1.2 misho 26953: USE_OPLINE
1.1 misho 26954: zval *retval_ptr;
26955:
26956:
1.1.1.2 misho 26957: SAVE_OPLINE();
26958: retval_ptr = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
26959:
26960: if (!EG(return_value_ptr_ptr)) {
26961: if (IS_CV == IS_TMP_VAR) {
1.1 misho 26962:
26963: }
1.1.1.2 misho 26964: } else if (!0) { /* Not a temp var */
26965: if (IS_CV == IS_CONST ||
26966: (PZVAL_IS_REF(retval_ptr) && Z_REFCOUNT_P(retval_ptr) > 0)) {
26967: zval *ret;
1.1 misho 26968:
1.1.1.2 misho 26969: ALLOC_ZVAL(ret);
26970: INIT_PZVAL_COPY(ret, retval_ptr);
26971: zval_copy_ctor(ret);
26972: *EG(return_value_ptr_ptr) = ret;
26973: } else if ((IS_CV == IS_CV || IS_CV == IS_VAR) &&
26974: retval_ptr == &EG(uninitialized_zval)) {
26975: zval *ret;
1.1 misho 26976:
1.1.1.2 misho 26977: ALLOC_INIT_ZVAL(ret);
26978: *EG(return_value_ptr_ptr) = ret;
26979: } else {
26980: *EG(return_value_ptr_ptr) = retval_ptr;
26981: Z_ADDREF_P(retval_ptr);
1.1 misho 26982: }
1.1.1.2 misho 26983: } else {
26984: zval *ret;
1.1 misho 26985:
1.1.1.2 misho 26986: ALLOC_ZVAL(ret);
26987: INIT_PZVAL_COPY(ret, retval_ptr);
26988: *EG(return_value_ptr_ptr) = ret;
26989: }
1.1 misho 26990:
1.1.1.2 misho 26991: return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
26992: }
1.1 misho 26993:
1.1.1.2 misho 26994: static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
26995: {
26996: USE_OPLINE
26997: zval *retval_ptr;
26998: zval **retval_ptr_ptr;
1.1 misho 26999:
27000:
1.1.1.2 misho 27001: SAVE_OPLINE();
1.1 misho 27002:
1.1.1.2 misho 27003: do {
27004: if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR) {
27005: /* Not supposed to happen, but we'll allow it */
27006: zend_error(E_NOTICE, "Only variable references should be returned by reference");
27007:
27008: retval_ptr = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
27009: if (!EG(return_value_ptr_ptr)) {
27010: if (IS_CV == IS_TMP_VAR) {
27011:
27012: }
27013: } else if (!0) { /* Not a temp var */
1.1 misho 27014: zval *ret;
27015:
27016: ALLOC_ZVAL(ret);
27017: INIT_PZVAL_COPY(ret, retval_ptr);
27018: zval_copy_ctor(ret);
27019: *EG(return_value_ptr_ptr) = ret;
1.1.1.2 misho 27020: } else {
1.1 misho 27021: zval *ret;
27022:
1.1.1.2 misho 27023: ALLOC_ZVAL(ret);
27024: INIT_PZVAL_COPY(ret, retval_ptr);
1.1 misho 27025: *EG(return_value_ptr_ptr) = ret;
27026: }
1.1.1.2 misho 27027: break;
27028: }
1.1 misho 27029:
1.1.1.2 misho 27030: retval_ptr_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC);
27031:
27032: if (IS_CV == IS_VAR && UNEXPECTED(retval_ptr_ptr == NULL)) {
27033: zend_error_noreturn(E_ERROR, "Cannot return string offsets by reference");
1.1 misho 27034: }
1.1.1.2 misho 27035:
27036: if (IS_CV == IS_VAR && !Z_ISREF_PP(retval_ptr_ptr)) {
27037: if (opline->extended_value == ZEND_RETURNS_FUNCTION &&
27038: EX_T(opline->op1.var).var.fcall_returned_reference) {
27039: } else if (EX_T(opline->op1.var).var.ptr_ptr == &EX_T(opline->op1.var).var.ptr) {
27040: zend_error(E_NOTICE, "Only variable references should be returned by reference");
27041: if (EG(return_value_ptr_ptr)) {
1.1.1.4 ! misho 27042: zval *ret;
! 27043:
! 27044: ALLOC_ZVAL(ret);
! 27045: INIT_PZVAL_COPY(ret, *retval_ptr_ptr);
! 27046: zval_copy_ctor(ret);
! 27047: *EG(return_value_ptr_ptr) = ret;
1.1.1.2 misho 27048: }
27049: break;
27050: }
27051: }
27052:
27053: if (EG(return_value_ptr_ptr)) {
27054: SEPARATE_ZVAL_TO_MAKE_IS_REF(retval_ptr_ptr);
27055: Z_ADDREF_PP(retval_ptr_ptr);
27056:
27057: *EG(return_value_ptr_ptr) = *retval_ptr_ptr;
27058: }
27059: } while (0);
1.1 misho 27060:
27061: return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
27062: }
27063:
27064: static int ZEND_FASTCALL ZEND_THROW_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
27065: {
1.1.1.2 misho 27066: USE_OPLINE
1.1 misho 27067: zval *value;
27068: zval *exception;
27069:
27070:
1.1.1.2 misho 27071: SAVE_OPLINE();
27072: value = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 27073:
1.1.1.2 misho 27074: if (IS_CV == IS_CONST || UNEXPECTED(Z_TYPE_P(value) != IS_OBJECT)) {
1.1 misho 27075: zend_error_noreturn(E_ERROR, "Can only throw objects");
27076: }
27077: zend_exception_save(TSRMLS_C);
27078: /* Not sure if a complete copy is what we want here */
27079: ALLOC_ZVAL(exception);
27080: INIT_PZVAL_COPY(exception, value);
27081: if (!0) {
27082: zval_copy_ctor(exception);
27083: }
27084:
27085: zend_throw_exception_object(exception TSRMLS_CC);
27086: zend_exception_restore(TSRMLS_C);
27087:
1.1.1.2 misho 27088: HANDLE_EXCEPTION();
1.1 misho 27089: }
27090:
27091: static int ZEND_FASTCALL zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS)
27092: {
1.1.1.2 misho 27093: USE_OPLINE
1.1 misho 27094: zval *varptr;
27095:
1.1.1.2 misho 27096: varptr = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 27097:
27098: if (varptr == &EG(uninitialized_zval)) {
27099: ALLOC_ZVAL(varptr);
27100: INIT_ZVAL(*varptr);
27101: Z_SET_REFCOUNT_P(varptr, 0);
27102: } else if (PZVAL_IS_REF(varptr)) {
27103: zval *original_var = varptr;
27104:
27105: ALLOC_ZVAL(varptr);
1.1.1.2 misho 27106: ZVAL_COPY_VALUE(varptr, original_var);
1.1 misho 27107: Z_UNSET_ISREF_P(varptr);
27108: Z_SET_REFCOUNT_P(varptr, 0);
27109: zval_copy_ctor(varptr);
27110: }
27111: Z_ADDREF_P(varptr);
27112: zend_vm_stack_push(varptr TSRMLS_CC);
27113: ; /* for string offsets */
27114:
1.1.1.2 misho 27115: CHECK_EXCEPTION();
1.1 misho 27116: ZEND_VM_NEXT_OPCODE();
27117: }
27118:
27119: static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
27120: {
1.1.1.2 misho 27121: USE_OPLINE
1.1 misho 27122: zend_free_op free_op1;
27123: zval *varptr;
27124:
1.1.1.2 misho 27125: SAVE_OPLINE();
1.1 misho 27126: if (opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) { /* Had function_ptr at compile_time */
27127: if (!(opline->extended_value & ZEND_ARG_SEND_BY_REF)) {
27128: return zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
27129: }
1.1.1.2 misho 27130: } else if (!ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) {
1.1 misho 27131: return zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
27132: }
27133:
27134: if (IS_CV == IS_VAR &&
27135: (opline->extended_value & ZEND_ARG_SEND_FUNCTION) &&
1.1.1.2 misho 27136: EX_T(opline->op1.var).var.fcall_returned_reference &&
27137: EX_T(opline->op1.var).var.ptr) {
27138: varptr = EX_T(opline->op1.var).var.ptr;
1.1 misho 27139: PZVAL_UNLOCK_EX(varptr, &free_op1, 0);
27140: } else {
1.1.1.2 misho 27141: varptr = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 27142: }
27143: if ((!(opline->extended_value & ZEND_ARG_SEND_FUNCTION) ||
1.1.1.2 misho 27144: EX_T(opline->op1.var).var.fcall_returned_reference) &&
1.1 misho 27145: varptr != &EG(uninitialized_zval) &&
27146: (PZVAL_IS_REF(varptr) ||
27147: (Z_REFCOUNT_P(varptr) == 1 && (IS_CV == IS_CV || free_op1.var)))) {
27148: Z_SET_ISREF_P(varptr);
27149: Z_ADDREF_P(varptr);
27150: zend_vm_stack_push(varptr TSRMLS_CC);
27151: } else {
27152: zval *valptr;
27153:
27154: if ((opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) ?
27155: !(opline->extended_value & ZEND_ARG_SEND_SILENT) :
1.1.1.2 misho 27156: !ARG_MAY_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) {
1.1 misho 27157: zend_error(E_STRICT, "Only variables should be passed by reference");
27158: }
27159: ALLOC_ZVAL(valptr);
27160: INIT_PZVAL_COPY(valptr, varptr);
27161: if (!0) {
27162: zval_copy_ctor(valptr);
27163: }
27164: zend_vm_stack_push(valptr TSRMLS_CC);
27165: }
27166:
1.1.1.2 misho 27167: CHECK_EXCEPTION();
1.1 misho 27168: ZEND_VM_NEXT_OPCODE();
27169: }
27170:
27171: static int ZEND_FASTCALL ZEND_SEND_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
27172: {
1.1.1.2 misho 27173: USE_OPLINE
1.1 misho 27174:
27175: zval **varptr_ptr;
27176: zval *varptr;
27177:
1.1.1.2 misho 27178: SAVE_OPLINE();
27179: varptr_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC);
27180:
27181: if (IS_CV == IS_VAR && UNEXPECTED(varptr_ptr == NULL)) {
1.1 misho 27182: zend_error_noreturn(E_ERROR, "Only variables can be passed by reference");
27183: }
27184:
1.1.1.2 misho 27185: if (IS_CV == IS_VAR && UNEXPECTED(*varptr_ptr == &EG(error_zval))) {
1.1 misho 27186: ALLOC_INIT_ZVAL(varptr);
27187: zend_vm_stack_push(varptr TSRMLS_CC);
1.1.1.2 misho 27188: CHECK_EXCEPTION();
1.1 misho 27189: ZEND_VM_NEXT_OPCODE();
27190: }
27191:
1.1.1.3 misho 27192: if (opline->extended_value == ZEND_DO_FCALL_BY_NAME &&
27193: EX(function_state).function->type == ZEND_INTERNAL_FUNCTION &&
27194: !ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) {
1.1 misho 27195: return zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
27196: }
27197:
27198: SEPARATE_ZVAL_TO_MAKE_IS_REF(varptr_ptr);
27199: varptr = *varptr_ptr;
27200: Z_ADDREF_P(varptr);
27201: zend_vm_stack_push(varptr TSRMLS_CC);
27202:
1.1.1.2 misho 27203: CHECK_EXCEPTION();
1.1 misho 27204: ZEND_VM_NEXT_OPCODE();
27205: }
27206:
27207: static int ZEND_FASTCALL ZEND_SEND_VAR_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
27208: {
1.1.1.2 misho 27209: USE_OPLINE
1.1 misho 27210:
27211: if ((opline->extended_value == ZEND_DO_FCALL_BY_NAME)
1.1.1.2 misho 27212: && ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) {
1.1 misho 27213: return ZEND_SEND_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
27214: }
1.1.1.2 misho 27215: SAVE_OPLINE();
1.1 misho 27216: return zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
27217: }
27218:
27219: static int ZEND_FASTCALL ZEND_BOOL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
27220: {
1.1.1.2 misho 27221: USE_OPLINE
1.1 misho 27222:
1.1.1.2 misho 27223: zval *retval = &EX_T(opline->result.var).tmp_var;
1.1 misho 27224:
1.1.1.2 misho 27225: SAVE_OPLINE();
1.1 misho 27226: /* PHP 3.0 returned "" for false and 1 for true, here we use 0 and 1 for now */
1.1.1.2 misho 27227: ZVAL_BOOL(retval, i_zend_is_true(_get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC)));
1.1 misho 27228:
1.1.1.2 misho 27229: CHECK_EXCEPTION();
1.1 misho 27230: ZEND_VM_NEXT_OPCODE();
27231: }
27232:
27233: static int ZEND_FASTCALL ZEND_CLONE_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
27234: {
1.1.1.2 misho 27235: USE_OPLINE
1.1 misho 27236:
1.1.1.2 misho 27237: zval *obj;
1.1 misho 27238: zend_class_entry *ce;
27239: zend_function *clone;
27240: zend_object_clone_obj_t clone_call;
27241:
1.1.1.2 misho 27242: SAVE_OPLINE();
27243: obj = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
27244:
1.1 misho 27245: if (IS_CV == IS_CONST ||
1.1.1.2 misho 27246: UNEXPECTED(Z_TYPE_P(obj) != IS_OBJECT)) {
1.1 misho 27247: zend_error_noreturn(E_ERROR, "__clone method called on non-object");
27248: }
27249:
27250: ce = Z_OBJCE_P(obj);
27251: clone = ce ? ce->clone : NULL;
27252: clone_call = Z_OBJ_HT_P(obj)->clone_obj;
1.1.1.2 misho 27253: if (UNEXPECTED(clone_call == NULL)) {
1.1 misho 27254: if (ce) {
27255: zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s", ce->name);
27256: } else {
27257: zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object");
27258: }
27259: }
27260:
27261: if (ce && clone) {
27262: if (clone->op_array.fn_flags & ZEND_ACC_PRIVATE) {
27263: /* Ensure that if we're calling a private function, we're allowed to do so.
27264: */
1.1.1.2 misho 27265: if (UNEXPECTED(ce != EG(scope))) {
1.1 misho 27266: zend_error_noreturn(E_ERROR, "Call to private %s::__clone() from context '%s'", ce->name, EG(scope) ? EG(scope)->name : "");
27267: }
27268: } else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) {
27269: /* Ensure that if we're calling a protected function, we're allowed to do so.
27270: */
1.1.1.3 misho 27271: if (UNEXPECTED(!zend_check_protected(zend_get_function_root_class(clone), EG(scope)))) {
1.1 misho 27272: zend_error_noreturn(E_ERROR, "Call to protected %s::__clone() from context '%s'", ce->name, EG(scope) ? EG(scope)->name : "");
27273: }
27274: }
27275: }
27276:
1.1.1.2 misho 27277: if (EXPECTED(EG(exception) == NULL)) {
27278: zval *retval;
27279:
27280: ALLOC_ZVAL(retval);
27281: Z_OBJVAL_P(retval) = clone_call(obj TSRMLS_CC);
27282: Z_TYPE_P(retval) = IS_OBJECT;
27283: Z_SET_REFCOUNT_P(retval, 1);
27284: Z_SET_ISREF_P(retval);
27285: if (!RETURN_VALUE_USED(opline) || UNEXPECTED(EG(exception) != NULL)) {
27286: zval_ptr_dtor(&retval);
27287: } else {
27288: AI_SET_PTR(&EX_T(opline->result.var), retval);
1.1 misho 27289: }
27290: }
27291:
1.1.1.2 misho 27292: CHECK_EXCEPTION();
1.1 misho 27293: ZEND_VM_NEXT_OPCODE();
27294: }
27295:
27296: static int ZEND_FASTCALL ZEND_CAST_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
27297: {
1.1.1.2 misho 27298: USE_OPLINE
27299:
27300: zval *expr;
27301: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 27302:
1.1.1.2 misho 27303: SAVE_OPLINE();
27304: expr = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 27305:
27306: if (opline->extended_value != IS_STRING) {
1.1.1.2 misho 27307: ZVAL_COPY_VALUE(result, expr);
1.1 misho 27308: if (!0) {
27309: zendi_zval_copy_ctor(*result);
27310: }
27311: }
27312: switch (opline->extended_value) {
27313: case IS_NULL:
27314: convert_to_null(result);
27315: break;
27316: case IS_BOOL:
27317: convert_to_boolean(result);
27318: break;
27319: case IS_LONG:
27320: convert_to_long(result);
27321: break;
27322: case IS_DOUBLE:
27323: convert_to_double(result);
27324: break;
27325: case IS_STRING: {
27326: zval var_copy;
27327: int use_copy;
27328:
27329: zend_make_printable_zval(expr, &var_copy, &use_copy);
27330: if (use_copy) {
1.1.1.2 misho 27331: ZVAL_COPY_VALUE(result, &var_copy);
1.1 misho 27332: if (0) {
27333:
27334: }
27335: } else {
1.1.1.2 misho 27336: ZVAL_COPY_VALUE(result, expr);
1.1 misho 27337: if (!0) {
27338: zendi_zval_copy_ctor(*result);
27339: }
27340: }
27341: break;
27342: }
27343: case IS_ARRAY:
27344: convert_to_array(result);
27345: break;
27346: case IS_OBJECT:
27347: convert_to_object(result);
27348: break;
27349: }
27350:
1.1.1.2 misho 27351: CHECK_EXCEPTION();
1.1 misho 27352: ZEND_VM_NEXT_OPCODE();
27353: }
27354:
27355: static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
27356: {
1.1.1.2 misho 27357: USE_OPLINE
1.1 misho 27358: zend_op_array *new_op_array=NULL;
27359:
1.1.1.2 misho 27360: zval *inc_filename;
27361: zval *tmp_inc_filename = NULL;
1.1 misho 27362: zend_bool failure_retval=0;
27363:
1.1.1.2 misho 27364: SAVE_OPLINE();
27365: inc_filename = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
27366:
1.1 misho 27367: if (inc_filename->type!=IS_STRING) {
1.1.1.2 misho 27368: MAKE_STD_ZVAL(tmp_inc_filename);
27369: ZVAL_COPY_VALUE(tmp_inc_filename, inc_filename);
27370: zval_copy_ctor(tmp_inc_filename);
27371: convert_to_string(tmp_inc_filename);
27372: inc_filename = tmp_inc_filename;
1.1 misho 27373: }
27374:
1.1.1.2 misho 27375: if (opline->extended_value != ZEND_EVAL && strlen(Z_STRVAL_P(inc_filename)) != Z_STRLEN_P(inc_filename)) {
27376: if (opline->extended_value == ZEND_INCLUDE_ONCE || opline->extended_value == ZEND_INCLUDE) {
1.1 misho 27377: zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
27378: } else {
27379: zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
27380: }
27381: } else {
1.1.1.2 misho 27382: switch (opline->extended_value) {
1.1 misho 27383: case ZEND_INCLUDE_ONCE:
27384: case ZEND_REQUIRE_ONCE: {
27385: zend_file_handle file_handle;
27386: char *resolved_path;
27387:
27388: resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename) TSRMLS_CC);
27389: if (resolved_path) {
27390: failure_retval = zend_hash_exists(&EG(included_files), resolved_path, strlen(resolved_path)+1);
27391: } else {
27392: resolved_path = Z_STRVAL_P(inc_filename);
27393: }
27394:
27395: if (failure_retval) {
27396: /* do nothing, file already included */
27397: } else if (SUCCESS == zend_stream_open(resolved_path, &file_handle TSRMLS_CC)) {
27398:
27399: if (!file_handle.opened_path) {
27400: file_handle.opened_path = estrdup(resolved_path);
27401: }
27402:
27403: if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) {
1.1.1.2 misho 27404: new_op_array = zend_compile_file(&file_handle, (opline->extended_value==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
1.1 misho 27405: zend_destroy_file_handle(&file_handle TSRMLS_CC);
27406: } else {
27407: zend_file_handle_dtor(&file_handle TSRMLS_CC);
27408: failure_retval=1;
27409: }
27410: } else {
1.1.1.2 misho 27411: if (opline->extended_value == ZEND_INCLUDE_ONCE) {
1.1 misho 27412: zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
27413: } else {
27414: zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
27415: }
27416: }
27417: if (resolved_path != Z_STRVAL_P(inc_filename)) {
27418: efree(resolved_path);
27419: }
27420: }
27421: break;
27422: case ZEND_INCLUDE:
27423: case ZEND_REQUIRE:
1.1.1.2 misho 27424: new_op_array = compile_filename(opline->extended_value, inc_filename TSRMLS_CC);
1.1 misho 27425: break;
27426: case ZEND_EVAL: {
27427: char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);
27428:
27429: new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
27430: efree(eval_desc);
27431: }
27432: break;
27433: EMPTY_SWITCH_DEFAULT_CASE()
27434: }
27435: }
1.1.1.2 misho 27436: if (tmp_inc_filename) {
27437: zval_ptr_dtor(&tmp_inc_filename);
1.1 misho 27438: }
27439:
1.1.1.2 misho 27440: if (UNEXPECTED(EG(exception) != NULL)) {
27441: HANDLE_EXCEPTION();
27442: } else if (EXPECTED(new_op_array != NULL)) {
1.1 misho 27443: EX(original_return_value) = EG(return_value_ptr_ptr);
27444: EG(active_op_array) = new_op_array;
1.1.1.2 misho 27445: if (RETURN_VALUE_USED(opline)) {
27446: EX_T(opline->result.var).var.ptr = NULL;
27447: EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
27448: EG(return_value_ptr_ptr) = EX_T(opline->result.var).var.ptr_ptr;
27449: } else {
27450: EG(return_value_ptr_ptr) = NULL;
27451: }
1.1 misho 27452:
27453: EX(current_object) = EX(object);
27454:
27455: EX(function_state).function = (zend_function *) new_op_array;
27456: EX(object) = NULL;
27457:
27458: if (!EG(active_symbol_table)) {
27459: zend_rebuild_symbol_table(TSRMLS_C);
27460: }
27461:
1.1.1.2 misho 27462: if (EXPECTED(zend_execute == execute)) {
1.1 misho 27463: ZEND_VM_ENTER();
27464: } else {
27465: zend_execute(new_op_array TSRMLS_CC);
27466: }
27467:
27468: EX(function_state).function = (zend_function *) EX(op_array);
27469: EX(object) = EX(current_object);
27470:
27471: EG(opline_ptr) = &EX(opline);
27472: EG(active_op_array) = EX(op_array);
27473: EG(return_value_ptr_ptr) = EX(original_return_value);
27474: destroy_op_array(new_op_array TSRMLS_CC);
27475: efree(new_op_array);
1.1.1.2 misho 27476: if (UNEXPECTED(EG(exception) != NULL)) {
1.1 misho 27477: zend_throw_exception_internal(NULL TSRMLS_CC);
1.1.1.2 misho 27478: HANDLE_EXCEPTION();
27479: } else if (RETURN_VALUE_USED(opline)) {
27480: if (!EX_T(opline->result.var).var.ptr) { /* there was no return statement */
27481: zval *retval;
1.1 misho 27482:
1.1.1.2 misho 27483: ALLOC_ZVAL(retval);
27484: ZVAL_BOOL(retval, 1);
27485: INIT_PZVAL(retval);
27486: EX_T(opline->result.var).var.ptr = retval;
1.1 misho 27487: }
27488: }
27489:
1.1.1.2 misho 27490: } else if (RETURN_VALUE_USED(opline)) {
27491: zval *retval;
1.1 misho 27492:
1.1.1.2 misho 27493: ALLOC_ZVAL(retval);
27494: ZVAL_BOOL(retval, failure_retval);
27495: INIT_PZVAL(retval);
27496: AI_SET_PTR(&EX_T(opline->result.var), retval);
1.1 misho 27497: }
27498: ZEND_VM_NEXT_OPCODE();
27499: }
27500:
27501: static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
27502: {
1.1.1.2 misho 27503: USE_OPLINE
1.1 misho 27504:
27505: zval *array_ptr, **array_ptr_ptr;
27506: HashTable *fe_ht;
27507: zend_object_iterator *iter = NULL;
27508: zend_class_entry *ce = NULL;
27509: zend_bool is_empty = 0;
27510:
1.1.1.2 misho 27511: SAVE_OPLINE();
27512:
27513: if ((IS_CV == IS_CV || IS_CV == IS_VAR) &&
27514: (opline->extended_value & ZEND_FE_RESET_VARIABLE)) {
27515: array_ptr_ptr = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 27516: if (array_ptr_ptr == NULL || array_ptr_ptr == &EG(uninitialized_zval_ptr)) {
1.1.1.2 misho 27517: MAKE_STD_ZVAL(array_ptr);
27518: ZVAL_NULL(array_ptr);
1.1 misho 27519: } else if (Z_TYPE_PP(array_ptr_ptr) == IS_OBJECT) {
27520: if(Z_OBJ_HT_PP(array_ptr_ptr)->get_class_entry == NULL) {
27521: zend_error(E_WARNING, "foreach() cannot iterate over objects without PHP class");
1.1.1.2 misho 27522: ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num);
1.1 misho 27523: }
27524:
27525: ce = Z_OBJCE_PP(array_ptr_ptr);
27526: if (!ce || ce->get_iterator == NULL) {
27527: SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr);
27528: Z_ADDREF_PP(array_ptr_ptr);
27529: }
27530: array_ptr = *array_ptr_ptr;
27531: } else {
27532: if (Z_TYPE_PP(array_ptr_ptr) == IS_ARRAY) {
27533: SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr);
27534: if (opline->extended_value & ZEND_FE_FETCH_BYREF) {
27535: Z_SET_ISREF_PP(array_ptr_ptr);
27536: }
27537: }
27538: array_ptr = *array_ptr_ptr;
27539: Z_ADDREF_P(array_ptr);
27540: }
27541: } else {
1.1.1.2 misho 27542: array_ptr = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 27543: if (0) { /* IS_TMP_VAR */
27544: zval *tmp;
27545:
27546: ALLOC_ZVAL(tmp);
27547: INIT_PZVAL_COPY(tmp, array_ptr);
27548: array_ptr = tmp;
27549: if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
27550: ce = Z_OBJCE_P(array_ptr);
27551: if (ce && ce->get_iterator) {
27552: Z_DELREF_P(array_ptr);
27553: }
27554: }
27555: } else if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
27556: ce = Z_OBJCE_P(array_ptr);
27557: if (!ce || !ce->get_iterator) {
27558: Z_ADDREF_P(array_ptr);
27559: }
27560: } else if (IS_CV == IS_CONST ||
27561: ((IS_CV == IS_CV || IS_CV == IS_VAR) &&
27562: !Z_ISREF_P(array_ptr) &&
27563: Z_REFCOUNT_P(array_ptr) > 1)) {
27564: zval *tmp;
27565:
27566: ALLOC_ZVAL(tmp);
27567: INIT_PZVAL_COPY(tmp, array_ptr);
27568: zval_copy_ctor(tmp);
27569: array_ptr = tmp;
27570: } else {
27571: Z_ADDREF_P(array_ptr);
27572: }
27573: }
27574:
27575: if (ce && ce->get_iterator) {
27576: iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC);
27577:
1.1.1.2 misho 27578: if (iter && EXPECTED(EG(exception) == NULL)) {
1.1 misho 27579: array_ptr = zend_iterator_wrap(iter TSRMLS_CC);
27580: } else {
27581:
27582: if (!EG(exception)) {
27583: zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Object of type %s did not create an Iterator", ce->name);
27584: }
27585: zend_throw_exception_internal(NULL TSRMLS_CC);
1.1.1.2 misho 27586: HANDLE_EXCEPTION();
1.1 misho 27587: }
27588: }
27589:
1.1.1.2 misho 27590: EX_T(opline->result.var).fe.ptr = array_ptr;
1.1 misho 27591:
27592: if (iter) {
27593: iter->index = 0;
27594: if (iter->funcs->rewind) {
27595: iter->funcs->rewind(iter TSRMLS_CC);
1.1.1.2 misho 27596: if (UNEXPECTED(EG(exception) != NULL)) {
1.1 misho 27597: zval_ptr_dtor(&array_ptr);
27598:
1.1.1.2 misho 27599: HANDLE_EXCEPTION();
1.1 misho 27600: }
27601: }
27602: is_empty = iter->funcs->valid(iter TSRMLS_CC) != SUCCESS;
1.1.1.2 misho 27603: if (UNEXPECTED(EG(exception) != NULL)) {
1.1 misho 27604: zval_ptr_dtor(&array_ptr);
27605:
1.1.1.2 misho 27606: HANDLE_EXCEPTION();
1.1 misho 27607: }
27608: iter->index = -1; /* will be set to 0 before using next handler */
27609: } else if ((fe_ht = HASH_OF(array_ptr)) != NULL) {
27610: zend_hash_internal_pointer_reset(fe_ht);
27611: if (ce) {
27612: zend_object *zobj = zend_objects_get_address(array_ptr TSRMLS_CC);
27613: while (zend_hash_has_more_elements(fe_ht) == SUCCESS) {
27614: char *str_key;
27615: uint str_key_len;
27616: ulong int_key;
27617: zend_uchar key_type;
27618:
27619: key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL);
27620: if (key_type != HASH_KEY_NON_EXISTANT &&
27621: (key_type == HASH_KEY_IS_LONG ||
27622: zend_check_property_access(zobj, str_key, str_key_len-1 TSRMLS_CC) == SUCCESS)) {
27623: break;
27624: }
27625: zend_hash_move_forward(fe_ht);
27626: }
27627: }
27628: is_empty = zend_hash_has_more_elements(fe_ht) != SUCCESS;
1.1.1.2 misho 27629: zend_hash_get_pointer(fe_ht, &EX_T(opline->result.var).fe.fe_pos);
1.1 misho 27630: } else {
27631: zend_error(E_WARNING, "Invalid argument supplied for foreach()");
27632: is_empty = 1;
27633: }
27634:
27635: if (is_empty) {
1.1.1.2 misho 27636: ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num);
1.1 misho 27637: } else {
1.1.1.2 misho 27638: CHECK_EXCEPTION();
1.1 misho 27639: ZEND_VM_NEXT_OPCODE();
27640: }
27641: }
27642:
1.1.1.2 misho 27643: static int ZEND_FASTCALL ZEND_EXIT_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 27644: {
1.1.1.2 misho 27645: #if 0 || (IS_CV != IS_UNUSED)
27646: USE_OPLINE
1.1 misho 27647:
1.1.1.2 misho 27648: SAVE_OPLINE();
27649: if (IS_CV != IS_UNUSED) {
1.1 misho 27650:
1.1.1.2 misho 27651: zval *ptr = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
27652:
27653: if (Z_TYPE_P(ptr) == IS_LONG) {
27654: EG(exit_status) = Z_LVAL_P(ptr);
1.1 misho 27655: } else {
1.1.1.2 misho 27656: zend_print_variable(ptr);
1.1 misho 27657: }
27658:
1.1.1.2 misho 27659: }
27660: #endif
27661: zend_bailout();
27662: ZEND_VM_NEXT_OPCODE(); /* Never reached */
27663: }
1.1 misho 27664:
1.1.1.2 misho 27665: static int ZEND_FASTCALL ZEND_JMP_SET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
27666: {
27667: USE_OPLINE
1.1 misho 27668:
1.1.1.2 misho 27669: zval *value;
1.1 misho 27670:
1.1.1.2 misho 27671: SAVE_OPLINE();
27672: value = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 27673:
1.1.1.2 misho 27674: if (i_zend_is_true(value)) {
27675: ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, value);
27676: if (!0) {
27677: zendi_zval_copy_ctor(EX_T(opline->result.var).tmp_var);
27678: }
1.1 misho 27679:
1.1.1.2 misho 27680: #if DEBUG_ZEND>=2
27681: printf("Conditional jmp to %d\n", opline->op2.opline_num);
27682: #endif
27683: ZEND_VM_JMP(opline->op2.jmp_addr);
1.1 misho 27684: }
27685:
1.1.1.2 misho 27686: CHECK_EXCEPTION();
1.1 misho 27687: ZEND_VM_NEXT_OPCODE();
27688: }
27689:
1.1.1.2 misho 27690: static int ZEND_FASTCALL ZEND_JMP_SET_VAR_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 27691: {
1.1.1.2 misho 27692: USE_OPLINE
1.1 misho 27693:
1.1.1.2 misho 27694: zval *value, *ret;
1.1 misho 27695:
1.1.1.2 misho 27696: SAVE_OPLINE();
27697: value = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
27698:
27699: if (i_zend_is_true(value)) {
27700: if (IS_CV == IS_VAR || IS_CV == IS_CV) {
27701: Z_ADDREF_P(value);
27702: EX_T(opline->result.var).var.ptr = value;
27703: EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
1.1 misho 27704: } else {
1.1.1.2 misho 27705: ALLOC_ZVAL(ret);
27706: INIT_PZVAL_COPY(ret, value);
27707: EX_T(opline->result.var).var.ptr = ret;
27708: EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
27709: if (!0) {
27710: zval_copy_ctor(EX_T(opline->result.var).var.ptr);
27711: }
1.1 misho 27712: }
27713:
1.1.1.2 misho 27714: #if DEBUG_ZEND>=2
27715: printf("Conditional jmp to %d\n", opline->op2.opline_num);
1.1 misho 27716: #endif
1.1.1.2 misho 27717: ZEND_VM_JMP(opline->op2.jmp_addr);
27718: }
27719:
27720: CHECK_EXCEPTION();
1.1 misho 27721: ZEND_VM_NEXT_OPCODE();
27722: }
27723:
1.1.1.2 misho 27724: static int ZEND_FASTCALL ZEND_QM_ASSIGN_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 27725: {
1.1.1.2 misho 27726: USE_OPLINE
1.1 misho 27727:
1.1.1.2 misho 27728: zval *value;
1.1 misho 27729:
1.1.1.2 misho 27730: SAVE_OPLINE();
27731: value = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 27732:
1.1.1.2 misho 27733: ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, value);
27734: if (!0) {
27735: zval_copy_ctor(&EX_T(opline->result.var).tmp_var);
1.1 misho 27736: }
27737:
1.1.1.2 misho 27738: CHECK_EXCEPTION();
1.1 misho 27739: ZEND_VM_NEXT_OPCODE();
27740: }
27741:
1.1.1.2 misho 27742: static int ZEND_FASTCALL ZEND_QM_ASSIGN_VAR_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 27743: {
1.1.1.2 misho 27744: USE_OPLINE
1.1 misho 27745:
1.1.1.2 misho 27746: zval *value, *ret;
1.1 misho 27747:
1.1.1.2 misho 27748: SAVE_OPLINE();
27749: value = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
27750:
27751: if (IS_CV == IS_VAR || IS_CV == IS_CV) {
27752: Z_ADDREF_P(value);
27753: EX_T(opline->result.var).var.ptr = value;
27754: EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
27755: } else {
27756: ALLOC_ZVAL(ret);
27757: INIT_PZVAL_COPY(ret, value);
27758: EX_T(opline->result.var).var.ptr = ret;
27759: EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
27760: if (!0) {
27761: zval_copy_ctor(EX_T(opline->result.var).var.ptr);
27762: }
1.1 misho 27763: }
27764:
1.1.1.2 misho 27765: CHECK_EXCEPTION();
1.1 misho 27766: ZEND_VM_NEXT_OPCODE();
27767: }
27768:
27769: static int ZEND_FASTCALL ZEND_INSTANCEOF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
27770: {
1.1.1.2 misho 27771: USE_OPLINE
1.1 misho 27772:
1.1.1.2 misho 27773: zval *expr;
1.1 misho 27774: zend_bool result;
27775:
1.1.1.2 misho 27776: SAVE_OPLINE();
27777: expr = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
27778:
1.1 misho 27779: if (Z_TYPE_P(expr) == IS_OBJECT && Z_OBJ_HT_P(expr)->get_class_entry) {
1.1.1.2 misho 27780: result = instanceof_function(Z_OBJCE_P(expr), EX_T(opline->op2.var).class_entry TSRMLS_CC);
1.1 misho 27781: } else {
27782: result = 0;
27783: }
1.1.1.2 misho 27784: ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, result);
1.1 misho 27785:
1.1.1.2 misho 27786: CHECK_EXCEPTION();
1.1 misho 27787: ZEND_VM_NEXT_OPCODE();
27788: }
27789:
27790: static int ZEND_FASTCALL ZEND_ADD_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
27791: {
1.1.1.2 misho 27792: USE_OPLINE
1.1 misho 27793:
27794:
1.1.1.2 misho 27795: SAVE_OPLINE();
27796: fast_add_function(&EX_T(opline->result.var).tmp_var,
27797: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
27798: opline->op2.zv TSRMLS_CC);
1.1 misho 27799:
27800:
1.1.1.2 misho 27801: CHECK_EXCEPTION();
1.1 misho 27802: ZEND_VM_NEXT_OPCODE();
27803: }
27804:
27805: static int ZEND_FASTCALL ZEND_SUB_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
27806: {
1.1.1.2 misho 27807: USE_OPLINE
1.1 misho 27808:
27809:
1.1.1.2 misho 27810: SAVE_OPLINE();
27811: fast_sub_function(&EX_T(opline->result.var).tmp_var,
27812: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
27813: opline->op2.zv TSRMLS_CC);
1.1 misho 27814:
27815:
1.1.1.2 misho 27816: CHECK_EXCEPTION();
1.1 misho 27817: ZEND_VM_NEXT_OPCODE();
27818: }
27819:
27820: static int ZEND_FASTCALL ZEND_MUL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
27821: {
1.1.1.2 misho 27822: USE_OPLINE
1.1 misho 27823:
27824:
1.1.1.2 misho 27825: SAVE_OPLINE();
27826: fast_mul_function(&EX_T(opline->result.var).tmp_var,
27827: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
27828: opline->op2.zv TSRMLS_CC);
1.1 misho 27829:
27830:
1.1.1.2 misho 27831: CHECK_EXCEPTION();
1.1 misho 27832: ZEND_VM_NEXT_OPCODE();
27833: }
27834:
27835: static int ZEND_FASTCALL ZEND_DIV_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
27836: {
1.1.1.2 misho 27837: USE_OPLINE
1.1 misho 27838:
27839:
1.1.1.2 misho 27840: SAVE_OPLINE();
27841: fast_div_function(&EX_T(opline->result.var).tmp_var,
27842: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
27843: opline->op2.zv TSRMLS_CC);
1.1 misho 27844:
27845:
1.1.1.2 misho 27846: CHECK_EXCEPTION();
1.1 misho 27847: ZEND_VM_NEXT_OPCODE();
27848: }
27849:
27850: static int ZEND_FASTCALL ZEND_MOD_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
27851: {
1.1.1.2 misho 27852: USE_OPLINE
1.1 misho 27853:
27854:
1.1.1.2 misho 27855: SAVE_OPLINE();
27856: fast_mod_function(&EX_T(opline->result.var).tmp_var,
27857: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
27858: opline->op2.zv TSRMLS_CC);
1.1 misho 27859:
27860:
1.1.1.2 misho 27861: CHECK_EXCEPTION();
1.1 misho 27862: ZEND_VM_NEXT_OPCODE();
27863: }
27864:
27865: static int ZEND_FASTCALL ZEND_SL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
27866: {
1.1.1.2 misho 27867: USE_OPLINE
1.1 misho 27868:
27869:
1.1.1.2 misho 27870: SAVE_OPLINE();
27871: shift_left_function(&EX_T(opline->result.var).tmp_var,
27872: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
27873: opline->op2.zv TSRMLS_CC);
1.1 misho 27874:
27875:
1.1.1.2 misho 27876: CHECK_EXCEPTION();
1.1 misho 27877: ZEND_VM_NEXT_OPCODE();
27878: }
27879:
27880: static int ZEND_FASTCALL ZEND_SR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
27881: {
1.1.1.2 misho 27882: USE_OPLINE
1.1 misho 27883:
27884:
1.1.1.2 misho 27885: SAVE_OPLINE();
27886: shift_right_function(&EX_T(opline->result.var).tmp_var,
27887: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
27888: opline->op2.zv TSRMLS_CC);
1.1 misho 27889:
27890:
1.1.1.2 misho 27891: CHECK_EXCEPTION();
1.1 misho 27892: ZEND_VM_NEXT_OPCODE();
27893: }
27894:
27895: static int ZEND_FASTCALL ZEND_CONCAT_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
27896: {
1.1.1.2 misho 27897: USE_OPLINE
1.1 misho 27898:
27899:
1.1.1.2 misho 27900: SAVE_OPLINE();
27901: concat_function(&EX_T(opline->result.var).tmp_var,
27902: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
27903: opline->op2.zv TSRMLS_CC);
1.1 misho 27904:
27905:
1.1.1.2 misho 27906: CHECK_EXCEPTION();
1.1 misho 27907: ZEND_VM_NEXT_OPCODE();
27908: }
27909:
27910: static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
27911: {
1.1.1.2 misho 27912: USE_OPLINE
1.1 misho 27913:
27914:
1.1.1.2 misho 27915: SAVE_OPLINE();
27916: is_identical_function(&EX_T(opline->result.var).tmp_var,
27917: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
27918: opline->op2.zv TSRMLS_CC);
1.1 misho 27919:
27920:
1.1.1.2 misho 27921: CHECK_EXCEPTION();
1.1 misho 27922: ZEND_VM_NEXT_OPCODE();
27923: }
27924:
27925: static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
27926: {
1.1.1.2 misho 27927: USE_OPLINE
1.1 misho 27928:
1.1.1.2 misho 27929: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 27930:
1.1.1.2 misho 27931: SAVE_OPLINE();
1.1 misho 27932: is_identical_function(result,
1.1.1.2 misho 27933: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
27934: opline->op2.zv TSRMLS_CC);
1.1 misho 27935: Z_LVAL_P(result) = !Z_LVAL_P(result);
27936:
27937:
1.1.1.2 misho 27938: CHECK_EXCEPTION();
1.1 misho 27939: ZEND_VM_NEXT_OPCODE();
27940: }
27941:
27942: static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
27943: {
1.1.1.2 misho 27944: USE_OPLINE
1.1 misho 27945:
1.1.1.2 misho 27946: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 27947:
1.1.1.2 misho 27948: SAVE_OPLINE();
27949: ZVAL_BOOL(result, fast_equal_function(result,
27950: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
27951: opline->op2.zv TSRMLS_CC));
1.1 misho 27952:
27953:
1.1.1.2 misho 27954: CHECK_EXCEPTION();
1.1 misho 27955: ZEND_VM_NEXT_OPCODE();
27956: }
27957:
27958: static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
27959: {
1.1.1.2 misho 27960: USE_OPLINE
1.1 misho 27961:
1.1.1.2 misho 27962: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 27963:
1.1.1.2 misho 27964: SAVE_OPLINE();
27965: ZVAL_BOOL(result, fast_not_equal_function(result,
27966: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
27967: opline->op2.zv TSRMLS_CC));
1.1 misho 27968:
27969:
1.1.1.2 misho 27970: CHECK_EXCEPTION();
1.1 misho 27971: ZEND_VM_NEXT_OPCODE();
27972: }
27973:
27974: static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
27975: {
1.1.1.2 misho 27976: USE_OPLINE
1.1 misho 27977:
1.1.1.2 misho 27978: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 27979:
1.1.1.2 misho 27980: SAVE_OPLINE();
27981: ZVAL_BOOL(result, fast_is_smaller_function(result,
27982: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
27983: opline->op2.zv TSRMLS_CC));
1.1 misho 27984:
27985:
1.1.1.2 misho 27986: CHECK_EXCEPTION();
1.1 misho 27987: ZEND_VM_NEXT_OPCODE();
27988: }
27989:
27990: static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
27991: {
1.1.1.2 misho 27992: USE_OPLINE
1.1 misho 27993:
1.1.1.2 misho 27994: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 27995:
1.1.1.2 misho 27996: SAVE_OPLINE();
27997: ZVAL_BOOL(result, fast_is_smaller_or_equal_function(result,
27998: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
27999: opline->op2.zv TSRMLS_CC));
1.1 misho 28000:
28001:
1.1.1.2 misho 28002: CHECK_EXCEPTION();
1.1 misho 28003: ZEND_VM_NEXT_OPCODE();
28004: }
28005:
28006: static int ZEND_FASTCALL ZEND_BW_OR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
28007: {
1.1.1.2 misho 28008: USE_OPLINE
1.1 misho 28009:
28010:
1.1.1.2 misho 28011: SAVE_OPLINE();
28012: bitwise_or_function(&EX_T(opline->result.var).tmp_var,
28013: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
28014: opline->op2.zv TSRMLS_CC);
1.1 misho 28015:
28016:
1.1.1.2 misho 28017: CHECK_EXCEPTION();
1.1 misho 28018: ZEND_VM_NEXT_OPCODE();
28019: }
28020:
28021: static int ZEND_FASTCALL ZEND_BW_AND_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
28022: {
1.1.1.2 misho 28023: USE_OPLINE
1.1 misho 28024:
28025:
1.1.1.2 misho 28026: SAVE_OPLINE();
28027: bitwise_and_function(&EX_T(opline->result.var).tmp_var,
28028: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
28029: opline->op2.zv TSRMLS_CC);
1.1 misho 28030:
28031:
1.1.1.2 misho 28032: CHECK_EXCEPTION();
1.1 misho 28033: ZEND_VM_NEXT_OPCODE();
28034: }
28035:
28036: static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
28037: {
1.1.1.2 misho 28038: USE_OPLINE
1.1 misho 28039:
28040:
1.1.1.2 misho 28041: SAVE_OPLINE();
28042: bitwise_xor_function(&EX_T(opline->result.var).tmp_var,
28043: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
28044: opline->op2.zv TSRMLS_CC);
1.1 misho 28045:
28046:
1.1.1.2 misho 28047: CHECK_EXCEPTION();
1.1 misho 28048: ZEND_VM_NEXT_OPCODE();
28049: }
28050:
28051: static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
28052: {
1.1.1.2 misho 28053: USE_OPLINE
1.1 misho 28054:
28055:
1.1.1.2 misho 28056: SAVE_OPLINE();
28057: boolean_xor_function(&EX_T(opline->result.var).tmp_var,
28058: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
28059: opline->op2.zv TSRMLS_CC);
1.1 misho 28060:
28061:
1.1.1.2 misho 28062: CHECK_EXCEPTION();
1.1 misho 28063: ZEND_VM_NEXT_OPCODE();
28064: }
28065:
28066: static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CONST(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
28067: {
1.1.1.2 misho 28068: USE_OPLINE
1.1 misho 28069: zend_free_op free_op_data1;
1.1.1.2 misho 28070: zval **object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 28071: zval *object;
1.1.1.2 misho 28072: zval *property = opline->op2.zv;
28073: zval *value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R);
1.1 misho 28074: int have_get_ptr = 0;
28075:
1.1.1.2 misho 28076: if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 28077: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
28078: }
28079:
28080: make_real_object(object_ptr TSRMLS_CC);
28081: object = *object_ptr;
28082:
1.1.1.2 misho 28083: if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
1.1 misho 28084: zend_error(E_WARNING, "Attempt to assign property of non-object");
28085:
28086: FREE_OP(free_op_data1);
28087:
1.1.1.2 misho 28088: if (RETURN_VALUE_USED(opline)) {
28089: PZVAL_LOCK(&EG(uninitialized_zval));
28090: EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
28091: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 28092: }
28093: } else {
28094: /* here we are sure we are dealing with an object */
28095: if (0) {
28096: MAKE_REAL_ZVAL_PTR(property);
28097: }
28098:
28099: /* here property is a string */
28100: if (opline->extended_value == ZEND_ASSIGN_OBJ
28101: && Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
1.1.1.2 misho 28102: zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 28103: if (zptr != NULL) { /* NULL means no success in getting PTR */
28104: SEPARATE_ZVAL_IF_NOT_REF(zptr);
28105:
28106: have_get_ptr = 1;
28107: binary_op(*zptr, *zptr, value TSRMLS_CC);
1.1.1.2 misho 28108: if (RETURN_VALUE_USED(opline)) {
1.1 misho 28109: PZVAL_LOCK(*zptr);
1.1.1.2 misho 28110: EX_T(opline->result.var).var.ptr = *zptr;
28111: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 28112: }
28113: }
28114: }
28115:
28116: if (!have_get_ptr) {
28117: zval *z = NULL;
28118:
28119: if (opline->extended_value == ZEND_ASSIGN_OBJ) {
28120: if (Z_OBJ_HT_P(object)->read_property) {
1.1.1.2 misho 28121: z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 28122: }
28123: } else /* if (opline->extended_value == ZEND_ASSIGN_DIM) */ {
28124: if (Z_OBJ_HT_P(object)->read_dimension) {
28125: z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC);
28126: }
28127: }
28128: if (z) {
28129: if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
28130: zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
28131:
28132: if (Z_REFCOUNT_P(z) == 0) {
28133: GC_REMOVE_ZVAL_FROM_BUFFER(z);
28134: zval_dtor(z);
28135: FREE_ZVAL(z);
28136: }
28137: z = value;
28138: }
28139: Z_ADDREF_P(z);
28140: SEPARATE_ZVAL_IF_NOT_REF(&z);
28141: binary_op(z, z, value TSRMLS_CC);
28142: if (opline->extended_value == ZEND_ASSIGN_OBJ) {
1.1.1.2 misho 28143: Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 28144: } else /* if (opline->extended_value == ZEND_ASSIGN_DIM) */ {
28145: Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC);
28146: }
1.1.1.2 misho 28147: if (RETURN_VALUE_USED(opline)) {
1.1 misho 28148: PZVAL_LOCK(z);
1.1.1.2 misho 28149: EX_T(opline->result.var).var.ptr = z;
28150: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 28151: }
28152: zval_ptr_dtor(&z);
28153: } else {
28154: zend_error(E_WARNING, "Attempt to assign property of non-object");
1.1.1.2 misho 28155: if (RETURN_VALUE_USED(opline)) {
28156: PZVAL_LOCK(&EG(uninitialized_zval));
28157: EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
28158: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 28159: }
28160: }
28161: }
28162:
28163: if (0) {
28164: zval_ptr_dtor(&property);
28165: } else {
28166:
28167: }
28168: FREE_OP(free_op_data1);
28169: }
28170:
28171: /* assign_obj has two opcodes! */
1.1.1.2 misho 28172: CHECK_EXCEPTION();
1.1 misho 28173: ZEND_VM_INC_OPCODE();
28174: ZEND_VM_NEXT_OPCODE();
28175: }
28176:
28177: static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_CONST(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
28178: {
1.1.1.2 misho 28179: USE_OPLINE
1.1 misho 28180: zend_free_op free_op_data2, free_op_data1;
28181: zval **var_ptr;
28182: zval *value;
28183:
1.1.1.2 misho 28184: SAVE_OPLINE();
1.1 misho 28185: switch (opline->extended_value) {
28186: case ZEND_ASSIGN_OBJ:
28187: return zend_binary_assign_op_obj_helper_SPEC_CV_CONST(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
28188: break;
28189: case ZEND_ASSIGN_DIM: {
1.1.1.2 misho 28190: zval **container = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 28191:
1.1.1.2 misho 28192: if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 28193: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
1.1.1.2 misho 28194: } else if (UNEXPECTED(Z_TYPE_PP(container) == IS_OBJECT)) {
1.1 misho 28195: if (IS_CV == IS_VAR && !0) {
28196: Z_ADDREF_PP(container); /* undo the effect of get_obj_zval_ptr_ptr() */
28197: }
28198: return zend_binary_assign_op_obj_helper_SPEC_CV_CONST(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
28199: } else {
1.1.1.2 misho 28200: zval *dim = opline->op2.zv;
1.1 misho 28201:
1.1.1.2 misho 28202: zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), container, dim, IS_CONST, BP_VAR_RW TSRMLS_CC);
28203: value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R);
28204: var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC);
1.1 misho 28205: }
28206: }
28207: break;
28208: default:
1.1.1.2 misho 28209: value = opline->op2.zv;
28210: var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 28211: /* do nothing */
28212: break;
28213: }
28214:
1.1.1.2 misho 28215: if (UNEXPECTED(var_ptr == NULL)) {
1.1 misho 28216: zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets");
28217: }
28218:
1.1.1.2 misho 28219: if (UNEXPECTED(*var_ptr == &EG(error_zval))) {
28220: if (RETURN_VALUE_USED(opline)) {
28221: PZVAL_LOCK(&EG(uninitialized_zval));
28222: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
1.1 misho 28223: }
28224:
28225:
1.1.1.2 misho 28226: CHECK_EXCEPTION();
28227: if (opline->extended_value == ZEND_ASSIGN_DIM) {
28228: ZEND_VM_INC_OPCODE();
28229: }
1.1 misho 28230: ZEND_VM_NEXT_OPCODE();
28231: }
28232:
28233: SEPARATE_ZVAL_IF_NOT_REF(var_ptr);
28234:
1.1.1.2 misho 28235: if (UNEXPECTED(Z_TYPE_PP(var_ptr) == IS_OBJECT)
28236: && Z_OBJ_HANDLER_PP(var_ptr, get)
1.1 misho 28237: && Z_OBJ_HANDLER_PP(var_ptr, set)) {
28238: /* proxy object */
28239: zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC);
28240: Z_ADDREF_P(objval);
28241: binary_op(objval, objval, value TSRMLS_CC);
28242: Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC);
28243: zval_ptr_dtor(&objval);
28244: } else {
28245: binary_op(*var_ptr, *var_ptr, value TSRMLS_CC);
28246: }
28247:
1.1.1.2 misho 28248: if (RETURN_VALUE_USED(opline)) {
1.1 misho 28249: PZVAL_LOCK(*var_ptr);
1.1.1.2 misho 28250: AI_SET_PTR(&EX_T(opline->result.var), *var_ptr);
1.1 misho 28251: }
28252:
28253: if (opline->extended_value == ZEND_ASSIGN_DIM) {
28254: FREE_OP(free_op_data1);
28255: FREE_OP_VAR_PTR(free_op_data2);
28256:
1.1.1.2 misho 28257: CHECK_EXCEPTION();
28258: ZEND_VM_INC_OPCODE();
28259: } else {
28260:
28261: CHECK_EXCEPTION();
28262: }
1.1 misho 28263: ZEND_VM_NEXT_OPCODE();
28264: }
28265:
28266: static int ZEND_FASTCALL ZEND_ASSIGN_ADD_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
28267: {
28268: return zend_binary_assign_op_helper_SPEC_CV_CONST(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
28269: }
28270:
28271: static int ZEND_FASTCALL ZEND_ASSIGN_SUB_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
28272: {
28273: return zend_binary_assign_op_helper_SPEC_CV_CONST(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
28274: }
28275:
28276: static int ZEND_FASTCALL ZEND_ASSIGN_MUL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
28277: {
28278: return zend_binary_assign_op_helper_SPEC_CV_CONST(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
28279: }
28280:
28281: static int ZEND_FASTCALL ZEND_ASSIGN_DIV_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
28282: {
28283: return zend_binary_assign_op_helper_SPEC_CV_CONST(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
28284: }
28285:
28286: static int ZEND_FASTCALL ZEND_ASSIGN_MOD_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
28287: {
28288: return zend_binary_assign_op_helper_SPEC_CV_CONST(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
28289: }
28290:
28291: static int ZEND_FASTCALL ZEND_ASSIGN_SL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
28292: {
28293: return zend_binary_assign_op_helper_SPEC_CV_CONST(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
28294: }
28295:
28296: static int ZEND_FASTCALL ZEND_ASSIGN_SR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
28297: {
28298: return zend_binary_assign_op_helper_SPEC_CV_CONST(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
28299: }
28300:
28301: static int ZEND_FASTCALL ZEND_ASSIGN_CONCAT_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
28302: {
28303: return zend_binary_assign_op_helper_SPEC_CV_CONST(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
28304: }
28305:
28306: static int ZEND_FASTCALL ZEND_ASSIGN_BW_OR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
28307: {
28308: return zend_binary_assign_op_helper_SPEC_CV_CONST(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
28309: }
28310:
28311: static int ZEND_FASTCALL ZEND_ASSIGN_BW_AND_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
28312: {
28313: return zend_binary_assign_op_helper_SPEC_CV_CONST(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
28314: }
28315:
28316: static int ZEND_FASTCALL ZEND_ASSIGN_BW_XOR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
28317: {
28318: return zend_binary_assign_op_helper_SPEC_CV_CONST(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
28319: }
28320:
28321: static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_CONST(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS)
28322: {
1.1.1.2 misho 28323: USE_OPLINE
1.1 misho 28324:
1.1.1.2 misho 28325: zval **object_ptr;
1.1 misho 28326: zval *object;
1.1.1.2 misho 28327: zval *property;
28328: zval **retval;
1.1 misho 28329: int have_get_ptr = 0;
28330:
1.1.1.2 misho 28331: SAVE_OPLINE();
28332: object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC);
28333: property = opline->op2.zv;
28334: retval = &EX_T(opline->result.var).var.ptr;
28335:
28336: if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 28337: zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
28338: }
28339:
28340: make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
28341: object = *object_ptr;
28342:
1.1.1.2 misho 28343: if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
1.1 misho 28344: zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
28345:
1.1.1.2 misho 28346: if (RETURN_VALUE_USED(opline)) {
28347: PZVAL_LOCK(&EG(uninitialized_zval));
28348: *retval = &EG(uninitialized_zval);
1.1 misho 28349: }
28350:
1.1.1.2 misho 28351: CHECK_EXCEPTION();
1.1 misho 28352: ZEND_VM_NEXT_OPCODE();
28353: }
28354:
28355: /* here we are sure we are dealing with an object */
28356:
28357: if (0) {
28358: MAKE_REAL_ZVAL_PTR(property);
28359: }
28360:
28361: if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
1.1.1.2 misho 28362: zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 28363: if (zptr != NULL) { /* NULL means no success in getting PTR */
28364: SEPARATE_ZVAL_IF_NOT_REF(zptr);
28365:
28366: have_get_ptr = 1;
28367: incdec_op(*zptr);
1.1.1.2 misho 28368: if (RETURN_VALUE_USED(opline)) {
1.1 misho 28369: *retval = *zptr;
28370: PZVAL_LOCK(*retval);
28371: }
28372: }
28373: }
28374:
28375: if (!have_get_ptr) {
28376: if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
1.1.1.2 misho 28377: zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 28378:
1.1.1.2 misho 28379: if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
1.1 misho 28380: zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
28381:
28382: if (Z_REFCOUNT_P(z) == 0) {
28383: GC_REMOVE_ZVAL_FROM_BUFFER(z);
28384: zval_dtor(z);
28385: FREE_ZVAL(z);
28386: }
28387: z = value;
28388: }
28389: Z_ADDREF_P(z);
28390: SEPARATE_ZVAL_IF_NOT_REF(&z);
28391: incdec_op(z);
28392: *retval = z;
1.1.1.2 misho 28393: Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
28394: SELECTIVE_PZVAL_LOCK(*retval, opline);
1.1 misho 28395: zval_ptr_dtor(&z);
28396: } else {
28397: zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
1.1.1.2 misho 28398: if (RETURN_VALUE_USED(opline)) {
28399: PZVAL_LOCK(&EG(uninitialized_zval));
28400: *retval = &EG(uninitialized_zval);
1.1 misho 28401: }
28402: }
28403: }
28404:
28405: if (0) {
28406: zval_ptr_dtor(&property);
28407: } else {
28408:
28409: }
28410:
1.1.1.2 misho 28411: CHECK_EXCEPTION();
1.1 misho 28412: ZEND_VM_NEXT_OPCODE();
28413: }
28414:
28415: static int ZEND_FASTCALL ZEND_PRE_INC_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
28416: {
28417: return zend_pre_incdec_property_helper_SPEC_CV_CONST(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
28418: }
28419:
28420: static int ZEND_FASTCALL ZEND_PRE_DEC_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
28421: {
28422: return zend_pre_incdec_property_helper_SPEC_CV_CONST(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
28423: }
28424:
28425: static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_CONST(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS)
28426: {
1.1.1.2 misho 28427: USE_OPLINE
1.1 misho 28428:
1.1.1.2 misho 28429: zval **object_ptr;
1.1 misho 28430: zval *object;
1.1.1.2 misho 28431: zval *property;
28432: zval *retval;
1.1 misho 28433: int have_get_ptr = 0;
28434:
1.1.1.2 misho 28435: SAVE_OPLINE();
28436: object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC);
28437: property = opline->op2.zv;
28438: retval = &EX_T(opline->result.var).tmp_var;
28439:
28440: if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 28441: zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
28442: }
28443:
28444: make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
28445: object = *object_ptr;
28446:
1.1.1.2 misho 28447: if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
1.1 misho 28448: zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
28449:
1.1.1.2 misho 28450: ZVAL_NULL(retval);
1.1 misho 28451:
1.1.1.2 misho 28452: CHECK_EXCEPTION();
1.1 misho 28453: ZEND_VM_NEXT_OPCODE();
28454: }
28455:
28456: /* here we are sure we are dealing with an object */
28457:
28458: if (0) {
28459: MAKE_REAL_ZVAL_PTR(property);
28460: }
28461:
28462: if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
1.1.1.2 misho 28463: zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 28464: if (zptr != NULL) { /* NULL means no success in getting PTR */
28465: have_get_ptr = 1;
28466: SEPARATE_ZVAL_IF_NOT_REF(zptr);
28467:
1.1.1.2 misho 28468: ZVAL_COPY_VALUE(retval, *zptr);
1.1 misho 28469: zendi_zval_copy_ctor(*retval);
28470:
28471: incdec_op(*zptr);
28472:
28473: }
28474: }
28475:
28476: if (!have_get_ptr) {
28477: if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
1.1.1.2 misho 28478: zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 28479: zval *z_copy;
28480:
1.1.1.2 misho 28481: if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
1.1 misho 28482: zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
28483:
28484: if (Z_REFCOUNT_P(z) == 0) {
28485: GC_REMOVE_ZVAL_FROM_BUFFER(z);
28486: zval_dtor(z);
28487: FREE_ZVAL(z);
28488: }
28489: z = value;
28490: }
1.1.1.2 misho 28491: ZVAL_COPY_VALUE(retval, z);
1.1 misho 28492: zendi_zval_copy_ctor(*retval);
28493: ALLOC_ZVAL(z_copy);
1.1.1.2 misho 28494: INIT_PZVAL_COPY(z_copy, z);
1.1 misho 28495: zendi_zval_copy_ctor(*z_copy);
28496: incdec_op(z_copy);
28497: Z_ADDREF_P(z);
1.1.1.2 misho 28498: Z_OBJ_HT_P(object)->write_property(object, property, z_copy, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 28499: zval_ptr_dtor(&z_copy);
28500: zval_ptr_dtor(&z);
28501: } else {
28502: zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
1.1.1.2 misho 28503: ZVAL_NULL(retval);
1.1 misho 28504: }
28505: }
28506:
28507: if (0) {
28508: zval_ptr_dtor(&property);
28509: } else {
28510:
28511: }
28512:
1.1.1.2 misho 28513: CHECK_EXCEPTION();
1.1 misho 28514: ZEND_VM_NEXT_OPCODE();
28515: }
28516:
28517: static int ZEND_FASTCALL ZEND_POST_INC_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
28518: {
28519: return zend_post_incdec_property_helper_SPEC_CV_CONST(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
28520: }
28521:
28522: static int ZEND_FASTCALL ZEND_POST_DEC_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
28523: {
28524: return zend_post_incdec_property_helper_SPEC_CV_CONST(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
28525: }
28526:
1.1.1.2 misho 28527: static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_CONST(int type, ZEND_OPCODE_HANDLER_ARGS)
28528: {
28529: USE_OPLINE
28530: zend_free_op free_op1;
28531: zval *varname;
28532: zval **retval;
28533: zval tmp_varname;
28534: HashTable *target_symbol_table;
28535: ulong hash_value;
28536:
28537: SAVE_OPLINE();
28538: varname = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
28539:
28540: if (IS_CV != IS_CONST && UNEXPECTED(Z_TYPE_P(varname) != IS_STRING)) {
28541: ZVAL_COPY_VALUE(&tmp_varname, varname);
28542: zval_copy_ctor(&tmp_varname);
28543: Z_SET_REFCOUNT(tmp_varname, 1);
28544: Z_UNSET_ISREF(tmp_varname);
28545: convert_to_string(&tmp_varname);
28546: varname = &tmp_varname;
28547: }
28548:
28549: if (IS_CONST != IS_UNUSED) {
28550: zend_class_entry *ce;
28551:
28552: if (IS_CONST == IS_CONST) {
28553: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
28554: ce = CACHED_PTR(opline->op2.literal->cache_slot);
28555: } else {
28556: ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
28557: if (UNEXPECTED(ce == NULL)) {
28558: if (IS_CV != IS_CONST && varname == &tmp_varname) {
28559: zval_dtor(&tmp_varname);
28560: }
28561:
28562: CHECK_EXCEPTION();
28563: ZEND_VM_NEXT_OPCODE();
28564: }
28565: CACHE_PTR(opline->op2.literal->cache_slot, ce);
28566: }
28567: } else {
28568: ce = EX_T(opline->op2.var).class_entry;
28569: }
28570: retval = zend_std_get_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 0, ((IS_CV == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
28571:
28572: } else {
28573: target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
28574: /*
28575: if (!target_symbol_table) {
28576: CHECK_EXCEPTION();
28577: ZEND_VM_NEXT_OPCODE();
28578: }
28579: */
28580: if (IS_CV == IS_CONST) {
28581: hash_value = Z_HASH_P(varname);
28582: } else if (IS_INTERNED(Z_STRVAL_P(varname))) {
28583: hash_value = INTERNED_HASH(Z_STRVAL_P(varname));
28584: } else {
28585: hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1);
28586: }
28587:
28588: if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) {
28589: switch (type) {
28590: case BP_VAR_R:
28591: case BP_VAR_UNSET:
28592: zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_P(varname));
28593: /* break missing intentionally */
28594: case BP_VAR_IS:
28595: retval = &EG(uninitialized_zval_ptr);
28596: break;
28597: case BP_VAR_RW:
28598: zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_P(varname));
28599: /* break missing intentionally */
28600: case BP_VAR_W:
28601: Z_ADDREF_P(&EG(uninitialized_zval));
28602: zend_hash_quick_update(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, &EG(uninitialized_zval_ptr), sizeof(zval *), (void **) &retval);
28603: break;
28604: EMPTY_SWITCH_DEFAULT_CASE()
28605: }
28606: }
28607: switch (opline->extended_value & ZEND_FETCH_TYPE_MASK) {
28608: case ZEND_FETCH_GLOBAL:
28609: if (IS_CV != IS_TMP_VAR) {
28610:
28611: }
28612: break;
28613: case ZEND_FETCH_LOCAL:
28614:
28615: break;
28616: case ZEND_FETCH_STATIC:
28617: zval_update_constant(retval, (void*) 1 TSRMLS_CC);
28618: break;
28619: case ZEND_FETCH_GLOBAL_LOCK:
28620: if (IS_CV == IS_VAR && !free_op1.var) {
28621: PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
28622: }
28623: break;
28624: }
28625: }
28626:
28627:
28628: if (IS_CV != IS_CONST && varname == &tmp_varname) {
28629: zval_dtor(&tmp_varname);
28630: }
28631: if (opline->extended_value & ZEND_FETCH_MAKE_REF) {
28632: SEPARATE_ZVAL_TO_MAKE_IS_REF(retval);
28633: }
28634: PZVAL_LOCK(*retval);
28635: switch (type) {
28636: case BP_VAR_R:
28637: case BP_VAR_IS:
28638: AI_SET_PTR(&EX_T(opline->result.var), *retval);
28639: break;
28640: case BP_VAR_UNSET: {
28641: zend_free_op free_res;
28642:
28643: PZVAL_UNLOCK(*retval, &free_res);
28644: if (retval != &EG(uninitialized_zval_ptr)) {
28645: SEPARATE_ZVAL_IF_NOT_REF(retval);
28646: }
28647: PZVAL_LOCK(*retval);
28648: FREE_OP_VAR_PTR(free_res);
28649: }
28650: /* break missing intentionally */
28651: default:
28652: EX_T(opline->result.var).var.ptr_ptr = retval;
28653: break;
28654: }
28655: CHECK_EXCEPTION();
28656: ZEND_VM_NEXT_OPCODE();
28657: }
28658:
28659: static int ZEND_FASTCALL ZEND_FETCH_R_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
28660: {
28661: return zend_fetch_var_address_helper_SPEC_CV_CONST(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
28662: }
28663:
28664: static int ZEND_FASTCALL ZEND_FETCH_W_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
28665: {
28666: return zend_fetch_var_address_helper_SPEC_CV_CONST(BP_VAR_W, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
28667: }
28668:
28669: static int ZEND_FASTCALL ZEND_FETCH_RW_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
28670: {
28671: return zend_fetch_var_address_helper_SPEC_CV_CONST(BP_VAR_RW, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
28672: }
28673:
28674: static int ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
28675: {
28676: USE_OPLINE
28677:
28678: return zend_fetch_var_address_helper_SPEC_CV_CONST(ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
28679: }
28680:
28681: static int ZEND_FASTCALL ZEND_FETCH_UNSET_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
28682: {
28683: return zend_fetch_var_address_helper_SPEC_CV_CONST(BP_VAR_UNSET, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
28684: }
28685:
28686: static int ZEND_FASTCALL ZEND_FETCH_IS_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
28687: {
28688: return zend_fetch_var_address_helper_SPEC_CV_CONST(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
28689: }
28690:
1.1 misho 28691: static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
28692: {
1.1.1.2 misho 28693: USE_OPLINE
1.1 misho 28694:
28695: zval **container;
28696:
1.1.1.2 misho 28697: SAVE_OPLINE();
28698:
28699: if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) &&
1.1 misho 28700: IS_CV != IS_CV &&
1.1.1.2 misho 28701: EX_T(opline->op1.var).var.ptr_ptr) {
28702: PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
1.1 misho 28703: }
1.1.1.2 misho 28704: container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
28705: zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_R TSRMLS_CC);
1.1 misho 28706:
28707:
1.1.1.2 misho 28708: CHECK_EXCEPTION();
1.1 misho 28709: ZEND_VM_NEXT_OPCODE();
28710: }
28711:
28712: static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
28713: {
1.1.1.2 misho 28714: USE_OPLINE
1.1 misho 28715: zend_free_op free_op1;
1.1.1.2 misho 28716: zval **container;
1.1 misho 28717:
1.1.1.2 misho 28718: SAVE_OPLINE();
28719: container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC);
28720:
28721: if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 28722: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
28723: }
1.1.1.2 misho 28724: zend_fetch_dimension_address(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_W TSRMLS_CC);
1.1 misho 28725:
1.1.1.2 misho 28726: if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
28727: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 28728: }
28729:
28730: /* We are going to assign the result by reference */
1.1.1.2 misho 28731: if (UNEXPECTED(opline->extended_value != 0)) {
28732: zval **retval_ptr = EX_T(opline->result.var).var.ptr_ptr;
28733:
28734: if (retval_ptr) {
28735: Z_DELREF_PP(retval_ptr);
28736: SEPARATE_ZVAL_TO_MAKE_IS_REF(retval_ptr);
28737: Z_ADDREF_PP(retval_ptr);
28738: }
1.1 misho 28739: }
28740:
1.1.1.2 misho 28741: CHECK_EXCEPTION();
1.1 misho 28742: ZEND_VM_NEXT_OPCODE();
28743: }
28744:
28745: static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
28746: {
1.1.1.2 misho 28747: USE_OPLINE
1.1 misho 28748: zend_free_op free_op1;
1.1.1.2 misho 28749: zval **container;
28750:
28751: SAVE_OPLINE();
28752: container = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 28753:
1.1.1.2 misho 28754: if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 28755: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
28756: }
1.1.1.2 misho 28757: zend_fetch_dimension_address(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_RW TSRMLS_CC);
1.1 misho 28758:
1.1.1.2 misho 28759: if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
28760: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 28761: }
28762:
1.1.1.2 misho 28763: CHECK_EXCEPTION();
1.1 misho 28764: ZEND_VM_NEXT_OPCODE();
28765: }
28766:
28767: static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
28768: {
1.1.1.2 misho 28769: USE_OPLINE
1.1 misho 28770:
1.1.1.2 misho 28771: zval **container;
1.1 misho 28772:
1.1.1.2 misho 28773: SAVE_OPLINE();
28774: container = _get_zval_ptr_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC);
28775: zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_IS TSRMLS_CC);
1.1 misho 28776:
28777:
1.1.1.2 misho 28778: CHECK_EXCEPTION();
1.1 misho 28779: ZEND_VM_NEXT_OPCODE();
28780: }
28781:
28782: static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
28783: {
1.1.1.2 misho 28784: USE_OPLINE
1.1 misho 28785: zend_free_op free_op1;
28786: zval **container;
28787:
1.1.1.2 misho 28788: SAVE_OPLINE();
28789:
28790: if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
28791: container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC);
28792: if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 28793: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
28794: }
1.1.1.2 misho 28795: zend_fetch_dimension_address(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_W TSRMLS_CC);
28796: if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
28797: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 28798: }
28799: } else {
28800: if (IS_CONST == IS_UNUSED) {
28801: zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
28802: }
1.1.1.2 misho 28803: container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
28804: zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_R TSRMLS_CC);
1.1 misho 28805: }
28806:
28807:
1.1.1.2 misho 28808: CHECK_EXCEPTION();
1.1 misho 28809: ZEND_VM_NEXT_OPCODE();
28810: }
28811:
28812: static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
28813: {
1.1.1.2 misho 28814: USE_OPLINE
1.1 misho 28815: zend_free_op free_op1;
1.1.1.2 misho 28816: zval **container;
28817:
28818: SAVE_OPLINE();
28819: container = _get_zval_ptr_ptr_cv_BP_VAR_UNSET(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 28820:
28821: if (IS_CV == IS_CV) {
28822: if (container != &EG(uninitialized_zval_ptr)) {
28823: SEPARATE_ZVAL_IF_NOT_REF(container);
28824: }
28825: }
1.1.1.2 misho 28826: if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 28827: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
28828: }
1.1.1.2 misho 28829: zend_fetch_dimension_address(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_UNSET TSRMLS_CC);
1.1 misho 28830:
1.1.1.2 misho 28831: if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
28832: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 28833: }
28834:
1.1.1.2 misho 28835: if (UNEXPECTED(EX_T(opline->result.var).var.ptr_ptr == NULL)) {
1.1 misho 28836: zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
28837: } else {
28838: zend_free_op free_res;
1.1.1.2 misho 28839: zval **retval_ptr = EX_T(opline->result.var).var.ptr_ptr;
1.1 misho 28840:
1.1.1.2 misho 28841: PZVAL_UNLOCK(*retval_ptr, &free_res);
28842: if (retval_ptr != &EG(uninitialized_zval_ptr)) {
28843: SEPARATE_ZVAL_IF_NOT_REF(retval_ptr);
1.1 misho 28844: }
1.1.1.2 misho 28845: PZVAL_LOCK(*retval_ptr);
1.1 misho 28846: FREE_OP_VAR_PTR(free_res);
1.1.1.2 misho 28847: CHECK_EXCEPTION();
28848: ZEND_VM_NEXT_OPCODE();
1.1 misho 28849: }
28850: }
28851:
1.1.1.2 misho 28852: static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_CV_CONST(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 28853: {
1.1.1.2 misho 28854: USE_OPLINE
1.1 misho 28855:
1.1.1.2 misho 28856: zval *container;
1.1 misho 28857:
1.1.1.2 misho 28858: zval *offset;
1.1 misho 28859:
1.1.1.2 misho 28860: SAVE_OPLINE();
28861: container = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
28862: offset = opline->op2.zv;
28863:
28864: if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
28865: UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
28866: zend_error(E_NOTICE, "Trying to get property of non-object");
28867: PZVAL_LOCK(&EG(uninitialized_zval));
28868: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
1.1 misho 28869:
28870: } else {
28871: zval *retval;
28872:
28873: if (0) {
28874: MAKE_REAL_ZVAL_PTR(offset);
28875: }
28876:
28877: /* here we are sure we are dealing with an object */
1.1.1.2 misho 28878: retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 28879:
1.1.1.2 misho 28880: PZVAL_LOCK(retval);
28881: AI_SET_PTR(&EX_T(opline->result.var), retval);
1.1 misho 28882:
28883: if (0) {
28884: zval_ptr_dtor(&offset);
28885: } else {
28886:
28887: }
28888: }
28889:
1.1.1.2 misho 28890: CHECK_EXCEPTION();
1.1 misho 28891: ZEND_VM_NEXT_OPCODE();
28892: }
28893:
28894: static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
28895: {
1.1.1.2 misho 28896: return zend_fetch_property_address_read_helper_SPEC_CV_CONST(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
1.1 misho 28897: }
28898:
28899: static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
28900: {
1.1.1.2 misho 28901: USE_OPLINE
1.1 misho 28902: zend_free_op free_op1;
1.1.1.2 misho 28903: zval *property;
1.1 misho 28904: zval **container;
28905:
1.1.1.2 misho 28906: SAVE_OPLINE();
28907: property = opline->op2.zv;
28908:
1.1 misho 28909: if (IS_CV == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
1.1.1.2 misho 28910: PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
28911: EX_T(opline->op1.var).var.ptr = *EX_T(opline->op1.var).var.ptr_ptr;
1.1 misho 28912: }
28913:
28914: if (0) {
28915: MAKE_REAL_ZVAL_PTR(property);
28916: }
1.1.1.2 misho 28917: container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC);
28918: if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 28919: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
28920: }
1.1.1.2 misho 28921:
28922: zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_W TSRMLS_CC);
1.1 misho 28923: if (0) {
28924: zval_ptr_dtor(&property);
28925: } else {
28926:
28927: }
1.1.1.2 misho 28928: if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
28929: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 28930: }
28931:
28932: /* We are going to assign the result by reference */
28933: if (opline->extended_value & ZEND_FETCH_MAKE_REF) {
1.1.1.2 misho 28934: zval **retval_ptr = EX_T(opline->result.var).var.ptr_ptr;
28935:
28936: Z_DELREF_PP(retval_ptr);
28937: SEPARATE_ZVAL_TO_MAKE_IS_REF(retval_ptr);
28938: Z_ADDREF_PP(retval_ptr);
28939: EX_T(opline->result.var).var.ptr = *EX_T(opline->result.var).var.ptr_ptr;
28940: EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
1.1 misho 28941: }
28942:
1.1.1.2 misho 28943: CHECK_EXCEPTION();
1.1 misho 28944: ZEND_VM_NEXT_OPCODE();
28945: }
28946:
28947: static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
28948: {
1.1.1.2 misho 28949: USE_OPLINE
1.1 misho 28950: zend_free_op free_op1;
1.1.1.2 misho 28951: zval *property;
28952: zval **container;
28953:
28954: SAVE_OPLINE();
28955: property = opline->op2.zv;
28956: container = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 28957:
28958: if (0) {
28959: MAKE_REAL_ZVAL_PTR(property);
28960: }
1.1.1.2 misho 28961: if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 28962: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
28963: }
1.1.1.2 misho 28964: zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_RW TSRMLS_CC);
1.1 misho 28965: if (0) {
28966: zval_ptr_dtor(&property);
28967: } else {
28968:
28969: }
1.1.1.2 misho 28970: if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
28971: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 28972: }
28973:
1.1.1.2 misho 28974: CHECK_EXCEPTION();
1.1 misho 28975: ZEND_VM_NEXT_OPCODE();
28976: }
28977:
28978: static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
28979: {
1.1.1.2 misho 28980: USE_OPLINE
28981:
28982: zval *container;
28983:
28984: zval *offset;
28985:
28986: SAVE_OPLINE();
28987: container = _get_zval_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC);
28988: offset = opline->op2.zv;
28989:
28990: if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
28991: UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
28992: PZVAL_LOCK(&EG(uninitialized_zval));
28993: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
28994:
28995: } else {
28996: zval *retval;
28997:
28998: if (0) {
28999: MAKE_REAL_ZVAL_PTR(offset);
29000: }
29001:
29002: /* here we are sure we are dealing with an object */
29003: retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
29004:
29005: PZVAL_LOCK(retval);
29006: AI_SET_PTR(&EX_T(opline->result.var), retval);
29007:
29008: if (0) {
29009: zval_ptr_dtor(&offset);
29010: } else {
29011:
29012: }
29013: }
29014:
29015: CHECK_EXCEPTION();
29016: ZEND_VM_NEXT_OPCODE();
1.1 misho 29017: }
29018:
29019: static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
29020: {
1.1.1.2 misho 29021: USE_OPLINE
1.1 misho 29022:
1.1.1.2 misho 29023: if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
1.1 misho 29024: /* Behave like FETCH_OBJ_W */
29025: zend_free_op free_op1;
1.1.1.2 misho 29026: zval *property;
29027: zval **container;
29028:
29029: SAVE_OPLINE();
29030: property = opline->op2.zv;
29031: container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 29032:
29033: if (0) {
29034: MAKE_REAL_ZVAL_PTR(property);
29035: }
1.1.1.2 misho 29036: if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 29037: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
29038: }
1.1.1.2 misho 29039: zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_W TSRMLS_CC);
1.1 misho 29040: if (0) {
29041: zval_ptr_dtor(&property);
29042: } else {
29043:
29044: }
1.1.1.2 misho 29045: if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
29046: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 29047: }
29048:
1.1.1.2 misho 29049: CHECK_EXCEPTION();
1.1 misho 29050: ZEND_VM_NEXT_OPCODE();
29051: } else {
1.1.1.2 misho 29052: return zend_fetch_property_address_read_helper_SPEC_CV_CONST(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
1.1 misho 29053: }
29054: }
29055:
29056: static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
29057: {
1.1.1.2 misho 29058: USE_OPLINE
1.1 misho 29059: zend_free_op free_op1, free_res;
1.1.1.2 misho 29060: zval **container;
29061: zval *property;
29062:
29063: SAVE_OPLINE();
29064: container = _get_zval_ptr_ptr_cv_BP_VAR_UNSET(EX_CVs(), opline->op1.var TSRMLS_CC);
29065: property = opline->op2.zv;
1.1 misho 29066:
29067: if (IS_CV == IS_CV) {
29068: if (container != &EG(uninitialized_zval_ptr)) {
29069: SEPARATE_ZVAL_IF_NOT_REF(container);
29070: }
29071: }
29072: if (0) {
29073: MAKE_REAL_ZVAL_PTR(property);
29074: }
1.1.1.2 misho 29075: if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 29076: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
29077: }
1.1.1.2 misho 29078: zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_UNSET TSRMLS_CC);
1.1 misho 29079: if (0) {
29080: zval_ptr_dtor(&property);
29081: } else {
29082:
29083: }
1.1.1.2 misho 29084: if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
29085: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 29086: }
29087:
1.1.1.2 misho 29088: PZVAL_UNLOCK(*EX_T(opline->result.var).var.ptr_ptr, &free_res);
29089: if (EX_T(opline->result.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) {
29090: SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.var).var.ptr_ptr);
1.1 misho 29091: }
1.1.1.2 misho 29092: PZVAL_LOCK(*EX_T(opline->result.var).var.ptr_ptr);
1.1 misho 29093: FREE_OP_VAR_PTR(free_res);
1.1.1.2 misho 29094: CHECK_EXCEPTION();
1.1 misho 29095: ZEND_VM_NEXT_OPCODE();
29096: }
29097:
29098: static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
29099: {
1.1.1.2 misho 29100: USE_OPLINE
29101:
29102: zval **object_ptr;
29103: zval *property_name;
1.1 misho 29104:
1.1.1.2 misho 29105: SAVE_OPLINE();
29106: object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC);
29107: property_name = opline->op2.zv;
1.1 misho 29108:
29109: if (0) {
29110: MAKE_REAL_ZVAL_PTR(property_name);
29111: }
1.1.1.2 misho 29112: if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 29113: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
29114: }
1.1.1.2 misho 29115: zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), ZEND_ASSIGN_OBJ, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 29116: if (0) {
29117: zval_ptr_dtor(&property_name);
29118: } else {
29119:
29120: }
29121:
29122: /* assign_obj has two opcodes! */
1.1.1.2 misho 29123: CHECK_EXCEPTION();
1.1 misho 29124: ZEND_VM_INC_OPCODE();
29125: ZEND_VM_NEXT_OPCODE();
29126: }
29127:
29128: static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
29129: {
1.1.1.2 misho 29130: USE_OPLINE
1.1 misho 29131:
1.1.1.2 misho 29132: zval **object_ptr;
1.1 misho 29133:
1.1.1.2 misho 29134: SAVE_OPLINE();
29135: object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC);
29136:
29137: if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 29138: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
29139: }
29140: if (Z_TYPE_PP(object_ptr) == IS_OBJECT) {
29141:
1.1.1.2 misho 29142: zval *property_name = opline->op2.zv;
1.1 misho 29143:
29144: if (0) {
29145: MAKE_REAL_ZVAL_PTR(property_name);
29146: }
1.1.1.2 misho 29147: zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), ZEND_ASSIGN_DIM, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 29148: if (0) {
29149: zval_ptr_dtor(&property_name);
29150: } else {
29151:
29152: }
29153: } else {
29154: zend_free_op free_op_data1, free_op_data2;
29155: zval *value;
1.1.1.2 misho 29156: zval *dim = opline->op2.zv;
1.1 misho 29157: zval **variable_ptr_ptr;
29158:
1.1.1.2 misho 29159: zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), object_ptr, dim, IS_CONST, BP_VAR_W TSRMLS_CC);
29160:
29161: value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R);
29162: variable_ptr_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC);
29163: if (UNEXPECTED(variable_ptr_ptr == NULL)) {
29164: if (zend_assign_to_string_offset(&EX_T((opline+1)->op2.var), value, (opline+1)->op1_type TSRMLS_CC)) {
29165: if (RETURN_VALUE_USED(opline)) {
29166: zval *retval;
1.1 misho 29167:
1.1.1.2 misho 29168: ALLOC_ZVAL(retval);
29169: ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T((opline+1)->op2.var).str_offset.str)+EX_T((opline+1)->op2.var).str_offset.offset, 1, 1);
29170: INIT_PZVAL(retval);
29171: AI_SET_PTR(&EX_T(opline->result.var), retval);
29172: }
29173: } else if (RETURN_VALUE_USED(opline)) {
29174: PZVAL_LOCK(&EG(uninitialized_zval));
29175: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
29176: }
29177: } else if (UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) {
29178: if (IS_TMP_FREE(free_op_data1)) {
29179: zval_dtor(value);
29180: }
29181: if (RETURN_VALUE_USED(opline)) {
29182: PZVAL_LOCK(&EG(uninitialized_zval));
29183: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
29184: }
29185: } else {
29186: if ((opline+1)->op1_type == IS_TMP_VAR) {
29187: value = zend_assign_tmp_to_variable(variable_ptr_ptr, value TSRMLS_CC);
29188: } else if ((opline+1)->op1_type == IS_CONST) {
29189: value = zend_assign_const_to_variable(variable_ptr_ptr, value TSRMLS_CC);
29190: } else {
29191: value = zend_assign_to_variable(variable_ptr_ptr, value TSRMLS_CC);
29192: }
29193: if (RETURN_VALUE_USED(opline)) {
1.1 misho 29194: PZVAL_LOCK(value);
1.1.1.2 misho 29195: AI_SET_PTR(&EX_T(opline->result.var), value);
1.1 misho 29196: }
29197: }
29198: FREE_OP_VAR_PTR(free_op_data2);
29199: FREE_OP_IF_VAR(free_op_data1);
29200: }
29201:
29202: /* assign_dim has two opcodes! */
1.1.1.2 misho 29203: CHECK_EXCEPTION();
1.1 misho 29204: ZEND_VM_INC_OPCODE();
29205: ZEND_VM_NEXT_OPCODE();
29206: }
29207:
29208: static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
29209: {
1.1.1.2 misho 29210: USE_OPLINE
1.1 misho 29211:
1.1.1.2 misho 29212: zval *value;
29213: zval **variable_ptr_ptr;
1.1 misho 29214:
1.1.1.2 misho 29215: SAVE_OPLINE();
29216: value = opline->op2.zv;
29217: variable_ptr_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC);
29218:
29219: if (IS_CV == IS_VAR && UNEXPECTED(variable_ptr_ptr == NULL)) {
29220: if (zend_assign_to_string_offset(&EX_T(opline->op1.var), value, IS_CONST TSRMLS_CC)) {
29221: if (RETURN_VALUE_USED(opline)) {
29222: zval *retval;
29223:
29224: ALLOC_ZVAL(retval);
29225: ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T(opline->op1.var).str_offset.str)+EX_T(opline->op1.var).str_offset.offset, 1, 1);
29226: INIT_PZVAL(retval);
29227: AI_SET_PTR(&EX_T(opline->result.var), retval);
29228: }
29229: } else if (RETURN_VALUE_USED(opline)) {
29230: PZVAL_LOCK(&EG(uninitialized_zval));
29231: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
29232: }
29233: } else if (IS_CV == IS_VAR && UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) {
29234: if (0) {
29235: zval_dtor(value);
29236: }
29237: if (RETURN_VALUE_USED(opline)) {
29238: PZVAL_LOCK(&EG(uninitialized_zval));
29239: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
29240: }
29241: } else {
29242: if (IS_CONST == IS_TMP_VAR) {
29243: value = zend_assign_tmp_to_variable(variable_ptr_ptr, value TSRMLS_CC);
29244: } else if (IS_CONST == IS_CONST) {
29245: value = zend_assign_const_to_variable(variable_ptr_ptr, value TSRMLS_CC);
29246: } else {
29247: value = zend_assign_to_variable(variable_ptr_ptr, value TSRMLS_CC);
29248: }
29249: if (RETURN_VALUE_USED(opline)) {
1.1 misho 29250: PZVAL_LOCK(value);
1.1.1.2 misho 29251: AI_SET_PTR(&EX_T(opline->result.var), value);
1.1 misho 29252: }
29253: }
29254:
29255: /* zend_assign_to_variable() always takes care of op2, never free it! */
29256:
1.1.1.2 misho 29257: CHECK_EXCEPTION();
1.1 misho 29258: ZEND_VM_NEXT_OPCODE();
29259: }
29260:
29261: static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
29262: {
1.1.1.2 misho 29263: USE_OPLINE
1.1 misho 29264: zval *function_name;
29265: char *function_name_strval;
29266: int function_name_strlen;
29267:
29268:
1.1.1.2 misho 29269: SAVE_OPLINE();
1.1 misho 29270: zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
29271:
1.1.1.2 misho 29272: function_name = opline->op2.zv;
1.1 misho 29273:
1.1.1.2 misho 29274: if (IS_CONST != IS_CONST &&
29275: UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
1.1 misho 29276: zend_error_noreturn(E_ERROR, "Method name must be a string");
29277: }
29278:
29279: function_name_strval = Z_STRVAL_P(function_name);
29280: function_name_strlen = Z_STRLEN_P(function_name);
29281:
1.1.1.2 misho 29282: EX(object) = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 29283:
1.1.1.2 misho 29284: if (EXPECTED(EX(object) != NULL) &&
29285: EXPECTED(Z_TYPE_P(EX(object)) == IS_OBJECT)) {
29286: EX(called_scope) = Z_OBJCE_P(EX(object));
1.1 misho 29287:
1.1.1.2 misho 29288: if (IS_CONST != IS_CONST ||
29289: (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope))) == NULL) {
29290: zval *object = EX(object);
29291:
29292: if (UNEXPECTED(Z_OBJ_HT_P(EX(object))->get_method == NULL)) {
29293: zend_error_noreturn(E_ERROR, "Object does not support method calls");
29294: }
29295:
29296: /* First, locate the function. */
29297: EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen, ((IS_CONST == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC);
29298: if (UNEXPECTED(EX(fbc) == NULL)) {
29299: zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval);
29300: }
29301: if (IS_CONST == IS_CONST &&
29302: EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) &&
29303: EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) &&
29304: EXPECTED(EX(object) == object)) {
29305: CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope), EX(fbc));
29306: }
1.1 misho 29307: }
29308: } else {
29309: zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval);
29310: }
29311:
29312: if ((EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) != 0) {
29313: EX(object) = NULL;
29314: } else {
29315: if (!PZVAL_IS_REF(EX(object))) {
29316: Z_ADDREF_P(EX(object)); /* For $this pointer */
29317: } else {
29318: zval *this_ptr;
29319: ALLOC_ZVAL(this_ptr);
29320: INIT_PZVAL_COPY(this_ptr, EX(object));
29321: zval_copy_ctor(this_ptr);
29322: EX(object) = this_ptr;
29323: }
29324: }
29325:
29326:
1.1.1.2 misho 29327: CHECK_EXCEPTION();
1.1 misho 29328: ZEND_VM_NEXT_OPCODE();
29329: }
29330:
29331: static int ZEND_FASTCALL ZEND_CASE_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
29332: {
1.1.1.2 misho 29333: USE_OPLINE
1.1 misho 29334:
29335:
1.1.1.2 misho 29336: SAVE_OPLINE();
1.1 misho 29337: if (IS_CV==IS_VAR) {
1.1.1.2 misho 29338: PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
1.1 misho 29339: }
1.1.1.2 misho 29340: is_equal_function(&EX_T(opline->result.var).tmp_var,
29341: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
29342: opline->op2.zv TSRMLS_CC);
1.1 misho 29343:
1.1.1.2 misho 29344: CHECK_EXCEPTION();
1.1 misho 29345: ZEND_VM_NEXT_OPCODE();
29346: }
29347:
29348: static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
29349: {
1.1.1.2 misho 29350: USE_OPLINE
1.1 misho 29351:
29352: zval *expr_ptr;
29353:
1.1.1.2 misho 29354: SAVE_OPLINE();
29355: if ((IS_CV == IS_VAR || IS_CV == IS_CV) && opline->extended_value) {
29356: zval **expr_ptr_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 29357:
1.1.1.2 misho 29358: if (IS_CV == IS_VAR && UNEXPECTED(expr_ptr_ptr == NULL)) {
29359: zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
29360: }
29361: SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr);
1.1 misho 29362: expr_ptr = *expr_ptr_ptr;
1.1.1.2 misho 29363: Z_ADDREF_P(expr_ptr);
1.1 misho 29364: } else {
1.1.1.2 misho 29365: expr_ptr=_get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
29366: if (0) { /* temporary variable */
29367: zval *new_expr;
1.1 misho 29368:
1.1.1.2 misho 29369: ALLOC_ZVAL(new_expr);
29370: INIT_PZVAL_COPY(new_expr, expr_ptr);
29371: expr_ptr = new_expr;
29372: } else if (IS_CV == IS_CONST || PZVAL_IS_REF(expr_ptr)) {
1.1 misho 29373: zval *new_expr;
29374:
29375: ALLOC_ZVAL(new_expr);
29376: INIT_PZVAL_COPY(new_expr, expr_ptr);
29377: expr_ptr = new_expr;
29378: zendi_zval_copy_ctor(*expr_ptr);
29379: } else {
29380: Z_ADDREF_P(expr_ptr);
29381: }
29382: }
1.1.1.2 misho 29383:
29384: if (IS_CONST != IS_UNUSED) {
29385:
29386: zval *offset = opline->op2.zv;
29387: ulong hval;
29388:
1.1 misho 29389: switch (Z_TYPE_P(offset)) {
29390: case IS_DOUBLE:
1.1.1.2 misho 29391: hval = zend_dval_to_lval(Z_DVAL_P(offset));
29392: goto num_index;
1.1 misho 29393: case IS_LONG:
29394: case IS_BOOL:
1.1.1.2 misho 29395: hval = Z_LVAL_P(offset);
29396: num_index:
29397: zend_hash_index_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), hval, &expr_ptr, sizeof(zval *), NULL);
1.1 misho 29398: break;
29399: case IS_STRING:
1.1.1.2 misho 29400: if (IS_CONST == IS_CONST) {
29401: hval = Z_HASH_P(offset);
29402: } else {
29403: ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
29404: if (IS_INTERNED(Z_STRVAL_P(offset))) {
29405: hval = INTERNED_HASH(Z_STRVAL_P(offset));
29406: } else {
29407: hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
29408: }
29409: }
29410: zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
1.1 misho 29411: break;
29412: case IS_NULL:
1.1.1.2 misho 29413: zend_hash_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
1.1 misho 29414: break;
29415: default:
29416: zend_error(E_WARNING, "Illegal offset type");
29417: zval_ptr_dtor(&expr_ptr);
29418: /* do nothing */
29419: break;
29420: }
29421:
29422: } else {
1.1.1.2 misho 29423: zend_hash_next_index_insert(Z_ARRVAL(EX_T(opline->result.var).tmp_var), &expr_ptr, sizeof(zval *), NULL);
29424: }
29425: if ((IS_CV == IS_VAR || IS_CV == IS_CV) && opline->extended_value) {
29426:
29427: } else {
29428:
29429: }
29430: CHECK_EXCEPTION();
29431: ZEND_VM_NEXT_OPCODE();
29432: }
29433:
29434: static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
29435: {
29436: USE_OPLINE
29437:
29438: array_init(&EX_T(opline->result.var).tmp_var);
29439: if (IS_CV == IS_UNUSED) {
29440: ZEND_VM_NEXT_OPCODE();
29441: #if 0 || IS_CV != IS_UNUSED
29442: } else {
29443: return ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
29444: #endif
29445: }
29446: }
29447:
29448: static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
29449: {
29450: USE_OPLINE
29451: zval tmp, *varname;
29452: HashTable *target_symbol_table;
29453:
29454:
29455: SAVE_OPLINE();
29456: if (IS_CV == IS_CV &&
29457: IS_CONST == IS_UNUSED &&
29458: (opline->extended_value & ZEND_QUICK_SET)) {
29459: if (EG(active_symbol_table)) {
29460: zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.var);
29461:
29462: zend_delete_variable(EX(prev_execute_data), EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value TSRMLS_CC);
29463: EX_CV(opline->op1.var) = NULL;
29464: } else if (EX_CV(opline->op1.var)) {
29465: zval_ptr_dtor(EX_CV(opline->op1.var));
29466: EX_CV(opline->op1.var) = NULL;
29467: }
29468: CHECK_EXCEPTION();
29469: ZEND_VM_NEXT_OPCODE();
29470: }
29471:
29472: varname = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
29473:
29474: if (IS_CV != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
29475: ZVAL_COPY_VALUE(&tmp, varname);
29476: zval_copy_ctor(&tmp);
29477: convert_to_string(&tmp);
29478: varname = &tmp;
29479: } else if (IS_CV == IS_VAR || IS_CV == IS_CV) {
29480: Z_ADDREF_P(varname);
1.1 misho 29481: }
29482:
1.1.1.2 misho 29483: if (IS_CONST != IS_UNUSED) {
29484: zend_class_entry *ce;
29485:
29486: if (IS_CONST == IS_CONST) {
29487: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
29488: ce = CACHED_PTR(opline->op2.literal->cache_slot);
29489: } else {
29490: ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
1.1.1.4 ! misho 29491: if (UNEXPECTED(EG(exception) != NULL)) {
1.1.1.2 misho 29492: if (IS_CV != IS_CONST && varname == &tmp) {
29493: zval_dtor(&tmp);
29494: } else if (IS_CV == IS_VAR || IS_CV == IS_CV) {
29495: zval_ptr_dtor(&varname);
29496: }
29497:
1.1.1.4 ! misho 29498: HANDLE_EXCEPTION();
! 29499: }
! 29500: if (UNEXPECTED(ce == NULL)) {
! 29501: zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op2.zv));
1.1.1.2 misho 29502: }
29503: CACHE_PTR(opline->op2.literal->cache_slot, ce);
29504: }
29505: } else {
29506: ce = EX_T(opline->op2.var).class_entry;
29507: }
29508: zend_std_unset_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), ((IS_CV == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
1.1 misho 29509: } else {
1.1.1.2 misho 29510: ulong hash_value = zend_inline_hash_func(varname->value.str.val, varname->value.str.len+1);
1.1 misho 29511:
1.1.1.2 misho 29512: target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
29513: zend_delete_variable(execute_data, target_symbol_table, varname->value.str.val, varname->value.str.len+1, hash_value TSRMLS_CC);
1.1 misho 29514: }
29515:
1.1.1.2 misho 29516: if (IS_CV != IS_CONST && varname == &tmp) {
29517: zval_dtor(&tmp);
29518: } else if (IS_CV == IS_VAR || IS_CV == IS_CV) {
29519: zval_ptr_dtor(&varname);
1.1 misho 29520: }
1.1.1.2 misho 29521:
29522: CHECK_EXCEPTION();
29523: ZEND_VM_NEXT_OPCODE();
1.1 misho 29524: }
29525:
29526: static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
29527: {
1.1.1.2 misho 29528: USE_OPLINE
1.1 misho 29529:
1.1.1.2 misho 29530: zval **container;
1.1 misho 29531: zval *offset;
1.1.1.2 misho 29532: ulong hval;
1.1 misho 29533:
1.1.1.2 misho 29534: SAVE_OPLINE();
29535: container = _get_zval_ptr_ptr_cv_BP_VAR_UNSET(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 29536: if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) {
29537: SEPARATE_ZVAL_IF_NOT_REF(container);
29538: }
1.1.1.2 misho 29539: offset = opline->op2.zv;
1.1 misho 29540:
29541: if (IS_CV != IS_VAR || container) {
29542: switch (Z_TYPE_PP(container)) {
29543: case IS_ARRAY: {
29544: HashTable *ht = Z_ARRVAL_PP(container);
29545:
29546: switch (Z_TYPE_P(offset)) {
29547: case IS_DOUBLE:
1.1.1.2 misho 29548: hval = zend_dval_to_lval(Z_DVAL_P(offset));
1.1.1.3 misho 29549: zend_hash_index_del(ht, hval);
29550: break;
1.1 misho 29551: case IS_RESOURCE:
29552: case IS_BOOL:
29553: case IS_LONG:
1.1.1.2 misho 29554: hval = Z_LVAL_P(offset);
29555: zend_hash_index_del(ht, hval);
1.1 misho 29556: break;
29557: case IS_STRING:
29558: if (IS_CONST == IS_CV || IS_CONST == IS_VAR) {
29559: Z_ADDREF_P(offset);
29560: }
1.1.1.2 misho 29561: if (IS_CONST == IS_CONST) {
29562: hval = Z_HASH_P(offset);
29563: } else {
29564: ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_dim);
29565: if (IS_INTERNED(Z_STRVAL_P(offset))) {
29566: hval = INTERNED_HASH(Z_STRVAL_P(offset));
29567: } else {
29568: hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
1.1 misho 29569: }
29570: }
1.1.1.2 misho 29571: if (ht == &EG(symbol_table)) {
29572: zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC);
29573: } else {
29574: zend_hash_quick_del(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval);
29575: }
29576: if (IS_CONST == IS_CV || IS_CONST == IS_VAR) {
29577: zval_ptr_dtor(&offset);
29578: }
29579: break;
29580: num_index_dim:
29581: zend_hash_index_del(ht, hval);
1.1 misho 29582: if (IS_CONST == IS_CV || IS_CONST == IS_VAR) {
29583: zval_ptr_dtor(&offset);
29584: }
29585: break;
29586: case IS_NULL:
29587: zend_hash_del(ht, "", sizeof(""));
29588: break;
29589: default:
29590: zend_error(E_WARNING, "Illegal offset type in unset");
29591: break;
29592: }
29593:
29594: break;
29595: }
29596: case IS_OBJECT:
1.1.1.2 misho 29597: if (UNEXPECTED(Z_OBJ_HT_P(*container)->unset_dimension == NULL)) {
1.1 misho 29598: zend_error_noreturn(E_ERROR, "Cannot use object as array");
29599: }
29600: if (0) {
29601: MAKE_REAL_ZVAL_PTR(offset);
29602: }
29603: Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC);
29604: if (0) {
29605: zval_ptr_dtor(&offset);
29606: } else {
29607:
29608: }
29609: break;
29610: case IS_STRING:
29611: zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
29612: ZEND_VM_CONTINUE(); /* bailed out before */
29613: default:
29614:
29615: break;
29616: }
29617: } else {
29618:
29619: }
29620:
1.1.1.2 misho 29621: CHECK_EXCEPTION();
1.1 misho 29622: ZEND_VM_NEXT_OPCODE();
29623: }
29624:
29625: static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
29626: {
1.1.1.2 misho 29627: USE_OPLINE
29628:
29629: zval **container;
29630: zval *offset;
1.1 misho 29631:
1.1.1.2 misho 29632: SAVE_OPLINE();
29633: container = _get_zval_ptr_ptr_cv_BP_VAR_UNSET(EX_CVs(), opline->op1.var TSRMLS_CC);
29634: offset = opline->op2.zv;
1.1 misho 29635:
29636: if (IS_CV != IS_VAR || container) {
29637: if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) {
29638: SEPARATE_ZVAL_IF_NOT_REF(container);
29639: }
29640: if (Z_TYPE_PP(container) == IS_OBJECT) {
29641: if (0) {
29642: MAKE_REAL_ZVAL_PTR(offset);
29643: }
29644: if (Z_OBJ_HT_P(*container)->unset_property) {
1.1.1.2 misho 29645: Z_OBJ_HT_P(*container)->unset_property(*container, offset, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 29646: } else {
29647: zend_error(E_NOTICE, "Trying to unset property of non-object");
29648: }
29649: if (0) {
29650: zval_ptr_dtor(&offset);
29651: } else {
29652:
29653: }
29654: } else {
29655:
29656: }
29657: } else {
29658:
29659: }
29660:
1.1.1.2 misho 29661: CHECK_EXCEPTION();
29662: ZEND_VM_NEXT_OPCODE();
29663: }
29664:
29665: static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
29666: {
29667: USE_OPLINE
29668: zval **value;
29669: zend_bool isset = 1;
29670:
29671: SAVE_OPLINE();
29672: if (IS_CV == IS_CV &&
29673: IS_CONST == IS_UNUSED &&
29674: (opline->extended_value & ZEND_QUICK_SET)) {
29675: if (EX_CV(opline->op1.var)) {
29676: value = EX_CV(opline->op1.var);
29677: } else if (EG(active_symbol_table)) {
29678: zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.var);
29679:
29680: if (zend_hash_quick_find(EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value, (void **) &value) == FAILURE) {
29681: isset = 0;
29682: }
29683: } else {
29684: isset = 0;
29685: }
29686: } else {
29687: HashTable *target_symbol_table;
29688:
29689: zval tmp, *varname = _get_zval_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC);
29690:
29691: if (IS_CV != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
29692: ZVAL_COPY_VALUE(&tmp, varname);
29693: zval_copy_ctor(&tmp);
29694: convert_to_string(&tmp);
29695: varname = &tmp;
29696: }
29697:
29698: if (IS_CONST != IS_UNUSED) {
29699: zend_class_entry *ce;
29700:
29701: if (IS_CONST == IS_CONST) {
29702: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
29703: ce = CACHED_PTR(opline->op2.literal->cache_slot);
29704: } else {
29705: ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
29706: if (UNEXPECTED(ce == NULL)) {
29707: CHECK_EXCEPTION();
29708: ZEND_VM_NEXT_OPCODE();
29709: }
29710: CACHE_PTR(opline->op2.literal->cache_slot, ce);
29711: }
29712: } else {
29713: ce = EX_T(opline->op2.var).class_entry;
29714: }
29715: value = zend_std_get_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 1, ((IS_CV == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
29716: if (!value) {
29717: isset = 0;
29718: }
29719: } else {
29720: target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
29721: if (zend_hash_find(target_symbol_table, varname->value.str.val, varname->value.str.len+1, (void **) &value) == FAILURE) {
29722: isset = 0;
29723: }
29724: }
29725:
29726: if (IS_CV != IS_CONST && varname == &tmp) {
29727: zval_dtor(&tmp);
29728: }
29729:
29730: }
29731:
29732: if (opline->extended_value & ZEND_ISSET) {
29733: if (isset && Z_TYPE_PP(value) != IS_NULL) {
29734: ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 1);
29735: } else {
29736: ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
29737: }
29738: } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
29739: if (!isset || !i_zend_is_true(*value)) {
29740: ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 1);
29741: } else {
29742: ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
29743: }
29744: }
29745:
29746: CHECK_EXCEPTION();
1.1 misho 29747: ZEND_VM_NEXT_OPCODE();
29748: }
29749:
29750: static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_CONST(int prop_dim, ZEND_OPCODE_HANDLER_ARGS)
29751: {
1.1.1.2 misho 29752: USE_OPLINE
1.1 misho 29753:
1.1.1.2 misho 29754: zval **container;
1.1 misho 29755: zval **value = NULL;
29756: int result = 0;
1.1.1.2 misho 29757: ulong hval;
29758: zval *offset;
1.1 misho 29759:
1.1.1.2 misho 29760: SAVE_OPLINE();
29761: container = _get_zval_ptr_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 29762:
1.1.1.2 misho 29763: offset = opline->op2.zv;
1.1 misho 29764:
1.1.1.2 misho 29765: if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) {
29766: HashTable *ht;
29767: int isset = 0;
1.1 misho 29768:
1.1.1.2 misho 29769: ht = Z_ARRVAL_PP(container);
1.1 misho 29770:
1.1.1.2 misho 29771: switch (Z_TYPE_P(offset)) {
29772: case IS_DOUBLE:
29773: hval = zend_dval_to_lval(Z_DVAL_P(offset));
29774: goto num_index_prop;
29775: case IS_RESOURCE:
29776: case IS_BOOL:
29777: case IS_LONG:
29778: hval = Z_LVAL_P(offset);
29779: num_index_prop:
29780: if (zend_hash_index_find(ht, hval, (void **) &value) == SUCCESS) {
29781: isset = 1;
29782: }
29783: break;
29784: case IS_STRING:
29785: if (IS_CONST == IS_CONST) {
29786: hval = Z_HASH_P(offset);
29787: } else {
29788: if (!prop_dim) {
29789: ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_prop);
1.1 misho 29790: }
1.1.1.2 misho 29791: if (IS_INTERNED(Z_STRVAL_P(offset))) {
29792: hval = INTERNED_HASH(Z_STRVAL_P(offset));
1.1 misho 29793: } else {
1.1.1.2 misho 29794: hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
1.1 misho 29795: }
29796: }
1.1.1.2 misho 29797: if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) {
29798: isset = 1;
29799: }
29800: break;
29801: case IS_NULL:
29802: if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) {
29803: isset = 1;
1.1 misho 29804: }
1.1.1.2 misho 29805: break;
29806: default:
29807: zend_error(E_WARNING, "Illegal offset type in isset or empty");
29808: break;
29809: }
29810:
29811: if (opline->extended_value & ZEND_ISSET) {
29812: if (isset && Z_TYPE_PP(value) == IS_NULL) {
29813: result = 0;
29814: } else {
29815: result = isset;
1.1 misho 29816: }
1.1.1.2 misho 29817: } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
29818: if (!isset || !i_zend_is_true(*value)) {
29819: result = 0;
1.1 misho 29820: } else {
1.1.1.2 misho 29821: result = 1;
29822: }
29823: }
1.1 misho 29824:
1.1.1.2 misho 29825: } else if (Z_TYPE_PP(container) == IS_OBJECT) {
29826: if (0) {
29827: MAKE_REAL_ZVAL_PTR(offset);
29828: }
29829: if (prop_dim) {
29830: if (Z_OBJ_HT_P(*container)->has_property) {
29831: result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
29832: } else {
29833: zend_error(E_NOTICE, "Trying to check property of non-object");
29834: result = 0;
29835: }
29836: } else {
29837: if (Z_OBJ_HT_P(*container)->has_dimension) {
29838: result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0 TSRMLS_CC);
29839: } else {
29840: zend_error(E_NOTICE, "Trying to check element of non-array");
29841: result = 0;
1.1 misho 29842: }
1.1.1.2 misho 29843: }
29844: if (0) {
29845: zval_ptr_dtor(&offset);
29846: } else {
1.1 misho 29847:
1.1.1.2 misho 29848: }
29849: } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */
29850: zval tmp;
29851:
29852: if (Z_TYPE_P(offset) != IS_LONG) {
29853: if (Z_TYPE_P(offset) <= IS_BOOL /* simple scalar types */
29854: || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */
29855: && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) {
29856: ZVAL_COPY_VALUE(&tmp, offset);
1.1 misho 29857: zval_copy_ctor(&tmp);
29858: convert_to_long(&tmp);
29859: offset = &tmp;
1.1.1.2 misho 29860: } else {
29861: /* can not be converted to proper offset, return "not set" */
29862: result = 0;
1.1 misho 29863: }
1.1.1.2 misho 29864: }
29865: if (Z_TYPE_P(offset) == IS_LONG) {
29866: if (opline->extended_value & ZEND_ISSET) {
29867: if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
29868: result = 1;
29869: }
29870: } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
29871: if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') {
29872: result = 1;
1.1 misho 29873: }
29874: }
1.1.1.2 misho 29875: }
1.1 misho 29876:
1.1.1.2 misho 29877: } else {
1.1 misho 29878:
29879: }
29880:
1.1.1.2 misho 29881: Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
29882: if (opline->extended_value & ZEND_ISSET) {
29883: Z_LVAL(EX_T(opline->result.var).tmp_var) = result;
29884: } else {
29885: Z_LVAL(EX_T(opline->result.var).tmp_var) = !result;
1.1 misho 29886: }
29887:
1.1.1.2 misho 29888: CHECK_EXCEPTION();
1.1 misho 29889: ZEND_VM_NEXT_OPCODE();
29890: }
29891:
29892: static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
29893: {
29894: return zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_CONST(0, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
29895: }
29896:
29897: static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
29898: {
29899: return zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_CONST(1, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
29900: }
29901:
29902: static int ZEND_FASTCALL ZEND_ADD_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
29903: {
1.1.1.2 misho 29904: USE_OPLINE
1.1 misho 29905: zend_free_op free_op2;
29906:
1.1.1.2 misho 29907: SAVE_OPLINE();
29908: fast_add_function(&EX_T(opline->result.var).tmp_var,
29909: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
29910: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 29911:
29912: zval_dtor(free_op2.var);
1.1.1.2 misho 29913: CHECK_EXCEPTION();
1.1 misho 29914: ZEND_VM_NEXT_OPCODE();
29915: }
29916:
29917: static int ZEND_FASTCALL ZEND_SUB_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
29918: {
1.1.1.2 misho 29919: USE_OPLINE
1.1 misho 29920: zend_free_op free_op2;
29921:
1.1.1.2 misho 29922: SAVE_OPLINE();
29923: fast_sub_function(&EX_T(opline->result.var).tmp_var,
29924: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
29925: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 29926:
29927: zval_dtor(free_op2.var);
1.1.1.2 misho 29928: CHECK_EXCEPTION();
1.1 misho 29929: ZEND_VM_NEXT_OPCODE();
29930: }
29931:
29932: static int ZEND_FASTCALL ZEND_MUL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
29933: {
1.1.1.2 misho 29934: USE_OPLINE
1.1 misho 29935: zend_free_op free_op2;
29936:
1.1.1.2 misho 29937: SAVE_OPLINE();
29938: fast_mul_function(&EX_T(opline->result.var).tmp_var,
29939: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
29940: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 29941:
29942: zval_dtor(free_op2.var);
1.1.1.2 misho 29943: CHECK_EXCEPTION();
1.1 misho 29944: ZEND_VM_NEXT_OPCODE();
29945: }
29946:
29947: static int ZEND_FASTCALL ZEND_DIV_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
29948: {
1.1.1.2 misho 29949: USE_OPLINE
1.1 misho 29950: zend_free_op free_op2;
29951:
1.1.1.2 misho 29952: SAVE_OPLINE();
29953: fast_div_function(&EX_T(opline->result.var).tmp_var,
29954: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
29955: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 29956:
29957: zval_dtor(free_op2.var);
1.1.1.2 misho 29958: CHECK_EXCEPTION();
1.1 misho 29959: ZEND_VM_NEXT_OPCODE();
29960: }
29961:
29962: static int ZEND_FASTCALL ZEND_MOD_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
29963: {
1.1.1.2 misho 29964: USE_OPLINE
1.1 misho 29965: zend_free_op free_op2;
29966:
1.1.1.2 misho 29967: SAVE_OPLINE();
29968: fast_mod_function(&EX_T(opline->result.var).tmp_var,
29969: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
29970: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 29971:
29972: zval_dtor(free_op2.var);
1.1.1.2 misho 29973: CHECK_EXCEPTION();
1.1 misho 29974: ZEND_VM_NEXT_OPCODE();
29975: }
29976:
29977: static int ZEND_FASTCALL ZEND_SL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
29978: {
1.1.1.2 misho 29979: USE_OPLINE
1.1 misho 29980: zend_free_op free_op2;
29981:
1.1.1.2 misho 29982: SAVE_OPLINE();
29983: shift_left_function(&EX_T(opline->result.var).tmp_var,
29984: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
29985: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 29986:
29987: zval_dtor(free_op2.var);
1.1.1.2 misho 29988: CHECK_EXCEPTION();
1.1 misho 29989: ZEND_VM_NEXT_OPCODE();
29990: }
29991:
29992: static int ZEND_FASTCALL ZEND_SR_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
29993: {
1.1.1.2 misho 29994: USE_OPLINE
1.1 misho 29995: zend_free_op free_op2;
29996:
1.1.1.2 misho 29997: SAVE_OPLINE();
29998: shift_right_function(&EX_T(opline->result.var).tmp_var,
29999: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
30000: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 30001:
30002: zval_dtor(free_op2.var);
1.1.1.2 misho 30003: CHECK_EXCEPTION();
1.1 misho 30004: ZEND_VM_NEXT_OPCODE();
30005: }
30006:
30007: static int ZEND_FASTCALL ZEND_CONCAT_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
30008: {
1.1.1.2 misho 30009: USE_OPLINE
1.1 misho 30010: zend_free_op free_op2;
30011:
1.1.1.2 misho 30012: SAVE_OPLINE();
30013: concat_function(&EX_T(opline->result.var).tmp_var,
30014: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
30015: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 30016:
30017: zval_dtor(free_op2.var);
1.1.1.2 misho 30018: CHECK_EXCEPTION();
1.1 misho 30019: ZEND_VM_NEXT_OPCODE();
30020: }
30021:
30022: static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
30023: {
1.1.1.2 misho 30024: USE_OPLINE
1.1 misho 30025: zend_free_op free_op2;
30026:
1.1.1.2 misho 30027: SAVE_OPLINE();
30028: is_identical_function(&EX_T(opline->result.var).tmp_var,
30029: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
30030: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 30031:
30032: zval_dtor(free_op2.var);
1.1.1.2 misho 30033: CHECK_EXCEPTION();
1.1 misho 30034: ZEND_VM_NEXT_OPCODE();
30035: }
30036:
30037: static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
30038: {
1.1.1.2 misho 30039: USE_OPLINE
1.1 misho 30040: zend_free_op free_op2;
1.1.1.2 misho 30041: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 30042:
1.1.1.2 misho 30043: SAVE_OPLINE();
1.1 misho 30044: is_identical_function(result,
1.1.1.2 misho 30045: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
30046: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 30047: Z_LVAL_P(result) = !Z_LVAL_P(result);
30048:
30049: zval_dtor(free_op2.var);
1.1.1.2 misho 30050: CHECK_EXCEPTION();
1.1 misho 30051: ZEND_VM_NEXT_OPCODE();
30052: }
30053:
30054: static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
30055: {
1.1.1.2 misho 30056: USE_OPLINE
1.1 misho 30057: zend_free_op free_op2;
1.1.1.2 misho 30058: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 30059:
1.1.1.2 misho 30060: SAVE_OPLINE();
30061: ZVAL_BOOL(result, fast_equal_function(result,
30062: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
30063: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC));
1.1 misho 30064:
30065: zval_dtor(free_op2.var);
1.1.1.2 misho 30066: CHECK_EXCEPTION();
1.1 misho 30067: ZEND_VM_NEXT_OPCODE();
30068: }
30069:
30070: static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
30071: {
1.1.1.2 misho 30072: USE_OPLINE
1.1 misho 30073: zend_free_op free_op2;
1.1.1.2 misho 30074: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 30075:
1.1.1.2 misho 30076: SAVE_OPLINE();
30077: ZVAL_BOOL(result, fast_not_equal_function(result,
30078: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
30079: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC));
1.1 misho 30080:
30081: zval_dtor(free_op2.var);
1.1.1.2 misho 30082: CHECK_EXCEPTION();
1.1 misho 30083: ZEND_VM_NEXT_OPCODE();
30084: }
30085:
30086: static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
30087: {
1.1.1.2 misho 30088: USE_OPLINE
1.1 misho 30089: zend_free_op free_op2;
1.1.1.2 misho 30090: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 30091:
1.1.1.2 misho 30092: SAVE_OPLINE();
30093: ZVAL_BOOL(result, fast_is_smaller_function(result,
30094: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
30095: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC));
1.1 misho 30096:
30097: zval_dtor(free_op2.var);
1.1.1.2 misho 30098: CHECK_EXCEPTION();
1.1 misho 30099: ZEND_VM_NEXT_OPCODE();
30100: }
30101:
30102: static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
30103: {
1.1.1.2 misho 30104: USE_OPLINE
1.1 misho 30105: zend_free_op free_op2;
1.1.1.2 misho 30106: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 30107:
1.1.1.2 misho 30108: SAVE_OPLINE();
30109: ZVAL_BOOL(result, fast_is_smaller_or_equal_function(result,
30110: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
30111: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC));
1.1 misho 30112:
30113: zval_dtor(free_op2.var);
1.1.1.2 misho 30114: CHECK_EXCEPTION();
1.1 misho 30115: ZEND_VM_NEXT_OPCODE();
30116: }
30117:
30118: static int ZEND_FASTCALL ZEND_BW_OR_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
30119: {
1.1.1.2 misho 30120: USE_OPLINE
1.1 misho 30121: zend_free_op free_op2;
30122:
1.1.1.2 misho 30123: SAVE_OPLINE();
30124: bitwise_or_function(&EX_T(opline->result.var).tmp_var,
30125: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
30126: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 30127:
30128: zval_dtor(free_op2.var);
1.1.1.2 misho 30129: CHECK_EXCEPTION();
1.1 misho 30130: ZEND_VM_NEXT_OPCODE();
30131: }
30132:
30133: static int ZEND_FASTCALL ZEND_BW_AND_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
30134: {
1.1.1.2 misho 30135: USE_OPLINE
1.1 misho 30136: zend_free_op free_op2;
30137:
1.1.1.2 misho 30138: SAVE_OPLINE();
30139: bitwise_and_function(&EX_T(opline->result.var).tmp_var,
30140: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
30141: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 30142:
30143: zval_dtor(free_op2.var);
1.1.1.2 misho 30144: CHECK_EXCEPTION();
1.1 misho 30145: ZEND_VM_NEXT_OPCODE();
30146: }
30147:
30148: static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
30149: {
1.1.1.2 misho 30150: USE_OPLINE
1.1 misho 30151: zend_free_op free_op2;
30152:
1.1.1.2 misho 30153: SAVE_OPLINE();
30154: bitwise_xor_function(&EX_T(opline->result.var).tmp_var,
30155: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
30156: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 30157:
30158: zval_dtor(free_op2.var);
1.1.1.2 misho 30159: CHECK_EXCEPTION();
1.1 misho 30160: ZEND_VM_NEXT_OPCODE();
30161: }
30162:
30163: static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
30164: {
1.1.1.2 misho 30165: USE_OPLINE
1.1 misho 30166: zend_free_op free_op2;
30167:
1.1.1.2 misho 30168: SAVE_OPLINE();
30169: boolean_xor_function(&EX_T(opline->result.var).tmp_var,
30170: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
30171: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 30172:
30173: zval_dtor(free_op2.var);
1.1.1.2 misho 30174: CHECK_EXCEPTION();
1.1 misho 30175: ZEND_VM_NEXT_OPCODE();
30176: }
30177:
30178: static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_TMP(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
30179: {
1.1.1.2 misho 30180: USE_OPLINE
1.1 misho 30181: zend_free_op free_op2, free_op_data1;
1.1.1.2 misho 30182: zval **object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 30183: zval *object;
1.1.1.2 misho 30184: zval *property = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
30185: zval *value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R);
1.1 misho 30186: int have_get_ptr = 0;
30187:
1.1.1.2 misho 30188: if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 30189: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
30190: }
30191:
30192: make_real_object(object_ptr TSRMLS_CC);
30193: object = *object_ptr;
30194:
1.1.1.2 misho 30195: if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
1.1 misho 30196: zend_error(E_WARNING, "Attempt to assign property of non-object");
30197: zval_dtor(free_op2.var);
30198: FREE_OP(free_op_data1);
30199:
1.1.1.2 misho 30200: if (RETURN_VALUE_USED(opline)) {
30201: PZVAL_LOCK(&EG(uninitialized_zval));
30202: EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
30203: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 30204: }
30205: } else {
30206: /* here we are sure we are dealing with an object */
30207: if (1) {
30208: MAKE_REAL_ZVAL_PTR(property);
30209: }
30210:
30211: /* here property is a string */
30212: if (opline->extended_value == ZEND_ASSIGN_OBJ
30213: && Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
1.1.1.2 misho 30214: zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 30215: if (zptr != NULL) { /* NULL means no success in getting PTR */
30216: SEPARATE_ZVAL_IF_NOT_REF(zptr);
30217:
30218: have_get_ptr = 1;
30219: binary_op(*zptr, *zptr, value TSRMLS_CC);
1.1.1.2 misho 30220: if (RETURN_VALUE_USED(opline)) {
1.1 misho 30221: PZVAL_LOCK(*zptr);
1.1.1.2 misho 30222: EX_T(opline->result.var).var.ptr = *zptr;
30223: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 30224: }
30225: }
30226: }
30227:
30228: if (!have_get_ptr) {
30229: zval *z = NULL;
30230:
30231: if (opline->extended_value == ZEND_ASSIGN_OBJ) {
30232: if (Z_OBJ_HT_P(object)->read_property) {
1.1.1.2 misho 30233: z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 30234: }
30235: } else /* if (opline->extended_value == ZEND_ASSIGN_DIM) */ {
30236: if (Z_OBJ_HT_P(object)->read_dimension) {
30237: z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC);
30238: }
30239: }
30240: if (z) {
30241: if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
30242: zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
30243:
30244: if (Z_REFCOUNT_P(z) == 0) {
30245: GC_REMOVE_ZVAL_FROM_BUFFER(z);
30246: zval_dtor(z);
30247: FREE_ZVAL(z);
30248: }
30249: z = value;
30250: }
30251: Z_ADDREF_P(z);
30252: SEPARATE_ZVAL_IF_NOT_REF(&z);
30253: binary_op(z, z, value TSRMLS_CC);
30254: if (opline->extended_value == ZEND_ASSIGN_OBJ) {
1.1.1.2 misho 30255: Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 30256: } else /* if (opline->extended_value == ZEND_ASSIGN_DIM) */ {
30257: Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC);
30258: }
1.1.1.2 misho 30259: if (RETURN_VALUE_USED(opline)) {
1.1 misho 30260: PZVAL_LOCK(z);
1.1.1.2 misho 30261: EX_T(opline->result.var).var.ptr = z;
30262: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 30263: }
30264: zval_ptr_dtor(&z);
30265: } else {
30266: zend_error(E_WARNING, "Attempt to assign property of non-object");
1.1.1.2 misho 30267: if (RETURN_VALUE_USED(opline)) {
30268: PZVAL_LOCK(&EG(uninitialized_zval));
30269: EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
30270: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 30271: }
30272: }
30273: }
30274:
30275: if (1) {
30276: zval_ptr_dtor(&property);
30277: } else {
30278: zval_dtor(free_op2.var);
30279: }
30280: FREE_OP(free_op_data1);
30281: }
30282:
30283: /* assign_obj has two opcodes! */
1.1.1.2 misho 30284: CHECK_EXCEPTION();
1.1 misho 30285: ZEND_VM_INC_OPCODE();
30286: ZEND_VM_NEXT_OPCODE();
30287: }
30288:
30289: static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_TMP(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
30290: {
1.1.1.2 misho 30291: USE_OPLINE
1.1 misho 30292: zend_free_op free_op2, free_op_data2, free_op_data1;
30293: zval **var_ptr;
30294: zval *value;
30295:
1.1.1.2 misho 30296: SAVE_OPLINE();
1.1 misho 30297: switch (opline->extended_value) {
30298: case ZEND_ASSIGN_OBJ:
30299: return zend_binary_assign_op_obj_helper_SPEC_CV_TMP(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
30300: break;
30301: case ZEND_ASSIGN_DIM: {
1.1.1.2 misho 30302: zval **container = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 30303:
1.1.1.2 misho 30304: if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 30305: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
1.1.1.2 misho 30306: } else if (UNEXPECTED(Z_TYPE_PP(container) == IS_OBJECT)) {
1.1 misho 30307: if (IS_CV == IS_VAR && !0) {
30308: Z_ADDREF_PP(container); /* undo the effect of get_obj_zval_ptr_ptr() */
30309: }
30310: return zend_binary_assign_op_obj_helper_SPEC_CV_TMP(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
30311: } else {
1.1.1.2 misho 30312: zval *dim = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 30313:
1.1.1.2 misho 30314: zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), container, dim, IS_TMP_VAR, BP_VAR_RW TSRMLS_CC);
30315: value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R);
30316: var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC);
1.1 misho 30317: }
30318: }
30319: break;
30320: default:
1.1.1.2 misho 30321: value = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
30322: var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 30323: /* do nothing */
30324: break;
30325: }
30326:
1.1.1.2 misho 30327: if (UNEXPECTED(var_ptr == NULL)) {
1.1 misho 30328: zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets");
30329: }
30330:
1.1.1.2 misho 30331: if (UNEXPECTED(*var_ptr == &EG(error_zval))) {
30332: if (RETURN_VALUE_USED(opline)) {
30333: PZVAL_LOCK(&EG(uninitialized_zval));
30334: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
1.1 misho 30335: }
30336: zval_dtor(free_op2.var);
30337:
1.1.1.2 misho 30338: CHECK_EXCEPTION();
30339: if (opline->extended_value == ZEND_ASSIGN_DIM) {
30340: ZEND_VM_INC_OPCODE();
30341: }
1.1 misho 30342: ZEND_VM_NEXT_OPCODE();
30343: }
30344:
30345: SEPARATE_ZVAL_IF_NOT_REF(var_ptr);
30346:
1.1.1.2 misho 30347: if (UNEXPECTED(Z_TYPE_PP(var_ptr) == IS_OBJECT)
30348: && Z_OBJ_HANDLER_PP(var_ptr, get)
1.1 misho 30349: && Z_OBJ_HANDLER_PP(var_ptr, set)) {
30350: /* proxy object */
30351: zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC);
30352: Z_ADDREF_P(objval);
30353: binary_op(objval, objval, value TSRMLS_CC);
30354: Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC);
30355: zval_ptr_dtor(&objval);
30356: } else {
30357: binary_op(*var_ptr, *var_ptr, value TSRMLS_CC);
30358: }
30359:
1.1.1.2 misho 30360: if (RETURN_VALUE_USED(opline)) {
1.1 misho 30361: PZVAL_LOCK(*var_ptr);
1.1.1.2 misho 30362: AI_SET_PTR(&EX_T(opline->result.var), *var_ptr);
1.1 misho 30363: }
30364: zval_dtor(free_op2.var);
30365:
30366: if (opline->extended_value == ZEND_ASSIGN_DIM) {
30367: FREE_OP(free_op_data1);
30368: FREE_OP_VAR_PTR(free_op_data2);
30369:
1.1.1.2 misho 30370: CHECK_EXCEPTION();
30371: ZEND_VM_INC_OPCODE();
30372: } else {
30373:
30374: CHECK_EXCEPTION();
30375: }
1.1 misho 30376: ZEND_VM_NEXT_OPCODE();
30377: }
30378:
30379: static int ZEND_FASTCALL ZEND_ASSIGN_ADD_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
30380: {
30381: return zend_binary_assign_op_helper_SPEC_CV_TMP(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
30382: }
30383:
30384: static int ZEND_FASTCALL ZEND_ASSIGN_SUB_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
30385: {
30386: return zend_binary_assign_op_helper_SPEC_CV_TMP(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
30387: }
30388:
30389: static int ZEND_FASTCALL ZEND_ASSIGN_MUL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
30390: {
30391: return zend_binary_assign_op_helper_SPEC_CV_TMP(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
30392: }
30393:
30394: static int ZEND_FASTCALL ZEND_ASSIGN_DIV_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
30395: {
30396: return zend_binary_assign_op_helper_SPEC_CV_TMP(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
30397: }
30398:
30399: static int ZEND_FASTCALL ZEND_ASSIGN_MOD_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
30400: {
30401: return zend_binary_assign_op_helper_SPEC_CV_TMP(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
30402: }
30403:
30404: static int ZEND_FASTCALL ZEND_ASSIGN_SL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
30405: {
30406: return zend_binary_assign_op_helper_SPEC_CV_TMP(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
30407: }
30408:
30409: static int ZEND_FASTCALL ZEND_ASSIGN_SR_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
30410: {
30411: return zend_binary_assign_op_helper_SPEC_CV_TMP(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
30412: }
30413:
30414: static int ZEND_FASTCALL ZEND_ASSIGN_CONCAT_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
30415: {
30416: return zend_binary_assign_op_helper_SPEC_CV_TMP(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
30417: }
30418:
30419: static int ZEND_FASTCALL ZEND_ASSIGN_BW_OR_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
30420: {
30421: return zend_binary_assign_op_helper_SPEC_CV_TMP(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
30422: }
30423:
30424: static int ZEND_FASTCALL ZEND_ASSIGN_BW_AND_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
30425: {
30426: return zend_binary_assign_op_helper_SPEC_CV_TMP(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
30427: }
30428:
30429: static int ZEND_FASTCALL ZEND_ASSIGN_BW_XOR_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
30430: {
30431: return zend_binary_assign_op_helper_SPEC_CV_TMP(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
30432: }
30433:
30434: static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_TMP(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS)
30435: {
1.1.1.2 misho 30436: USE_OPLINE
1.1 misho 30437: zend_free_op free_op2;
1.1.1.2 misho 30438: zval **object_ptr;
1.1 misho 30439: zval *object;
1.1.1.2 misho 30440: zval *property;
30441: zval **retval;
1.1 misho 30442: int have_get_ptr = 0;
30443:
1.1.1.2 misho 30444: SAVE_OPLINE();
30445: object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC);
30446: property = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
30447: retval = &EX_T(opline->result.var).var.ptr;
30448:
30449: if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 30450: zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
30451: }
30452:
30453: make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
30454: object = *object_ptr;
30455:
1.1.1.2 misho 30456: if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
1.1 misho 30457: zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
30458: zval_dtor(free_op2.var);
1.1.1.2 misho 30459: if (RETURN_VALUE_USED(opline)) {
30460: PZVAL_LOCK(&EG(uninitialized_zval));
30461: *retval = &EG(uninitialized_zval);
1.1 misho 30462: }
30463:
1.1.1.2 misho 30464: CHECK_EXCEPTION();
1.1 misho 30465: ZEND_VM_NEXT_OPCODE();
30466: }
30467:
30468: /* here we are sure we are dealing with an object */
30469:
30470: if (1) {
30471: MAKE_REAL_ZVAL_PTR(property);
30472: }
30473:
30474: if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
1.1.1.2 misho 30475: zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 30476: if (zptr != NULL) { /* NULL means no success in getting PTR */
30477: SEPARATE_ZVAL_IF_NOT_REF(zptr);
30478:
30479: have_get_ptr = 1;
30480: incdec_op(*zptr);
1.1.1.2 misho 30481: if (RETURN_VALUE_USED(opline)) {
1.1 misho 30482: *retval = *zptr;
30483: PZVAL_LOCK(*retval);
30484: }
30485: }
30486: }
30487:
30488: if (!have_get_ptr) {
30489: if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
1.1.1.2 misho 30490: zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 30491:
1.1.1.2 misho 30492: if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
1.1 misho 30493: zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
30494:
30495: if (Z_REFCOUNT_P(z) == 0) {
30496: GC_REMOVE_ZVAL_FROM_BUFFER(z);
30497: zval_dtor(z);
30498: FREE_ZVAL(z);
30499: }
30500: z = value;
30501: }
30502: Z_ADDREF_P(z);
30503: SEPARATE_ZVAL_IF_NOT_REF(&z);
30504: incdec_op(z);
30505: *retval = z;
1.1.1.2 misho 30506: Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
30507: SELECTIVE_PZVAL_LOCK(*retval, opline);
1.1 misho 30508: zval_ptr_dtor(&z);
30509: } else {
30510: zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
1.1.1.2 misho 30511: if (RETURN_VALUE_USED(opline)) {
30512: PZVAL_LOCK(&EG(uninitialized_zval));
30513: *retval = &EG(uninitialized_zval);
1.1 misho 30514: }
30515: }
30516: }
30517:
30518: if (1) {
30519: zval_ptr_dtor(&property);
30520: } else {
30521: zval_dtor(free_op2.var);
30522: }
30523:
1.1.1.2 misho 30524: CHECK_EXCEPTION();
1.1 misho 30525: ZEND_VM_NEXT_OPCODE();
30526: }
30527:
30528: static int ZEND_FASTCALL ZEND_PRE_INC_OBJ_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
30529: {
30530: return zend_pre_incdec_property_helper_SPEC_CV_TMP(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
30531: }
30532:
30533: static int ZEND_FASTCALL ZEND_PRE_DEC_OBJ_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
30534: {
30535: return zend_pre_incdec_property_helper_SPEC_CV_TMP(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
30536: }
30537:
30538: static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_TMP(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS)
30539: {
1.1.1.2 misho 30540: USE_OPLINE
1.1 misho 30541: zend_free_op free_op2;
1.1.1.2 misho 30542: zval **object_ptr;
1.1 misho 30543: zval *object;
1.1.1.2 misho 30544: zval *property;
30545: zval *retval;
1.1 misho 30546: int have_get_ptr = 0;
30547:
1.1.1.2 misho 30548: SAVE_OPLINE();
30549: object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC);
30550: property = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
30551: retval = &EX_T(opline->result.var).tmp_var;
30552:
30553: if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 30554: zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
30555: }
30556:
30557: make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
30558: object = *object_ptr;
30559:
1.1.1.2 misho 30560: if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
1.1 misho 30561: zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
30562: zval_dtor(free_op2.var);
1.1.1.2 misho 30563: ZVAL_NULL(retval);
1.1 misho 30564:
1.1.1.2 misho 30565: CHECK_EXCEPTION();
1.1 misho 30566: ZEND_VM_NEXT_OPCODE();
30567: }
30568:
30569: /* here we are sure we are dealing with an object */
30570:
30571: if (1) {
30572: MAKE_REAL_ZVAL_PTR(property);
30573: }
30574:
30575: if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
1.1.1.2 misho 30576: zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 30577: if (zptr != NULL) { /* NULL means no success in getting PTR */
30578: have_get_ptr = 1;
30579: SEPARATE_ZVAL_IF_NOT_REF(zptr);
30580:
1.1.1.2 misho 30581: ZVAL_COPY_VALUE(retval, *zptr);
1.1 misho 30582: zendi_zval_copy_ctor(*retval);
30583:
30584: incdec_op(*zptr);
30585:
30586: }
30587: }
30588:
30589: if (!have_get_ptr) {
30590: if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
1.1.1.2 misho 30591: zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 30592: zval *z_copy;
30593:
1.1.1.2 misho 30594: if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
1.1 misho 30595: zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
30596:
30597: if (Z_REFCOUNT_P(z) == 0) {
30598: GC_REMOVE_ZVAL_FROM_BUFFER(z);
30599: zval_dtor(z);
30600: FREE_ZVAL(z);
30601: }
30602: z = value;
30603: }
1.1.1.2 misho 30604: ZVAL_COPY_VALUE(retval, z);
1.1 misho 30605: zendi_zval_copy_ctor(*retval);
30606: ALLOC_ZVAL(z_copy);
1.1.1.2 misho 30607: INIT_PZVAL_COPY(z_copy, z);
1.1 misho 30608: zendi_zval_copy_ctor(*z_copy);
30609: incdec_op(z_copy);
30610: Z_ADDREF_P(z);
1.1.1.2 misho 30611: Z_OBJ_HT_P(object)->write_property(object, property, z_copy, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 30612: zval_ptr_dtor(&z_copy);
30613: zval_ptr_dtor(&z);
30614: } else {
30615: zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
1.1.1.2 misho 30616: ZVAL_NULL(retval);
1.1 misho 30617: }
30618: }
30619:
30620: if (1) {
30621: zval_ptr_dtor(&property);
30622: } else {
30623: zval_dtor(free_op2.var);
30624: }
30625:
1.1.1.2 misho 30626: CHECK_EXCEPTION();
1.1 misho 30627: ZEND_VM_NEXT_OPCODE();
30628: }
30629:
30630: static int ZEND_FASTCALL ZEND_POST_INC_OBJ_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
30631: {
30632: return zend_post_incdec_property_helper_SPEC_CV_TMP(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
30633: }
30634:
30635: static int ZEND_FASTCALL ZEND_POST_DEC_OBJ_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
30636: {
30637: return zend_post_incdec_property_helper_SPEC_CV_TMP(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
30638: }
30639:
30640: static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
30641: {
1.1.1.2 misho 30642: USE_OPLINE
1.1 misho 30643: zend_free_op free_op2;
30644: zval **container;
30645:
1.1.1.2 misho 30646: SAVE_OPLINE();
30647:
30648: if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) &&
1.1 misho 30649: IS_CV != IS_CV &&
1.1.1.2 misho 30650: EX_T(opline->op1.var).var.ptr_ptr) {
30651: PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
1.1 misho 30652: }
1.1.1.2 misho 30653: container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
30654: zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC);
1.1 misho 30655: zval_dtor(free_op2.var);
30656:
1.1.1.2 misho 30657: CHECK_EXCEPTION();
1.1 misho 30658: ZEND_VM_NEXT_OPCODE();
30659: }
30660:
30661: static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
30662: {
1.1.1.2 misho 30663: USE_OPLINE
1.1 misho 30664: zend_free_op free_op1, free_op2;
1.1.1.2 misho 30665: zval **container;
30666:
30667: SAVE_OPLINE();
30668: container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 30669:
1.1.1.2 misho 30670: if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 30671: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
30672: }
1.1.1.2 misho 30673: zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_W TSRMLS_CC);
1.1 misho 30674: zval_dtor(free_op2.var);
1.1.1.2 misho 30675: if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
30676: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 30677: }
30678:
30679: /* We are going to assign the result by reference */
1.1.1.2 misho 30680: if (UNEXPECTED(opline->extended_value != 0)) {
30681: zval **retval_ptr = EX_T(opline->result.var).var.ptr_ptr;
30682:
30683: if (retval_ptr) {
30684: Z_DELREF_PP(retval_ptr);
30685: SEPARATE_ZVAL_TO_MAKE_IS_REF(retval_ptr);
30686: Z_ADDREF_PP(retval_ptr);
30687: }
1.1 misho 30688: }
30689:
1.1.1.2 misho 30690: CHECK_EXCEPTION();
1.1 misho 30691: ZEND_VM_NEXT_OPCODE();
30692: }
30693:
30694: static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
30695: {
1.1.1.2 misho 30696: USE_OPLINE
1.1 misho 30697: zend_free_op free_op1, free_op2;
1.1.1.2 misho 30698: zval **container;
1.1 misho 30699:
1.1.1.2 misho 30700: SAVE_OPLINE();
30701: container = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC);
30702:
30703: if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 30704: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
30705: }
1.1.1.2 misho 30706: zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_RW TSRMLS_CC);
1.1 misho 30707: zval_dtor(free_op2.var);
1.1.1.2 misho 30708: if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
30709: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 30710: }
30711:
1.1.1.2 misho 30712: CHECK_EXCEPTION();
1.1 misho 30713: ZEND_VM_NEXT_OPCODE();
30714: }
30715:
30716: static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
30717: {
1.1.1.2 misho 30718: USE_OPLINE
1.1 misho 30719: zend_free_op free_op2;
1.1.1.2 misho 30720: zval **container;
1.1 misho 30721:
1.1.1.2 misho 30722: SAVE_OPLINE();
30723: container = _get_zval_ptr_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC);
30724: zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_IS TSRMLS_CC);
1.1 misho 30725: zval_dtor(free_op2.var);
30726:
1.1.1.2 misho 30727: CHECK_EXCEPTION();
1.1 misho 30728: ZEND_VM_NEXT_OPCODE();
30729: }
30730:
30731: static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
30732: {
1.1.1.2 misho 30733: USE_OPLINE
1.1 misho 30734: zend_free_op free_op1, free_op2;
30735: zval **container;
30736:
1.1.1.2 misho 30737: SAVE_OPLINE();
30738:
30739: if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
30740: container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC);
30741: if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 30742: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
30743: }
1.1.1.2 misho 30744: zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_W TSRMLS_CC);
30745: if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
30746: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 30747: }
30748: } else {
30749: if (IS_TMP_VAR == IS_UNUSED) {
30750: zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
30751: }
1.1.1.2 misho 30752: container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
30753: zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC);
1.1 misho 30754: }
30755: zval_dtor(free_op2.var);
30756:
1.1.1.2 misho 30757: CHECK_EXCEPTION();
1.1 misho 30758: ZEND_VM_NEXT_OPCODE();
30759: }
30760:
30761: static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
30762: {
1.1.1.2 misho 30763: USE_OPLINE
1.1 misho 30764: zend_free_op free_op1, free_op2;
1.1.1.2 misho 30765: zval **container;
30766:
30767: SAVE_OPLINE();
30768: container = _get_zval_ptr_ptr_cv_BP_VAR_UNSET(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 30769:
30770: if (IS_CV == IS_CV) {
30771: if (container != &EG(uninitialized_zval_ptr)) {
30772: SEPARATE_ZVAL_IF_NOT_REF(container);
30773: }
30774: }
1.1.1.2 misho 30775: if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 30776: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
30777: }
1.1.1.2 misho 30778: zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_UNSET TSRMLS_CC);
1.1 misho 30779: zval_dtor(free_op2.var);
1.1.1.2 misho 30780: if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
30781: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 30782: }
30783:
1.1.1.2 misho 30784: if (UNEXPECTED(EX_T(opline->result.var).var.ptr_ptr == NULL)) {
1.1 misho 30785: zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
30786: } else {
30787: zend_free_op free_res;
1.1.1.2 misho 30788: zval **retval_ptr = EX_T(opline->result.var).var.ptr_ptr;
1.1 misho 30789:
1.1.1.2 misho 30790: PZVAL_UNLOCK(*retval_ptr, &free_res);
30791: if (retval_ptr != &EG(uninitialized_zval_ptr)) {
30792: SEPARATE_ZVAL_IF_NOT_REF(retval_ptr);
1.1 misho 30793: }
1.1.1.2 misho 30794: PZVAL_LOCK(*retval_ptr);
1.1 misho 30795: FREE_OP_VAR_PTR(free_res);
1.1.1.2 misho 30796: CHECK_EXCEPTION();
30797: ZEND_VM_NEXT_OPCODE();
1.1 misho 30798: }
30799: }
30800:
1.1.1.2 misho 30801: static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_CV_TMP(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 30802: {
1.1.1.2 misho 30803: USE_OPLINE
1.1 misho 30804:
1.1.1.2 misho 30805: zval *container;
1.1 misho 30806: zend_free_op free_op2;
1.1.1.2 misho 30807: zval *offset;
1.1 misho 30808:
1.1.1.2 misho 30809: SAVE_OPLINE();
30810: container = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
30811: offset = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
30812:
30813: if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
30814: UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
30815: zend_error(E_NOTICE, "Trying to get property of non-object");
30816: PZVAL_LOCK(&EG(uninitialized_zval));
30817: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
1.1 misho 30818: zval_dtor(free_op2.var);
30819: } else {
30820: zval *retval;
30821:
30822: if (1) {
30823: MAKE_REAL_ZVAL_PTR(offset);
30824: }
30825:
30826: /* here we are sure we are dealing with an object */
1.1.1.2 misho 30827: retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 30828:
1.1.1.2 misho 30829: PZVAL_LOCK(retval);
30830: AI_SET_PTR(&EX_T(opline->result.var), retval);
1.1 misho 30831:
30832: if (1) {
30833: zval_ptr_dtor(&offset);
30834: } else {
30835: zval_dtor(free_op2.var);
30836: }
30837: }
30838:
1.1.1.2 misho 30839: CHECK_EXCEPTION();
1.1 misho 30840: ZEND_VM_NEXT_OPCODE();
30841: }
30842:
30843: static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
30844: {
1.1.1.2 misho 30845: return zend_fetch_property_address_read_helper_SPEC_CV_TMP(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
1.1 misho 30846: }
30847:
30848: static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
30849: {
1.1.1.2 misho 30850: USE_OPLINE
1.1 misho 30851: zend_free_op free_op1, free_op2;
1.1.1.2 misho 30852: zval *property;
1.1 misho 30853: zval **container;
30854:
1.1.1.2 misho 30855: SAVE_OPLINE();
30856: property = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
30857:
1.1 misho 30858: if (IS_CV == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
1.1.1.2 misho 30859: PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
30860: EX_T(opline->op1.var).var.ptr = *EX_T(opline->op1.var).var.ptr_ptr;
1.1 misho 30861: }
30862:
30863: if (1) {
30864: MAKE_REAL_ZVAL_PTR(property);
30865: }
1.1.1.2 misho 30866: container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC);
30867: if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 30868: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
30869: }
1.1.1.2 misho 30870:
30871: zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_W TSRMLS_CC);
1.1 misho 30872: if (1) {
30873: zval_ptr_dtor(&property);
30874: } else {
30875: zval_dtor(free_op2.var);
30876: }
1.1.1.2 misho 30877: if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
30878: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 30879: }
30880:
30881: /* We are going to assign the result by reference */
30882: if (opline->extended_value & ZEND_FETCH_MAKE_REF) {
1.1.1.2 misho 30883: zval **retval_ptr = EX_T(opline->result.var).var.ptr_ptr;
30884:
30885: Z_DELREF_PP(retval_ptr);
30886: SEPARATE_ZVAL_TO_MAKE_IS_REF(retval_ptr);
30887: Z_ADDREF_PP(retval_ptr);
30888: EX_T(opline->result.var).var.ptr = *EX_T(opline->result.var).var.ptr_ptr;
30889: EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
1.1 misho 30890: }
30891:
1.1.1.2 misho 30892: CHECK_EXCEPTION();
1.1 misho 30893: ZEND_VM_NEXT_OPCODE();
30894: }
30895:
30896: static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
30897: {
1.1.1.2 misho 30898: USE_OPLINE
1.1 misho 30899: zend_free_op free_op1, free_op2;
1.1.1.2 misho 30900: zval *property;
30901: zval **container;
30902:
30903: SAVE_OPLINE();
30904: property = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
30905: container = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 30906:
30907: if (1) {
30908: MAKE_REAL_ZVAL_PTR(property);
30909: }
1.1.1.2 misho 30910: if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 30911: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
30912: }
1.1.1.2 misho 30913: zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_RW TSRMLS_CC);
1.1 misho 30914: if (1) {
30915: zval_ptr_dtor(&property);
30916: } else {
30917: zval_dtor(free_op2.var);
30918: }
1.1.1.2 misho 30919: if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
30920: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 30921: }
30922:
1.1.1.2 misho 30923: CHECK_EXCEPTION();
1.1 misho 30924: ZEND_VM_NEXT_OPCODE();
30925: }
30926:
30927: static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
30928: {
1.1.1.2 misho 30929: USE_OPLINE
30930:
30931: zval *container;
30932: zend_free_op free_op2;
30933: zval *offset;
30934:
30935: SAVE_OPLINE();
30936: container = _get_zval_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC);
30937: offset = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
30938:
30939: if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
30940: UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
30941: PZVAL_LOCK(&EG(uninitialized_zval));
30942: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
30943: zval_dtor(free_op2.var);
30944: } else {
30945: zval *retval;
30946:
30947: if (1) {
30948: MAKE_REAL_ZVAL_PTR(offset);
30949: }
30950:
30951: /* here we are sure we are dealing with an object */
30952: retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
30953:
30954: PZVAL_LOCK(retval);
30955: AI_SET_PTR(&EX_T(opline->result.var), retval);
30956:
30957: if (1) {
30958: zval_ptr_dtor(&offset);
30959: } else {
30960: zval_dtor(free_op2.var);
30961: }
30962: }
30963:
30964: CHECK_EXCEPTION();
30965: ZEND_VM_NEXT_OPCODE();
1.1 misho 30966: }
30967:
30968: static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
30969: {
1.1.1.2 misho 30970: USE_OPLINE
1.1 misho 30971:
1.1.1.2 misho 30972: if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
1.1 misho 30973: /* Behave like FETCH_OBJ_W */
30974: zend_free_op free_op1, free_op2;
1.1.1.2 misho 30975: zval *property;
30976: zval **container;
30977:
30978: SAVE_OPLINE();
30979: property = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
30980: container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 30981:
30982: if (1) {
30983: MAKE_REAL_ZVAL_PTR(property);
30984: }
1.1.1.2 misho 30985: if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 30986: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
30987: }
1.1.1.2 misho 30988: zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_W TSRMLS_CC);
1.1 misho 30989: if (1) {
30990: zval_ptr_dtor(&property);
30991: } else {
30992: zval_dtor(free_op2.var);
30993: }
1.1.1.2 misho 30994: if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
30995: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 30996: }
30997:
1.1.1.2 misho 30998: CHECK_EXCEPTION();
1.1 misho 30999: ZEND_VM_NEXT_OPCODE();
31000: } else {
1.1.1.2 misho 31001: return zend_fetch_property_address_read_helper_SPEC_CV_TMP(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
1.1 misho 31002: }
31003: }
31004:
31005: static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
31006: {
1.1.1.2 misho 31007: USE_OPLINE
1.1 misho 31008: zend_free_op free_op1, free_op2, free_res;
1.1.1.2 misho 31009: zval **container;
31010: zval *property;
31011:
31012: SAVE_OPLINE();
31013: container = _get_zval_ptr_ptr_cv_BP_VAR_UNSET(EX_CVs(), opline->op1.var TSRMLS_CC);
31014: property = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 31015:
31016: if (IS_CV == IS_CV) {
31017: if (container != &EG(uninitialized_zval_ptr)) {
31018: SEPARATE_ZVAL_IF_NOT_REF(container);
31019: }
31020: }
31021: if (1) {
31022: MAKE_REAL_ZVAL_PTR(property);
31023: }
1.1.1.2 misho 31024: if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 31025: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
31026: }
1.1.1.2 misho 31027: zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_UNSET TSRMLS_CC);
1.1 misho 31028: if (1) {
31029: zval_ptr_dtor(&property);
31030: } else {
31031: zval_dtor(free_op2.var);
31032: }
1.1.1.2 misho 31033: if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
31034: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 31035: }
31036:
1.1.1.2 misho 31037: PZVAL_UNLOCK(*EX_T(opline->result.var).var.ptr_ptr, &free_res);
31038: if (EX_T(opline->result.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) {
31039: SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.var).var.ptr_ptr);
1.1 misho 31040: }
1.1.1.2 misho 31041: PZVAL_LOCK(*EX_T(opline->result.var).var.ptr_ptr);
1.1 misho 31042: FREE_OP_VAR_PTR(free_res);
1.1.1.2 misho 31043: CHECK_EXCEPTION();
1.1 misho 31044: ZEND_VM_NEXT_OPCODE();
31045: }
31046:
31047: static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
31048: {
1.1.1.2 misho 31049: USE_OPLINE
1.1 misho 31050: zend_free_op free_op2;
1.1.1.2 misho 31051: zval **object_ptr;
31052: zval *property_name;
31053:
31054: SAVE_OPLINE();
31055: object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC);
31056: property_name = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 31057:
31058: if (1) {
31059: MAKE_REAL_ZVAL_PTR(property_name);
31060: }
1.1.1.2 misho 31061: if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 31062: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
31063: }
1.1.1.2 misho 31064: zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), ZEND_ASSIGN_OBJ, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 31065: if (1) {
31066: zval_ptr_dtor(&property_name);
31067: } else {
31068: zval_dtor(free_op2.var);
31069: }
31070:
31071: /* assign_obj has two opcodes! */
1.1.1.2 misho 31072: CHECK_EXCEPTION();
1.1 misho 31073: ZEND_VM_INC_OPCODE();
31074: ZEND_VM_NEXT_OPCODE();
31075: }
31076:
31077: static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
31078: {
1.1.1.2 misho 31079: USE_OPLINE
31080:
31081: zval **object_ptr;
1.1 misho 31082:
1.1.1.2 misho 31083: SAVE_OPLINE();
31084: object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 31085:
1.1.1.2 misho 31086: if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 31087: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
31088: }
31089: if (Z_TYPE_PP(object_ptr) == IS_OBJECT) {
31090: zend_free_op free_op2;
1.1.1.2 misho 31091: zval *property_name = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 31092:
31093: if (1) {
31094: MAKE_REAL_ZVAL_PTR(property_name);
31095: }
1.1.1.2 misho 31096: zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), ZEND_ASSIGN_DIM, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 31097: if (1) {
31098: zval_ptr_dtor(&property_name);
31099: } else {
31100: zval_dtor(free_op2.var);
31101: }
31102: } else {
31103: zend_free_op free_op2, free_op_data1, free_op_data2;
31104: zval *value;
1.1.1.2 misho 31105: zval *dim = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 31106: zval **variable_ptr_ptr;
31107:
1.1.1.2 misho 31108: zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), object_ptr, dim, IS_TMP_VAR, BP_VAR_W TSRMLS_CC);
1.1 misho 31109: zval_dtor(free_op2.var);
31110:
1.1.1.2 misho 31111: value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R);
31112: variable_ptr_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC);
31113: if (UNEXPECTED(variable_ptr_ptr == NULL)) {
31114: if (zend_assign_to_string_offset(&EX_T((opline+1)->op2.var), value, (opline+1)->op1_type TSRMLS_CC)) {
31115: if (RETURN_VALUE_USED(opline)) {
31116: zval *retval;
31117:
31118: ALLOC_ZVAL(retval);
31119: ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T((opline+1)->op2.var).str_offset.str)+EX_T((opline+1)->op2.var).str_offset.offset, 1, 1);
31120: INIT_PZVAL(retval);
31121: AI_SET_PTR(&EX_T(opline->result.var), retval);
31122: }
31123: } else if (RETURN_VALUE_USED(opline)) {
31124: PZVAL_LOCK(&EG(uninitialized_zval));
31125: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
31126: }
31127: } else if (UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) {
31128: if (IS_TMP_FREE(free_op_data1)) {
31129: zval_dtor(value);
31130: }
31131: if (RETURN_VALUE_USED(opline)) {
31132: PZVAL_LOCK(&EG(uninitialized_zval));
31133: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
31134: }
31135: } else {
31136: if ((opline+1)->op1_type == IS_TMP_VAR) {
31137: value = zend_assign_tmp_to_variable(variable_ptr_ptr, value TSRMLS_CC);
31138: } else if ((opline+1)->op1_type == IS_CONST) {
31139: value = zend_assign_const_to_variable(variable_ptr_ptr, value TSRMLS_CC);
31140: } else {
31141: value = zend_assign_to_variable(variable_ptr_ptr, value TSRMLS_CC);
31142: }
31143: if (RETURN_VALUE_USED(opline)) {
1.1 misho 31144: PZVAL_LOCK(value);
1.1.1.2 misho 31145: AI_SET_PTR(&EX_T(opline->result.var), value);
1.1 misho 31146: }
31147: }
31148: FREE_OP_VAR_PTR(free_op_data2);
31149: FREE_OP_IF_VAR(free_op_data1);
31150: }
31151:
31152: /* assign_dim has two opcodes! */
1.1.1.2 misho 31153: CHECK_EXCEPTION();
1.1 misho 31154: ZEND_VM_INC_OPCODE();
31155: ZEND_VM_NEXT_OPCODE();
31156: }
31157:
31158: static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
31159: {
1.1.1.2 misho 31160: USE_OPLINE
1.1 misho 31161: zend_free_op free_op2;
1.1.1.2 misho 31162: zval *value;
31163: zval **variable_ptr_ptr;
1.1 misho 31164:
1.1.1.2 misho 31165: SAVE_OPLINE();
31166: value = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
31167: variable_ptr_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC);
31168:
31169: if (IS_CV == IS_VAR && UNEXPECTED(variable_ptr_ptr == NULL)) {
31170: if (zend_assign_to_string_offset(&EX_T(opline->op1.var), value, IS_TMP_VAR TSRMLS_CC)) {
31171: if (RETURN_VALUE_USED(opline)) {
31172: zval *retval;
31173:
31174: ALLOC_ZVAL(retval);
31175: ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T(opline->op1.var).str_offset.str)+EX_T(opline->op1.var).str_offset.offset, 1, 1);
31176: INIT_PZVAL(retval);
31177: AI_SET_PTR(&EX_T(opline->result.var), retval);
31178: }
31179: } else if (RETURN_VALUE_USED(opline)) {
31180: PZVAL_LOCK(&EG(uninitialized_zval));
31181: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
31182: }
31183: } else if (IS_CV == IS_VAR && UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) {
31184: if (1) {
31185: zval_dtor(value);
31186: }
31187: if (RETURN_VALUE_USED(opline)) {
31188: PZVAL_LOCK(&EG(uninitialized_zval));
31189: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
31190: }
31191: } else {
31192: if (IS_TMP_VAR == IS_TMP_VAR) {
31193: value = zend_assign_tmp_to_variable(variable_ptr_ptr, value TSRMLS_CC);
31194: } else if (IS_TMP_VAR == IS_CONST) {
31195: value = zend_assign_const_to_variable(variable_ptr_ptr, value TSRMLS_CC);
31196: } else {
31197: value = zend_assign_to_variable(variable_ptr_ptr, value TSRMLS_CC);
31198: }
31199: if (RETURN_VALUE_USED(opline)) {
1.1 misho 31200: PZVAL_LOCK(value);
1.1.1.2 misho 31201: AI_SET_PTR(&EX_T(opline->result.var), value);
1.1 misho 31202: }
31203: }
31204:
31205: /* zend_assign_to_variable() always takes care of op2, never free it! */
31206:
1.1.1.2 misho 31207: CHECK_EXCEPTION();
1.1 misho 31208: ZEND_VM_NEXT_OPCODE();
31209: }
31210:
31211: static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
31212: {
1.1.1.2 misho 31213: USE_OPLINE
1.1 misho 31214: zval *function_name;
31215: char *function_name_strval;
31216: int function_name_strlen;
31217: zend_free_op free_op2;
31218:
1.1.1.2 misho 31219: SAVE_OPLINE();
1.1 misho 31220: zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
31221:
1.1.1.2 misho 31222: function_name = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 31223:
1.1.1.2 misho 31224: if (IS_TMP_VAR != IS_CONST &&
31225: UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
1.1 misho 31226: zend_error_noreturn(E_ERROR, "Method name must be a string");
31227: }
31228:
31229: function_name_strval = Z_STRVAL_P(function_name);
31230: function_name_strlen = Z_STRLEN_P(function_name);
31231:
1.1.1.2 misho 31232: EX(object) = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 31233:
1.1.1.2 misho 31234: if (EXPECTED(EX(object) != NULL) &&
31235: EXPECTED(Z_TYPE_P(EX(object)) == IS_OBJECT)) {
31236: EX(called_scope) = Z_OBJCE_P(EX(object));
1.1 misho 31237:
1.1.1.2 misho 31238: if (IS_TMP_VAR != IS_CONST ||
31239: (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope))) == NULL) {
31240: zval *object = EX(object);
31241:
31242: if (UNEXPECTED(Z_OBJ_HT_P(EX(object))->get_method == NULL)) {
31243: zend_error_noreturn(E_ERROR, "Object does not support method calls");
31244: }
31245:
31246: /* First, locate the function. */
31247: EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen, ((IS_TMP_VAR == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC);
31248: if (UNEXPECTED(EX(fbc) == NULL)) {
31249: zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval);
31250: }
31251: if (IS_TMP_VAR == IS_CONST &&
31252: EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) &&
31253: EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) &&
31254: EXPECTED(EX(object) == object)) {
31255: CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope), EX(fbc));
31256: }
1.1 misho 31257: }
31258: } else {
31259: zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval);
31260: }
31261:
31262: if ((EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) != 0) {
31263: EX(object) = NULL;
31264: } else {
31265: if (!PZVAL_IS_REF(EX(object))) {
31266: Z_ADDREF_P(EX(object)); /* For $this pointer */
31267: } else {
31268: zval *this_ptr;
31269: ALLOC_ZVAL(this_ptr);
31270: INIT_PZVAL_COPY(this_ptr, EX(object));
31271: zval_copy_ctor(this_ptr);
31272: EX(object) = this_ptr;
31273: }
31274: }
31275:
31276: zval_dtor(free_op2.var);
31277:
1.1.1.2 misho 31278: CHECK_EXCEPTION();
1.1 misho 31279: ZEND_VM_NEXT_OPCODE();
31280: }
31281:
31282: static int ZEND_FASTCALL ZEND_CASE_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
31283: {
1.1.1.2 misho 31284: USE_OPLINE
1.1 misho 31285: zend_free_op free_op2;
31286:
1.1.1.2 misho 31287: SAVE_OPLINE();
1.1 misho 31288: if (IS_CV==IS_VAR) {
1.1.1.2 misho 31289: PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
1.1 misho 31290: }
1.1.1.2 misho 31291: is_equal_function(&EX_T(opline->result.var).tmp_var,
31292: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
31293: _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 31294:
31295: zval_dtor(free_op2.var);
1.1.1.2 misho 31296: CHECK_EXCEPTION();
1.1 misho 31297: ZEND_VM_NEXT_OPCODE();
31298: }
31299:
31300: static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
31301: {
1.1.1.2 misho 31302: USE_OPLINE
31303:
1.1 misho 31304: zval *expr_ptr;
31305:
1.1.1.2 misho 31306: SAVE_OPLINE();
31307: if ((IS_CV == IS_VAR || IS_CV == IS_CV) && opline->extended_value) {
31308: zval **expr_ptr_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 31309:
1.1.1.2 misho 31310: if (IS_CV == IS_VAR && UNEXPECTED(expr_ptr_ptr == NULL)) {
31311: zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
31312: }
31313: SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr);
1.1 misho 31314: expr_ptr = *expr_ptr_ptr;
1.1.1.2 misho 31315: Z_ADDREF_P(expr_ptr);
1.1 misho 31316: } else {
1.1.1.2 misho 31317: expr_ptr=_get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
31318: if (0) { /* temporary variable */
31319: zval *new_expr;
1.1 misho 31320:
1.1.1.2 misho 31321: ALLOC_ZVAL(new_expr);
31322: INIT_PZVAL_COPY(new_expr, expr_ptr);
31323: expr_ptr = new_expr;
31324: } else if (IS_CV == IS_CONST || PZVAL_IS_REF(expr_ptr)) {
1.1 misho 31325: zval *new_expr;
31326:
31327: ALLOC_ZVAL(new_expr);
31328: INIT_PZVAL_COPY(new_expr, expr_ptr);
31329: expr_ptr = new_expr;
31330: zendi_zval_copy_ctor(*expr_ptr);
31331: } else {
31332: Z_ADDREF_P(expr_ptr);
31333: }
31334: }
1.1.1.2 misho 31335:
31336: if (IS_TMP_VAR != IS_UNUSED) {
31337: zend_free_op free_op2;
31338: zval *offset = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
31339: ulong hval;
31340:
1.1 misho 31341: switch (Z_TYPE_P(offset)) {
31342: case IS_DOUBLE:
1.1.1.2 misho 31343: hval = zend_dval_to_lval(Z_DVAL_P(offset));
31344: goto num_index;
1.1 misho 31345: case IS_LONG:
31346: case IS_BOOL:
1.1.1.2 misho 31347: hval = Z_LVAL_P(offset);
31348: num_index:
31349: zend_hash_index_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), hval, &expr_ptr, sizeof(zval *), NULL);
1.1 misho 31350: break;
31351: case IS_STRING:
1.1.1.2 misho 31352: if (IS_TMP_VAR == IS_CONST) {
31353: hval = Z_HASH_P(offset);
31354: } else {
31355: ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
31356: if (IS_INTERNED(Z_STRVAL_P(offset))) {
31357: hval = INTERNED_HASH(Z_STRVAL_P(offset));
31358: } else {
31359: hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
31360: }
31361: }
31362: zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
1.1 misho 31363: break;
31364: case IS_NULL:
1.1.1.2 misho 31365: zend_hash_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
1.1 misho 31366: break;
31367: default:
31368: zend_error(E_WARNING, "Illegal offset type");
31369: zval_ptr_dtor(&expr_ptr);
31370: /* do nothing */
31371: break;
31372: }
31373: zval_dtor(free_op2.var);
31374: } else {
1.1.1.2 misho 31375: zend_hash_next_index_insert(Z_ARRVAL(EX_T(opline->result.var).tmp_var), &expr_ptr, sizeof(zval *), NULL);
1.1 misho 31376: }
1.1.1.2 misho 31377: if ((IS_CV == IS_VAR || IS_CV == IS_CV) && opline->extended_value) {
1.1 misho 31378:
31379: } else {
31380:
31381: }
1.1.1.2 misho 31382: CHECK_EXCEPTION();
1.1 misho 31383: ZEND_VM_NEXT_OPCODE();
31384: }
31385:
31386: static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
31387: {
1.1.1.2 misho 31388: USE_OPLINE
1.1 misho 31389:
1.1.1.2 misho 31390: array_init(&EX_T(opline->result.var).tmp_var);
1.1 misho 31391: if (IS_CV == IS_UNUSED) {
31392: ZEND_VM_NEXT_OPCODE();
31393: #if 0 || IS_CV != IS_UNUSED
31394: } else {
31395: return ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
31396: #endif
31397: }
31398: }
31399:
31400: static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
31401: {
1.1.1.2 misho 31402: USE_OPLINE
1.1 misho 31403: zend_free_op free_op2;
1.1.1.2 misho 31404: zval **container;
1.1 misho 31405: zval *offset;
1.1.1.2 misho 31406: ulong hval;
1.1 misho 31407:
1.1.1.2 misho 31408: SAVE_OPLINE();
31409: container = _get_zval_ptr_ptr_cv_BP_VAR_UNSET(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 31410: if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) {
31411: SEPARATE_ZVAL_IF_NOT_REF(container);
31412: }
1.1.1.2 misho 31413: offset = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 31414:
31415: if (IS_CV != IS_VAR || container) {
31416: switch (Z_TYPE_PP(container)) {
31417: case IS_ARRAY: {
31418: HashTable *ht = Z_ARRVAL_PP(container);
31419:
31420: switch (Z_TYPE_P(offset)) {
31421: case IS_DOUBLE:
1.1.1.2 misho 31422: hval = zend_dval_to_lval(Z_DVAL_P(offset));
1.1.1.3 misho 31423: zend_hash_index_del(ht, hval);
31424: break;
1.1 misho 31425: case IS_RESOURCE:
31426: case IS_BOOL:
31427: case IS_LONG:
1.1.1.2 misho 31428: hval = Z_LVAL_P(offset);
31429: zend_hash_index_del(ht, hval);
1.1 misho 31430: break;
31431: case IS_STRING:
31432: if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) {
31433: Z_ADDREF_P(offset);
31434: }
1.1.1.2 misho 31435: if (IS_TMP_VAR == IS_CONST) {
31436: hval = Z_HASH_P(offset);
31437: } else {
31438: ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_dim);
31439: if (IS_INTERNED(Z_STRVAL_P(offset))) {
31440: hval = INTERNED_HASH(Z_STRVAL_P(offset));
31441: } else {
31442: hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
1.1 misho 31443: }
31444: }
1.1.1.2 misho 31445: if (ht == &EG(symbol_table)) {
31446: zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC);
31447: } else {
31448: zend_hash_quick_del(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval);
31449: }
31450: if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) {
31451: zval_ptr_dtor(&offset);
31452: }
31453: break;
31454: num_index_dim:
31455: zend_hash_index_del(ht, hval);
1.1 misho 31456: if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) {
31457: zval_ptr_dtor(&offset);
31458: }
31459: break;
31460: case IS_NULL:
31461: zend_hash_del(ht, "", sizeof(""));
31462: break;
31463: default:
31464: zend_error(E_WARNING, "Illegal offset type in unset");
31465: break;
31466: }
31467: zval_dtor(free_op2.var);
31468: break;
31469: }
31470: case IS_OBJECT:
1.1.1.2 misho 31471: if (UNEXPECTED(Z_OBJ_HT_P(*container)->unset_dimension == NULL)) {
1.1 misho 31472: zend_error_noreturn(E_ERROR, "Cannot use object as array");
31473: }
31474: if (1) {
31475: MAKE_REAL_ZVAL_PTR(offset);
31476: }
31477: Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC);
31478: if (1) {
31479: zval_ptr_dtor(&offset);
31480: } else {
31481: zval_dtor(free_op2.var);
31482: }
31483: break;
31484: case IS_STRING:
31485: zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
31486: ZEND_VM_CONTINUE(); /* bailed out before */
31487: default:
31488: zval_dtor(free_op2.var);
31489: break;
31490: }
31491: } else {
31492: zval_dtor(free_op2.var);
31493: }
31494:
1.1.1.2 misho 31495: CHECK_EXCEPTION();
1.1 misho 31496: ZEND_VM_NEXT_OPCODE();
31497: }
31498:
31499: static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
31500: {
1.1.1.2 misho 31501: USE_OPLINE
1.1 misho 31502: zend_free_op free_op2;
1.1.1.2 misho 31503: zval **container;
31504: zval *offset;
31505:
31506: SAVE_OPLINE();
31507: container = _get_zval_ptr_ptr_cv_BP_VAR_UNSET(EX_CVs(), opline->op1.var TSRMLS_CC);
31508: offset = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 31509:
31510: if (IS_CV != IS_VAR || container) {
31511: if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) {
31512: SEPARATE_ZVAL_IF_NOT_REF(container);
31513: }
31514: if (Z_TYPE_PP(container) == IS_OBJECT) {
31515: if (1) {
31516: MAKE_REAL_ZVAL_PTR(offset);
31517: }
31518: if (Z_OBJ_HT_P(*container)->unset_property) {
1.1.1.2 misho 31519: Z_OBJ_HT_P(*container)->unset_property(*container, offset, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 31520: } else {
31521: zend_error(E_NOTICE, "Trying to unset property of non-object");
31522: }
31523: if (1) {
31524: zval_ptr_dtor(&offset);
31525: } else {
31526: zval_dtor(free_op2.var);
31527: }
31528: } else {
31529: zval_dtor(free_op2.var);
31530: }
31531: } else {
31532: zval_dtor(free_op2.var);
31533: }
31534:
1.1.1.2 misho 31535: CHECK_EXCEPTION();
1.1 misho 31536: ZEND_VM_NEXT_OPCODE();
31537: }
31538:
31539: static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_TMP(int prop_dim, ZEND_OPCODE_HANDLER_ARGS)
31540: {
1.1.1.2 misho 31541: USE_OPLINE
31542: zend_free_op free_op2;
31543: zval **container;
1.1 misho 31544: zval **value = NULL;
31545: int result = 0;
1.1.1.2 misho 31546: ulong hval;
31547: zval *offset;
1.1 misho 31548:
1.1.1.2 misho 31549: SAVE_OPLINE();
31550: container = _get_zval_ptr_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 31551:
1.1.1.2 misho 31552: offset = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 31553:
1.1.1.2 misho 31554: if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) {
31555: HashTable *ht;
31556: int isset = 0;
1.1 misho 31557:
1.1.1.2 misho 31558: ht = Z_ARRVAL_PP(container);
31559:
31560: switch (Z_TYPE_P(offset)) {
31561: case IS_DOUBLE:
31562: hval = zend_dval_to_lval(Z_DVAL_P(offset));
31563: goto num_index_prop;
31564: case IS_RESOURCE:
31565: case IS_BOOL:
31566: case IS_LONG:
31567: hval = Z_LVAL_P(offset);
31568: num_index_prop:
31569: if (zend_hash_index_find(ht, hval, (void **) &value) == SUCCESS) {
31570: isset = 1;
31571: }
31572: break;
31573: case IS_STRING:
31574: if (IS_TMP_VAR == IS_CONST) {
31575: hval = Z_HASH_P(offset);
31576: } else {
31577: if (!prop_dim) {
31578: ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_prop);
1.1 misho 31579: }
1.1.1.2 misho 31580: if (IS_INTERNED(Z_STRVAL_P(offset))) {
31581: hval = INTERNED_HASH(Z_STRVAL_P(offset));
1.1 misho 31582: } else {
1.1.1.2 misho 31583: hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
1.1 misho 31584: }
1.1.1.2 misho 31585: }
31586: if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) {
31587: isset = 1;
31588: }
31589: break;
31590: case IS_NULL:
31591: if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) {
31592: isset = 1;
31593: }
31594: break;
31595: default:
31596: zend_error(E_WARNING, "Illegal offset type in isset or empty");
31597: break;
31598: }
31599:
31600: if (opline->extended_value & ZEND_ISSET) {
31601: if (isset && Z_TYPE_PP(value) == IS_NULL) {
31602: result = 0;
31603: } else {
31604: result = isset;
1.1 misho 31605: }
1.1.1.2 misho 31606: } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
31607: if (!isset || !i_zend_is_true(*value)) {
31608: result = 0;
31609: } else {
31610: result = 1;
1.1 misho 31611: }
1.1.1.2 misho 31612: }
31613: zval_dtor(free_op2.var);
31614: } else if (Z_TYPE_PP(container) == IS_OBJECT) {
31615: if (1) {
31616: MAKE_REAL_ZVAL_PTR(offset);
31617: }
31618: if (prop_dim) {
31619: if (Z_OBJ_HT_P(*container)->has_property) {
31620: result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 31621: } else {
1.1.1.2 misho 31622: zend_error(E_NOTICE, "Trying to check property of non-object");
31623: result = 0;
1.1 misho 31624: }
1.1.1.2 misho 31625: } else {
31626: if (Z_OBJ_HT_P(*container)->has_dimension) {
31627: result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0 TSRMLS_CC);
1.1 misho 31628: } else {
1.1.1.2 misho 31629: zend_error(E_NOTICE, "Trying to check element of non-array");
31630: result = 0;
1.1 misho 31631: }
1.1.1.2 misho 31632: }
31633: if (1) {
31634: zval_ptr_dtor(&offset);
31635: } else {
31636: zval_dtor(free_op2.var);
31637: }
31638: } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */
31639: zval tmp;
1.1 misho 31640:
1.1.1.2 misho 31641: if (Z_TYPE_P(offset) != IS_LONG) {
31642: if (Z_TYPE_P(offset) <= IS_BOOL /* simple scalar types */
31643: || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */
31644: && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) {
31645: ZVAL_COPY_VALUE(&tmp, offset);
1.1 misho 31646: zval_copy_ctor(&tmp);
31647: convert_to_long(&tmp);
31648: offset = &tmp;
1.1.1.2 misho 31649: } else {
31650: /* can not be converted to proper offset, return "not set" */
31651: result = 0;
1.1 misho 31652: }
1.1.1.2 misho 31653: }
31654: if (Z_TYPE_P(offset) == IS_LONG) {
31655: if (opline->extended_value & ZEND_ISSET) {
31656: if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
31657: result = 1;
31658: }
31659: } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
31660: if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') {
31661: result = 1;
1.1 misho 31662: }
31663: }
31664: }
1.1.1.2 misho 31665: zval_dtor(free_op2.var);
31666: } else {
31667: zval_dtor(free_op2.var);
1.1 misho 31668: }
31669:
1.1.1.2 misho 31670: Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
31671: if (opline->extended_value & ZEND_ISSET) {
31672: Z_LVAL(EX_T(opline->result.var).tmp_var) = result;
31673: } else {
31674: Z_LVAL(EX_T(opline->result.var).tmp_var) = !result;
1.1 misho 31675: }
31676:
1.1.1.2 misho 31677: CHECK_EXCEPTION();
1.1 misho 31678: ZEND_VM_NEXT_OPCODE();
31679: }
31680:
31681: static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
31682: {
31683: return zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_TMP(0, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
31684: }
31685:
31686: static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
31687: {
31688: return zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_TMP(1, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
31689: }
31690:
31691: static int ZEND_FASTCALL ZEND_ADD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
31692: {
1.1.1.2 misho 31693: USE_OPLINE
1.1 misho 31694: zend_free_op free_op2;
31695:
1.1.1.2 misho 31696: SAVE_OPLINE();
31697: fast_add_function(&EX_T(opline->result.var).tmp_var,
31698: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
31699: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 31700:
31701: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 31702: CHECK_EXCEPTION();
1.1 misho 31703: ZEND_VM_NEXT_OPCODE();
31704: }
31705:
31706: static int ZEND_FASTCALL ZEND_SUB_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
31707: {
1.1.1.2 misho 31708: USE_OPLINE
1.1 misho 31709: zend_free_op free_op2;
31710:
1.1.1.2 misho 31711: SAVE_OPLINE();
31712: fast_sub_function(&EX_T(opline->result.var).tmp_var,
31713: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
31714: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 31715:
31716: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 31717: CHECK_EXCEPTION();
1.1 misho 31718: ZEND_VM_NEXT_OPCODE();
31719: }
31720:
31721: static int ZEND_FASTCALL ZEND_MUL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
31722: {
1.1.1.2 misho 31723: USE_OPLINE
1.1 misho 31724: zend_free_op free_op2;
31725:
1.1.1.2 misho 31726: SAVE_OPLINE();
31727: fast_mul_function(&EX_T(opline->result.var).tmp_var,
31728: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
31729: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 31730:
31731: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 31732: CHECK_EXCEPTION();
1.1 misho 31733: ZEND_VM_NEXT_OPCODE();
31734: }
31735:
31736: static int ZEND_FASTCALL ZEND_DIV_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
31737: {
1.1.1.2 misho 31738: USE_OPLINE
1.1 misho 31739: zend_free_op free_op2;
31740:
1.1.1.2 misho 31741: SAVE_OPLINE();
31742: fast_div_function(&EX_T(opline->result.var).tmp_var,
31743: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
31744: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 31745:
31746: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 31747: CHECK_EXCEPTION();
1.1 misho 31748: ZEND_VM_NEXT_OPCODE();
31749: }
31750:
31751: static int ZEND_FASTCALL ZEND_MOD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
31752: {
1.1.1.2 misho 31753: USE_OPLINE
1.1 misho 31754: zend_free_op free_op2;
31755:
1.1.1.2 misho 31756: SAVE_OPLINE();
31757: fast_mod_function(&EX_T(opline->result.var).tmp_var,
31758: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
31759: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 31760:
31761: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 31762: CHECK_EXCEPTION();
1.1 misho 31763: ZEND_VM_NEXT_OPCODE();
31764: }
31765:
31766: static int ZEND_FASTCALL ZEND_SL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
31767: {
1.1.1.2 misho 31768: USE_OPLINE
1.1 misho 31769: zend_free_op free_op2;
31770:
1.1.1.2 misho 31771: SAVE_OPLINE();
31772: shift_left_function(&EX_T(opline->result.var).tmp_var,
31773: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
31774: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 31775:
31776: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 31777: CHECK_EXCEPTION();
1.1 misho 31778: ZEND_VM_NEXT_OPCODE();
31779: }
31780:
31781: static int ZEND_FASTCALL ZEND_SR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
31782: {
1.1.1.2 misho 31783: USE_OPLINE
1.1 misho 31784: zend_free_op free_op2;
31785:
1.1.1.2 misho 31786: SAVE_OPLINE();
31787: shift_right_function(&EX_T(opline->result.var).tmp_var,
31788: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
31789: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 31790:
31791: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 31792: CHECK_EXCEPTION();
1.1 misho 31793: ZEND_VM_NEXT_OPCODE();
31794: }
31795:
31796: static int ZEND_FASTCALL ZEND_CONCAT_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
31797: {
1.1.1.2 misho 31798: USE_OPLINE
1.1 misho 31799: zend_free_op free_op2;
31800:
1.1.1.2 misho 31801: SAVE_OPLINE();
31802: concat_function(&EX_T(opline->result.var).tmp_var,
31803: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
31804: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 31805:
31806: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 31807: CHECK_EXCEPTION();
1.1 misho 31808: ZEND_VM_NEXT_OPCODE();
31809: }
31810:
31811: static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
31812: {
1.1.1.2 misho 31813: USE_OPLINE
1.1 misho 31814: zend_free_op free_op2;
31815:
1.1.1.2 misho 31816: SAVE_OPLINE();
31817: is_identical_function(&EX_T(opline->result.var).tmp_var,
31818: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
31819: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 31820:
31821: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 31822: CHECK_EXCEPTION();
1.1 misho 31823: ZEND_VM_NEXT_OPCODE();
31824: }
31825:
31826: static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
31827: {
1.1.1.2 misho 31828: USE_OPLINE
1.1 misho 31829: zend_free_op free_op2;
1.1.1.2 misho 31830: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 31831:
1.1.1.2 misho 31832: SAVE_OPLINE();
1.1 misho 31833: is_identical_function(result,
1.1.1.2 misho 31834: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
31835: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 31836: Z_LVAL_P(result) = !Z_LVAL_P(result);
31837:
31838: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 31839: CHECK_EXCEPTION();
1.1 misho 31840: ZEND_VM_NEXT_OPCODE();
31841: }
31842:
31843: static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
31844: {
1.1.1.2 misho 31845: USE_OPLINE
1.1 misho 31846: zend_free_op free_op2;
1.1.1.2 misho 31847: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 31848:
1.1.1.2 misho 31849: SAVE_OPLINE();
31850: ZVAL_BOOL(result, fast_equal_function(result,
31851: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
31852: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC));
1.1 misho 31853:
31854: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 31855: CHECK_EXCEPTION();
1.1 misho 31856: ZEND_VM_NEXT_OPCODE();
31857: }
31858:
31859: static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
31860: {
1.1.1.2 misho 31861: USE_OPLINE
1.1 misho 31862: zend_free_op free_op2;
1.1.1.2 misho 31863: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 31864:
1.1.1.2 misho 31865: SAVE_OPLINE();
31866: ZVAL_BOOL(result, fast_not_equal_function(result,
31867: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
31868: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC));
1.1 misho 31869:
31870: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 31871: CHECK_EXCEPTION();
1.1 misho 31872: ZEND_VM_NEXT_OPCODE();
31873: }
31874:
31875: static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
31876: {
1.1.1.2 misho 31877: USE_OPLINE
1.1 misho 31878: zend_free_op free_op2;
1.1.1.2 misho 31879: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 31880:
1.1.1.2 misho 31881: SAVE_OPLINE();
31882: ZVAL_BOOL(result, fast_is_smaller_function(result,
31883: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
31884: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC));
1.1 misho 31885:
31886: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 31887: CHECK_EXCEPTION();
1.1 misho 31888: ZEND_VM_NEXT_OPCODE();
31889: }
31890:
31891: static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
31892: {
1.1.1.2 misho 31893: USE_OPLINE
1.1 misho 31894: zend_free_op free_op2;
1.1.1.2 misho 31895: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 31896:
1.1.1.2 misho 31897: SAVE_OPLINE();
31898: ZVAL_BOOL(result, fast_is_smaller_or_equal_function(result,
31899: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
31900: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC));
1.1 misho 31901:
31902: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 31903: CHECK_EXCEPTION();
1.1 misho 31904: ZEND_VM_NEXT_OPCODE();
31905: }
31906:
31907: static int ZEND_FASTCALL ZEND_BW_OR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
31908: {
1.1.1.2 misho 31909: USE_OPLINE
1.1 misho 31910: zend_free_op free_op2;
31911:
1.1.1.2 misho 31912: SAVE_OPLINE();
31913: bitwise_or_function(&EX_T(opline->result.var).tmp_var,
31914: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
31915: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 31916:
31917: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 31918: CHECK_EXCEPTION();
1.1 misho 31919: ZEND_VM_NEXT_OPCODE();
31920: }
31921:
31922: static int ZEND_FASTCALL ZEND_BW_AND_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
31923: {
1.1.1.2 misho 31924: USE_OPLINE
1.1 misho 31925: zend_free_op free_op2;
31926:
1.1.1.2 misho 31927: SAVE_OPLINE();
31928: bitwise_and_function(&EX_T(opline->result.var).tmp_var,
31929: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
31930: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 31931:
31932: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 31933: CHECK_EXCEPTION();
1.1 misho 31934: ZEND_VM_NEXT_OPCODE();
31935: }
31936:
31937: static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
31938: {
1.1.1.2 misho 31939: USE_OPLINE
1.1 misho 31940: zend_free_op free_op2;
31941:
1.1.1.2 misho 31942: SAVE_OPLINE();
31943: bitwise_xor_function(&EX_T(opline->result.var).tmp_var,
31944: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
31945: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 31946:
31947: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 31948: CHECK_EXCEPTION();
1.1 misho 31949: ZEND_VM_NEXT_OPCODE();
31950: }
31951:
31952: static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
31953: {
1.1.1.2 misho 31954: USE_OPLINE
1.1 misho 31955: zend_free_op free_op2;
31956:
1.1.1.2 misho 31957: SAVE_OPLINE();
31958: boolean_xor_function(&EX_T(opline->result.var).tmp_var,
31959: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
31960: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 31961:
31962: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 31963: CHECK_EXCEPTION();
1.1 misho 31964: ZEND_VM_NEXT_OPCODE();
31965: }
31966:
31967: static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_VAR(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
31968: {
1.1.1.2 misho 31969: USE_OPLINE
1.1 misho 31970: zend_free_op free_op2, free_op_data1;
1.1.1.2 misho 31971: zval **object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 31972: zval *object;
1.1.1.2 misho 31973: zval *property = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
31974: zval *value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R);
1.1 misho 31975: int have_get_ptr = 0;
31976:
1.1.1.2 misho 31977: if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 31978: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
31979: }
31980:
31981: make_real_object(object_ptr TSRMLS_CC);
31982: object = *object_ptr;
31983:
1.1.1.2 misho 31984: if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
1.1 misho 31985: zend_error(E_WARNING, "Attempt to assign property of non-object");
31986: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
31987: FREE_OP(free_op_data1);
31988:
1.1.1.2 misho 31989: if (RETURN_VALUE_USED(opline)) {
31990: PZVAL_LOCK(&EG(uninitialized_zval));
31991: EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
31992: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 31993: }
31994: } else {
31995: /* here we are sure we are dealing with an object */
31996: if (0) {
31997: MAKE_REAL_ZVAL_PTR(property);
31998: }
31999:
32000: /* here property is a string */
32001: if (opline->extended_value == ZEND_ASSIGN_OBJ
32002: && Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
1.1.1.2 misho 32003: zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 32004: if (zptr != NULL) { /* NULL means no success in getting PTR */
32005: SEPARATE_ZVAL_IF_NOT_REF(zptr);
32006:
32007: have_get_ptr = 1;
32008: binary_op(*zptr, *zptr, value TSRMLS_CC);
1.1.1.2 misho 32009: if (RETURN_VALUE_USED(opline)) {
1.1 misho 32010: PZVAL_LOCK(*zptr);
1.1.1.2 misho 32011: EX_T(opline->result.var).var.ptr = *zptr;
32012: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 32013: }
32014: }
32015: }
32016:
32017: if (!have_get_ptr) {
32018: zval *z = NULL;
32019:
32020: if (opline->extended_value == ZEND_ASSIGN_OBJ) {
32021: if (Z_OBJ_HT_P(object)->read_property) {
1.1.1.2 misho 32022: z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 32023: }
32024: } else /* if (opline->extended_value == ZEND_ASSIGN_DIM) */ {
32025: if (Z_OBJ_HT_P(object)->read_dimension) {
32026: z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC);
32027: }
32028: }
32029: if (z) {
32030: if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
32031: zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
32032:
32033: if (Z_REFCOUNT_P(z) == 0) {
32034: GC_REMOVE_ZVAL_FROM_BUFFER(z);
32035: zval_dtor(z);
32036: FREE_ZVAL(z);
32037: }
32038: z = value;
32039: }
32040: Z_ADDREF_P(z);
32041: SEPARATE_ZVAL_IF_NOT_REF(&z);
32042: binary_op(z, z, value TSRMLS_CC);
32043: if (opline->extended_value == ZEND_ASSIGN_OBJ) {
1.1.1.2 misho 32044: Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 32045: } else /* if (opline->extended_value == ZEND_ASSIGN_DIM) */ {
32046: Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC);
32047: }
1.1.1.2 misho 32048: if (RETURN_VALUE_USED(opline)) {
1.1 misho 32049: PZVAL_LOCK(z);
1.1.1.2 misho 32050: EX_T(opline->result.var).var.ptr = z;
32051: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 32052: }
32053: zval_ptr_dtor(&z);
32054: } else {
32055: zend_error(E_WARNING, "Attempt to assign property of non-object");
1.1.1.2 misho 32056: if (RETURN_VALUE_USED(opline)) {
32057: PZVAL_LOCK(&EG(uninitialized_zval));
32058: EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
32059: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 32060: }
32061: }
32062: }
32063:
32064: if (0) {
32065: zval_ptr_dtor(&property);
32066: } else {
32067: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
32068: }
32069: FREE_OP(free_op_data1);
32070: }
32071:
32072: /* assign_obj has two opcodes! */
1.1.1.2 misho 32073: CHECK_EXCEPTION();
1.1 misho 32074: ZEND_VM_INC_OPCODE();
32075: ZEND_VM_NEXT_OPCODE();
32076: }
32077:
32078: static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_VAR(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
32079: {
1.1.1.2 misho 32080: USE_OPLINE
1.1 misho 32081: zend_free_op free_op2, free_op_data2, free_op_data1;
32082: zval **var_ptr;
32083: zval *value;
32084:
1.1.1.2 misho 32085: SAVE_OPLINE();
1.1 misho 32086: switch (opline->extended_value) {
32087: case ZEND_ASSIGN_OBJ:
32088: return zend_binary_assign_op_obj_helper_SPEC_CV_VAR(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
32089: break;
32090: case ZEND_ASSIGN_DIM: {
1.1.1.2 misho 32091: zval **container = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 32092:
1.1.1.2 misho 32093: if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 32094: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
1.1.1.2 misho 32095: } else if (UNEXPECTED(Z_TYPE_PP(container) == IS_OBJECT)) {
1.1 misho 32096: if (IS_CV == IS_VAR && !0) {
32097: Z_ADDREF_PP(container); /* undo the effect of get_obj_zval_ptr_ptr() */
32098: }
32099: return zend_binary_assign_op_obj_helper_SPEC_CV_VAR(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
32100: } else {
1.1.1.2 misho 32101: zval *dim = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 32102:
1.1.1.2 misho 32103: zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), container, dim, IS_VAR, BP_VAR_RW TSRMLS_CC);
32104: value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R);
32105: var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC);
1.1 misho 32106: }
32107: }
32108: break;
32109: default:
1.1.1.2 misho 32110: value = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
32111: var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 32112: /* do nothing */
32113: break;
32114: }
32115:
1.1.1.2 misho 32116: if (UNEXPECTED(var_ptr == NULL)) {
1.1 misho 32117: zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets");
32118: }
32119:
1.1.1.2 misho 32120: if (UNEXPECTED(*var_ptr == &EG(error_zval))) {
32121: if (RETURN_VALUE_USED(opline)) {
32122: PZVAL_LOCK(&EG(uninitialized_zval));
32123: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
1.1 misho 32124: }
32125: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
32126:
1.1.1.2 misho 32127: CHECK_EXCEPTION();
32128: if (opline->extended_value == ZEND_ASSIGN_DIM) {
32129: ZEND_VM_INC_OPCODE();
32130: }
1.1 misho 32131: ZEND_VM_NEXT_OPCODE();
32132: }
32133:
32134: SEPARATE_ZVAL_IF_NOT_REF(var_ptr);
32135:
1.1.1.2 misho 32136: if (UNEXPECTED(Z_TYPE_PP(var_ptr) == IS_OBJECT)
32137: && Z_OBJ_HANDLER_PP(var_ptr, get)
1.1 misho 32138: && Z_OBJ_HANDLER_PP(var_ptr, set)) {
32139: /* proxy object */
32140: zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC);
32141: Z_ADDREF_P(objval);
32142: binary_op(objval, objval, value TSRMLS_CC);
32143: Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC);
32144: zval_ptr_dtor(&objval);
32145: } else {
32146: binary_op(*var_ptr, *var_ptr, value TSRMLS_CC);
32147: }
32148:
1.1.1.2 misho 32149: if (RETURN_VALUE_USED(opline)) {
1.1 misho 32150: PZVAL_LOCK(*var_ptr);
1.1.1.2 misho 32151: AI_SET_PTR(&EX_T(opline->result.var), *var_ptr);
1.1 misho 32152: }
32153: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
32154:
32155: if (opline->extended_value == ZEND_ASSIGN_DIM) {
32156: FREE_OP(free_op_data1);
32157: FREE_OP_VAR_PTR(free_op_data2);
32158:
1.1.1.2 misho 32159: CHECK_EXCEPTION();
32160: ZEND_VM_INC_OPCODE();
32161: } else {
32162:
32163: CHECK_EXCEPTION();
32164: }
1.1 misho 32165: ZEND_VM_NEXT_OPCODE();
32166: }
32167:
32168: static int ZEND_FASTCALL ZEND_ASSIGN_ADD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
32169: {
32170: return zend_binary_assign_op_helper_SPEC_CV_VAR(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
32171: }
32172:
32173: static int ZEND_FASTCALL ZEND_ASSIGN_SUB_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
32174: {
32175: return zend_binary_assign_op_helper_SPEC_CV_VAR(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
32176: }
32177:
32178: static int ZEND_FASTCALL ZEND_ASSIGN_MUL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
32179: {
32180: return zend_binary_assign_op_helper_SPEC_CV_VAR(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
32181: }
32182:
32183: static int ZEND_FASTCALL ZEND_ASSIGN_DIV_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
32184: {
32185: return zend_binary_assign_op_helper_SPEC_CV_VAR(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
32186: }
32187:
32188: static int ZEND_FASTCALL ZEND_ASSIGN_MOD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
32189: {
32190: return zend_binary_assign_op_helper_SPEC_CV_VAR(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
32191: }
32192:
32193: static int ZEND_FASTCALL ZEND_ASSIGN_SL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
32194: {
32195: return zend_binary_assign_op_helper_SPEC_CV_VAR(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
32196: }
32197:
32198: static int ZEND_FASTCALL ZEND_ASSIGN_SR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
32199: {
32200: return zend_binary_assign_op_helper_SPEC_CV_VAR(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
32201: }
32202:
32203: static int ZEND_FASTCALL ZEND_ASSIGN_CONCAT_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
32204: {
32205: return zend_binary_assign_op_helper_SPEC_CV_VAR(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
32206: }
32207:
32208: static int ZEND_FASTCALL ZEND_ASSIGN_BW_OR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
32209: {
32210: return zend_binary_assign_op_helper_SPEC_CV_VAR(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
32211: }
32212:
32213: static int ZEND_FASTCALL ZEND_ASSIGN_BW_AND_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
32214: {
32215: return zend_binary_assign_op_helper_SPEC_CV_VAR(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
32216: }
32217:
32218: static int ZEND_FASTCALL ZEND_ASSIGN_BW_XOR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
32219: {
32220: return zend_binary_assign_op_helper_SPEC_CV_VAR(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
32221: }
32222:
32223: static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_VAR(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS)
32224: {
1.1.1.2 misho 32225: USE_OPLINE
1.1 misho 32226: zend_free_op free_op2;
1.1.1.2 misho 32227: zval **object_ptr;
1.1 misho 32228: zval *object;
1.1.1.2 misho 32229: zval *property;
32230: zval **retval;
1.1 misho 32231: int have_get_ptr = 0;
32232:
1.1.1.2 misho 32233: SAVE_OPLINE();
32234: object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC);
32235: property = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
32236: retval = &EX_T(opline->result.var).var.ptr;
32237:
32238: if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 32239: zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
32240: }
32241:
32242: make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
32243: object = *object_ptr;
32244:
1.1.1.2 misho 32245: if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
1.1 misho 32246: zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
32247: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 32248: if (RETURN_VALUE_USED(opline)) {
32249: PZVAL_LOCK(&EG(uninitialized_zval));
32250: *retval = &EG(uninitialized_zval);
1.1 misho 32251: }
32252:
1.1.1.2 misho 32253: CHECK_EXCEPTION();
1.1 misho 32254: ZEND_VM_NEXT_OPCODE();
32255: }
32256:
32257: /* here we are sure we are dealing with an object */
32258:
32259: if (0) {
32260: MAKE_REAL_ZVAL_PTR(property);
32261: }
32262:
32263: if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
1.1.1.2 misho 32264: zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 32265: if (zptr != NULL) { /* NULL means no success in getting PTR */
32266: SEPARATE_ZVAL_IF_NOT_REF(zptr);
32267:
32268: have_get_ptr = 1;
32269: incdec_op(*zptr);
1.1.1.2 misho 32270: if (RETURN_VALUE_USED(opline)) {
1.1 misho 32271: *retval = *zptr;
32272: PZVAL_LOCK(*retval);
32273: }
32274: }
32275: }
32276:
32277: if (!have_get_ptr) {
32278: if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
1.1.1.2 misho 32279: zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 32280:
1.1.1.2 misho 32281: if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
1.1 misho 32282: zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
32283:
32284: if (Z_REFCOUNT_P(z) == 0) {
32285: GC_REMOVE_ZVAL_FROM_BUFFER(z);
32286: zval_dtor(z);
32287: FREE_ZVAL(z);
32288: }
32289: z = value;
32290: }
32291: Z_ADDREF_P(z);
32292: SEPARATE_ZVAL_IF_NOT_REF(&z);
32293: incdec_op(z);
32294: *retval = z;
1.1.1.2 misho 32295: Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
32296: SELECTIVE_PZVAL_LOCK(*retval, opline);
1.1 misho 32297: zval_ptr_dtor(&z);
32298: } else {
32299: zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
1.1.1.2 misho 32300: if (RETURN_VALUE_USED(opline)) {
32301: PZVAL_LOCK(&EG(uninitialized_zval));
32302: *retval = &EG(uninitialized_zval);
1.1 misho 32303: }
32304: }
32305: }
32306:
32307: if (0) {
32308: zval_ptr_dtor(&property);
32309: } else {
32310: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
32311: }
32312:
1.1.1.2 misho 32313: CHECK_EXCEPTION();
1.1 misho 32314: ZEND_VM_NEXT_OPCODE();
32315: }
32316:
32317: static int ZEND_FASTCALL ZEND_PRE_INC_OBJ_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
32318: {
32319: return zend_pre_incdec_property_helper_SPEC_CV_VAR(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
32320: }
32321:
32322: static int ZEND_FASTCALL ZEND_PRE_DEC_OBJ_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
32323: {
32324: return zend_pre_incdec_property_helper_SPEC_CV_VAR(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
32325: }
32326:
32327: static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_VAR(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS)
32328: {
1.1.1.2 misho 32329: USE_OPLINE
1.1 misho 32330: zend_free_op free_op2;
1.1.1.2 misho 32331: zval **object_ptr;
1.1 misho 32332: zval *object;
1.1.1.2 misho 32333: zval *property;
32334: zval *retval;
1.1 misho 32335: int have_get_ptr = 0;
32336:
1.1.1.2 misho 32337: SAVE_OPLINE();
32338: object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC);
32339: property = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
32340: retval = &EX_T(opline->result.var).tmp_var;
32341:
32342: if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 32343: zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
32344: }
32345:
32346: make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
32347: object = *object_ptr;
32348:
1.1.1.2 misho 32349: if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
1.1 misho 32350: zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
32351: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 32352: ZVAL_NULL(retval);
1.1 misho 32353:
1.1.1.2 misho 32354: CHECK_EXCEPTION();
1.1 misho 32355: ZEND_VM_NEXT_OPCODE();
32356: }
32357:
32358: /* here we are sure we are dealing with an object */
32359:
32360: if (0) {
32361: MAKE_REAL_ZVAL_PTR(property);
32362: }
32363:
32364: if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
1.1.1.2 misho 32365: zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 32366: if (zptr != NULL) { /* NULL means no success in getting PTR */
32367: have_get_ptr = 1;
32368: SEPARATE_ZVAL_IF_NOT_REF(zptr);
32369:
1.1.1.2 misho 32370: ZVAL_COPY_VALUE(retval, *zptr);
1.1 misho 32371: zendi_zval_copy_ctor(*retval);
32372:
32373: incdec_op(*zptr);
32374:
32375: }
32376: }
32377:
32378: if (!have_get_ptr) {
32379: if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
1.1.1.2 misho 32380: zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 32381: zval *z_copy;
32382:
1.1.1.2 misho 32383: if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
1.1 misho 32384: zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
32385:
32386: if (Z_REFCOUNT_P(z) == 0) {
32387: GC_REMOVE_ZVAL_FROM_BUFFER(z);
32388: zval_dtor(z);
32389: FREE_ZVAL(z);
32390: }
32391: z = value;
32392: }
1.1.1.2 misho 32393: ZVAL_COPY_VALUE(retval, z);
1.1 misho 32394: zendi_zval_copy_ctor(*retval);
32395: ALLOC_ZVAL(z_copy);
1.1.1.2 misho 32396: INIT_PZVAL_COPY(z_copy, z);
1.1 misho 32397: zendi_zval_copy_ctor(*z_copy);
32398: incdec_op(z_copy);
32399: Z_ADDREF_P(z);
1.1.1.2 misho 32400: Z_OBJ_HT_P(object)->write_property(object, property, z_copy, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 32401: zval_ptr_dtor(&z_copy);
32402: zval_ptr_dtor(&z);
32403: } else {
32404: zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
1.1.1.2 misho 32405: ZVAL_NULL(retval);
32406: }
32407: }
32408:
32409: if (0) {
32410: zval_ptr_dtor(&property);
32411: } else {
32412: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
32413: }
32414:
32415: CHECK_EXCEPTION();
32416: ZEND_VM_NEXT_OPCODE();
32417: }
32418:
32419: static int ZEND_FASTCALL ZEND_POST_INC_OBJ_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
32420: {
32421: return zend_post_incdec_property_helper_SPEC_CV_VAR(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
32422: }
32423:
32424: static int ZEND_FASTCALL ZEND_POST_DEC_OBJ_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
32425: {
32426: return zend_post_incdec_property_helper_SPEC_CV_VAR(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
32427: }
32428:
32429: static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_VAR(int type, ZEND_OPCODE_HANDLER_ARGS)
32430: {
32431: USE_OPLINE
32432: zend_free_op free_op1;
32433: zval *varname;
32434: zval **retval;
32435: zval tmp_varname;
32436: HashTable *target_symbol_table;
32437: ulong hash_value;
32438:
32439: SAVE_OPLINE();
32440: varname = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
32441:
32442: if (IS_CV != IS_CONST && UNEXPECTED(Z_TYPE_P(varname) != IS_STRING)) {
32443: ZVAL_COPY_VALUE(&tmp_varname, varname);
32444: zval_copy_ctor(&tmp_varname);
32445: Z_SET_REFCOUNT(tmp_varname, 1);
32446: Z_UNSET_ISREF(tmp_varname);
32447: convert_to_string(&tmp_varname);
32448: varname = &tmp_varname;
32449: }
32450:
32451: if (IS_VAR != IS_UNUSED) {
32452: zend_class_entry *ce;
32453:
32454: if (IS_VAR == IS_CONST) {
32455: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
32456: ce = CACHED_PTR(opline->op2.literal->cache_slot);
32457: } else {
32458: ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
32459: if (UNEXPECTED(ce == NULL)) {
32460: if (IS_CV != IS_CONST && varname == &tmp_varname) {
32461: zval_dtor(&tmp_varname);
32462: }
32463:
32464: CHECK_EXCEPTION();
32465: ZEND_VM_NEXT_OPCODE();
32466: }
32467: CACHE_PTR(opline->op2.literal->cache_slot, ce);
32468: }
32469: } else {
32470: ce = EX_T(opline->op2.var).class_entry;
32471: }
32472: retval = zend_std_get_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 0, ((IS_CV == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
32473:
32474: } else {
32475: target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
32476: /*
32477: if (!target_symbol_table) {
32478: CHECK_EXCEPTION();
32479: ZEND_VM_NEXT_OPCODE();
32480: }
32481: */
32482: if (IS_CV == IS_CONST) {
32483: hash_value = Z_HASH_P(varname);
32484: } else if (IS_INTERNED(Z_STRVAL_P(varname))) {
32485: hash_value = INTERNED_HASH(Z_STRVAL_P(varname));
32486: } else {
32487: hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1);
32488: }
32489:
32490: if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) {
32491: switch (type) {
32492: case BP_VAR_R:
32493: case BP_VAR_UNSET:
32494: zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_P(varname));
32495: /* break missing intentionally */
32496: case BP_VAR_IS:
32497: retval = &EG(uninitialized_zval_ptr);
32498: break;
32499: case BP_VAR_RW:
32500: zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_P(varname));
32501: /* break missing intentionally */
32502: case BP_VAR_W:
32503: Z_ADDREF_P(&EG(uninitialized_zval));
32504: zend_hash_quick_update(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, &EG(uninitialized_zval_ptr), sizeof(zval *), (void **) &retval);
32505: break;
32506: EMPTY_SWITCH_DEFAULT_CASE()
32507: }
32508: }
32509: switch (opline->extended_value & ZEND_FETCH_TYPE_MASK) {
32510: case ZEND_FETCH_GLOBAL:
32511: if (IS_CV != IS_TMP_VAR) {
32512:
32513: }
32514: break;
32515: case ZEND_FETCH_LOCAL:
32516:
32517: break;
32518: case ZEND_FETCH_STATIC:
32519: zval_update_constant(retval, (void*) 1 TSRMLS_CC);
32520: break;
32521: case ZEND_FETCH_GLOBAL_LOCK:
32522: if (IS_CV == IS_VAR && !free_op1.var) {
32523: PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
32524: }
32525: break;
32526: }
32527: }
32528:
32529:
32530: if (IS_CV != IS_CONST && varname == &tmp_varname) {
32531: zval_dtor(&tmp_varname);
32532: }
32533: if (opline->extended_value & ZEND_FETCH_MAKE_REF) {
32534: SEPARATE_ZVAL_TO_MAKE_IS_REF(retval);
32535: }
32536: PZVAL_LOCK(*retval);
32537: switch (type) {
32538: case BP_VAR_R:
32539: case BP_VAR_IS:
32540: AI_SET_PTR(&EX_T(opline->result.var), *retval);
32541: break;
32542: case BP_VAR_UNSET: {
32543: zend_free_op free_res;
32544:
32545: PZVAL_UNLOCK(*retval, &free_res);
32546: if (retval != &EG(uninitialized_zval_ptr)) {
32547: SEPARATE_ZVAL_IF_NOT_REF(retval);
32548: }
32549: PZVAL_LOCK(*retval);
32550: FREE_OP_VAR_PTR(free_res);
1.1 misho 32551: }
1.1.1.2 misho 32552: /* break missing intentionally */
32553: default:
32554: EX_T(opline->result.var).var.ptr_ptr = retval;
32555: break;
1.1 misho 32556: }
1.1.1.2 misho 32557: CHECK_EXCEPTION();
32558: ZEND_VM_NEXT_OPCODE();
32559: }
32560:
32561: static int ZEND_FASTCALL ZEND_FETCH_R_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
32562: {
32563: return zend_fetch_var_address_helper_SPEC_CV_VAR(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
32564: }
32565:
32566: static int ZEND_FASTCALL ZEND_FETCH_W_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
32567: {
32568: return zend_fetch_var_address_helper_SPEC_CV_VAR(BP_VAR_W, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
32569: }
1.1 misho 32570:
1.1.1.2 misho 32571: static int ZEND_FASTCALL ZEND_FETCH_RW_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
32572: {
32573: return zend_fetch_var_address_helper_SPEC_CV_VAR(BP_VAR_RW, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
32574: }
1.1 misho 32575:
1.1.1.2 misho 32576: static int ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
32577: {
32578: USE_OPLINE
32579:
32580: return zend_fetch_var_address_helper_SPEC_CV_VAR(ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
1.1 misho 32581: }
32582:
1.1.1.2 misho 32583: static int ZEND_FASTCALL ZEND_FETCH_UNSET_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 32584: {
1.1.1.2 misho 32585: return zend_fetch_var_address_helper_SPEC_CV_VAR(BP_VAR_UNSET, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
1.1 misho 32586: }
32587:
1.1.1.2 misho 32588: static int ZEND_FASTCALL ZEND_FETCH_IS_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 32589: {
1.1.1.2 misho 32590: return zend_fetch_var_address_helper_SPEC_CV_VAR(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
1.1 misho 32591: }
32592:
32593: static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
32594: {
1.1.1.2 misho 32595: USE_OPLINE
1.1 misho 32596: zend_free_op free_op2;
32597: zval **container;
32598:
1.1.1.2 misho 32599: SAVE_OPLINE();
32600:
32601: if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) &&
1.1 misho 32602: IS_CV != IS_CV &&
1.1.1.2 misho 32603: EX_T(opline->op1.var).var.ptr_ptr) {
32604: PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
1.1 misho 32605: }
1.1.1.2 misho 32606: container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
32607: zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC);
1.1 misho 32608: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
32609:
1.1.1.2 misho 32610: CHECK_EXCEPTION();
1.1 misho 32611: ZEND_VM_NEXT_OPCODE();
32612: }
32613:
32614: static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
32615: {
1.1.1.2 misho 32616: USE_OPLINE
1.1 misho 32617: zend_free_op free_op1, free_op2;
1.1.1.2 misho 32618: zval **container;
1.1 misho 32619:
1.1.1.2 misho 32620: SAVE_OPLINE();
32621: container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC);
32622:
32623: if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 32624: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
32625: }
1.1.1.2 misho 32626: zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_W TSRMLS_CC);
1.1 misho 32627: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 32628: if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
32629: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 32630: }
32631:
32632: /* We are going to assign the result by reference */
1.1.1.2 misho 32633: if (UNEXPECTED(opline->extended_value != 0)) {
32634: zval **retval_ptr = EX_T(opline->result.var).var.ptr_ptr;
32635:
32636: if (retval_ptr) {
32637: Z_DELREF_PP(retval_ptr);
32638: SEPARATE_ZVAL_TO_MAKE_IS_REF(retval_ptr);
32639: Z_ADDREF_PP(retval_ptr);
32640: }
1.1 misho 32641: }
32642:
1.1.1.2 misho 32643: CHECK_EXCEPTION();
1.1 misho 32644: ZEND_VM_NEXT_OPCODE();
32645: }
32646:
32647: static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
32648: {
1.1.1.2 misho 32649: USE_OPLINE
1.1 misho 32650: zend_free_op free_op1, free_op2;
1.1.1.2 misho 32651: zval **container;
32652:
32653: SAVE_OPLINE();
32654: container = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 32655:
1.1.1.2 misho 32656: if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 32657: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
32658: }
1.1.1.2 misho 32659: zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_RW TSRMLS_CC);
1.1 misho 32660: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 32661: if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
32662: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 32663: }
32664:
1.1.1.2 misho 32665: CHECK_EXCEPTION();
1.1 misho 32666: ZEND_VM_NEXT_OPCODE();
32667: }
32668:
32669: static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
32670: {
1.1.1.2 misho 32671: USE_OPLINE
1.1 misho 32672: zend_free_op free_op2;
1.1.1.2 misho 32673: zval **container;
1.1 misho 32674:
1.1.1.2 misho 32675: SAVE_OPLINE();
32676: container = _get_zval_ptr_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC);
32677: zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_IS TSRMLS_CC);
1.1 misho 32678: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
32679:
1.1.1.2 misho 32680: CHECK_EXCEPTION();
1.1 misho 32681: ZEND_VM_NEXT_OPCODE();
32682: }
32683:
32684: static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
32685: {
1.1.1.2 misho 32686: USE_OPLINE
1.1 misho 32687: zend_free_op free_op1, free_op2;
32688: zval **container;
32689:
1.1.1.2 misho 32690: SAVE_OPLINE();
32691:
32692: if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
32693: container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC);
32694: if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 32695: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
32696: }
1.1.1.2 misho 32697: zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_W TSRMLS_CC);
32698: if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
32699: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 32700: }
32701: } else {
32702: if (IS_VAR == IS_UNUSED) {
32703: zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
32704: }
1.1.1.2 misho 32705: container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
32706: zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC);
1.1 misho 32707: }
32708: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
32709:
1.1.1.2 misho 32710: CHECK_EXCEPTION();
1.1 misho 32711: ZEND_VM_NEXT_OPCODE();
32712: }
32713:
32714: static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
32715: {
1.1.1.2 misho 32716: USE_OPLINE
1.1 misho 32717: zend_free_op free_op1, free_op2;
1.1.1.2 misho 32718: zval **container;
32719:
32720: SAVE_OPLINE();
32721: container = _get_zval_ptr_ptr_cv_BP_VAR_UNSET(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 32722:
32723: if (IS_CV == IS_CV) {
32724: if (container != &EG(uninitialized_zval_ptr)) {
32725: SEPARATE_ZVAL_IF_NOT_REF(container);
32726: }
32727: }
1.1.1.2 misho 32728: if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 32729: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
32730: }
1.1.1.2 misho 32731: zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_UNSET TSRMLS_CC);
1.1 misho 32732: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 32733: if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
32734: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 32735: }
32736:
1.1.1.2 misho 32737: if (UNEXPECTED(EX_T(opline->result.var).var.ptr_ptr == NULL)) {
1.1 misho 32738: zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
32739: } else {
32740: zend_free_op free_res;
1.1.1.2 misho 32741: zval **retval_ptr = EX_T(opline->result.var).var.ptr_ptr;
1.1 misho 32742:
1.1.1.2 misho 32743: PZVAL_UNLOCK(*retval_ptr, &free_res);
32744: if (retval_ptr != &EG(uninitialized_zval_ptr)) {
32745: SEPARATE_ZVAL_IF_NOT_REF(retval_ptr);
1.1 misho 32746: }
1.1.1.2 misho 32747: PZVAL_LOCK(*retval_ptr);
1.1 misho 32748: FREE_OP_VAR_PTR(free_res);
1.1.1.2 misho 32749: CHECK_EXCEPTION();
32750: ZEND_VM_NEXT_OPCODE();
1.1 misho 32751: }
32752: }
32753:
1.1.1.2 misho 32754: static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_CV_VAR(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 32755: {
1.1.1.2 misho 32756: USE_OPLINE
1.1 misho 32757:
1.1.1.2 misho 32758: zval *container;
1.1 misho 32759: zend_free_op free_op2;
1.1.1.2 misho 32760: zval *offset;
1.1 misho 32761:
1.1.1.2 misho 32762: SAVE_OPLINE();
32763: container = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
32764: offset = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
32765:
32766: if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
32767: UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
32768: zend_error(E_NOTICE, "Trying to get property of non-object");
32769: PZVAL_LOCK(&EG(uninitialized_zval));
32770: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
1.1 misho 32771: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
32772: } else {
32773: zval *retval;
32774:
32775: if (0) {
32776: MAKE_REAL_ZVAL_PTR(offset);
32777: }
32778:
32779: /* here we are sure we are dealing with an object */
1.1.1.2 misho 32780: retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 32781:
1.1.1.2 misho 32782: PZVAL_LOCK(retval);
32783: AI_SET_PTR(&EX_T(opline->result.var), retval);
1.1 misho 32784:
32785: if (0) {
32786: zval_ptr_dtor(&offset);
32787: } else {
32788: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
32789: }
32790: }
32791:
1.1.1.2 misho 32792: CHECK_EXCEPTION();
1.1 misho 32793: ZEND_VM_NEXT_OPCODE();
32794: }
32795:
32796: static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
32797: {
1.1.1.2 misho 32798: return zend_fetch_property_address_read_helper_SPEC_CV_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
1.1 misho 32799: }
32800:
32801: static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
32802: {
1.1.1.2 misho 32803: USE_OPLINE
1.1 misho 32804: zend_free_op free_op1, free_op2;
1.1.1.2 misho 32805: zval *property;
1.1 misho 32806: zval **container;
32807:
1.1.1.2 misho 32808: SAVE_OPLINE();
32809: property = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
32810:
1.1 misho 32811: if (IS_CV == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
1.1.1.2 misho 32812: PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
32813: EX_T(opline->op1.var).var.ptr = *EX_T(opline->op1.var).var.ptr_ptr;
1.1 misho 32814: }
32815:
32816: if (0) {
32817: MAKE_REAL_ZVAL_PTR(property);
32818: }
1.1.1.2 misho 32819: container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC);
32820: if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 32821: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
32822: }
1.1.1.2 misho 32823:
32824: zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_W TSRMLS_CC);
1.1 misho 32825: if (0) {
32826: zval_ptr_dtor(&property);
32827: } else {
32828: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
32829: }
1.1.1.2 misho 32830: if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
32831: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 32832: }
32833:
32834: /* We are going to assign the result by reference */
32835: if (opline->extended_value & ZEND_FETCH_MAKE_REF) {
1.1.1.2 misho 32836: zval **retval_ptr = EX_T(opline->result.var).var.ptr_ptr;
32837:
32838: Z_DELREF_PP(retval_ptr);
32839: SEPARATE_ZVAL_TO_MAKE_IS_REF(retval_ptr);
32840: Z_ADDREF_PP(retval_ptr);
32841: EX_T(opline->result.var).var.ptr = *EX_T(opline->result.var).var.ptr_ptr;
32842: EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
1.1 misho 32843: }
32844:
1.1.1.2 misho 32845: CHECK_EXCEPTION();
1.1 misho 32846: ZEND_VM_NEXT_OPCODE();
32847: }
32848:
32849: static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
32850: {
1.1.1.2 misho 32851: USE_OPLINE
1.1 misho 32852: zend_free_op free_op1, free_op2;
1.1.1.2 misho 32853: zval *property;
32854: zval **container;
32855:
32856: SAVE_OPLINE();
32857: property = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
32858: container = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 32859:
32860: if (0) {
32861: MAKE_REAL_ZVAL_PTR(property);
32862: }
1.1.1.2 misho 32863: if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 32864: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
32865: }
1.1.1.2 misho 32866: zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_RW TSRMLS_CC);
1.1 misho 32867: if (0) {
32868: zval_ptr_dtor(&property);
32869: } else {
32870: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
32871: }
1.1.1.2 misho 32872: if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
32873: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 32874: }
32875:
1.1.1.2 misho 32876: CHECK_EXCEPTION();
1.1 misho 32877: ZEND_VM_NEXT_OPCODE();
32878: }
32879:
32880: static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
32881: {
1.1.1.2 misho 32882: USE_OPLINE
32883:
32884: zval *container;
32885: zend_free_op free_op2;
32886: zval *offset;
32887:
32888: SAVE_OPLINE();
32889: container = _get_zval_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC);
32890: offset = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
32891:
32892: if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
32893: UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
32894: PZVAL_LOCK(&EG(uninitialized_zval));
32895: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
32896: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
32897: } else {
32898: zval *retval;
32899:
32900: if (0) {
32901: MAKE_REAL_ZVAL_PTR(offset);
32902: }
32903:
32904: /* here we are sure we are dealing with an object */
32905: retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
32906:
32907: PZVAL_LOCK(retval);
32908: AI_SET_PTR(&EX_T(opline->result.var), retval);
32909:
32910: if (0) {
32911: zval_ptr_dtor(&offset);
32912: } else {
32913: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
32914: }
32915: }
32916:
32917: CHECK_EXCEPTION();
32918: ZEND_VM_NEXT_OPCODE();
1.1 misho 32919: }
32920:
32921: static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
32922: {
1.1.1.2 misho 32923: USE_OPLINE
1.1 misho 32924:
1.1.1.2 misho 32925: if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
1.1 misho 32926: /* Behave like FETCH_OBJ_W */
32927: zend_free_op free_op1, free_op2;
1.1.1.2 misho 32928: zval *property;
32929: zval **container;
32930:
32931: SAVE_OPLINE();
32932: property = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
32933: container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 32934:
32935: if (0) {
32936: MAKE_REAL_ZVAL_PTR(property);
32937: }
1.1.1.2 misho 32938: if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 32939: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
32940: }
1.1.1.2 misho 32941: zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_W TSRMLS_CC);
1.1 misho 32942: if (0) {
32943: zval_ptr_dtor(&property);
32944: } else {
32945: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
32946: }
1.1.1.2 misho 32947: if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
32948: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 32949: }
32950:
1.1.1.2 misho 32951: CHECK_EXCEPTION();
1.1 misho 32952: ZEND_VM_NEXT_OPCODE();
32953: } else {
1.1.1.2 misho 32954: return zend_fetch_property_address_read_helper_SPEC_CV_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
1.1 misho 32955: }
32956: }
32957:
32958: static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
32959: {
1.1.1.2 misho 32960: USE_OPLINE
1.1 misho 32961: zend_free_op free_op1, free_op2, free_res;
1.1.1.2 misho 32962: zval **container;
32963: zval *property;
32964:
32965: SAVE_OPLINE();
32966: container = _get_zval_ptr_ptr_cv_BP_VAR_UNSET(EX_CVs(), opline->op1.var TSRMLS_CC);
32967: property = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 32968:
32969: if (IS_CV == IS_CV) {
32970: if (container != &EG(uninitialized_zval_ptr)) {
32971: SEPARATE_ZVAL_IF_NOT_REF(container);
32972: }
32973: }
32974: if (0) {
32975: MAKE_REAL_ZVAL_PTR(property);
32976: }
1.1.1.2 misho 32977: if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 32978: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
32979: }
1.1.1.2 misho 32980: zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_UNSET TSRMLS_CC);
1.1 misho 32981: if (0) {
32982: zval_ptr_dtor(&property);
32983: } else {
32984: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
32985: }
1.1.1.2 misho 32986: if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
32987: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 32988: }
32989:
1.1.1.2 misho 32990: PZVAL_UNLOCK(*EX_T(opline->result.var).var.ptr_ptr, &free_res);
32991: if (EX_T(opline->result.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) {
32992: SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.var).var.ptr_ptr);
1.1 misho 32993: }
1.1.1.2 misho 32994: PZVAL_LOCK(*EX_T(opline->result.var).var.ptr_ptr);
1.1 misho 32995: FREE_OP_VAR_PTR(free_res);
1.1.1.2 misho 32996: CHECK_EXCEPTION();
1.1 misho 32997: ZEND_VM_NEXT_OPCODE();
32998: }
32999:
33000: static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
33001: {
1.1.1.2 misho 33002: USE_OPLINE
1.1 misho 33003: zend_free_op free_op2;
1.1.1.2 misho 33004: zval **object_ptr;
33005: zval *property_name;
33006:
33007: SAVE_OPLINE();
33008: object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC);
33009: property_name = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 33010:
33011: if (0) {
33012: MAKE_REAL_ZVAL_PTR(property_name);
33013: }
1.1.1.2 misho 33014: if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 33015: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
33016: }
1.1.1.2 misho 33017: zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), ZEND_ASSIGN_OBJ, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 33018: if (0) {
33019: zval_ptr_dtor(&property_name);
33020: } else {
33021: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
33022: }
33023:
33024: /* assign_obj has two opcodes! */
1.1.1.2 misho 33025: CHECK_EXCEPTION();
1.1 misho 33026: ZEND_VM_INC_OPCODE();
33027: ZEND_VM_NEXT_OPCODE();
33028: }
33029:
33030: static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
33031: {
1.1.1.2 misho 33032: USE_OPLINE
1.1 misho 33033:
1.1.1.2 misho 33034: zval **object_ptr;
1.1 misho 33035:
1.1.1.2 misho 33036: SAVE_OPLINE();
33037: object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC);
33038:
33039: if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 33040: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
33041: }
33042: if (Z_TYPE_PP(object_ptr) == IS_OBJECT) {
33043: zend_free_op free_op2;
1.1.1.2 misho 33044: zval *property_name = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 33045:
33046: if (0) {
33047: MAKE_REAL_ZVAL_PTR(property_name);
33048: }
1.1.1.2 misho 33049: zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), ZEND_ASSIGN_DIM, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 33050: if (0) {
33051: zval_ptr_dtor(&property_name);
33052: } else {
33053: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
33054: }
33055: } else {
33056: zend_free_op free_op2, free_op_data1, free_op_data2;
33057: zval *value;
1.1.1.2 misho 33058: zval *dim = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 33059: zval **variable_ptr_ptr;
33060:
1.1.1.2 misho 33061: zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), object_ptr, dim, IS_VAR, BP_VAR_W TSRMLS_CC);
1.1 misho 33062: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
33063:
1.1.1.2 misho 33064: value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R);
33065: variable_ptr_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC);
33066: if (UNEXPECTED(variable_ptr_ptr == NULL)) {
33067: if (zend_assign_to_string_offset(&EX_T((opline+1)->op2.var), value, (opline+1)->op1_type TSRMLS_CC)) {
33068: if (RETURN_VALUE_USED(opline)) {
33069: zval *retval;
33070:
33071: ALLOC_ZVAL(retval);
33072: ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T((opline+1)->op2.var).str_offset.str)+EX_T((opline+1)->op2.var).str_offset.offset, 1, 1);
33073: INIT_PZVAL(retval);
33074: AI_SET_PTR(&EX_T(opline->result.var), retval);
33075: }
33076: } else if (RETURN_VALUE_USED(opline)) {
33077: PZVAL_LOCK(&EG(uninitialized_zval));
33078: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
33079: }
33080: } else if (UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) {
33081: if (IS_TMP_FREE(free_op_data1)) {
33082: zval_dtor(value);
33083: }
33084: if (RETURN_VALUE_USED(opline)) {
33085: PZVAL_LOCK(&EG(uninitialized_zval));
33086: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
33087: }
33088: } else {
33089: if ((opline+1)->op1_type == IS_TMP_VAR) {
33090: value = zend_assign_tmp_to_variable(variable_ptr_ptr, value TSRMLS_CC);
33091: } else if ((opline+1)->op1_type == IS_CONST) {
33092: value = zend_assign_const_to_variable(variable_ptr_ptr, value TSRMLS_CC);
33093: } else {
33094: value = zend_assign_to_variable(variable_ptr_ptr, value TSRMLS_CC);
33095: }
33096: if (RETURN_VALUE_USED(opline)) {
1.1 misho 33097: PZVAL_LOCK(value);
1.1.1.2 misho 33098: AI_SET_PTR(&EX_T(opline->result.var), value);
1.1 misho 33099: }
33100: }
33101: FREE_OP_VAR_PTR(free_op_data2);
33102: FREE_OP_IF_VAR(free_op_data1);
33103: }
33104:
33105: /* assign_dim has two opcodes! */
1.1.1.2 misho 33106: CHECK_EXCEPTION();
1.1 misho 33107: ZEND_VM_INC_OPCODE();
33108: ZEND_VM_NEXT_OPCODE();
33109: }
33110:
33111: static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
33112: {
1.1.1.2 misho 33113: USE_OPLINE
1.1 misho 33114: zend_free_op free_op2;
1.1.1.2 misho 33115: zval *value;
33116: zval **variable_ptr_ptr;
1.1 misho 33117:
1.1.1.2 misho 33118: SAVE_OPLINE();
33119: value = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
33120: variable_ptr_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC);
33121:
33122: if (IS_CV == IS_VAR && UNEXPECTED(variable_ptr_ptr == NULL)) {
33123: if (zend_assign_to_string_offset(&EX_T(opline->op1.var), value, IS_VAR TSRMLS_CC)) {
33124: if (RETURN_VALUE_USED(opline)) {
33125: zval *retval;
33126:
33127: ALLOC_ZVAL(retval);
33128: ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T(opline->op1.var).str_offset.str)+EX_T(opline->op1.var).str_offset.offset, 1, 1);
33129: INIT_PZVAL(retval);
33130: AI_SET_PTR(&EX_T(opline->result.var), retval);
33131: }
33132: } else if (RETURN_VALUE_USED(opline)) {
33133: PZVAL_LOCK(&EG(uninitialized_zval));
33134: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
33135: }
33136: } else if (IS_CV == IS_VAR && UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) {
33137: if (0) {
33138: zval_dtor(value);
33139: }
33140: if (RETURN_VALUE_USED(opline)) {
33141: PZVAL_LOCK(&EG(uninitialized_zval));
33142: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
33143: }
33144: } else {
33145: if (IS_VAR == IS_TMP_VAR) {
33146: value = zend_assign_tmp_to_variable(variable_ptr_ptr, value TSRMLS_CC);
33147: } else if (IS_VAR == IS_CONST) {
33148: value = zend_assign_const_to_variable(variable_ptr_ptr, value TSRMLS_CC);
33149: } else {
33150: value = zend_assign_to_variable(variable_ptr_ptr, value TSRMLS_CC);
33151: }
33152: if (RETURN_VALUE_USED(opline)) {
1.1 misho 33153: PZVAL_LOCK(value);
1.1.1.2 misho 33154: AI_SET_PTR(&EX_T(opline->result.var), value);
1.1 misho 33155: }
33156: }
33157:
33158: /* zend_assign_to_variable() always takes care of op2, never free it! */
33159: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
33160:
1.1.1.2 misho 33161: CHECK_EXCEPTION();
1.1 misho 33162: ZEND_VM_NEXT_OPCODE();
33163: }
33164:
33165: static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
33166: {
1.1.1.2 misho 33167: USE_OPLINE
1.1 misho 33168: zend_free_op free_op2;
33169: zval **variable_ptr_ptr;
1.1.1.2 misho 33170: zval **value_ptr_ptr;
33171:
33172: SAVE_OPLINE();
33173: value_ptr_ptr = _get_zval_ptr_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 33174:
33175: if (IS_VAR == IS_VAR &&
33176: value_ptr_ptr &&
33177: !Z_ISREF_PP(value_ptr_ptr) &&
33178: opline->extended_value == ZEND_RETURNS_FUNCTION &&
1.1.1.2 misho 33179: !EX_T(opline->op2.var).var.fcall_returned_reference) {
1.1 misho 33180: if (free_op2.var == NULL) {
33181: PZVAL_LOCK(*value_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */
33182: }
33183: zend_error(E_STRICT, "Only variables should be assigned by reference");
33184: if (UNEXPECTED(EG(exception) != NULL)) {
33185: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 33186: HANDLE_EXCEPTION();
1.1 misho 33187: }
33188: return ZEND_ASSIGN_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
33189: } else if (IS_VAR == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) {
33190: PZVAL_LOCK(*value_ptr_ptr);
33191: }
1.1.1.2 misho 33192: if (IS_CV == IS_VAR && UNEXPECTED(EX_T(opline->op1.var).var.ptr_ptr == &EX_T(opline->op1.var).var.ptr)) {
1.1 misho 33193: zend_error_noreturn(E_ERROR, "Cannot assign by reference to overloaded object");
33194: }
33195:
1.1.1.2 misho 33196: variable_ptr_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC);
33197: if ((IS_VAR == IS_VAR && UNEXPECTED(value_ptr_ptr == NULL)) ||
33198: (IS_CV == IS_VAR && UNEXPECTED(variable_ptr_ptr == NULL))) {
1.1 misho 33199: zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets nor overloaded objects");
33200: }
33201: zend_assign_to_variable_reference(variable_ptr_ptr, value_ptr_ptr TSRMLS_CC);
33202:
33203: if (IS_VAR == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) {
33204: Z_DELREF_PP(variable_ptr_ptr);
33205: }
33206:
1.1.1.2 misho 33207: if (RETURN_VALUE_USED(opline)) {
1.1 misho 33208: PZVAL_LOCK(*variable_ptr_ptr);
1.1.1.2 misho 33209: AI_SET_PTR(&EX_T(opline->result.var), *variable_ptr_ptr);
1.1 misho 33210: }
33211:
33212: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
33213:
1.1.1.2 misho 33214: CHECK_EXCEPTION();
1.1 misho 33215: ZEND_VM_NEXT_OPCODE();
33216: }
33217:
33218: static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
33219: {
1.1.1.2 misho 33220: USE_OPLINE
1.1 misho 33221: zval *function_name;
33222: char *function_name_strval;
33223: int function_name_strlen;
33224: zend_free_op free_op2;
33225:
1.1.1.2 misho 33226: SAVE_OPLINE();
1.1 misho 33227: zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
33228:
1.1.1.2 misho 33229: function_name = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 33230:
1.1.1.2 misho 33231: if (IS_VAR != IS_CONST &&
33232: UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
1.1 misho 33233: zend_error_noreturn(E_ERROR, "Method name must be a string");
33234: }
33235:
33236: function_name_strval = Z_STRVAL_P(function_name);
33237: function_name_strlen = Z_STRLEN_P(function_name);
33238:
1.1.1.2 misho 33239: EX(object) = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 33240:
1.1.1.2 misho 33241: if (EXPECTED(EX(object) != NULL) &&
33242: EXPECTED(Z_TYPE_P(EX(object)) == IS_OBJECT)) {
33243: EX(called_scope) = Z_OBJCE_P(EX(object));
1.1 misho 33244:
1.1.1.2 misho 33245: if (IS_VAR != IS_CONST ||
33246: (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope))) == NULL) {
33247: zval *object = EX(object);
33248:
33249: if (UNEXPECTED(Z_OBJ_HT_P(EX(object))->get_method == NULL)) {
33250: zend_error_noreturn(E_ERROR, "Object does not support method calls");
33251: }
33252:
33253: /* First, locate the function. */
33254: EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen, ((IS_VAR == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC);
33255: if (UNEXPECTED(EX(fbc) == NULL)) {
33256: zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval);
33257: }
33258: if (IS_VAR == IS_CONST &&
33259: EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) &&
33260: EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) &&
33261: EXPECTED(EX(object) == object)) {
33262: CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope), EX(fbc));
33263: }
1.1 misho 33264: }
33265: } else {
33266: zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval);
33267: }
33268:
33269: if ((EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) != 0) {
33270: EX(object) = NULL;
33271: } else {
33272: if (!PZVAL_IS_REF(EX(object))) {
33273: Z_ADDREF_P(EX(object)); /* For $this pointer */
33274: } else {
33275: zval *this_ptr;
33276: ALLOC_ZVAL(this_ptr);
33277: INIT_PZVAL_COPY(this_ptr, EX(object));
33278: zval_copy_ctor(this_ptr);
33279: EX(object) = this_ptr;
33280: }
33281: }
33282:
33283: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
33284:
1.1.1.2 misho 33285: CHECK_EXCEPTION();
1.1 misho 33286: ZEND_VM_NEXT_OPCODE();
33287: }
33288:
33289: static int ZEND_FASTCALL ZEND_CASE_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
33290: {
1.1.1.2 misho 33291: USE_OPLINE
1.1 misho 33292: zend_free_op free_op2;
33293:
1.1.1.2 misho 33294: SAVE_OPLINE();
1.1 misho 33295: if (IS_CV==IS_VAR) {
1.1.1.2 misho 33296: PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
1.1 misho 33297: }
1.1.1.2 misho 33298: is_equal_function(&EX_T(opline->result.var).tmp_var,
33299: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
33300: _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC);
1.1 misho 33301:
33302: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1.1.2 misho 33303: CHECK_EXCEPTION();
1.1 misho 33304: ZEND_VM_NEXT_OPCODE();
33305: }
33306:
33307: static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
33308: {
1.1.1.2 misho 33309: USE_OPLINE
33310:
1.1 misho 33311: zval *expr_ptr;
33312:
1.1.1.2 misho 33313: SAVE_OPLINE();
33314: if ((IS_CV == IS_VAR || IS_CV == IS_CV) && opline->extended_value) {
33315: zval **expr_ptr_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 33316:
1.1.1.2 misho 33317: if (IS_CV == IS_VAR && UNEXPECTED(expr_ptr_ptr == NULL)) {
33318: zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
33319: }
33320: SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr);
1.1 misho 33321: expr_ptr = *expr_ptr_ptr;
1.1.1.2 misho 33322: Z_ADDREF_P(expr_ptr);
1.1 misho 33323: } else {
1.1.1.2 misho 33324: expr_ptr=_get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
33325: if (0) { /* temporary variable */
33326: zval *new_expr;
1.1 misho 33327:
1.1.1.2 misho 33328: ALLOC_ZVAL(new_expr);
33329: INIT_PZVAL_COPY(new_expr, expr_ptr);
33330: expr_ptr = new_expr;
33331: } else if (IS_CV == IS_CONST || PZVAL_IS_REF(expr_ptr)) {
1.1 misho 33332: zval *new_expr;
33333:
33334: ALLOC_ZVAL(new_expr);
33335: INIT_PZVAL_COPY(new_expr, expr_ptr);
33336: expr_ptr = new_expr;
33337: zendi_zval_copy_ctor(*expr_ptr);
33338: } else {
33339: Z_ADDREF_P(expr_ptr);
33340: }
33341: }
1.1.1.2 misho 33342:
33343: if (IS_VAR != IS_UNUSED) {
33344: zend_free_op free_op2;
33345: zval *offset = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
33346: ulong hval;
33347:
1.1 misho 33348: switch (Z_TYPE_P(offset)) {
33349: case IS_DOUBLE:
1.1.1.2 misho 33350: hval = zend_dval_to_lval(Z_DVAL_P(offset));
33351: goto num_index;
1.1 misho 33352: case IS_LONG:
33353: case IS_BOOL:
1.1.1.2 misho 33354: hval = Z_LVAL_P(offset);
33355: num_index:
33356: zend_hash_index_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), hval, &expr_ptr, sizeof(zval *), NULL);
1.1 misho 33357: break;
33358: case IS_STRING:
1.1.1.2 misho 33359: if (IS_VAR == IS_CONST) {
33360: hval = Z_HASH_P(offset);
33361: } else {
33362: ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
33363: if (IS_INTERNED(Z_STRVAL_P(offset))) {
33364: hval = INTERNED_HASH(Z_STRVAL_P(offset));
33365: } else {
33366: hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
33367: }
33368: }
33369: zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
1.1 misho 33370: break;
33371: case IS_NULL:
1.1.1.2 misho 33372: zend_hash_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
1.1 misho 33373: break;
33374: default:
33375: zend_error(E_WARNING, "Illegal offset type");
33376: zval_ptr_dtor(&expr_ptr);
33377: /* do nothing */
33378: break;
33379: }
33380: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
33381: } else {
1.1.1.2 misho 33382: zend_hash_next_index_insert(Z_ARRVAL(EX_T(opline->result.var).tmp_var), &expr_ptr, sizeof(zval *), NULL);
1.1 misho 33383: }
1.1.1.2 misho 33384: if ((IS_CV == IS_VAR || IS_CV == IS_CV) && opline->extended_value) {
1.1 misho 33385:
33386: } else {
33387:
33388: }
1.1.1.2 misho 33389: CHECK_EXCEPTION();
1.1 misho 33390: ZEND_VM_NEXT_OPCODE();
33391: }
33392:
33393: static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
33394: {
1.1.1.2 misho 33395: USE_OPLINE
1.1 misho 33396:
1.1.1.2 misho 33397: array_init(&EX_T(opline->result.var).tmp_var);
1.1 misho 33398: if (IS_CV == IS_UNUSED) {
33399: ZEND_VM_NEXT_OPCODE();
33400: #if 0 || IS_CV != IS_UNUSED
33401: } else {
33402: return ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
33403: #endif
33404: }
33405: }
33406:
1.1.1.2 misho 33407: static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
33408: {
33409: USE_OPLINE
33410: zval tmp, *varname;
33411: HashTable *target_symbol_table;
33412:
33413:
33414: SAVE_OPLINE();
33415: if (IS_CV == IS_CV &&
33416: IS_VAR == IS_UNUSED &&
33417: (opline->extended_value & ZEND_QUICK_SET)) {
33418: if (EG(active_symbol_table)) {
33419: zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.var);
33420:
33421: zend_delete_variable(EX(prev_execute_data), EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value TSRMLS_CC);
33422: EX_CV(opline->op1.var) = NULL;
33423: } else if (EX_CV(opline->op1.var)) {
33424: zval_ptr_dtor(EX_CV(opline->op1.var));
33425: EX_CV(opline->op1.var) = NULL;
33426: }
33427: CHECK_EXCEPTION();
33428: ZEND_VM_NEXT_OPCODE();
33429: }
33430:
33431: varname = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
33432:
33433: if (IS_CV != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
33434: ZVAL_COPY_VALUE(&tmp, varname);
33435: zval_copy_ctor(&tmp);
33436: convert_to_string(&tmp);
33437: varname = &tmp;
33438: } else if (IS_CV == IS_VAR || IS_CV == IS_CV) {
33439: Z_ADDREF_P(varname);
33440: }
33441:
33442: if (IS_VAR != IS_UNUSED) {
33443: zend_class_entry *ce;
33444:
33445: if (IS_VAR == IS_CONST) {
33446: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
33447: ce = CACHED_PTR(opline->op2.literal->cache_slot);
33448: } else {
33449: ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
1.1.1.4 ! misho 33450: if (UNEXPECTED(EG(exception) != NULL)) {
1.1.1.2 misho 33451: if (IS_CV != IS_CONST && varname == &tmp) {
33452: zval_dtor(&tmp);
33453: } else if (IS_CV == IS_VAR || IS_CV == IS_CV) {
33454: zval_ptr_dtor(&varname);
33455: }
33456:
1.1.1.4 ! misho 33457: HANDLE_EXCEPTION();
! 33458: }
! 33459: if (UNEXPECTED(ce == NULL)) {
! 33460: zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op2.zv));
1.1.1.2 misho 33461: }
33462: CACHE_PTR(opline->op2.literal->cache_slot, ce);
33463: }
33464: } else {
33465: ce = EX_T(opline->op2.var).class_entry;
33466: }
33467: zend_std_unset_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), ((IS_CV == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
33468: } else {
33469: ulong hash_value = zend_inline_hash_func(varname->value.str.val, varname->value.str.len+1);
33470:
33471: target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
33472: zend_delete_variable(execute_data, target_symbol_table, varname->value.str.val, varname->value.str.len+1, hash_value TSRMLS_CC);
33473: }
33474:
33475: if (IS_CV != IS_CONST && varname == &tmp) {
33476: zval_dtor(&tmp);
33477: } else if (IS_CV == IS_VAR || IS_CV == IS_CV) {
33478: zval_ptr_dtor(&varname);
33479: }
33480:
33481: CHECK_EXCEPTION();
33482: ZEND_VM_NEXT_OPCODE();
33483: }
33484:
1.1 misho 33485: static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
33486: {
1.1.1.2 misho 33487: USE_OPLINE
1.1 misho 33488: zend_free_op free_op2;
1.1.1.2 misho 33489: zval **container;
1.1 misho 33490: zval *offset;
1.1.1.2 misho 33491: ulong hval;
1.1 misho 33492:
1.1.1.2 misho 33493: SAVE_OPLINE();
33494: container = _get_zval_ptr_ptr_cv_BP_VAR_UNSET(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 33495: if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) {
33496: SEPARATE_ZVAL_IF_NOT_REF(container);
33497: }
1.1.1.2 misho 33498: offset = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 33499:
33500: if (IS_CV != IS_VAR || container) {
33501: switch (Z_TYPE_PP(container)) {
33502: case IS_ARRAY: {
33503: HashTable *ht = Z_ARRVAL_PP(container);
33504:
33505: switch (Z_TYPE_P(offset)) {
33506: case IS_DOUBLE:
1.1.1.2 misho 33507: hval = zend_dval_to_lval(Z_DVAL_P(offset));
1.1.1.3 misho 33508: zend_hash_index_del(ht, hval);
33509: break;
1.1 misho 33510: case IS_RESOURCE:
33511: case IS_BOOL:
33512: case IS_LONG:
1.1.1.2 misho 33513: hval = Z_LVAL_P(offset);
33514: zend_hash_index_del(ht, hval);
1.1 misho 33515: break;
33516: case IS_STRING:
33517: if (IS_VAR == IS_CV || IS_VAR == IS_VAR) {
33518: Z_ADDREF_P(offset);
33519: }
1.1.1.2 misho 33520: if (IS_VAR == IS_CONST) {
33521: hval = Z_HASH_P(offset);
33522: } else {
33523: ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_dim);
33524: if (IS_INTERNED(Z_STRVAL_P(offset))) {
33525: hval = INTERNED_HASH(Z_STRVAL_P(offset));
33526: } else {
33527: hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
1.1 misho 33528: }
33529: }
1.1.1.2 misho 33530: if (ht == &EG(symbol_table)) {
33531: zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC);
33532: } else {
33533: zend_hash_quick_del(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval);
33534: }
33535: if (IS_VAR == IS_CV || IS_VAR == IS_VAR) {
33536: zval_ptr_dtor(&offset);
33537: }
33538: break;
33539: num_index_dim:
33540: zend_hash_index_del(ht, hval);
1.1 misho 33541: if (IS_VAR == IS_CV || IS_VAR == IS_VAR) {
33542: zval_ptr_dtor(&offset);
33543: }
33544: break;
33545: case IS_NULL:
33546: zend_hash_del(ht, "", sizeof(""));
33547: break;
33548: default:
33549: zend_error(E_WARNING, "Illegal offset type in unset");
33550: break;
33551: }
33552: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
33553: break;
33554: }
33555: case IS_OBJECT:
1.1.1.2 misho 33556: if (UNEXPECTED(Z_OBJ_HT_P(*container)->unset_dimension == NULL)) {
1.1 misho 33557: zend_error_noreturn(E_ERROR, "Cannot use object as array");
33558: }
33559: if (0) {
33560: MAKE_REAL_ZVAL_PTR(offset);
33561: }
33562: Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC);
33563: if (0) {
33564: zval_ptr_dtor(&offset);
33565: } else {
33566: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
33567: }
33568: break;
33569: case IS_STRING:
33570: zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
33571: ZEND_VM_CONTINUE(); /* bailed out before */
33572: default:
33573: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
33574: break;
33575: }
1.1.1.2 misho 33576: } else {
33577: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
33578: }
33579:
33580: CHECK_EXCEPTION();
33581: ZEND_VM_NEXT_OPCODE();
33582: }
33583:
33584: static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
33585: {
33586: USE_OPLINE
33587: zend_free_op free_op2;
33588: zval **container;
33589: zval *offset;
33590:
33591: SAVE_OPLINE();
33592: container = _get_zval_ptr_ptr_cv_BP_VAR_UNSET(EX_CVs(), opline->op1.var TSRMLS_CC);
33593: offset = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
33594:
33595: if (IS_CV != IS_VAR || container) {
33596: if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) {
33597: SEPARATE_ZVAL_IF_NOT_REF(container);
33598: }
33599: if (Z_TYPE_PP(container) == IS_OBJECT) {
33600: if (0) {
33601: MAKE_REAL_ZVAL_PTR(offset);
33602: }
33603: if (Z_OBJ_HT_P(*container)->unset_property) {
33604: Z_OBJ_HT_P(*container)->unset_property(*container, offset, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
33605: } else {
33606: zend_error(E_NOTICE, "Trying to unset property of non-object");
33607: }
33608: if (0) {
33609: zval_ptr_dtor(&offset);
33610: } else {
33611: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
33612: }
33613: } else {
33614: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
33615: }
33616: } else {
33617: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
33618: }
33619:
33620: CHECK_EXCEPTION();
33621: ZEND_VM_NEXT_OPCODE();
33622: }
33623:
33624: static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
33625: {
33626: USE_OPLINE
33627: zval **value;
33628: zend_bool isset = 1;
33629:
33630: SAVE_OPLINE();
33631: if (IS_CV == IS_CV &&
33632: IS_VAR == IS_UNUSED &&
33633: (opline->extended_value & ZEND_QUICK_SET)) {
33634: if (EX_CV(opline->op1.var)) {
33635: value = EX_CV(opline->op1.var);
33636: } else if (EG(active_symbol_table)) {
33637: zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.var);
33638:
33639: if (zend_hash_quick_find(EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value, (void **) &value) == FAILURE) {
33640: isset = 0;
33641: }
33642: } else {
33643: isset = 0;
33644: }
33645: } else {
33646: HashTable *target_symbol_table;
33647:
33648: zval tmp, *varname = _get_zval_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC);
33649:
33650: if (IS_CV != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
33651: ZVAL_COPY_VALUE(&tmp, varname);
33652: zval_copy_ctor(&tmp);
33653: convert_to_string(&tmp);
33654: varname = &tmp;
33655: }
33656:
33657: if (IS_VAR != IS_UNUSED) {
33658: zend_class_entry *ce;
33659:
33660: if (IS_VAR == IS_CONST) {
33661: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
33662: ce = CACHED_PTR(opline->op2.literal->cache_slot);
33663: } else {
33664: ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
33665: if (UNEXPECTED(ce == NULL)) {
33666: CHECK_EXCEPTION();
33667: ZEND_VM_NEXT_OPCODE();
33668: }
33669: CACHE_PTR(opline->op2.literal->cache_slot, ce);
33670: }
33671: } else {
33672: ce = EX_T(opline->op2.var).class_entry;
33673: }
33674: value = zend_std_get_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 1, ((IS_CV == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
33675: if (!value) {
33676: isset = 0;
33677: }
33678: } else {
33679: target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
33680: if (zend_hash_find(target_symbol_table, varname->value.str.val, varname->value.str.len+1, (void **) &value) == FAILURE) {
33681: isset = 0;
33682: }
33683: }
1.1 misho 33684:
1.1.1.2 misho 33685: if (IS_CV != IS_CONST && varname == &tmp) {
33686: zval_dtor(&tmp);
33687: }
1.1 misho 33688:
1.1.1.2 misho 33689: }
1.1 misho 33690:
1.1.1.2 misho 33691: if (opline->extended_value & ZEND_ISSET) {
33692: if (isset && Z_TYPE_PP(value) != IS_NULL) {
33693: ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 1);
33694: } else {
33695: ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
1.1 misho 33696: }
1.1.1.2 misho 33697: } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
33698: if (!isset || !i_zend_is_true(*value)) {
33699: ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 1);
1.1 misho 33700: } else {
1.1.1.2 misho 33701: ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
1.1 misho 33702: }
33703: }
33704:
1.1.1.2 misho 33705: CHECK_EXCEPTION();
1.1 misho 33706: ZEND_VM_NEXT_OPCODE();
33707: }
33708:
33709: static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_VAR(int prop_dim, ZEND_OPCODE_HANDLER_ARGS)
33710: {
1.1.1.2 misho 33711: USE_OPLINE
33712: zend_free_op free_op2;
33713: zval **container;
1.1 misho 33714: zval **value = NULL;
33715: int result = 0;
1.1.1.2 misho 33716: ulong hval;
33717: zval *offset;
1.1 misho 33718:
1.1.1.2 misho 33719: SAVE_OPLINE();
33720: container = _get_zval_ptr_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 33721:
1.1.1.2 misho 33722: offset = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC);
1.1 misho 33723:
1.1.1.2 misho 33724: if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) {
33725: HashTable *ht;
33726: int isset = 0;
1.1 misho 33727:
1.1.1.2 misho 33728: ht = Z_ARRVAL_PP(container);
33729:
33730: switch (Z_TYPE_P(offset)) {
33731: case IS_DOUBLE:
33732: hval = zend_dval_to_lval(Z_DVAL_P(offset));
33733: goto num_index_prop;
33734: case IS_RESOURCE:
33735: case IS_BOOL:
33736: case IS_LONG:
33737: hval = Z_LVAL_P(offset);
33738: num_index_prop:
33739: if (zend_hash_index_find(ht, hval, (void **) &value) == SUCCESS) {
33740: isset = 1;
33741: }
33742: break;
33743: case IS_STRING:
33744: if (IS_VAR == IS_CONST) {
33745: hval = Z_HASH_P(offset);
33746: } else {
33747: if (!prop_dim) {
33748: ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_prop);
1.1 misho 33749: }
1.1.1.2 misho 33750: if (IS_INTERNED(Z_STRVAL_P(offset))) {
33751: hval = INTERNED_HASH(Z_STRVAL_P(offset));
1.1 misho 33752: } else {
1.1.1.2 misho 33753: hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
1.1 misho 33754: }
1.1.1.2 misho 33755: }
33756: if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) {
33757: isset = 1;
33758: }
33759: break;
33760: case IS_NULL:
33761: if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) {
33762: isset = 1;
33763: }
33764: break;
33765: default:
33766: zend_error(E_WARNING, "Illegal offset type in isset or empty");
33767: break;
33768: }
33769:
33770: if (opline->extended_value & ZEND_ISSET) {
33771: if (isset && Z_TYPE_PP(value) == IS_NULL) {
33772: result = 0;
33773: } else {
33774: result = isset;
1.1 misho 33775: }
1.1.1.2 misho 33776: } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
33777: if (!isset || !i_zend_is_true(*value)) {
33778: result = 0;
33779: } else {
33780: result = 1;
1.1 misho 33781: }
1.1.1.2 misho 33782: }
33783: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
33784: } else if (Z_TYPE_PP(container) == IS_OBJECT) {
33785: if (0) {
33786: MAKE_REAL_ZVAL_PTR(offset);
33787: }
33788: if (prop_dim) {
33789: if (Z_OBJ_HT_P(*container)->has_property) {
33790: result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 33791: } else {
1.1.1.2 misho 33792: zend_error(E_NOTICE, "Trying to check property of non-object");
33793: result = 0;
1.1 misho 33794: }
1.1.1.2 misho 33795: } else {
33796: if (Z_OBJ_HT_P(*container)->has_dimension) {
33797: result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0 TSRMLS_CC);
1.1 misho 33798: } else {
1.1.1.2 misho 33799: zend_error(E_NOTICE, "Trying to check element of non-array");
33800: result = 0;
1.1 misho 33801: }
1.1.1.2 misho 33802: }
33803: if (0) {
33804: zval_ptr_dtor(&offset);
33805: } else {
33806: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
33807: }
33808: } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */
33809: zval tmp;
1.1 misho 33810:
1.1.1.2 misho 33811: if (Z_TYPE_P(offset) != IS_LONG) {
33812: if (Z_TYPE_P(offset) <= IS_BOOL /* simple scalar types */
33813: || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */
33814: && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) {
33815: ZVAL_COPY_VALUE(&tmp, offset);
1.1 misho 33816: zval_copy_ctor(&tmp);
33817: convert_to_long(&tmp);
33818: offset = &tmp;
1.1.1.2 misho 33819: } else {
33820: /* can not be converted to proper offset, return "not set" */
33821: result = 0;
1.1 misho 33822: }
1.1.1.2 misho 33823: }
33824: if (Z_TYPE_P(offset) == IS_LONG) {
33825: if (opline->extended_value & ZEND_ISSET) {
33826: if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
33827: result = 1;
33828: }
33829: } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
33830: if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') {
33831: result = 1;
1.1 misho 33832: }
33833: }
33834: }
1.1.1.2 misho 33835: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
33836: } else {
33837: if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
1.1 misho 33838: }
33839:
1.1.1.2 misho 33840: Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
33841: if (opline->extended_value & ZEND_ISSET) {
33842: Z_LVAL(EX_T(opline->result.var).tmp_var) = result;
33843: } else {
33844: Z_LVAL(EX_T(opline->result.var).tmp_var) = !result;
1.1 misho 33845: }
33846:
1.1.1.2 misho 33847: CHECK_EXCEPTION();
1.1 misho 33848: ZEND_VM_NEXT_OPCODE();
33849: }
33850:
33851: static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
33852: {
33853: return zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_VAR(0, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
33854: }
33855:
33856: static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
33857: {
33858: return zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_VAR(1, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
33859: }
33860:
33861: static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_UNUSED(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
33862: {
1.1.1.2 misho 33863: USE_OPLINE
1.1 misho 33864: zend_free_op free_op_data1;
1.1.1.2 misho 33865: zval **object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 33866: zval *object;
33867: zval *property = NULL;
1.1.1.2 misho 33868: zval *value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R);
1.1 misho 33869: int have_get_ptr = 0;
33870:
1.1.1.2 misho 33871: if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 33872: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
33873: }
33874:
33875: make_real_object(object_ptr TSRMLS_CC);
33876: object = *object_ptr;
33877:
1.1.1.2 misho 33878: if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
1.1 misho 33879: zend_error(E_WARNING, "Attempt to assign property of non-object");
33880:
33881: FREE_OP(free_op_data1);
33882:
1.1.1.2 misho 33883: if (RETURN_VALUE_USED(opline)) {
33884: PZVAL_LOCK(&EG(uninitialized_zval));
33885: EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
33886: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 33887: }
33888: } else {
33889: /* here we are sure we are dealing with an object */
33890: if (0) {
33891: MAKE_REAL_ZVAL_PTR(property);
33892: }
33893:
33894: /* here property is a string */
33895: if (opline->extended_value == ZEND_ASSIGN_OBJ
33896: && Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
1.1.1.2 misho 33897: zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_UNUSED == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 33898: if (zptr != NULL) { /* NULL means no success in getting PTR */
33899: SEPARATE_ZVAL_IF_NOT_REF(zptr);
33900:
33901: have_get_ptr = 1;
33902: binary_op(*zptr, *zptr, value TSRMLS_CC);
1.1.1.2 misho 33903: if (RETURN_VALUE_USED(opline)) {
1.1 misho 33904: PZVAL_LOCK(*zptr);
1.1.1.2 misho 33905: EX_T(opline->result.var).var.ptr = *zptr;
33906: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 33907: }
33908: }
33909: }
33910:
33911: if (!have_get_ptr) {
33912: zval *z = NULL;
33913:
33914: if (opline->extended_value == ZEND_ASSIGN_OBJ) {
33915: if (Z_OBJ_HT_P(object)->read_property) {
1.1.1.2 misho 33916: z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_UNUSED == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 33917: }
33918: } else /* if (opline->extended_value == ZEND_ASSIGN_DIM) */ {
33919: if (Z_OBJ_HT_P(object)->read_dimension) {
33920: z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC);
33921: }
33922: }
33923: if (z) {
33924: if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
33925: zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
33926:
33927: if (Z_REFCOUNT_P(z) == 0) {
33928: GC_REMOVE_ZVAL_FROM_BUFFER(z);
33929: zval_dtor(z);
33930: FREE_ZVAL(z);
33931: }
33932: z = value;
33933: }
33934: Z_ADDREF_P(z);
33935: SEPARATE_ZVAL_IF_NOT_REF(&z);
33936: binary_op(z, z, value TSRMLS_CC);
33937: if (opline->extended_value == ZEND_ASSIGN_OBJ) {
1.1.1.2 misho 33938: Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_UNUSED == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 33939: } else /* if (opline->extended_value == ZEND_ASSIGN_DIM) */ {
33940: Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC);
33941: }
1.1.1.2 misho 33942: if (RETURN_VALUE_USED(opline)) {
1.1 misho 33943: PZVAL_LOCK(z);
1.1.1.2 misho 33944: EX_T(opline->result.var).var.ptr = z;
33945: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 33946: }
33947: zval_ptr_dtor(&z);
33948: } else {
33949: zend_error(E_WARNING, "Attempt to assign property of non-object");
1.1.1.2 misho 33950: if (RETURN_VALUE_USED(opline)) {
33951: PZVAL_LOCK(&EG(uninitialized_zval));
33952: EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
33953: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 33954: }
33955: }
33956: }
33957:
33958: if (0) {
33959: zval_ptr_dtor(&property);
33960: } else {
33961:
33962: }
33963: FREE_OP(free_op_data1);
33964: }
33965:
33966: /* assign_obj has two opcodes! */
1.1.1.2 misho 33967: CHECK_EXCEPTION();
1.1 misho 33968: ZEND_VM_INC_OPCODE();
33969: ZEND_VM_NEXT_OPCODE();
33970: }
33971:
33972: static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_UNUSED(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
33973: {
1.1.1.2 misho 33974: USE_OPLINE
1.1 misho 33975: zend_free_op free_op_data2, free_op_data1;
33976: zval **var_ptr;
33977: zval *value;
33978:
1.1.1.2 misho 33979: SAVE_OPLINE();
1.1 misho 33980: switch (opline->extended_value) {
33981: case ZEND_ASSIGN_OBJ:
33982: return zend_binary_assign_op_obj_helper_SPEC_CV_UNUSED(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
33983: break;
33984: case ZEND_ASSIGN_DIM: {
1.1.1.2 misho 33985: zval **container = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 33986:
1.1.1.2 misho 33987: if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 33988: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
1.1.1.2 misho 33989: } else if (UNEXPECTED(Z_TYPE_PP(container) == IS_OBJECT)) {
1.1 misho 33990: if (IS_CV == IS_VAR && !0) {
33991: Z_ADDREF_PP(container); /* undo the effect of get_obj_zval_ptr_ptr() */
33992: }
33993: return zend_binary_assign_op_obj_helper_SPEC_CV_UNUSED(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
33994: } else {
33995: zval *dim = NULL;
33996:
1.1.1.2 misho 33997: zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), container, dim, IS_UNUSED, BP_VAR_RW TSRMLS_CC);
33998: value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R);
33999: var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC);
1.1 misho 34000: }
34001: }
34002: break;
34003: default:
34004: value = NULL;
1.1.1.2 misho 34005: var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 34006: /* do nothing */
34007: break;
34008: }
34009:
1.1.1.2 misho 34010: if (UNEXPECTED(var_ptr == NULL)) {
1.1 misho 34011: zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets");
34012: }
34013:
1.1.1.2 misho 34014: if (UNEXPECTED(*var_ptr == &EG(error_zval))) {
34015: if (RETURN_VALUE_USED(opline)) {
34016: PZVAL_LOCK(&EG(uninitialized_zval));
34017: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
1.1 misho 34018: }
34019:
34020:
1.1.1.2 misho 34021: CHECK_EXCEPTION();
34022: if (opline->extended_value == ZEND_ASSIGN_DIM) {
34023: ZEND_VM_INC_OPCODE();
34024: }
1.1 misho 34025: ZEND_VM_NEXT_OPCODE();
34026: }
34027:
34028: SEPARATE_ZVAL_IF_NOT_REF(var_ptr);
34029:
1.1.1.2 misho 34030: if (UNEXPECTED(Z_TYPE_PP(var_ptr) == IS_OBJECT)
34031: && Z_OBJ_HANDLER_PP(var_ptr, get)
1.1 misho 34032: && Z_OBJ_HANDLER_PP(var_ptr, set)) {
34033: /* proxy object */
34034: zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC);
34035: Z_ADDREF_P(objval);
34036: binary_op(objval, objval, value TSRMLS_CC);
34037: Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC);
34038: zval_ptr_dtor(&objval);
34039: } else {
34040: binary_op(*var_ptr, *var_ptr, value TSRMLS_CC);
34041: }
34042:
1.1.1.2 misho 34043: if (RETURN_VALUE_USED(opline)) {
1.1 misho 34044: PZVAL_LOCK(*var_ptr);
1.1.1.2 misho 34045: AI_SET_PTR(&EX_T(opline->result.var), *var_ptr);
1.1 misho 34046: }
34047:
34048: if (opline->extended_value == ZEND_ASSIGN_DIM) {
34049: FREE_OP(free_op_data1);
34050: FREE_OP_VAR_PTR(free_op_data2);
34051:
1.1.1.2 misho 34052: CHECK_EXCEPTION();
34053: ZEND_VM_INC_OPCODE();
34054: } else {
34055:
34056: CHECK_EXCEPTION();
34057: }
1.1 misho 34058: ZEND_VM_NEXT_OPCODE();
34059: }
34060:
34061: static int ZEND_FASTCALL ZEND_ASSIGN_ADD_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
34062: {
34063: return zend_binary_assign_op_helper_SPEC_CV_UNUSED(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
34064: }
34065:
34066: static int ZEND_FASTCALL ZEND_ASSIGN_SUB_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
34067: {
34068: return zend_binary_assign_op_helper_SPEC_CV_UNUSED(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
34069: }
34070:
34071: static int ZEND_FASTCALL ZEND_ASSIGN_MUL_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
34072: {
34073: return zend_binary_assign_op_helper_SPEC_CV_UNUSED(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
34074: }
34075:
34076: static int ZEND_FASTCALL ZEND_ASSIGN_DIV_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
34077: {
34078: return zend_binary_assign_op_helper_SPEC_CV_UNUSED(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
34079: }
34080:
34081: static int ZEND_FASTCALL ZEND_ASSIGN_MOD_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
34082: {
34083: return zend_binary_assign_op_helper_SPEC_CV_UNUSED(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
34084: }
34085:
34086: static int ZEND_FASTCALL ZEND_ASSIGN_SL_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
34087: {
34088: return zend_binary_assign_op_helper_SPEC_CV_UNUSED(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
34089: }
34090:
34091: static int ZEND_FASTCALL ZEND_ASSIGN_SR_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
34092: {
34093: return zend_binary_assign_op_helper_SPEC_CV_UNUSED(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
34094: }
34095:
34096: static int ZEND_FASTCALL ZEND_ASSIGN_CONCAT_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
34097: {
34098: return zend_binary_assign_op_helper_SPEC_CV_UNUSED(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
34099: }
34100:
34101: static int ZEND_FASTCALL ZEND_ASSIGN_BW_OR_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
34102: {
34103: return zend_binary_assign_op_helper_SPEC_CV_UNUSED(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
34104: }
34105:
34106: static int ZEND_FASTCALL ZEND_ASSIGN_BW_AND_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
34107: {
34108: return zend_binary_assign_op_helper_SPEC_CV_UNUSED(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
34109: }
34110:
34111: static int ZEND_FASTCALL ZEND_ASSIGN_BW_XOR_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
34112: {
34113: return zend_binary_assign_op_helper_SPEC_CV_UNUSED(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
34114: }
34115:
1.1.1.2 misho 34116: static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_UNUSED(int type, ZEND_OPCODE_HANDLER_ARGS)
34117: {
34118: USE_OPLINE
34119: zend_free_op free_op1;
34120: zval *varname;
34121: zval **retval;
34122: zval tmp_varname;
34123: HashTable *target_symbol_table;
34124: ulong hash_value;
34125:
34126: SAVE_OPLINE();
34127: varname = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
34128:
34129: if (IS_CV != IS_CONST && UNEXPECTED(Z_TYPE_P(varname) != IS_STRING)) {
34130: ZVAL_COPY_VALUE(&tmp_varname, varname);
34131: zval_copy_ctor(&tmp_varname);
34132: Z_SET_REFCOUNT(tmp_varname, 1);
34133: Z_UNSET_ISREF(tmp_varname);
34134: convert_to_string(&tmp_varname);
34135: varname = &tmp_varname;
34136: }
34137:
34138: if (IS_UNUSED != IS_UNUSED) {
34139: zend_class_entry *ce;
34140:
34141: if (IS_UNUSED == IS_CONST) {
34142: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
34143: ce = CACHED_PTR(opline->op2.literal->cache_slot);
34144: } else {
34145: ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
34146: if (UNEXPECTED(ce == NULL)) {
34147: if (IS_CV != IS_CONST && varname == &tmp_varname) {
34148: zval_dtor(&tmp_varname);
34149: }
34150:
34151: CHECK_EXCEPTION();
34152: ZEND_VM_NEXT_OPCODE();
34153: }
34154: CACHE_PTR(opline->op2.literal->cache_slot, ce);
34155: }
34156: } else {
34157: ce = EX_T(opline->op2.var).class_entry;
34158: }
34159: retval = zend_std_get_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 0, ((IS_CV == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
34160:
34161: } else {
34162: target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
34163: /*
34164: if (!target_symbol_table) {
34165: CHECK_EXCEPTION();
34166: ZEND_VM_NEXT_OPCODE();
34167: }
34168: */
34169: if (IS_CV == IS_CONST) {
34170: hash_value = Z_HASH_P(varname);
34171: } else if (IS_INTERNED(Z_STRVAL_P(varname))) {
34172: hash_value = INTERNED_HASH(Z_STRVAL_P(varname));
34173: } else {
34174: hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1);
34175: }
34176:
34177: if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) {
34178: switch (type) {
34179: case BP_VAR_R:
34180: case BP_VAR_UNSET:
34181: zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_P(varname));
34182: /* break missing intentionally */
34183: case BP_VAR_IS:
34184: retval = &EG(uninitialized_zval_ptr);
34185: break;
34186: case BP_VAR_RW:
34187: zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_P(varname));
34188: /* break missing intentionally */
34189: case BP_VAR_W:
34190: Z_ADDREF_P(&EG(uninitialized_zval));
34191: zend_hash_quick_update(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, &EG(uninitialized_zval_ptr), sizeof(zval *), (void **) &retval);
34192: break;
34193: EMPTY_SWITCH_DEFAULT_CASE()
34194: }
34195: }
34196: switch (opline->extended_value & ZEND_FETCH_TYPE_MASK) {
34197: case ZEND_FETCH_GLOBAL:
34198: if (IS_CV != IS_TMP_VAR) {
34199:
34200: }
34201: break;
34202: case ZEND_FETCH_LOCAL:
34203:
34204: break;
34205: case ZEND_FETCH_STATIC:
34206: zval_update_constant(retval, (void*) 1 TSRMLS_CC);
34207: break;
34208: case ZEND_FETCH_GLOBAL_LOCK:
34209: if (IS_CV == IS_VAR && !free_op1.var) {
34210: PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
34211: }
34212: break;
34213: }
34214: }
34215:
34216:
34217: if (IS_CV != IS_CONST && varname == &tmp_varname) {
34218: zval_dtor(&tmp_varname);
34219: }
34220: if (opline->extended_value & ZEND_FETCH_MAKE_REF) {
34221: SEPARATE_ZVAL_TO_MAKE_IS_REF(retval);
34222: }
34223: PZVAL_LOCK(*retval);
34224: switch (type) {
34225: case BP_VAR_R:
34226: case BP_VAR_IS:
34227: AI_SET_PTR(&EX_T(opline->result.var), *retval);
34228: break;
34229: case BP_VAR_UNSET: {
34230: zend_free_op free_res;
34231:
34232: PZVAL_UNLOCK(*retval, &free_res);
34233: if (retval != &EG(uninitialized_zval_ptr)) {
34234: SEPARATE_ZVAL_IF_NOT_REF(retval);
34235: }
34236: PZVAL_LOCK(*retval);
34237: FREE_OP_VAR_PTR(free_res);
34238: }
34239: /* break missing intentionally */
34240: default:
34241: EX_T(opline->result.var).var.ptr_ptr = retval;
34242: break;
34243: }
34244: CHECK_EXCEPTION();
34245: ZEND_VM_NEXT_OPCODE();
34246: }
34247:
34248: static int ZEND_FASTCALL ZEND_FETCH_R_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
34249: {
34250: return zend_fetch_var_address_helper_SPEC_CV_UNUSED(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
34251: }
34252:
34253: static int ZEND_FASTCALL ZEND_FETCH_W_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
34254: {
34255: return zend_fetch_var_address_helper_SPEC_CV_UNUSED(BP_VAR_W, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
34256: }
34257:
34258: static int ZEND_FASTCALL ZEND_FETCH_RW_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
34259: {
34260: return zend_fetch_var_address_helper_SPEC_CV_UNUSED(BP_VAR_RW, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
34261: }
34262:
34263: static int ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
34264: {
34265: USE_OPLINE
34266:
34267: return zend_fetch_var_address_helper_SPEC_CV_UNUSED(ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
34268: }
34269:
34270: static int ZEND_FASTCALL ZEND_FETCH_UNSET_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
34271: {
34272: return zend_fetch_var_address_helper_SPEC_CV_UNUSED(BP_VAR_UNSET, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
34273: }
34274:
34275: static int ZEND_FASTCALL ZEND_FETCH_IS_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
34276: {
34277: return zend_fetch_var_address_helper_SPEC_CV_UNUSED(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
34278: }
34279:
1.1 misho 34280: static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
34281: {
1.1.1.2 misho 34282: USE_OPLINE
1.1 misho 34283: zend_free_op free_op1;
1.1.1.2 misho 34284: zval **container;
34285:
34286: SAVE_OPLINE();
34287: container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 34288:
1.1.1.2 misho 34289: if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 34290: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
34291: }
1.1.1.2 misho 34292: zend_fetch_dimension_address(&EX_T(opline->result.var), container, NULL, IS_UNUSED, BP_VAR_W TSRMLS_CC);
1.1 misho 34293:
1.1.1.2 misho 34294: if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
34295: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 34296: }
34297:
34298: /* We are going to assign the result by reference */
1.1.1.2 misho 34299: if (UNEXPECTED(opline->extended_value != 0)) {
34300: zval **retval_ptr = EX_T(opline->result.var).var.ptr_ptr;
34301:
34302: if (retval_ptr) {
34303: Z_DELREF_PP(retval_ptr);
34304: SEPARATE_ZVAL_TO_MAKE_IS_REF(retval_ptr);
34305: Z_ADDREF_PP(retval_ptr);
34306: }
1.1 misho 34307: }
34308:
1.1.1.2 misho 34309: CHECK_EXCEPTION();
1.1 misho 34310: ZEND_VM_NEXT_OPCODE();
34311: }
34312:
34313: static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
34314: {
1.1.1.2 misho 34315: USE_OPLINE
1.1 misho 34316: zend_free_op free_op1;
1.1.1.2 misho 34317: zval **container;
1.1 misho 34318:
1.1.1.2 misho 34319: SAVE_OPLINE();
34320: container = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC);
34321:
34322: if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 34323: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
34324: }
1.1.1.2 misho 34325: zend_fetch_dimension_address(&EX_T(opline->result.var), container, NULL, IS_UNUSED, BP_VAR_RW TSRMLS_CC);
1.1 misho 34326:
1.1.1.2 misho 34327: if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
34328: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 34329: }
34330:
1.1.1.2 misho 34331: CHECK_EXCEPTION();
1.1 misho 34332: ZEND_VM_NEXT_OPCODE();
34333: }
34334:
34335: static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
34336: {
1.1.1.2 misho 34337: USE_OPLINE
1.1 misho 34338: zend_free_op free_op1;
34339: zval **container;
34340:
1.1.1.2 misho 34341: SAVE_OPLINE();
34342:
34343: if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
34344: container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC);
34345: if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 34346: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
34347: }
1.1.1.2 misho 34348: zend_fetch_dimension_address(&EX_T(opline->result.var), container, NULL, IS_UNUSED, BP_VAR_W TSRMLS_CC);
34349: if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
34350: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 34351: }
34352: } else {
34353: if (IS_UNUSED == IS_UNUSED) {
34354: zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
34355: }
1.1.1.2 misho 34356: container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
34357: zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, NULL, IS_UNUSED, BP_VAR_R TSRMLS_CC);
1.1 misho 34358: }
34359:
34360:
1.1.1.2 misho 34361: CHECK_EXCEPTION();
1.1 misho 34362: ZEND_VM_NEXT_OPCODE();
34363: }
34364:
34365: static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
34366: {
1.1.1.2 misho 34367: USE_OPLINE
1.1 misho 34368:
1.1.1.2 misho 34369: zval **object_ptr;
1.1 misho 34370:
1.1.1.2 misho 34371: SAVE_OPLINE();
34372: object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC);
34373:
34374: if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 34375: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
34376: }
34377: if (Z_TYPE_PP(object_ptr) == IS_OBJECT) {
34378:
34379: zval *property_name = NULL;
34380:
34381: if (0) {
34382: MAKE_REAL_ZVAL_PTR(property_name);
34383: }
1.1.1.2 misho 34384: zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), ZEND_ASSIGN_DIM, ((IS_UNUSED == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 34385: if (0) {
34386: zval_ptr_dtor(&property_name);
34387: } else {
34388:
34389: }
34390: } else {
34391: zend_free_op free_op_data1, free_op_data2;
34392: zval *value;
34393: zval *dim = NULL;
34394: zval **variable_ptr_ptr;
34395:
1.1.1.2 misho 34396: zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), object_ptr, dim, IS_UNUSED, BP_VAR_W TSRMLS_CC);
34397:
34398: value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R);
34399: variable_ptr_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC);
34400: if (UNEXPECTED(variable_ptr_ptr == NULL)) {
34401: if (zend_assign_to_string_offset(&EX_T((opline+1)->op2.var), value, (opline+1)->op1_type TSRMLS_CC)) {
34402: if (RETURN_VALUE_USED(opline)) {
34403: zval *retval;
1.1 misho 34404:
1.1.1.2 misho 34405: ALLOC_ZVAL(retval);
34406: ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T((opline+1)->op2.var).str_offset.str)+EX_T((opline+1)->op2.var).str_offset.offset, 1, 1);
34407: INIT_PZVAL(retval);
34408: AI_SET_PTR(&EX_T(opline->result.var), retval);
34409: }
34410: } else if (RETURN_VALUE_USED(opline)) {
34411: PZVAL_LOCK(&EG(uninitialized_zval));
34412: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
34413: }
34414: } else if (UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) {
34415: if (IS_TMP_FREE(free_op_data1)) {
34416: zval_dtor(value);
34417: }
34418: if (RETURN_VALUE_USED(opline)) {
34419: PZVAL_LOCK(&EG(uninitialized_zval));
34420: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
34421: }
34422: } else {
34423: if ((opline+1)->op1_type == IS_TMP_VAR) {
34424: value = zend_assign_tmp_to_variable(variable_ptr_ptr, value TSRMLS_CC);
34425: } else if ((opline+1)->op1_type == IS_CONST) {
34426: value = zend_assign_const_to_variable(variable_ptr_ptr, value TSRMLS_CC);
34427: } else {
34428: value = zend_assign_to_variable(variable_ptr_ptr, value TSRMLS_CC);
34429: }
34430: if (RETURN_VALUE_USED(opline)) {
1.1 misho 34431: PZVAL_LOCK(value);
1.1.1.2 misho 34432: AI_SET_PTR(&EX_T(opline->result.var), value);
1.1 misho 34433: }
34434: }
34435: FREE_OP_VAR_PTR(free_op_data2);
34436: FREE_OP_IF_VAR(free_op_data1);
34437: }
34438:
34439: /* assign_dim has two opcodes! */
1.1.1.2 misho 34440: CHECK_EXCEPTION();
1.1 misho 34441: ZEND_VM_INC_OPCODE();
34442: ZEND_VM_NEXT_OPCODE();
34443: }
34444:
34445: static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
34446: {
1.1.1.2 misho 34447: USE_OPLINE
1.1 misho 34448:
34449: zval *expr_ptr;
34450:
1.1.1.2 misho 34451: SAVE_OPLINE();
34452: if ((IS_CV == IS_VAR || IS_CV == IS_CV) && opline->extended_value) {
34453: zval **expr_ptr_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 34454:
1.1.1.2 misho 34455: if (IS_CV == IS_VAR && UNEXPECTED(expr_ptr_ptr == NULL)) {
34456: zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
34457: }
34458: SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr);
1.1 misho 34459: expr_ptr = *expr_ptr_ptr;
1.1.1.2 misho 34460: Z_ADDREF_P(expr_ptr);
1.1 misho 34461: } else {
1.1.1.2 misho 34462: expr_ptr=_get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
34463: if (0) { /* temporary variable */
34464: zval *new_expr;
1.1 misho 34465:
1.1.1.2 misho 34466: ALLOC_ZVAL(new_expr);
34467: INIT_PZVAL_COPY(new_expr, expr_ptr);
34468: expr_ptr = new_expr;
34469: } else if (IS_CV == IS_CONST || PZVAL_IS_REF(expr_ptr)) {
1.1 misho 34470: zval *new_expr;
34471:
34472: ALLOC_ZVAL(new_expr);
34473: INIT_PZVAL_COPY(new_expr, expr_ptr);
34474: expr_ptr = new_expr;
34475: zendi_zval_copy_ctor(*expr_ptr);
34476: } else {
34477: Z_ADDREF_P(expr_ptr);
34478: }
34479: }
1.1.1.2 misho 34480:
34481: if (IS_UNUSED != IS_UNUSED) {
34482:
34483: zval *offset = NULL;
34484: ulong hval;
34485:
1.1 misho 34486: switch (Z_TYPE_P(offset)) {
34487: case IS_DOUBLE:
1.1.1.2 misho 34488: hval = zend_dval_to_lval(Z_DVAL_P(offset));
34489: goto num_index;
1.1 misho 34490: case IS_LONG:
34491: case IS_BOOL:
1.1.1.2 misho 34492: hval = Z_LVAL_P(offset);
34493: num_index:
34494: zend_hash_index_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), hval, &expr_ptr, sizeof(zval *), NULL);
1.1 misho 34495: break;
34496: case IS_STRING:
1.1.1.2 misho 34497: if (IS_UNUSED == IS_CONST) {
34498: hval = Z_HASH_P(offset);
34499: } else {
34500: ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
34501: if (IS_INTERNED(Z_STRVAL_P(offset))) {
34502: hval = INTERNED_HASH(Z_STRVAL_P(offset));
34503: } else {
34504: hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
34505: }
34506: }
34507: zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
1.1 misho 34508: break;
34509: case IS_NULL:
1.1.1.2 misho 34510: zend_hash_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
1.1 misho 34511: break;
34512: default:
34513: zend_error(E_WARNING, "Illegal offset type");
34514: zval_ptr_dtor(&expr_ptr);
34515: /* do nothing */
34516: break;
34517: }
34518:
34519: } else {
1.1.1.2 misho 34520: zend_hash_next_index_insert(Z_ARRVAL(EX_T(opline->result.var).tmp_var), &expr_ptr, sizeof(zval *), NULL);
1.1 misho 34521: }
1.1.1.2 misho 34522: if ((IS_CV == IS_VAR || IS_CV == IS_CV) && opline->extended_value) {
1.1 misho 34523:
34524: } else {
34525:
34526: }
1.1.1.2 misho 34527: CHECK_EXCEPTION();
1.1 misho 34528: ZEND_VM_NEXT_OPCODE();
34529: }
34530:
34531: static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
34532: {
1.1.1.2 misho 34533: USE_OPLINE
1.1 misho 34534:
1.1.1.2 misho 34535: array_init(&EX_T(opline->result.var).tmp_var);
1.1 misho 34536: if (IS_CV == IS_UNUSED) {
34537: ZEND_VM_NEXT_OPCODE();
34538: #if 0 || IS_CV != IS_UNUSED
34539: } else {
34540: return ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
34541: #endif
34542: }
34543: }
34544:
1.1.1.2 misho 34545: static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
34546: {
34547: USE_OPLINE
34548: zval tmp, *varname;
34549: HashTable *target_symbol_table;
34550:
34551:
34552: SAVE_OPLINE();
34553: if (IS_CV == IS_CV &&
34554: IS_UNUSED == IS_UNUSED &&
34555: (opline->extended_value & ZEND_QUICK_SET)) {
34556: if (EG(active_symbol_table)) {
34557: zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.var);
34558:
34559: zend_delete_variable(EX(prev_execute_data), EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value TSRMLS_CC);
34560: EX_CV(opline->op1.var) = NULL;
34561: } else if (EX_CV(opline->op1.var)) {
34562: zval_ptr_dtor(EX_CV(opline->op1.var));
34563: EX_CV(opline->op1.var) = NULL;
34564: }
34565: CHECK_EXCEPTION();
34566: ZEND_VM_NEXT_OPCODE();
34567: }
34568:
34569: varname = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
34570:
34571: if (IS_CV != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
34572: ZVAL_COPY_VALUE(&tmp, varname);
34573: zval_copy_ctor(&tmp);
34574: convert_to_string(&tmp);
34575: varname = &tmp;
34576: } else if (IS_CV == IS_VAR || IS_CV == IS_CV) {
34577: Z_ADDREF_P(varname);
34578: }
34579:
34580: if (IS_UNUSED != IS_UNUSED) {
34581: zend_class_entry *ce;
34582:
34583: if (IS_UNUSED == IS_CONST) {
34584: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
34585: ce = CACHED_PTR(opline->op2.literal->cache_slot);
34586: } else {
34587: ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
1.1.1.4 ! misho 34588: if (UNEXPECTED(EG(exception) != NULL)) {
1.1.1.2 misho 34589: if (IS_CV != IS_CONST && varname == &tmp) {
34590: zval_dtor(&tmp);
34591: } else if (IS_CV == IS_VAR || IS_CV == IS_CV) {
34592: zval_ptr_dtor(&varname);
34593: }
34594:
1.1.1.4 ! misho 34595: HANDLE_EXCEPTION();
! 34596: }
! 34597: if (UNEXPECTED(ce == NULL)) {
! 34598: zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op2.zv));
1.1.1.2 misho 34599: }
34600: CACHE_PTR(opline->op2.literal->cache_slot, ce);
34601: }
34602: } else {
34603: ce = EX_T(opline->op2.var).class_entry;
34604: }
34605: zend_std_unset_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), ((IS_CV == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
34606: } else {
34607: ulong hash_value = zend_inline_hash_func(varname->value.str.val, varname->value.str.len+1);
34608:
34609: target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
34610: zend_delete_variable(execute_data, target_symbol_table, varname->value.str.val, varname->value.str.len+1, hash_value TSRMLS_CC);
34611: }
34612:
34613: if (IS_CV != IS_CONST && varname == &tmp) {
34614: zval_dtor(&tmp);
34615: } else if (IS_CV == IS_VAR || IS_CV == IS_CV) {
34616: zval_ptr_dtor(&varname);
34617: }
34618:
34619: CHECK_EXCEPTION();
34620: ZEND_VM_NEXT_OPCODE();
34621: }
34622:
34623: static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
34624: {
34625: USE_OPLINE
34626: zval **value;
34627: zend_bool isset = 1;
34628:
34629: SAVE_OPLINE();
34630: if (IS_CV == IS_CV &&
34631: IS_UNUSED == IS_UNUSED &&
34632: (opline->extended_value & ZEND_QUICK_SET)) {
34633: if (EX_CV(opline->op1.var)) {
34634: value = EX_CV(opline->op1.var);
34635: } else if (EG(active_symbol_table)) {
34636: zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.var);
34637:
34638: if (zend_hash_quick_find(EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value, (void **) &value) == FAILURE) {
34639: isset = 0;
34640: }
34641: } else {
34642: isset = 0;
34643: }
34644: } else {
34645: HashTable *target_symbol_table;
34646:
34647: zval tmp, *varname = _get_zval_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC);
34648:
34649: if (IS_CV != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
34650: ZVAL_COPY_VALUE(&tmp, varname);
34651: zval_copy_ctor(&tmp);
34652: convert_to_string(&tmp);
34653: varname = &tmp;
34654: }
34655:
34656: if (IS_UNUSED != IS_UNUSED) {
34657: zend_class_entry *ce;
34658:
34659: if (IS_UNUSED == IS_CONST) {
34660: if (CACHED_PTR(opline->op2.literal->cache_slot)) {
34661: ce = CACHED_PTR(opline->op2.literal->cache_slot);
34662: } else {
34663: ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
34664: if (UNEXPECTED(ce == NULL)) {
34665: CHECK_EXCEPTION();
34666: ZEND_VM_NEXT_OPCODE();
34667: }
34668: CACHE_PTR(opline->op2.literal->cache_slot, ce);
34669: }
34670: } else {
34671: ce = EX_T(opline->op2.var).class_entry;
34672: }
34673: value = zend_std_get_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 1, ((IS_CV == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
34674: if (!value) {
34675: isset = 0;
34676: }
34677: } else {
34678: target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
34679: if (zend_hash_find(target_symbol_table, varname->value.str.val, varname->value.str.len+1, (void **) &value) == FAILURE) {
34680: isset = 0;
34681: }
34682: }
34683:
34684: if (IS_CV != IS_CONST && varname == &tmp) {
34685: zval_dtor(&tmp);
34686: }
34687:
34688: }
34689:
34690: if (opline->extended_value & ZEND_ISSET) {
34691: if (isset && Z_TYPE_PP(value) != IS_NULL) {
34692: ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 1);
34693: } else {
34694: ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
34695: }
34696: } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
34697: if (!isset || !i_zend_is_true(*value)) {
34698: ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 1);
34699: } else {
34700: ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
34701: }
34702: }
34703:
34704: CHECK_EXCEPTION();
34705: ZEND_VM_NEXT_OPCODE();
34706: }
34707:
1.1 misho 34708: static int ZEND_FASTCALL ZEND_ADD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
34709: {
1.1.1.2 misho 34710: USE_OPLINE
1.1 misho 34711:
34712:
1.1.1.2 misho 34713: SAVE_OPLINE();
34714: fast_add_function(&EX_T(opline->result.var).tmp_var,
34715: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
34716: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
1.1 misho 34717:
34718:
1.1.1.2 misho 34719: CHECK_EXCEPTION();
1.1 misho 34720: ZEND_VM_NEXT_OPCODE();
34721: }
34722:
34723: static int ZEND_FASTCALL ZEND_SUB_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
34724: {
1.1.1.2 misho 34725: USE_OPLINE
1.1 misho 34726:
34727:
1.1.1.2 misho 34728: SAVE_OPLINE();
34729: fast_sub_function(&EX_T(opline->result.var).tmp_var,
34730: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
34731: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
1.1 misho 34732:
34733:
1.1.1.2 misho 34734: CHECK_EXCEPTION();
1.1 misho 34735: ZEND_VM_NEXT_OPCODE();
34736: }
34737:
34738: static int ZEND_FASTCALL ZEND_MUL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
34739: {
1.1.1.2 misho 34740: USE_OPLINE
1.1 misho 34741:
34742:
1.1.1.2 misho 34743: SAVE_OPLINE();
34744: fast_mul_function(&EX_T(opline->result.var).tmp_var,
34745: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
34746: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
1.1 misho 34747:
34748:
1.1.1.2 misho 34749: CHECK_EXCEPTION();
1.1 misho 34750: ZEND_VM_NEXT_OPCODE();
34751: }
34752:
34753: static int ZEND_FASTCALL ZEND_DIV_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
34754: {
1.1.1.2 misho 34755: USE_OPLINE
1.1 misho 34756:
34757:
1.1.1.2 misho 34758: SAVE_OPLINE();
34759: fast_div_function(&EX_T(opline->result.var).tmp_var,
34760: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
34761: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
1.1 misho 34762:
34763:
1.1.1.2 misho 34764: CHECK_EXCEPTION();
1.1 misho 34765: ZEND_VM_NEXT_OPCODE();
34766: }
34767:
34768: static int ZEND_FASTCALL ZEND_MOD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
34769: {
1.1.1.2 misho 34770: USE_OPLINE
1.1 misho 34771:
34772:
1.1.1.2 misho 34773: SAVE_OPLINE();
34774: fast_mod_function(&EX_T(opline->result.var).tmp_var,
34775: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
34776: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
1.1 misho 34777:
34778:
1.1.1.2 misho 34779: CHECK_EXCEPTION();
1.1 misho 34780: ZEND_VM_NEXT_OPCODE();
34781: }
34782:
34783: static int ZEND_FASTCALL ZEND_SL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
34784: {
1.1.1.2 misho 34785: USE_OPLINE
1.1 misho 34786:
34787:
1.1.1.2 misho 34788: SAVE_OPLINE();
34789: shift_left_function(&EX_T(opline->result.var).tmp_var,
34790: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
34791: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
1.1 misho 34792:
34793:
1.1.1.2 misho 34794: CHECK_EXCEPTION();
1.1 misho 34795: ZEND_VM_NEXT_OPCODE();
34796: }
34797:
34798: static int ZEND_FASTCALL ZEND_SR_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
34799: {
1.1.1.2 misho 34800: USE_OPLINE
1.1 misho 34801:
34802:
1.1.1.2 misho 34803: SAVE_OPLINE();
34804: shift_right_function(&EX_T(opline->result.var).tmp_var,
34805: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
34806: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
1.1 misho 34807:
34808:
1.1.1.2 misho 34809: CHECK_EXCEPTION();
1.1 misho 34810: ZEND_VM_NEXT_OPCODE();
34811: }
34812:
34813: static int ZEND_FASTCALL ZEND_CONCAT_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
34814: {
1.1.1.2 misho 34815: USE_OPLINE
1.1 misho 34816:
34817:
1.1.1.2 misho 34818: SAVE_OPLINE();
34819: concat_function(&EX_T(opline->result.var).tmp_var,
34820: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
34821: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
1.1 misho 34822:
34823:
1.1.1.2 misho 34824: CHECK_EXCEPTION();
1.1 misho 34825: ZEND_VM_NEXT_OPCODE();
34826: }
34827:
34828: static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
34829: {
1.1.1.2 misho 34830: USE_OPLINE
1.1 misho 34831:
34832:
1.1.1.2 misho 34833: SAVE_OPLINE();
34834: is_identical_function(&EX_T(opline->result.var).tmp_var,
34835: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
34836: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
1.1 misho 34837:
34838:
1.1.1.2 misho 34839: CHECK_EXCEPTION();
1.1 misho 34840: ZEND_VM_NEXT_OPCODE();
34841: }
34842:
34843: static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
34844: {
1.1.1.2 misho 34845: USE_OPLINE
1.1 misho 34846:
1.1.1.2 misho 34847: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 34848:
1.1.1.2 misho 34849: SAVE_OPLINE();
1.1 misho 34850: is_identical_function(result,
1.1.1.2 misho 34851: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
34852: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
1.1 misho 34853: Z_LVAL_P(result) = !Z_LVAL_P(result);
34854:
34855:
1.1.1.2 misho 34856: CHECK_EXCEPTION();
1.1 misho 34857: ZEND_VM_NEXT_OPCODE();
34858: }
34859:
34860: static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
34861: {
1.1.1.2 misho 34862: USE_OPLINE
1.1 misho 34863:
1.1.1.2 misho 34864: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 34865:
1.1.1.2 misho 34866: SAVE_OPLINE();
34867: ZVAL_BOOL(result, fast_equal_function(result,
34868: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
34869: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC));
1.1 misho 34870:
34871:
1.1.1.2 misho 34872: CHECK_EXCEPTION();
1.1 misho 34873: ZEND_VM_NEXT_OPCODE();
34874: }
34875:
34876: static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
34877: {
1.1.1.2 misho 34878: USE_OPLINE
1.1 misho 34879:
1.1.1.2 misho 34880: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 34881:
1.1.1.2 misho 34882: SAVE_OPLINE();
34883: ZVAL_BOOL(result, fast_not_equal_function(result,
34884: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
34885: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC));
1.1 misho 34886:
34887:
1.1.1.2 misho 34888: CHECK_EXCEPTION();
1.1 misho 34889: ZEND_VM_NEXT_OPCODE();
34890: }
34891:
34892: static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
34893: {
1.1.1.2 misho 34894: USE_OPLINE
1.1 misho 34895:
1.1.1.2 misho 34896: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 34897:
1.1.1.2 misho 34898: SAVE_OPLINE();
34899: ZVAL_BOOL(result, fast_is_smaller_function(result,
34900: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
34901: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC));
1.1 misho 34902:
34903:
1.1.1.2 misho 34904: CHECK_EXCEPTION();
1.1 misho 34905: ZEND_VM_NEXT_OPCODE();
34906: }
34907:
34908: static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
34909: {
1.1.1.2 misho 34910: USE_OPLINE
1.1 misho 34911:
1.1.1.2 misho 34912: zval *result = &EX_T(opline->result.var).tmp_var;
1.1 misho 34913:
1.1.1.2 misho 34914: SAVE_OPLINE();
34915: ZVAL_BOOL(result, fast_is_smaller_or_equal_function(result,
34916: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
34917: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC));
1.1 misho 34918:
34919:
1.1.1.2 misho 34920: CHECK_EXCEPTION();
1.1 misho 34921: ZEND_VM_NEXT_OPCODE();
34922: }
34923:
34924: static int ZEND_FASTCALL ZEND_BW_OR_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
34925: {
1.1.1.2 misho 34926: USE_OPLINE
1.1 misho 34927:
34928:
1.1.1.2 misho 34929: SAVE_OPLINE();
34930: bitwise_or_function(&EX_T(opline->result.var).tmp_var,
34931: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
34932: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
1.1 misho 34933:
34934:
1.1.1.2 misho 34935: CHECK_EXCEPTION();
1.1 misho 34936: ZEND_VM_NEXT_OPCODE();
34937: }
34938:
34939: static int ZEND_FASTCALL ZEND_BW_AND_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
34940: {
1.1.1.2 misho 34941: USE_OPLINE
1.1 misho 34942:
34943:
1.1.1.2 misho 34944: SAVE_OPLINE();
34945: bitwise_and_function(&EX_T(opline->result.var).tmp_var,
34946: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
34947: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
1.1 misho 34948:
34949:
1.1.1.2 misho 34950: CHECK_EXCEPTION();
1.1 misho 34951: ZEND_VM_NEXT_OPCODE();
34952: }
34953:
34954: static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
34955: {
1.1.1.2 misho 34956: USE_OPLINE
1.1 misho 34957:
34958:
1.1.1.2 misho 34959: SAVE_OPLINE();
34960: bitwise_xor_function(&EX_T(opline->result.var).tmp_var,
34961: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
34962: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
1.1 misho 34963:
34964:
1.1.1.2 misho 34965: CHECK_EXCEPTION();
1.1 misho 34966: ZEND_VM_NEXT_OPCODE();
34967: }
34968:
34969: static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
34970: {
1.1.1.2 misho 34971: USE_OPLINE
1.1 misho 34972:
34973:
1.1.1.2 misho 34974: SAVE_OPLINE();
34975: boolean_xor_function(&EX_T(opline->result.var).tmp_var,
34976: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
34977: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
1.1 misho 34978:
34979:
1.1.1.2 misho 34980: CHECK_EXCEPTION();
1.1 misho 34981: ZEND_VM_NEXT_OPCODE();
34982: }
34983:
34984: static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CV(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
34985: {
1.1.1.2 misho 34986: USE_OPLINE
1.1 misho 34987: zend_free_op free_op_data1;
1.1.1.2 misho 34988: zval **object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 34989: zval *object;
1.1.1.2 misho 34990: zval *property = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
34991: zval *value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R);
1.1 misho 34992: int have_get_ptr = 0;
34993:
1.1.1.2 misho 34994: if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 34995: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
34996: }
34997:
34998: make_real_object(object_ptr TSRMLS_CC);
34999: object = *object_ptr;
35000:
1.1.1.2 misho 35001: if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
1.1 misho 35002: zend_error(E_WARNING, "Attempt to assign property of non-object");
35003:
35004: FREE_OP(free_op_data1);
35005:
1.1.1.2 misho 35006: if (RETURN_VALUE_USED(opline)) {
35007: PZVAL_LOCK(&EG(uninitialized_zval));
35008: EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
35009: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 35010: }
35011: } else {
35012: /* here we are sure we are dealing with an object */
35013: if (0) {
35014: MAKE_REAL_ZVAL_PTR(property);
35015: }
35016:
35017: /* here property is a string */
35018: if (opline->extended_value == ZEND_ASSIGN_OBJ
35019: && Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
1.1.1.2 misho 35020: zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 35021: if (zptr != NULL) { /* NULL means no success in getting PTR */
35022: SEPARATE_ZVAL_IF_NOT_REF(zptr);
35023:
35024: have_get_ptr = 1;
35025: binary_op(*zptr, *zptr, value TSRMLS_CC);
1.1.1.2 misho 35026: if (RETURN_VALUE_USED(opline)) {
1.1 misho 35027: PZVAL_LOCK(*zptr);
1.1.1.2 misho 35028: EX_T(opline->result.var).var.ptr = *zptr;
35029: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 35030: }
35031: }
35032: }
35033:
35034: if (!have_get_ptr) {
35035: zval *z = NULL;
35036:
35037: if (opline->extended_value == ZEND_ASSIGN_OBJ) {
35038: if (Z_OBJ_HT_P(object)->read_property) {
1.1.1.2 misho 35039: z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 35040: }
35041: } else /* if (opline->extended_value == ZEND_ASSIGN_DIM) */ {
35042: if (Z_OBJ_HT_P(object)->read_dimension) {
35043: z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC);
35044: }
35045: }
35046: if (z) {
35047: if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
35048: zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
35049:
35050: if (Z_REFCOUNT_P(z) == 0) {
35051: GC_REMOVE_ZVAL_FROM_BUFFER(z);
35052: zval_dtor(z);
35053: FREE_ZVAL(z);
35054: }
35055: z = value;
35056: }
35057: Z_ADDREF_P(z);
35058: SEPARATE_ZVAL_IF_NOT_REF(&z);
35059: binary_op(z, z, value TSRMLS_CC);
35060: if (opline->extended_value == ZEND_ASSIGN_OBJ) {
1.1.1.2 misho 35061: Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 35062: } else /* if (opline->extended_value == ZEND_ASSIGN_DIM) */ {
35063: Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC);
35064: }
1.1.1.2 misho 35065: if (RETURN_VALUE_USED(opline)) {
1.1 misho 35066: PZVAL_LOCK(z);
1.1.1.2 misho 35067: EX_T(opline->result.var).var.ptr = z;
35068: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 35069: }
35070: zval_ptr_dtor(&z);
35071: } else {
35072: zend_error(E_WARNING, "Attempt to assign property of non-object");
1.1.1.2 misho 35073: if (RETURN_VALUE_USED(opline)) {
35074: PZVAL_LOCK(&EG(uninitialized_zval));
35075: EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
35076: EX_T(opline->result.var).var.ptr_ptr = NULL;
1.1 misho 35077: }
35078: }
35079: }
35080:
35081: if (0) {
35082: zval_ptr_dtor(&property);
35083: } else {
35084:
35085: }
35086: FREE_OP(free_op_data1);
35087: }
35088:
35089: /* assign_obj has two opcodes! */
1.1.1.2 misho 35090: CHECK_EXCEPTION();
1.1 misho 35091: ZEND_VM_INC_OPCODE();
35092: ZEND_VM_NEXT_OPCODE();
35093: }
35094:
35095: static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_CV(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
35096: {
1.1.1.2 misho 35097: USE_OPLINE
1.1 misho 35098: zend_free_op free_op_data2, free_op_data1;
35099: zval **var_ptr;
35100: zval *value;
35101:
1.1.1.2 misho 35102: SAVE_OPLINE();
1.1 misho 35103: switch (opline->extended_value) {
35104: case ZEND_ASSIGN_OBJ:
35105: return zend_binary_assign_op_obj_helper_SPEC_CV_CV(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
35106: break;
35107: case ZEND_ASSIGN_DIM: {
1.1.1.2 misho 35108: zval **container = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 35109:
1.1.1.2 misho 35110: if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 35111: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
1.1.1.2 misho 35112: } else if (UNEXPECTED(Z_TYPE_PP(container) == IS_OBJECT)) {
1.1 misho 35113: if (IS_CV == IS_VAR && !0) {
35114: Z_ADDREF_PP(container); /* undo the effect of get_obj_zval_ptr_ptr() */
35115: }
35116: return zend_binary_assign_op_obj_helper_SPEC_CV_CV(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
35117: } else {
1.1.1.2 misho 35118: zval *dim = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
1.1 misho 35119:
1.1.1.2 misho 35120: zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), container, dim, IS_CV, BP_VAR_RW TSRMLS_CC);
35121: value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R);
35122: var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC);
1.1 misho 35123: }
35124: }
35125: break;
35126: default:
1.1.1.2 misho 35127: value = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
35128: var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 35129: /* do nothing */
35130: break;
35131: }
35132:
1.1.1.2 misho 35133: if (UNEXPECTED(var_ptr == NULL)) {
1.1 misho 35134: zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets");
35135: }
35136:
1.1.1.2 misho 35137: if (UNEXPECTED(*var_ptr == &EG(error_zval))) {
35138: if (RETURN_VALUE_USED(opline)) {
35139: PZVAL_LOCK(&EG(uninitialized_zval));
35140: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
1.1 misho 35141: }
35142:
35143:
1.1.1.2 misho 35144: CHECK_EXCEPTION();
35145: if (opline->extended_value == ZEND_ASSIGN_DIM) {
35146: ZEND_VM_INC_OPCODE();
35147: }
1.1 misho 35148: ZEND_VM_NEXT_OPCODE();
35149: }
35150:
35151: SEPARATE_ZVAL_IF_NOT_REF(var_ptr);
35152:
1.1.1.2 misho 35153: if (UNEXPECTED(Z_TYPE_PP(var_ptr) == IS_OBJECT)
35154: && Z_OBJ_HANDLER_PP(var_ptr, get)
1.1 misho 35155: && Z_OBJ_HANDLER_PP(var_ptr, set)) {
35156: /* proxy object */
35157: zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC);
35158: Z_ADDREF_P(objval);
35159: binary_op(objval, objval, value TSRMLS_CC);
35160: Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC);
35161: zval_ptr_dtor(&objval);
35162: } else {
35163: binary_op(*var_ptr, *var_ptr, value TSRMLS_CC);
35164: }
35165:
1.1.1.2 misho 35166: if (RETURN_VALUE_USED(opline)) {
1.1 misho 35167: PZVAL_LOCK(*var_ptr);
1.1.1.2 misho 35168: AI_SET_PTR(&EX_T(opline->result.var), *var_ptr);
1.1 misho 35169: }
35170:
35171: if (opline->extended_value == ZEND_ASSIGN_DIM) {
35172: FREE_OP(free_op_data1);
35173: FREE_OP_VAR_PTR(free_op_data2);
35174:
1.1.1.2 misho 35175: CHECK_EXCEPTION();
35176: ZEND_VM_INC_OPCODE();
35177: } else {
35178:
35179: CHECK_EXCEPTION();
35180: }
1.1 misho 35181: ZEND_VM_NEXT_OPCODE();
35182: }
35183:
35184: static int ZEND_FASTCALL ZEND_ASSIGN_ADD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
35185: {
35186: return zend_binary_assign_op_helper_SPEC_CV_CV(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
35187: }
35188:
35189: static int ZEND_FASTCALL ZEND_ASSIGN_SUB_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
35190: {
35191: return zend_binary_assign_op_helper_SPEC_CV_CV(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
35192: }
35193:
35194: static int ZEND_FASTCALL ZEND_ASSIGN_MUL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
35195: {
35196: return zend_binary_assign_op_helper_SPEC_CV_CV(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
35197: }
35198:
35199: static int ZEND_FASTCALL ZEND_ASSIGN_DIV_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
35200: {
35201: return zend_binary_assign_op_helper_SPEC_CV_CV(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
35202: }
35203:
35204: static int ZEND_FASTCALL ZEND_ASSIGN_MOD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
35205: {
35206: return zend_binary_assign_op_helper_SPEC_CV_CV(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
35207: }
35208:
35209: static int ZEND_FASTCALL ZEND_ASSIGN_SL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
35210: {
35211: return zend_binary_assign_op_helper_SPEC_CV_CV(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
35212: }
35213:
35214: static int ZEND_FASTCALL ZEND_ASSIGN_SR_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
35215: {
35216: return zend_binary_assign_op_helper_SPEC_CV_CV(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
35217: }
35218:
35219: static int ZEND_FASTCALL ZEND_ASSIGN_CONCAT_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
35220: {
35221: return zend_binary_assign_op_helper_SPEC_CV_CV(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
35222: }
35223:
35224: static int ZEND_FASTCALL ZEND_ASSIGN_BW_OR_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
35225: {
35226: return zend_binary_assign_op_helper_SPEC_CV_CV(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
35227: }
35228:
35229: static int ZEND_FASTCALL ZEND_ASSIGN_BW_AND_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
35230: {
35231: return zend_binary_assign_op_helper_SPEC_CV_CV(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
35232: }
35233:
35234: static int ZEND_FASTCALL ZEND_ASSIGN_BW_XOR_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
35235: {
35236: return zend_binary_assign_op_helper_SPEC_CV_CV(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
35237: }
35238:
35239: static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_CV(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS)
35240: {
1.1.1.2 misho 35241: USE_OPLINE
1.1 misho 35242:
1.1.1.2 misho 35243: zval **object_ptr;
1.1 misho 35244: zval *object;
1.1.1.2 misho 35245: zval *property;
35246: zval **retval;
1.1 misho 35247: int have_get_ptr = 0;
35248:
1.1.1.2 misho 35249: SAVE_OPLINE();
35250: object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC);
35251: property = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
35252: retval = &EX_T(opline->result.var).var.ptr;
35253:
35254: if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 35255: zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
35256: }
35257:
35258: make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
35259: object = *object_ptr;
35260:
1.1.1.2 misho 35261: if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
1.1 misho 35262: zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
35263:
1.1.1.2 misho 35264: if (RETURN_VALUE_USED(opline)) {
35265: PZVAL_LOCK(&EG(uninitialized_zval));
35266: *retval = &EG(uninitialized_zval);
1.1 misho 35267: }
35268:
1.1.1.2 misho 35269: CHECK_EXCEPTION();
1.1 misho 35270: ZEND_VM_NEXT_OPCODE();
35271: }
35272:
35273: /* here we are sure we are dealing with an object */
35274:
35275: if (0) {
35276: MAKE_REAL_ZVAL_PTR(property);
35277: }
35278:
35279: if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
1.1.1.2 misho 35280: zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 35281: if (zptr != NULL) { /* NULL means no success in getting PTR */
35282: SEPARATE_ZVAL_IF_NOT_REF(zptr);
35283:
35284: have_get_ptr = 1;
35285: incdec_op(*zptr);
1.1.1.2 misho 35286: if (RETURN_VALUE_USED(opline)) {
1.1 misho 35287: *retval = *zptr;
35288: PZVAL_LOCK(*retval);
35289: }
35290: }
35291: }
35292:
35293: if (!have_get_ptr) {
35294: if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
1.1.1.2 misho 35295: zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 35296:
1.1.1.2 misho 35297: if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
1.1 misho 35298: zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
35299:
35300: if (Z_REFCOUNT_P(z) == 0) {
35301: GC_REMOVE_ZVAL_FROM_BUFFER(z);
35302: zval_dtor(z);
35303: FREE_ZVAL(z);
35304: }
35305: z = value;
35306: }
35307: Z_ADDREF_P(z);
35308: SEPARATE_ZVAL_IF_NOT_REF(&z);
35309: incdec_op(z);
35310: *retval = z;
1.1.1.2 misho 35311: Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
35312: SELECTIVE_PZVAL_LOCK(*retval, opline);
1.1 misho 35313: zval_ptr_dtor(&z);
35314: } else {
35315: zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
1.1.1.2 misho 35316: if (RETURN_VALUE_USED(opline)) {
35317: PZVAL_LOCK(&EG(uninitialized_zval));
35318: *retval = &EG(uninitialized_zval);
1.1 misho 35319: }
35320: }
35321: }
35322:
35323: if (0) {
35324: zval_ptr_dtor(&property);
35325: } else {
35326:
35327: }
35328:
1.1.1.2 misho 35329: CHECK_EXCEPTION();
1.1 misho 35330: ZEND_VM_NEXT_OPCODE();
35331: }
35332:
35333: static int ZEND_FASTCALL ZEND_PRE_INC_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
35334: {
35335: return zend_pre_incdec_property_helper_SPEC_CV_CV(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
35336: }
35337:
35338: static int ZEND_FASTCALL ZEND_PRE_DEC_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
35339: {
35340: return zend_pre_incdec_property_helper_SPEC_CV_CV(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
35341: }
35342:
35343: static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_CV(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS)
35344: {
1.1.1.2 misho 35345: USE_OPLINE
1.1 misho 35346:
1.1.1.2 misho 35347: zval **object_ptr;
1.1 misho 35348: zval *object;
1.1.1.2 misho 35349: zval *property;
35350: zval *retval;
1.1 misho 35351: int have_get_ptr = 0;
35352:
1.1.1.2 misho 35353: SAVE_OPLINE();
35354: object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC);
35355: property = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
35356: retval = &EX_T(opline->result.var).tmp_var;
35357:
35358: if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 35359: zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
35360: }
35361:
35362: make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
35363: object = *object_ptr;
35364:
1.1.1.2 misho 35365: if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
1.1 misho 35366: zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
35367:
1.1.1.2 misho 35368: ZVAL_NULL(retval);
1.1 misho 35369:
1.1.1.2 misho 35370: CHECK_EXCEPTION();
1.1 misho 35371: ZEND_VM_NEXT_OPCODE();
35372: }
35373:
35374: /* here we are sure we are dealing with an object */
35375:
35376: if (0) {
35377: MAKE_REAL_ZVAL_PTR(property);
35378: }
35379:
35380: if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
1.1.1.2 misho 35381: zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 35382: if (zptr != NULL) { /* NULL means no success in getting PTR */
35383: have_get_ptr = 1;
35384: SEPARATE_ZVAL_IF_NOT_REF(zptr);
35385:
1.1.1.2 misho 35386: ZVAL_COPY_VALUE(retval, *zptr);
1.1 misho 35387: zendi_zval_copy_ctor(*retval);
35388:
35389: incdec_op(*zptr);
35390:
35391: }
35392: }
35393:
35394: if (!have_get_ptr) {
35395: if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
1.1.1.2 misho 35396: zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 35397: zval *z_copy;
35398:
1.1.1.2 misho 35399: if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
1.1 misho 35400: zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
35401:
35402: if (Z_REFCOUNT_P(z) == 0) {
35403: GC_REMOVE_ZVAL_FROM_BUFFER(z);
35404: zval_dtor(z);
35405: FREE_ZVAL(z);
35406: }
35407: z = value;
35408: }
1.1.1.2 misho 35409: ZVAL_COPY_VALUE(retval, z);
1.1 misho 35410: zendi_zval_copy_ctor(*retval);
35411: ALLOC_ZVAL(z_copy);
1.1.1.2 misho 35412: INIT_PZVAL_COPY(z_copy, z);
1.1 misho 35413: zendi_zval_copy_ctor(*z_copy);
35414: incdec_op(z_copy);
35415: Z_ADDREF_P(z);
1.1.1.2 misho 35416: Z_OBJ_HT_P(object)->write_property(object, property, z_copy, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 35417: zval_ptr_dtor(&z_copy);
35418: zval_ptr_dtor(&z);
35419: } else {
35420: zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
1.1.1.2 misho 35421: ZVAL_NULL(retval);
1.1 misho 35422: }
35423: }
35424:
35425: if (0) {
35426: zval_ptr_dtor(&property);
35427: } else {
35428:
35429: }
35430:
1.1.1.2 misho 35431: CHECK_EXCEPTION();
1.1 misho 35432: ZEND_VM_NEXT_OPCODE();
35433: }
35434:
35435: static int ZEND_FASTCALL ZEND_POST_INC_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
35436: {
35437: return zend_post_incdec_property_helper_SPEC_CV_CV(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
35438: }
35439:
35440: static int ZEND_FASTCALL ZEND_POST_DEC_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
35441: {
35442: return zend_post_incdec_property_helper_SPEC_CV_CV(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
35443: }
35444:
35445: static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
35446: {
1.1.1.2 misho 35447: USE_OPLINE
1.1 misho 35448:
35449: zval **container;
35450:
1.1.1.2 misho 35451: SAVE_OPLINE();
35452:
35453: if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) &&
1.1 misho 35454: IS_CV != IS_CV &&
1.1.1.2 misho 35455: EX_T(opline->op1.var).var.ptr_ptr) {
35456: PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
1.1 misho 35457: }
1.1.1.2 misho 35458: container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
35459: zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC);
1.1 misho 35460:
35461:
1.1.1.2 misho 35462: CHECK_EXCEPTION();
1.1 misho 35463: ZEND_VM_NEXT_OPCODE();
35464: }
35465:
35466: static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
35467: {
1.1.1.2 misho 35468: USE_OPLINE
1.1 misho 35469: zend_free_op free_op1;
1.1.1.2 misho 35470: zval **container;
1.1 misho 35471:
1.1.1.2 misho 35472: SAVE_OPLINE();
35473: container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC);
35474:
35475: if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 35476: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
35477: }
1.1.1.2 misho 35478: zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_W TSRMLS_CC);
1.1 misho 35479:
1.1.1.2 misho 35480: if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
35481: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 35482: }
35483:
35484: /* We are going to assign the result by reference */
1.1.1.2 misho 35485: if (UNEXPECTED(opline->extended_value != 0)) {
35486: zval **retval_ptr = EX_T(opline->result.var).var.ptr_ptr;
35487:
35488: if (retval_ptr) {
35489: Z_DELREF_PP(retval_ptr);
35490: SEPARATE_ZVAL_TO_MAKE_IS_REF(retval_ptr);
35491: Z_ADDREF_PP(retval_ptr);
35492: }
1.1 misho 35493: }
35494:
1.1.1.2 misho 35495: CHECK_EXCEPTION();
1.1 misho 35496: ZEND_VM_NEXT_OPCODE();
35497: }
35498:
35499: static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
35500: {
1.1.1.2 misho 35501: USE_OPLINE
1.1 misho 35502: zend_free_op free_op1;
1.1.1.2 misho 35503: zval **container;
35504:
35505: SAVE_OPLINE();
35506: container = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 35507:
1.1.1.2 misho 35508: if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 35509: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
35510: }
1.1.1.2 misho 35511: zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_RW TSRMLS_CC);
1.1 misho 35512:
1.1.1.2 misho 35513: if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
35514: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 35515: }
35516:
1.1.1.2 misho 35517: CHECK_EXCEPTION();
1.1 misho 35518: ZEND_VM_NEXT_OPCODE();
35519: }
35520:
35521: static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
35522: {
1.1.1.2 misho 35523: USE_OPLINE
1.1 misho 35524:
1.1.1.2 misho 35525: zval **container;
1.1 misho 35526:
1.1.1.2 misho 35527: SAVE_OPLINE();
35528: container = _get_zval_ptr_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC);
35529: zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_IS TSRMLS_CC);
1.1 misho 35530:
35531:
1.1.1.2 misho 35532: CHECK_EXCEPTION();
1.1 misho 35533: ZEND_VM_NEXT_OPCODE();
35534: }
35535:
35536: static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
35537: {
1.1.1.2 misho 35538: USE_OPLINE
1.1 misho 35539: zend_free_op free_op1;
35540: zval **container;
35541:
1.1.1.2 misho 35542: SAVE_OPLINE();
35543:
35544: if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
35545: container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC);
35546: if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 35547: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
35548: }
1.1.1.2 misho 35549: zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_W TSRMLS_CC);
35550: if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
35551: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 35552: }
35553: } else {
35554: if (IS_CV == IS_UNUSED) {
35555: zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
35556: }
1.1.1.2 misho 35557: container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
35558: zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC);
1.1 misho 35559: }
35560:
35561:
1.1.1.2 misho 35562: CHECK_EXCEPTION();
1.1 misho 35563: ZEND_VM_NEXT_OPCODE();
35564: }
35565:
35566: static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
35567: {
1.1.1.2 misho 35568: USE_OPLINE
1.1 misho 35569: zend_free_op free_op1;
1.1.1.2 misho 35570: zval **container;
35571:
35572: SAVE_OPLINE();
35573: container = _get_zval_ptr_ptr_cv_BP_VAR_UNSET(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 35574:
35575: if (IS_CV == IS_CV) {
35576: if (container != &EG(uninitialized_zval_ptr)) {
35577: SEPARATE_ZVAL_IF_NOT_REF(container);
35578: }
35579: }
1.1.1.2 misho 35580: if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 35581: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
35582: }
1.1.1.2 misho 35583: zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_UNSET TSRMLS_CC);
1.1 misho 35584:
1.1.1.2 misho 35585: if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
35586: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 35587: }
35588:
1.1.1.2 misho 35589: if (UNEXPECTED(EX_T(opline->result.var).var.ptr_ptr == NULL)) {
1.1 misho 35590: zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
35591: } else {
35592: zend_free_op free_res;
1.1.1.2 misho 35593: zval **retval_ptr = EX_T(opline->result.var).var.ptr_ptr;
1.1 misho 35594:
1.1.1.2 misho 35595: PZVAL_UNLOCK(*retval_ptr, &free_res);
35596: if (retval_ptr != &EG(uninitialized_zval_ptr)) {
35597: SEPARATE_ZVAL_IF_NOT_REF(retval_ptr);
1.1 misho 35598: }
1.1.1.2 misho 35599: PZVAL_LOCK(*retval_ptr);
1.1 misho 35600: FREE_OP_VAR_PTR(free_res);
1.1.1.2 misho 35601: CHECK_EXCEPTION();
35602: ZEND_VM_NEXT_OPCODE();
1.1 misho 35603: }
35604: }
35605:
1.1.1.2 misho 35606: static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_CV_CV(ZEND_OPCODE_HANDLER_ARGS)
1.1 misho 35607: {
1.1.1.2 misho 35608: USE_OPLINE
1.1 misho 35609:
1.1.1.2 misho 35610: zval *container;
1.1 misho 35611:
1.1.1.2 misho 35612: zval *offset;
1.1 misho 35613:
1.1.1.2 misho 35614: SAVE_OPLINE();
35615: container = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
35616: offset = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
35617:
35618: if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
35619: UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
35620: zend_error(E_NOTICE, "Trying to get property of non-object");
35621: PZVAL_LOCK(&EG(uninitialized_zval));
35622: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
1.1 misho 35623:
35624: } else {
35625: zval *retval;
35626:
35627: if (0) {
35628: MAKE_REAL_ZVAL_PTR(offset);
35629: }
35630:
35631: /* here we are sure we are dealing with an object */
1.1.1.2 misho 35632: retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 35633:
1.1.1.2 misho 35634: PZVAL_LOCK(retval);
35635: AI_SET_PTR(&EX_T(opline->result.var), retval);
1.1 misho 35636:
35637: if (0) {
35638: zval_ptr_dtor(&offset);
35639: } else {
35640:
35641: }
35642: }
35643:
1.1.1.2 misho 35644: CHECK_EXCEPTION();
1.1 misho 35645: ZEND_VM_NEXT_OPCODE();
35646: }
35647:
35648: static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
35649: {
1.1.1.2 misho 35650: return zend_fetch_property_address_read_helper_SPEC_CV_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
1.1 misho 35651: }
35652:
35653: static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
35654: {
1.1.1.2 misho 35655: USE_OPLINE
1.1 misho 35656: zend_free_op free_op1;
1.1.1.2 misho 35657: zval *property;
1.1 misho 35658: zval **container;
35659:
1.1.1.2 misho 35660: SAVE_OPLINE();
35661: property = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
35662:
1.1 misho 35663: if (IS_CV == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
1.1.1.2 misho 35664: PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
35665: EX_T(opline->op1.var).var.ptr = *EX_T(opline->op1.var).var.ptr_ptr;
1.1 misho 35666: }
35667:
35668: if (0) {
35669: MAKE_REAL_ZVAL_PTR(property);
35670: }
1.1.1.2 misho 35671: container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC);
35672: if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 35673: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
35674: }
1.1.1.2 misho 35675:
35676: zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_W TSRMLS_CC);
1.1 misho 35677: if (0) {
35678: zval_ptr_dtor(&property);
35679: } else {
35680:
35681: }
1.1.1.2 misho 35682: if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
35683: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 35684: }
35685:
35686: /* We are going to assign the result by reference */
35687: if (opline->extended_value & ZEND_FETCH_MAKE_REF) {
1.1.1.2 misho 35688: zval **retval_ptr = EX_T(opline->result.var).var.ptr_ptr;
35689:
35690: Z_DELREF_PP(retval_ptr);
35691: SEPARATE_ZVAL_TO_MAKE_IS_REF(retval_ptr);
35692: Z_ADDREF_PP(retval_ptr);
35693: EX_T(opline->result.var).var.ptr = *EX_T(opline->result.var).var.ptr_ptr;
35694: EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
1.1 misho 35695: }
35696:
1.1.1.2 misho 35697: CHECK_EXCEPTION();
1.1 misho 35698: ZEND_VM_NEXT_OPCODE();
35699: }
35700:
35701: static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
35702: {
1.1.1.2 misho 35703: USE_OPLINE
1.1 misho 35704: zend_free_op free_op1;
1.1.1.2 misho 35705: zval *property;
35706: zval **container;
35707:
35708: SAVE_OPLINE();
35709: property = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
35710: container = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 35711:
35712: if (0) {
35713: MAKE_REAL_ZVAL_PTR(property);
35714: }
1.1.1.2 misho 35715: if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 35716: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
35717: }
1.1.1.2 misho 35718: zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_RW TSRMLS_CC);
1.1 misho 35719: if (0) {
35720: zval_ptr_dtor(&property);
35721: } else {
35722:
35723: }
1.1.1.2 misho 35724: if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
35725: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 35726: }
35727:
1.1.1.2 misho 35728: CHECK_EXCEPTION();
1.1 misho 35729: ZEND_VM_NEXT_OPCODE();
35730: }
35731:
35732: static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
35733: {
1.1.1.2 misho 35734: USE_OPLINE
35735:
35736: zval *container;
35737:
35738: zval *offset;
35739:
35740: SAVE_OPLINE();
35741: container = _get_zval_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC);
35742: offset = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
35743:
35744: if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
35745: UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
35746: PZVAL_LOCK(&EG(uninitialized_zval));
35747: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
35748:
35749: } else {
35750: zval *retval;
35751:
35752: if (0) {
35753: MAKE_REAL_ZVAL_PTR(offset);
35754: }
35755:
35756: /* here we are sure we are dealing with an object */
35757: retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
35758:
35759: PZVAL_LOCK(retval);
35760: AI_SET_PTR(&EX_T(opline->result.var), retval);
35761:
35762: if (0) {
35763: zval_ptr_dtor(&offset);
35764: } else {
35765:
35766: }
35767: }
35768:
35769: CHECK_EXCEPTION();
35770: ZEND_VM_NEXT_OPCODE();
1.1 misho 35771: }
35772:
35773: static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
35774: {
1.1.1.2 misho 35775: USE_OPLINE
1.1 misho 35776:
1.1.1.2 misho 35777: if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
1.1 misho 35778: /* Behave like FETCH_OBJ_W */
35779: zend_free_op free_op1;
1.1.1.2 misho 35780: zval *property;
35781: zval **container;
35782:
35783: SAVE_OPLINE();
35784: property = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
35785: container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 35786:
35787: if (0) {
35788: MAKE_REAL_ZVAL_PTR(property);
35789: }
1.1.1.2 misho 35790: if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 35791: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
35792: }
1.1.1.2 misho 35793: zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_W TSRMLS_CC);
1.1 misho 35794: if (0) {
35795: zval_ptr_dtor(&property);
35796: } else {
35797:
35798: }
1.1.1.2 misho 35799: if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
35800: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 35801: }
35802:
1.1.1.2 misho 35803: CHECK_EXCEPTION();
1.1 misho 35804: ZEND_VM_NEXT_OPCODE();
35805: } else {
1.1.1.2 misho 35806: return zend_fetch_property_address_read_helper_SPEC_CV_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
1.1 misho 35807: }
35808: }
35809:
35810: static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
35811: {
1.1.1.2 misho 35812: USE_OPLINE
1.1 misho 35813: zend_free_op free_op1, free_res;
1.1.1.2 misho 35814: zval **container;
35815: zval *property;
35816:
35817: SAVE_OPLINE();
35818: container = _get_zval_ptr_ptr_cv_BP_VAR_UNSET(EX_CVs(), opline->op1.var TSRMLS_CC);
35819: property = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
1.1 misho 35820:
35821: if (IS_CV == IS_CV) {
35822: if (container != &EG(uninitialized_zval_ptr)) {
35823: SEPARATE_ZVAL_IF_NOT_REF(container);
35824: }
35825: }
35826: if (0) {
35827: MAKE_REAL_ZVAL_PTR(property);
35828: }
1.1.1.2 misho 35829: if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
1.1 misho 35830: zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
35831: }
1.1.1.2 misho 35832: zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_UNSET TSRMLS_CC);
1.1 misho 35833: if (0) {
35834: zval_ptr_dtor(&property);
35835: } else {
35836:
35837: }
1.1.1.2 misho 35838: if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
35839: EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
1.1 misho 35840: }
35841:
1.1.1.2 misho 35842: PZVAL_UNLOCK(*EX_T(opline->result.var).var.ptr_ptr, &free_res);
35843: if (EX_T(opline->result.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) {
35844: SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.var).var.ptr_ptr);
1.1 misho 35845: }
1.1.1.2 misho 35846: PZVAL_LOCK(*EX_T(opline->result.var).var.ptr_ptr);
1.1 misho 35847: FREE_OP_VAR_PTR(free_res);
1.1.1.2 misho 35848: CHECK_EXCEPTION();
1.1 misho 35849: ZEND_VM_NEXT_OPCODE();
35850: }
35851:
35852: static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
35853: {
1.1.1.2 misho 35854: USE_OPLINE
35855:
35856: zval **object_ptr;
35857: zval *property_name;
1.1 misho 35858:
1.1.1.2 misho 35859: SAVE_OPLINE();
35860: object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC);
35861: property_name = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
1.1 misho 35862:
35863: if (0) {
35864: MAKE_REAL_ZVAL_PTR(property_name);
35865: }
1.1.1.2 misho 35866: if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 35867: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
35868: }
1.1.1.2 misho 35869: zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), ZEND_ASSIGN_OBJ, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 35870: if (0) {
35871: zval_ptr_dtor(&property_name);
35872: } else {
35873:
35874: }
35875:
35876: /* assign_obj has two opcodes! */
1.1.1.2 misho 35877: CHECK_EXCEPTION();
1.1 misho 35878: ZEND_VM_INC_OPCODE();
35879: ZEND_VM_NEXT_OPCODE();
35880: }
35881:
35882: static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
35883: {
1.1.1.2 misho 35884: USE_OPLINE
1.1 misho 35885:
1.1.1.2 misho 35886: zval **object_ptr;
1.1 misho 35887:
1.1.1.2 misho 35888: SAVE_OPLINE();
35889: object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC);
35890:
35891: if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
1.1 misho 35892: zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
35893: }
35894: if (Z_TYPE_PP(object_ptr) == IS_OBJECT) {
35895:
1.1.1.2 misho 35896: zval *property_name = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
1.1 misho 35897:
35898: if (0) {
35899: MAKE_REAL_ZVAL_PTR(property_name);
35900: }
1.1.1.2 misho 35901: zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), ZEND_ASSIGN_DIM, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 35902: if (0) {
35903: zval_ptr_dtor(&property_name);
35904: } else {
35905:
35906: }
35907: } else {
35908: zend_free_op free_op_data1, free_op_data2;
35909: zval *value;
1.1.1.2 misho 35910: zval *dim = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
1.1 misho 35911: zval **variable_ptr_ptr;
35912:
1.1.1.2 misho 35913: zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), object_ptr, dim, IS_CV, BP_VAR_W TSRMLS_CC);
35914:
35915: value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R);
35916: variable_ptr_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC);
35917: if (UNEXPECTED(variable_ptr_ptr == NULL)) {
35918: if (zend_assign_to_string_offset(&EX_T((opline+1)->op2.var), value, (opline+1)->op1_type TSRMLS_CC)) {
35919: if (RETURN_VALUE_USED(opline)) {
35920: zval *retval;
1.1 misho 35921:
1.1.1.2 misho 35922: ALLOC_ZVAL(retval);
35923: ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T((opline+1)->op2.var).str_offset.str)+EX_T((opline+1)->op2.var).str_offset.offset, 1, 1);
35924: INIT_PZVAL(retval);
35925: AI_SET_PTR(&EX_T(opline->result.var), retval);
35926: }
35927: } else if (RETURN_VALUE_USED(opline)) {
35928: PZVAL_LOCK(&EG(uninitialized_zval));
35929: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
35930: }
35931: } else if (UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) {
35932: if (IS_TMP_FREE(free_op_data1)) {
35933: zval_dtor(value);
35934: }
35935: if (RETURN_VALUE_USED(opline)) {
35936: PZVAL_LOCK(&EG(uninitialized_zval));
35937: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
35938: }
35939: } else {
35940: if ((opline+1)->op1_type == IS_TMP_VAR) {
35941: value = zend_assign_tmp_to_variable(variable_ptr_ptr, value TSRMLS_CC);
35942: } else if ((opline+1)->op1_type == IS_CONST) {
35943: value = zend_assign_const_to_variable(variable_ptr_ptr, value TSRMLS_CC);
35944: } else {
35945: value = zend_assign_to_variable(variable_ptr_ptr, value TSRMLS_CC);
35946: }
35947: if (RETURN_VALUE_USED(opline)) {
1.1 misho 35948: PZVAL_LOCK(value);
1.1.1.2 misho 35949: AI_SET_PTR(&EX_T(opline->result.var), value);
1.1 misho 35950: }
35951: }
35952: FREE_OP_VAR_PTR(free_op_data2);
35953: FREE_OP_IF_VAR(free_op_data1);
35954: }
35955:
35956: /* assign_dim has two opcodes! */
1.1.1.2 misho 35957: CHECK_EXCEPTION();
1.1 misho 35958: ZEND_VM_INC_OPCODE();
35959: ZEND_VM_NEXT_OPCODE();
35960: }
35961:
35962: static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
35963: {
1.1.1.2 misho 35964: USE_OPLINE
1.1 misho 35965:
1.1.1.2 misho 35966: zval *value;
35967: zval **variable_ptr_ptr;
1.1 misho 35968:
1.1.1.2 misho 35969: SAVE_OPLINE();
35970: value = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
35971: variable_ptr_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC);
35972:
35973: if (IS_CV == IS_VAR && UNEXPECTED(variable_ptr_ptr == NULL)) {
35974: if (zend_assign_to_string_offset(&EX_T(opline->op1.var), value, IS_CV TSRMLS_CC)) {
35975: if (RETURN_VALUE_USED(opline)) {
35976: zval *retval;
35977:
35978: ALLOC_ZVAL(retval);
35979: ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T(opline->op1.var).str_offset.str)+EX_T(opline->op1.var).str_offset.offset, 1, 1);
35980: INIT_PZVAL(retval);
35981: AI_SET_PTR(&EX_T(opline->result.var), retval);
35982: }
35983: } else if (RETURN_VALUE_USED(opline)) {
35984: PZVAL_LOCK(&EG(uninitialized_zval));
35985: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
35986: }
35987: } else if (IS_CV == IS_VAR && UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) {
35988: if (0) {
35989: zval_dtor(value);
35990: }
35991: if (RETURN_VALUE_USED(opline)) {
35992: PZVAL_LOCK(&EG(uninitialized_zval));
35993: AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
35994: }
35995: } else {
35996: if (IS_CV == IS_TMP_VAR) {
35997: value = zend_assign_tmp_to_variable(variable_ptr_ptr, value TSRMLS_CC);
35998: } else if (IS_CV == IS_CONST) {
35999: value = zend_assign_const_to_variable(variable_ptr_ptr, value TSRMLS_CC);
36000: } else {
36001: value = zend_assign_to_variable(variable_ptr_ptr, value TSRMLS_CC);
36002: }
36003: if (RETURN_VALUE_USED(opline)) {
1.1 misho 36004: PZVAL_LOCK(value);
1.1.1.2 misho 36005: AI_SET_PTR(&EX_T(opline->result.var), value);
1.1 misho 36006: }
36007: }
36008:
36009: /* zend_assign_to_variable() always takes care of op2, never free it! */
36010:
1.1.1.2 misho 36011: CHECK_EXCEPTION();
1.1 misho 36012: ZEND_VM_NEXT_OPCODE();
36013: }
36014:
36015: static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
36016: {
1.1.1.2 misho 36017: USE_OPLINE
1.1 misho 36018: zend_free_op free_op2;
36019: zval **variable_ptr_ptr;
1.1.1.2 misho 36020: zval **value_ptr_ptr;
36021:
36022: SAVE_OPLINE();
36023: value_ptr_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op2.var TSRMLS_CC);
1.1 misho 36024:
36025: if (IS_CV == IS_VAR &&
36026: value_ptr_ptr &&
36027: !Z_ISREF_PP(value_ptr_ptr) &&
36028: opline->extended_value == ZEND_RETURNS_FUNCTION &&
1.1.1.2 misho 36029: !EX_T(opline->op2.var).var.fcall_returned_reference) {
1.1 misho 36030: if (free_op2.var == NULL) {
36031: PZVAL_LOCK(*value_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */
36032: }
36033: zend_error(E_STRICT, "Only variables should be assigned by reference");
36034: if (UNEXPECTED(EG(exception) != NULL)) {
36035:
1.1.1.2 misho 36036: HANDLE_EXCEPTION();
1.1 misho 36037: }
36038: return ZEND_ASSIGN_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
36039: } else if (IS_CV == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) {
36040: PZVAL_LOCK(*value_ptr_ptr);
36041: }
1.1.1.2 misho 36042: if (IS_CV == IS_VAR && UNEXPECTED(EX_T(opline->op1.var).var.ptr_ptr == &EX_T(opline->op1.var).var.ptr)) {
1.1 misho 36043: zend_error_noreturn(E_ERROR, "Cannot assign by reference to overloaded object");
36044: }
36045:
1.1.1.2 misho 36046: variable_ptr_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC);
36047: if ((IS_CV == IS_VAR && UNEXPECTED(value_ptr_ptr == NULL)) ||
36048: (IS_CV == IS_VAR && UNEXPECTED(variable_ptr_ptr == NULL))) {
1.1 misho 36049: zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets nor overloaded objects");
36050: }
36051: zend_assign_to_variable_reference(variable_ptr_ptr, value_ptr_ptr TSRMLS_CC);
36052:
36053: if (IS_CV == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) {
36054: Z_DELREF_PP(variable_ptr_ptr);
36055: }
36056:
1.1.1.2 misho 36057: if (RETURN_VALUE_USED(opline)) {
1.1 misho 36058: PZVAL_LOCK(*variable_ptr_ptr);
1.1.1.2 misho 36059: AI_SET_PTR(&EX_T(opline->result.var), *variable_ptr_ptr);
1.1 misho 36060: }
36061:
36062:
1.1.1.2 misho 36063: CHECK_EXCEPTION();
1.1 misho 36064: ZEND_VM_NEXT_OPCODE();
36065: }
36066:
36067: static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
36068: {
1.1.1.2 misho 36069: USE_OPLINE
1.1 misho 36070: zval *function_name;
36071: char *function_name_strval;
36072: int function_name_strlen;
36073:
36074:
1.1.1.2 misho 36075: SAVE_OPLINE();
1.1 misho 36076: zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
36077:
1.1.1.2 misho 36078: function_name = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
1.1 misho 36079:
1.1.1.2 misho 36080: if (IS_CV != IS_CONST &&
36081: UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
1.1 misho 36082: zend_error_noreturn(E_ERROR, "Method name must be a string");
36083: }
36084:
36085: function_name_strval = Z_STRVAL_P(function_name);
36086: function_name_strlen = Z_STRLEN_P(function_name);
36087:
1.1.1.2 misho 36088: EX(object) = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 36089:
1.1.1.2 misho 36090: if (EXPECTED(EX(object) != NULL) &&
36091: EXPECTED(Z_TYPE_P(EX(object)) == IS_OBJECT)) {
36092: EX(called_scope) = Z_OBJCE_P(EX(object));
1.1 misho 36093:
1.1.1.2 misho 36094: if (IS_CV != IS_CONST ||
36095: (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope))) == NULL) {
36096: zval *object = EX(object);
36097:
36098: if (UNEXPECTED(Z_OBJ_HT_P(EX(object))->get_method == NULL)) {
36099: zend_error_noreturn(E_ERROR, "Object does not support method calls");
36100: }
36101:
36102: /* First, locate the function. */
36103: EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen, ((IS_CV == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC);
36104: if (UNEXPECTED(EX(fbc) == NULL)) {
36105: zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval);
36106: }
36107: if (IS_CV == IS_CONST &&
36108: EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) &&
36109: EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) &&
36110: EXPECTED(EX(object) == object)) {
36111: CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope), EX(fbc));
36112: }
1.1 misho 36113: }
36114: } else {
36115: zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval);
36116: }
36117:
36118: if ((EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) != 0) {
36119: EX(object) = NULL;
36120: } else {
36121: if (!PZVAL_IS_REF(EX(object))) {
36122: Z_ADDREF_P(EX(object)); /* For $this pointer */
36123: } else {
36124: zval *this_ptr;
36125: ALLOC_ZVAL(this_ptr);
36126: INIT_PZVAL_COPY(this_ptr, EX(object));
36127: zval_copy_ctor(this_ptr);
36128: EX(object) = this_ptr;
36129: }
36130: }
36131:
36132:
1.1.1.2 misho 36133: CHECK_EXCEPTION();
1.1 misho 36134: ZEND_VM_NEXT_OPCODE();
36135: }
36136:
36137: static int ZEND_FASTCALL ZEND_CASE_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
36138: {
1.1.1.2 misho 36139: USE_OPLINE
1.1 misho 36140:
36141:
1.1.1.2 misho 36142: SAVE_OPLINE();
1.1 misho 36143: if (IS_CV==IS_VAR) {
1.1.1.2 misho 36144: PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
1.1 misho 36145: }
1.1.1.2 misho 36146: is_equal_function(&EX_T(opline->result.var).tmp_var,
36147: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC),
36148: _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC);
1.1 misho 36149:
1.1.1.2 misho 36150: CHECK_EXCEPTION();
1.1 misho 36151: ZEND_VM_NEXT_OPCODE();
36152: }
36153:
36154: static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
36155: {
1.1.1.2 misho 36156: USE_OPLINE
1.1 misho 36157:
36158: zval *expr_ptr;
36159:
1.1.1.2 misho 36160: SAVE_OPLINE();
36161: if ((IS_CV == IS_VAR || IS_CV == IS_CV) && opline->extended_value) {
36162: zval **expr_ptr_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 36163:
1.1.1.2 misho 36164: if (IS_CV == IS_VAR && UNEXPECTED(expr_ptr_ptr == NULL)) {
36165: zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
36166: }
36167: SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr);
1.1 misho 36168: expr_ptr = *expr_ptr_ptr;
1.1.1.2 misho 36169: Z_ADDREF_P(expr_ptr);
1.1 misho 36170: } else {
1.1.1.2 misho 36171: expr_ptr=_get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
36172: if (0) { /* temporary variable */
36173: zval *new_expr;
1.1 misho 36174:
1.1.1.2 misho 36175: ALLOC_ZVAL(new_expr);
36176: INIT_PZVAL_COPY(new_expr, expr_ptr);
36177: expr_ptr = new_expr;
36178: } else if (IS_CV == IS_CONST || PZVAL_IS_REF(expr_ptr)) {
1.1 misho 36179: zval *new_expr;
36180:
36181: ALLOC_ZVAL(new_expr);
36182: INIT_PZVAL_COPY(new_expr, expr_ptr);
36183: expr_ptr = new_expr;
36184: zendi_zval_copy_ctor(*expr_ptr);
36185: } else {
36186: Z_ADDREF_P(expr_ptr);
36187: }
36188: }
1.1.1.2 misho 36189:
36190: if (IS_CV != IS_UNUSED) {
36191:
36192: zval *offset = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
36193: ulong hval;
36194:
1.1 misho 36195: switch (Z_TYPE_P(offset)) {
36196: case IS_DOUBLE:
1.1.1.2 misho 36197: hval = zend_dval_to_lval(Z_DVAL_P(offset));
36198: goto num_index;
1.1 misho 36199: case IS_LONG:
36200: case IS_BOOL:
1.1.1.2 misho 36201: hval = Z_LVAL_P(offset);
36202: num_index:
36203: zend_hash_index_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), hval, &expr_ptr, sizeof(zval *), NULL);
1.1 misho 36204: break;
36205: case IS_STRING:
1.1.1.2 misho 36206: if (IS_CV == IS_CONST) {
36207: hval = Z_HASH_P(offset);
36208: } else {
36209: ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
36210: if (IS_INTERNED(Z_STRVAL_P(offset))) {
36211: hval = INTERNED_HASH(Z_STRVAL_P(offset));
36212: } else {
36213: hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
36214: }
36215: }
36216: zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
1.1 misho 36217: break;
36218: case IS_NULL:
1.1.1.2 misho 36219: zend_hash_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
1.1 misho 36220: break;
36221: default:
36222: zend_error(E_WARNING, "Illegal offset type");
36223: zval_ptr_dtor(&expr_ptr);
36224: /* do nothing */
36225: break;
36226: }
36227:
36228: } else {
1.1.1.2 misho 36229: zend_hash_next_index_insert(Z_ARRVAL(EX_T(opline->result.var).tmp_var), &expr_ptr, sizeof(zval *), NULL);
1.1 misho 36230: }
1.1.1.2 misho 36231: if ((IS_CV == IS_VAR || IS_CV == IS_CV) && opline->extended_value) {
1.1 misho 36232:
36233: } else {
36234:
36235: }
1.1.1.2 misho 36236: CHECK_EXCEPTION();
1.1 misho 36237: ZEND_VM_NEXT_OPCODE();
36238: }
36239:
36240: static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
36241: {
1.1.1.2 misho 36242: USE_OPLINE
1.1 misho 36243:
1.1.1.2 misho 36244: array_init(&EX_T(opline->result.var).tmp_var);
1.1 misho 36245: if (IS_CV == IS_UNUSED) {
36246: ZEND_VM_NEXT_OPCODE();
36247: #if 0 || IS_CV != IS_UNUSED
36248: } else {
36249: return ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
36250: #endif
36251: }
36252: }
36253:
36254: static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
36255: {
1.1.1.2 misho 36256: USE_OPLINE
1.1 misho 36257:
1.1.1.2 misho 36258: zval **container;
1.1 misho 36259: zval *offset;
1.1.1.2 misho 36260: ulong hval;
1.1 misho 36261:
1.1.1.2 misho 36262: SAVE_OPLINE();
36263: container = _get_zval_ptr_ptr_cv_BP_VAR_UNSET(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 36264: if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) {
36265: SEPARATE_ZVAL_IF_NOT_REF(container);
36266: }
1.1.1.2 misho 36267: offset = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
1.1 misho 36268:
36269: if (IS_CV != IS_VAR || container) {
36270: switch (Z_TYPE_PP(container)) {
36271: case IS_ARRAY: {
36272: HashTable *ht = Z_ARRVAL_PP(container);
36273:
36274: switch (Z_TYPE_P(offset)) {
36275: case IS_DOUBLE:
1.1.1.2 misho 36276: hval = zend_dval_to_lval(Z_DVAL_P(offset));
1.1.1.3 misho 36277: zend_hash_index_del(ht, hval);
36278: break;
1.1 misho 36279: case IS_RESOURCE:
36280: case IS_BOOL:
36281: case IS_LONG:
1.1.1.2 misho 36282: hval = Z_LVAL_P(offset);
36283: zend_hash_index_del(ht, hval);
1.1 misho 36284: break;
36285: case IS_STRING:
36286: if (IS_CV == IS_CV || IS_CV == IS_VAR) {
36287: Z_ADDREF_P(offset);
36288: }
1.1.1.2 misho 36289: if (IS_CV == IS_CONST) {
36290: hval = Z_HASH_P(offset);
36291: } else {
36292: ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_dim);
36293: if (IS_INTERNED(Z_STRVAL_P(offset))) {
36294: hval = INTERNED_HASH(Z_STRVAL_P(offset));
36295: } else {
36296: hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
1.1 misho 36297: }
36298: }
1.1.1.2 misho 36299: if (ht == &EG(symbol_table)) {
36300: zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC);
36301: } else {
36302: zend_hash_quick_del(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval);
36303: }
36304: if (IS_CV == IS_CV || IS_CV == IS_VAR) {
36305: zval_ptr_dtor(&offset);
36306: }
36307: break;
36308: num_index_dim:
36309: zend_hash_index_del(ht, hval);
1.1 misho 36310: if (IS_CV == IS_CV || IS_CV == IS_VAR) {
36311: zval_ptr_dtor(&offset);
36312: }
36313: break;
36314: case IS_NULL:
36315: zend_hash_del(ht, "", sizeof(""));
36316: break;
36317: default:
36318: zend_error(E_WARNING, "Illegal offset type in unset");
36319: break;
36320: }
36321:
36322: break;
36323: }
36324: case IS_OBJECT:
1.1.1.2 misho 36325: if (UNEXPECTED(Z_OBJ_HT_P(*container)->unset_dimension == NULL)) {
1.1 misho 36326: zend_error_noreturn(E_ERROR, "Cannot use object as array");
36327: }
36328: if (0) {
36329: MAKE_REAL_ZVAL_PTR(offset);
36330: }
36331: Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC);
36332: if (0) {
36333: zval_ptr_dtor(&offset);
36334: } else {
36335:
36336: }
36337: break;
36338: case IS_STRING:
36339: zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
36340: ZEND_VM_CONTINUE(); /* bailed out before */
36341: default:
36342:
36343: break;
36344: }
36345: } else {
36346:
36347: }
36348:
1.1.1.2 misho 36349: CHECK_EXCEPTION();
1.1 misho 36350: ZEND_VM_NEXT_OPCODE();
36351: }
36352:
36353: static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
36354: {
1.1.1.2 misho 36355: USE_OPLINE
36356:
36357: zval **container;
36358: zval *offset;
1.1 misho 36359:
1.1.1.2 misho 36360: SAVE_OPLINE();
36361: container = _get_zval_ptr_ptr_cv_BP_VAR_UNSET(EX_CVs(), opline->op1.var TSRMLS_CC);
36362: offset = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
1.1 misho 36363:
36364: if (IS_CV != IS_VAR || container) {
36365: if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) {
36366: SEPARATE_ZVAL_IF_NOT_REF(container);
36367: }
36368: if (Z_TYPE_PP(container) == IS_OBJECT) {
36369: if (0) {
36370: MAKE_REAL_ZVAL_PTR(offset);
36371: }
36372: if (Z_OBJ_HT_P(*container)->unset_property) {
1.1.1.2 misho 36373: Z_OBJ_HT_P(*container)->unset_property(*container, offset, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
1.1 misho 36374: } else {
36375: zend_error(E_NOTICE, "Trying to unset property of non-object");
36376: }
36377: if (0) {
36378: zval_ptr_dtor(&offset);
36379: } else {
36380:
36381: }
36382: } else {
36383:
36384: }
36385: } else {
36386:
36387: }
36388:
1.1.1.2 misho 36389: CHECK_EXCEPTION();
1.1 misho 36390: ZEND_VM_NEXT_OPCODE();
36391: }
36392:
36393: static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_CV(int prop_dim, ZEND_OPCODE_HANDLER_ARGS)
36394: {
1.1.1.2 misho 36395: USE_OPLINE
1.1 misho 36396:
1.1.1.2 misho 36397: zval **container;
1.1 misho 36398: zval **value = NULL;
36399: int result = 0;
1.1.1.2 misho 36400: ulong hval;
36401: zval *offset;
1.1 misho 36402:
1.1.1.2 misho 36403: SAVE_OPLINE();
36404: container = _get_zval_ptr_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC);
1.1 misho 36405:
1.1.1.2 misho 36406: offset = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC);
36407:
36408: if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) {
36409: HashTable *ht;
36410: int isset = 0;
36411:
36412: ht = Z_ARRVAL_PP(container);
36413:
36414: switch (Z_TYPE_P(offset)) {
36415: case IS_DOUBLE:
36416: hval = zend_dval_to_lval(Z_DVAL_P(offset));
36417: goto num_index_prop;
36418: case IS_RESOURCE:
36419: case IS_BOOL:
36420: case IS_LONG:
36421: hval = Z_LVAL_P(offset);
36422: num_index_prop:
36423: if (zend_hash_index_find(ht, hval, (void **) &value) == SUCCESS) {
36424: isset = 1;
36425: }
36426: break;
36427: case IS_STRING:
36428: if (IS_CV == IS_CONST) {
36429: hval = Z_HASH_P(offset);
36430: } else {
36431: if (!prop_dim) {
36432: ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_prop);
1.1 misho 36433: }
1.1.1.2 misho 36434: if (IS_INTERNED(Z_STRVAL_P(offset))) {
36435: hval = INTERNED_HASH(Z_STRVAL_P(offset));
1.1 misho 36436: } else {
1.1.1.2 misho 36437: hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
1.1 misho 36438: }
36439: }
1.1.1.2 misho 36440: if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) {
36441: isset = 1;
36442: }
36443: break;
36444: case IS_NULL:
36445: if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) {
36446: isset = 1;
1.1 misho 36447: }
1.1.1.2 misho 36448: break;
36449: default:
36450: zend_error(E_WARNING, "Illegal offset type in isset or empty");
36451: break;
36452: }
36453:
36454: if (opline->extended_value & ZEND_ISSET) {
36455: if (isset && Z_TYPE_PP(value) == IS_NULL) {
36456: result = 0;
36457: } else {
36458: result = isset;
1.1 misho 36459: }
1.1.1.2 misho 36460: } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
36461: if (!isset || !i_zend_is_true(*value)) {
36462: result = 0;
1.1 misho 36463: } else {
1.1.1.2 misho 36464: result = 1;
36465: }
36466: }
1.1 misho 36467:
1.1.1.2 misho 36468: } else if (Z_TYPE_PP(container) == IS_OBJECT) {
36469: if (0) {
36470: MAKE_REAL_ZVAL_PTR(offset);
36471: }
36472: if (prop_dim) {
36473: if (Z_OBJ_HT_P(*container)->has_property) {
36474: result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
36475: } else {
36476: zend_error(E_NOTICE, "Trying to check property of non-object");
36477: result = 0;
1.1 misho 36478: }
1.1.1.2 misho 36479: } else {
36480: if (Z_OBJ_HT_P(*container)->has_dimension) {
36481: result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0 TSRMLS_CC);
36482: } else {
36483: zend_error(E_NOTICE, "Trying to check element of non-array");
36484: result = 0;
36485: }
36486: }
36487: if (0) {
36488: zval_ptr_dtor(&offset);
36489: } else {
36490:
36491: }
36492: } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */
36493: zval tmp;
1.1 misho 36494:
1.1.1.2 misho 36495: if (Z_TYPE_P(offset) != IS_LONG) {
36496: if (Z_TYPE_P(offset) <= IS_BOOL /* simple scalar types */
36497: || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */
36498: && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) {
36499: ZVAL_COPY_VALUE(&tmp, offset);
1.1 misho 36500: zval_copy_ctor(&tmp);
36501: convert_to_long(&tmp);
36502: offset = &tmp;
1.1.1.2 misho 36503: } else {
36504: /* can not be converted to proper offset, return "not set" */
36505: result = 0;
1.1 misho 36506: }
1.1.1.2 misho 36507: }
36508: if (Z_TYPE_P(offset) == IS_LONG) {
36509: if (opline->extended_value & ZEND_ISSET) {
36510: if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
36511: result = 1;
36512: }
36513: } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
36514: if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') {
36515: result = 1;
1.1 misho 36516: }
36517: }
1.1.1.2 misho 36518: }
1.1 misho 36519:
1.1.1.2 misho 36520: } else {
1.1 misho 36521:
36522: }
36523:
1.1.1.2 misho 36524: Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
36525: if (opline->extended_value & ZEND_ISSET) {
36526: Z_LVAL(EX_T(opline->result.var).tmp_var) = result;
36527: } else {
36528: Z_LVAL(EX_T(opline->result.var).tmp_var) = !result;
1.1 misho 36529: }
36530:
1.1.1.2 misho 36531: CHECK_EXCEPTION();
1.1 misho 36532: ZEND_VM_NEXT_OPCODE();
36533: }
36534:
36535: static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
36536: {
36537: return zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_CV(0, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
36538: }
36539:
36540: static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
36541: {
36542: return zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_CV(1, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
36543: }
36544:
36545: static int ZEND_FASTCALL ZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
36546: {
1.1.1.2 misho 36547: zend_error_noreturn(E_ERROR, "Invalid opcode %d/%d/%d.", OPLINE->opcode, OPLINE->op1_type, OPLINE->op2_type);
1.1 misho 36548: }
36549:
36550:
36551: void zend_init_opcodes_handlers(void)
36552: {
36553: static const opcode_handler_t labels[] = {
36554: ZEND_NOP_SPEC_HANDLER,
36555: ZEND_NOP_SPEC_HANDLER,
36556: ZEND_NOP_SPEC_HANDLER,
36557: ZEND_NOP_SPEC_HANDLER,
36558: ZEND_NOP_SPEC_HANDLER,
36559: ZEND_NOP_SPEC_HANDLER,
36560: ZEND_NOP_SPEC_HANDLER,
36561: ZEND_NOP_SPEC_HANDLER,
36562: ZEND_NOP_SPEC_HANDLER,
36563: ZEND_NOP_SPEC_HANDLER,
36564: ZEND_NOP_SPEC_HANDLER,
36565: ZEND_NOP_SPEC_HANDLER,
36566: ZEND_NOP_SPEC_HANDLER,
36567: ZEND_NOP_SPEC_HANDLER,
36568: ZEND_NOP_SPEC_HANDLER,
36569: ZEND_NOP_SPEC_HANDLER,
36570: ZEND_NOP_SPEC_HANDLER,
36571: ZEND_NOP_SPEC_HANDLER,
36572: ZEND_NOP_SPEC_HANDLER,
36573: ZEND_NOP_SPEC_HANDLER,
36574: ZEND_NOP_SPEC_HANDLER,
36575: ZEND_NOP_SPEC_HANDLER,
36576: ZEND_NOP_SPEC_HANDLER,
36577: ZEND_NOP_SPEC_HANDLER,
36578: ZEND_NOP_SPEC_HANDLER,
36579: ZEND_ADD_SPEC_CONST_CONST_HANDLER,
36580: ZEND_ADD_SPEC_CONST_TMP_HANDLER,
36581: ZEND_ADD_SPEC_CONST_VAR_HANDLER,
36582: ZEND_NULL_HANDLER,
36583: ZEND_ADD_SPEC_CONST_CV_HANDLER,
36584: ZEND_ADD_SPEC_TMP_CONST_HANDLER,
36585: ZEND_ADD_SPEC_TMP_TMP_HANDLER,
36586: ZEND_ADD_SPEC_TMP_VAR_HANDLER,
36587: ZEND_NULL_HANDLER,
36588: ZEND_ADD_SPEC_TMP_CV_HANDLER,
36589: ZEND_ADD_SPEC_VAR_CONST_HANDLER,
36590: ZEND_ADD_SPEC_VAR_TMP_HANDLER,
36591: ZEND_ADD_SPEC_VAR_VAR_HANDLER,
36592: ZEND_NULL_HANDLER,
36593: ZEND_ADD_SPEC_VAR_CV_HANDLER,
36594: ZEND_NULL_HANDLER,
36595: ZEND_NULL_HANDLER,
36596: ZEND_NULL_HANDLER,
36597: ZEND_NULL_HANDLER,
36598: ZEND_NULL_HANDLER,
36599: ZEND_ADD_SPEC_CV_CONST_HANDLER,
36600: ZEND_ADD_SPEC_CV_TMP_HANDLER,
36601: ZEND_ADD_SPEC_CV_VAR_HANDLER,
36602: ZEND_NULL_HANDLER,
36603: ZEND_ADD_SPEC_CV_CV_HANDLER,
36604: ZEND_SUB_SPEC_CONST_CONST_HANDLER,
36605: ZEND_SUB_SPEC_CONST_TMP_HANDLER,
36606: ZEND_SUB_SPEC_CONST_VAR_HANDLER,
36607: ZEND_NULL_HANDLER,
36608: ZEND_SUB_SPEC_CONST_CV_HANDLER,
36609: ZEND_SUB_SPEC_TMP_CONST_HANDLER,
36610: ZEND_SUB_SPEC_TMP_TMP_HANDLER,
36611: ZEND_SUB_SPEC_TMP_VAR_HANDLER,
36612: ZEND_NULL_HANDLER,
36613: ZEND_SUB_SPEC_TMP_CV_HANDLER,
36614: ZEND_SUB_SPEC_VAR_CONST_HANDLER,
36615: ZEND_SUB_SPEC_VAR_TMP_HANDLER,
36616: ZEND_SUB_SPEC_VAR_VAR_HANDLER,
36617: ZEND_NULL_HANDLER,
36618: ZEND_SUB_SPEC_VAR_CV_HANDLER,
36619: ZEND_NULL_HANDLER,
36620: ZEND_NULL_HANDLER,
36621: ZEND_NULL_HANDLER,
36622: ZEND_NULL_HANDLER,
36623: ZEND_NULL_HANDLER,
36624: ZEND_SUB_SPEC_CV_CONST_HANDLER,
36625: ZEND_SUB_SPEC_CV_TMP_HANDLER,
36626: ZEND_SUB_SPEC_CV_VAR_HANDLER,
36627: ZEND_NULL_HANDLER,
36628: ZEND_SUB_SPEC_CV_CV_HANDLER,
36629: ZEND_MUL_SPEC_CONST_CONST_HANDLER,
36630: ZEND_MUL_SPEC_CONST_TMP_HANDLER,
36631: ZEND_MUL_SPEC_CONST_VAR_HANDLER,
36632: ZEND_NULL_HANDLER,
36633: ZEND_MUL_SPEC_CONST_CV_HANDLER,
36634: ZEND_MUL_SPEC_TMP_CONST_HANDLER,
36635: ZEND_MUL_SPEC_TMP_TMP_HANDLER,
36636: ZEND_MUL_SPEC_TMP_VAR_HANDLER,
36637: ZEND_NULL_HANDLER,
36638: ZEND_MUL_SPEC_TMP_CV_HANDLER,
36639: ZEND_MUL_SPEC_VAR_CONST_HANDLER,
36640: ZEND_MUL_SPEC_VAR_TMP_HANDLER,
36641: ZEND_MUL_SPEC_VAR_VAR_HANDLER,
36642: ZEND_NULL_HANDLER,
36643: ZEND_MUL_SPEC_VAR_CV_HANDLER,
36644: ZEND_NULL_HANDLER,
36645: ZEND_NULL_HANDLER,
36646: ZEND_NULL_HANDLER,
36647: ZEND_NULL_HANDLER,
36648: ZEND_NULL_HANDLER,
36649: ZEND_MUL_SPEC_CV_CONST_HANDLER,
36650: ZEND_MUL_SPEC_CV_TMP_HANDLER,
36651: ZEND_MUL_SPEC_CV_VAR_HANDLER,
36652: ZEND_NULL_HANDLER,
36653: ZEND_MUL_SPEC_CV_CV_HANDLER,
36654: ZEND_DIV_SPEC_CONST_CONST_HANDLER,
36655: ZEND_DIV_SPEC_CONST_TMP_HANDLER,
36656: ZEND_DIV_SPEC_CONST_VAR_HANDLER,
36657: ZEND_NULL_HANDLER,
36658: ZEND_DIV_SPEC_CONST_CV_HANDLER,
36659: ZEND_DIV_SPEC_TMP_CONST_HANDLER,
36660: ZEND_DIV_SPEC_TMP_TMP_HANDLER,
36661: ZEND_DIV_SPEC_TMP_VAR_HANDLER,
36662: ZEND_NULL_HANDLER,
36663: ZEND_DIV_SPEC_TMP_CV_HANDLER,
36664: ZEND_DIV_SPEC_VAR_CONST_HANDLER,
36665: ZEND_DIV_SPEC_VAR_TMP_HANDLER,
36666: ZEND_DIV_SPEC_VAR_VAR_HANDLER,
36667: ZEND_NULL_HANDLER,
36668: ZEND_DIV_SPEC_VAR_CV_HANDLER,
36669: ZEND_NULL_HANDLER,
36670: ZEND_NULL_HANDLER,
36671: ZEND_NULL_HANDLER,
36672: ZEND_NULL_HANDLER,
36673: ZEND_NULL_HANDLER,
36674: ZEND_DIV_SPEC_CV_CONST_HANDLER,
36675: ZEND_DIV_SPEC_CV_TMP_HANDLER,
36676: ZEND_DIV_SPEC_CV_VAR_HANDLER,
36677: ZEND_NULL_HANDLER,
36678: ZEND_DIV_SPEC_CV_CV_HANDLER,
36679: ZEND_MOD_SPEC_CONST_CONST_HANDLER,
36680: ZEND_MOD_SPEC_CONST_TMP_HANDLER,
36681: ZEND_MOD_SPEC_CONST_VAR_HANDLER,
36682: ZEND_NULL_HANDLER,
36683: ZEND_MOD_SPEC_CONST_CV_HANDLER,
36684: ZEND_MOD_SPEC_TMP_CONST_HANDLER,
36685: ZEND_MOD_SPEC_TMP_TMP_HANDLER,
36686: ZEND_MOD_SPEC_TMP_VAR_HANDLER,
36687: ZEND_NULL_HANDLER,
36688: ZEND_MOD_SPEC_TMP_CV_HANDLER,
36689: ZEND_MOD_SPEC_VAR_CONST_HANDLER,
36690: ZEND_MOD_SPEC_VAR_TMP_HANDLER,
36691: ZEND_MOD_SPEC_VAR_VAR_HANDLER,
36692: ZEND_NULL_HANDLER,
36693: ZEND_MOD_SPEC_VAR_CV_HANDLER,
36694: ZEND_NULL_HANDLER,
36695: ZEND_NULL_HANDLER,
36696: ZEND_NULL_HANDLER,
36697: ZEND_NULL_HANDLER,
36698: ZEND_NULL_HANDLER,
36699: ZEND_MOD_SPEC_CV_CONST_HANDLER,
36700: ZEND_MOD_SPEC_CV_TMP_HANDLER,
36701: ZEND_MOD_SPEC_CV_VAR_HANDLER,
36702: ZEND_NULL_HANDLER,
36703: ZEND_MOD_SPEC_CV_CV_HANDLER,
36704: ZEND_SL_SPEC_CONST_CONST_HANDLER,
36705: ZEND_SL_SPEC_CONST_TMP_HANDLER,
36706: ZEND_SL_SPEC_CONST_VAR_HANDLER,
36707: ZEND_NULL_HANDLER,
36708: ZEND_SL_SPEC_CONST_CV_HANDLER,
36709: ZEND_SL_SPEC_TMP_CONST_HANDLER,
36710: ZEND_SL_SPEC_TMP_TMP_HANDLER,
36711: ZEND_SL_SPEC_TMP_VAR_HANDLER,
36712: ZEND_NULL_HANDLER,
36713: ZEND_SL_SPEC_TMP_CV_HANDLER,
36714: ZEND_SL_SPEC_VAR_CONST_HANDLER,
36715: ZEND_SL_SPEC_VAR_TMP_HANDLER,
36716: ZEND_SL_SPEC_VAR_VAR_HANDLER,
36717: ZEND_NULL_HANDLER,
36718: ZEND_SL_SPEC_VAR_CV_HANDLER,
36719: ZEND_NULL_HANDLER,
36720: ZEND_NULL_HANDLER,
36721: ZEND_NULL_HANDLER,
36722: ZEND_NULL_HANDLER,
36723: ZEND_NULL_HANDLER,
36724: ZEND_SL_SPEC_CV_CONST_HANDLER,
36725: ZEND_SL_SPEC_CV_TMP_HANDLER,
36726: ZEND_SL_SPEC_CV_VAR_HANDLER,
36727: ZEND_NULL_HANDLER,
36728: ZEND_SL_SPEC_CV_CV_HANDLER,
36729: ZEND_SR_SPEC_CONST_CONST_HANDLER,
36730: ZEND_SR_SPEC_CONST_TMP_HANDLER,
36731: ZEND_SR_SPEC_CONST_VAR_HANDLER,
36732: ZEND_NULL_HANDLER,
36733: ZEND_SR_SPEC_CONST_CV_HANDLER,
36734: ZEND_SR_SPEC_TMP_CONST_HANDLER,
36735: ZEND_SR_SPEC_TMP_TMP_HANDLER,
36736: ZEND_SR_SPEC_TMP_VAR_HANDLER,
36737: ZEND_NULL_HANDLER,
36738: ZEND_SR_SPEC_TMP_CV_HANDLER,
36739: ZEND_SR_SPEC_VAR_CONST_HANDLER,
36740: ZEND_SR_SPEC_VAR_TMP_HANDLER,
36741: ZEND_SR_SPEC_VAR_VAR_HANDLER,
36742: ZEND_NULL_HANDLER,
36743: ZEND_SR_SPEC_VAR_CV_HANDLER,
36744: ZEND_NULL_HANDLER,
36745: ZEND_NULL_HANDLER,
36746: ZEND_NULL_HANDLER,
36747: ZEND_NULL_HANDLER,
36748: ZEND_NULL_HANDLER,
36749: ZEND_SR_SPEC_CV_CONST_HANDLER,
36750: ZEND_SR_SPEC_CV_TMP_HANDLER,
36751: ZEND_SR_SPEC_CV_VAR_HANDLER,
36752: ZEND_NULL_HANDLER,
36753: ZEND_SR_SPEC_CV_CV_HANDLER,
36754: ZEND_CONCAT_SPEC_CONST_CONST_HANDLER,
36755: ZEND_CONCAT_SPEC_CONST_TMP_HANDLER,
36756: ZEND_CONCAT_SPEC_CONST_VAR_HANDLER,
36757: ZEND_NULL_HANDLER,
36758: ZEND_CONCAT_SPEC_CONST_CV_HANDLER,
36759: ZEND_CONCAT_SPEC_TMP_CONST_HANDLER,
36760: ZEND_CONCAT_SPEC_TMP_TMP_HANDLER,
36761: ZEND_CONCAT_SPEC_TMP_VAR_HANDLER,
36762: ZEND_NULL_HANDLER,
36763: ZEND_CONCAT_SPEC_TMP_CV_HANDLER,
36764: ZEND_CONCAT_SPEC_VAR_CONST_HANDLER,
36765: ZEND_CONCAT_SPEC_VAR_TMP_HANDLER,
36766: ZEND_CONCAT_SPEC_VAR_VAR_HANDLER,
36767: ZEND_NULL_HANDLER,
36768: ZEND_CONCAT_SPEC_VAR_CV_HANDLER,
36769: ZEND_NULL_HANDLER,
36770: ZEND_NULL_HANDLER,
36771: ZEND_NULL_HANDLER,
36772: ZEND_NULL_HANDLER,
36773: ZEND_NULL_HANDLER,
36774: ZEND_CONCAT_SPEC_CV_CONST_HANDLER,
36775: ZEND_CONCAT_SPEC_CV_TMP_HANDLER,
36776: ZEND_CONCAT_SPEC_CV_VAR_HANDLER,
36777: ZEND_NULL_HANDLER,
36778: ZEND_CONCAT_SPEC_CV_CV_HANDLER,
36779: ZEND_BW_OR_SPEC_CONST_CONST_HANDLER,
36780: ZEND_BW_OR_SPEC_CONST_TMP_HANDLER,
36781: ZEND_BW_OR_SPEC_CONST_VAR_HANDLER,
36782: ZEND_NULL_HANDLER,
36783: ZEND_BW_OR_SPEC_CONST_CV_HANDLER,
36784: ZEND_BW_OR_SPEC_TMP_CONST_HANDLER,
36785: ZEND_BW_OR_SPEC_TMP_TMP_HANDLER,
36786: ZEND_BW_OR_SPEC_TMP_VAR_HANDLER,
36787: ZEND_NULL_HANDLER,
36788: ZEND_BW_OR_SPEC_TMP_CV_HANDLER,
36789: ZEND_BW_OR_SPEC_VAR_CONST_HANDLER,
36790: ZEND_BW_OR_SPEC_VAR_TMP_HANDLER,
36791: ZEND_BW_OR_SPEC_VAR_VAR_HANDLER,
36792: ZEND_NULL_HANDLER,
36793: ZEND_BW_OR_SPEC_VAR_CV_HANDLER,
36794: ZEND_NULL_HANDLER,
36795: ZEND_NULL_HANDLER,
36796: ZEND_NULL_HANDLER,
36797: ZEND_NULL_HANDLER,
36798: ZEND_NULL_HANDLER,
36799: ZEND_BW_OR_SPEC_CV_CONST_HANDLER,
36800: ZEND_BW_OR_SPEC_CV_TMP_HANDLER,
36801: ZEND_BW_OR_SPEC_CV_VAR_HANDLER,
36802: ZEND_NULL_HANDLER,
36803: ZEND_BW_OR_SPEC_CV_CV_HANDLER,
36804: ZEND_BW_AND_SPEC_CONST_CONST_HANDLER,
36805: ZEND_BW_AND_SPEC_CONST_TMP_HANDLER,
36806: ZEND_BW_AND_SPEC_CONST_VAR_HANDLER,
36807: ZEND_NULL_HANDLER,
36808: ZEND_BW_AND_SPEC_CONST_CV_HANDLER,
36809: ZEND_BW_AND_SPEC_TMP_CONST_HANDLER,
36810: ZEND_BW_AND_SPEC_TMP_TMP_HANDLER,
36811: ZEND_BW_AND_SPEC_TMP_VAR_HANDLER,
36812: ZEND_NULL_HANDLER,
36813: ZEND_BW_AND_SPEC_TMP_CV_HANDLER,
36814: ZEND_BW_AND_SPEC_VAR_CONST_HANDLER,
36815: ZEND_BW_AND_SPEC_VAR_TMP_HANDLER,
36816: ZEND_BW_AND_SPEC_VAR_VAR_HANDLER,
36817: ZEND_NULL_HANDLER,
36818: ZEND_BW_AND_SPEC_VAR_CV_HANDLER,
36819: ZEND_NULL_HANDLER,
36820: ZEND_NULL_HANDLER,
36821: ZEND_NULL_HANDLER,
36822: ZEND_NULL_HANDLER,
36823: ZEND_NULL_HANDLER,
36824: ZEND_BW_AND_SPEC_CV_CONST_HANDLER,
36825: ZEND_BW_AND_SPEC_CV_TMP_HANDLER,
36826: ZEND_BW_AND_SPEC_CV_VAR_HANDLER,
36827: ZEND_NULL_HANDLER,
36828: ZEND_BW_AND_SPEC_CV_CV_HANDLER,
36829: ZEND_BW_XOR_SPEC_CONST_CONST_HANDLER,
36830: ZEND_BW_XOR_SPEC_CONST_TMP_HANDLER,
36831: ZEND_BW_XOR_SPEC_CONST_VAR_HANDLER,
36832: ZEND_NULL_HANDLER,
36833: ZEND_BW_XOR_SPEC_CONST_CV_HANDLER,
36834: ZEND_BW_XOR_SPEC_TMP_CONST_HANDLER,
36835: ZEND_BW_XOR_SPEC_TMP_TMP_HANDLER,
36836: ZEND_BW_XOR_SPEC_TMP_VAR_HANDLER,
36837: ZEND_NULL_HANDLER,
36838: ZEND_BW_XOR_SPEC_TMP_CV_HANDLER,
36839: ZEND_BW_XOR_SPEC_VAR_CONST_HANDLER,
36840: ZEND_BW_XOR_SPEC_VAR_TMP_HANDLER,
36841: ZEND_BW_XOR_SPEC_VAR_VAR_HANDLER,
36842: ZEND_NULL_HANDLER,
36843: ZEND_BW_XOR_SPEC_VAR_CV_HANDLER,
36844: ZEND_NULL_HANDLER,
36845: ZEND_NULL_HANDLER,
36846: ZEND_NULL_HANDLER,
36847: ZEND_NULL_HANDLER,
36848: ZEND_NULL_HANDLER,
36849: ZEND_BW_XOR_SPEC_CV_CONST_HANDLER,
36850: ZEND_BW_XOR_SPEC_CV_TMP_HANDLER,
36851: ZEND_BW_XOR_SPEC_CV_VAR_HANDLER,
36852: ZEND_NULL_HANDLER,
36853: ZEND_BW_XOR_SPEC_CV_CV_HANDLER,
36854: ZEND_BW_NOT_SPEC_CONST_HANDLER,
36855: ZEND_BW_NOT_SPEC_CONST_HANDLER,
36856: ZEND_BW_NOT_SPEC_CONST_HANDLER,
36857: ZEND_BW_NOT_SPEC_CONST_HANDLER,
36858: ZEND_BW_NOT_SPEC_CONST_HANDLER,
36859: ZEND_BW_NOT_SPEC_TMP_HANDLER,
36860: ZEND_BW_NOT_SPEC_TMP_HANDLER,
36861: ZEND_BW_NOT_SPEC_TMP_HANDLER,
36862: ZEND_BW_NOT_SPEC_TMP_HANDLER,
36863: ZEND_BW_NOT_SPEC_TMP_HANDLER,
36864: ZEND_BW_NOT_SPEC_VAR_HANDLER,
36865: ZEND_BW_NOT_SPEC_VAR_HANDLER,
36866: ZEND_BW_NOT_SPEC_VAR_HANDLER,
36867: ZEND_BW_NOT_SPEC_VAR_HANDLER,
36868: ZEND_BW_NOT_SPEC_VAR_HANDLER,
36869: ZEND_NULL_HANDLER,
36870: ZEND_NULL_HANDLER,
36871: ZEND_NULL_HANDLER,
36872: ZEND_NULL_HANDLER,
36873: ZEND_NULL_HANDLER,
36874: ZEND_BW_NOT_SPEC_CV_HANDLER,
36875: ZEND_BW_NOT_SPEC_CV_HANDLER,
36876: ZEND_BW_NOT_SPEC_CV_HANDLER,
36877: ZEND_BW_NOT_SPEC_CV_HANDLER,
36878: ZEND_BW_NOT_SPEC_CV_HANDLER,
36879: ZEND_BOOL_NOT_SPEC_CONST_HANDLER,
36880: ZEND_BOOL_NOT_SPEC_CONST_HANDLER,
36881: ZEND_BOOL_NOT_SPEC_CONST_HANDLER,
36882: ZEND_BOOL_NOT_SPEC_CONST_HANDLER,
36883: ZEND_BOOL_NOT_SPEC_CONST_HANDLER,
36884: ZEND_BOOL_NOT_SPEC_TMP_HANDLER,
36885: ZEND_BOOL_NOT_SPEC_TMP_HANDLER,
36886: ZEND_BOOL_NOT_SPEC_TMP_HANDLER,
36887: ZEND_BOOL_NOT_SPEC_TMP_HANDLER,
36888: ZEND_BOOL_NOT_SPEC_TMP_HANDLER,
36889: ZEND_BOOL_NOT_SPEC_VAR_HANDLER,
36890: ZEND_BOOL_NOT_SPEC_VAR_HANDLER,
36891: ZEND_BOOL_NOT_SPEC_VAR_HANDLER,
36892: ZEND_BOOL_NOT_SPEC_VAR_HANDLER,
36893: ZEND_BOOL_NOT_SPEC_VAR_HANDLER,
36894: ZEND_NULL_HANDLER,
36895: ZEND_NULL_HANDLER,
36896: ZEND_NULL_HANDLER,
36897: ZEND_NULL_HANDLER,
36898: ZEND_NULL_HANDLER,
36899: ZEND_BOOL_NOT_SPEC_CV_HANDLER,
36900: ZEND_BOOL_NOT_SPEC_CV_HANDLER,
36901: ZEND_BOOL_NOT_SPEC_CV_HANDLER,
36902: ZEND_BOOL_NOT_SPEC_CV_HANDLER,
36903: ZEND_BOOL_NOT_SPEC_CV_HANDLER,
36904: ZEND_BOOL_XOR_SPEC_CONST_CONST_HANDLER,
36905: ZEND_BOOL_XOR_SPEC_CONST_TMP_HANDLER,
36906: ZEND_BOOL_XOR_SPEC_CONST_VAR_HANDLER,
36907: ZEND_NULL_HANDLER,
36908: ZEND_BOOL_XOR_SPEC_CONST_CV_HANDLER,
36909: ZEND_BOOL_XOR_SPEC_TMP_CONST_HANDLER,
36910: ZEND_BOOL_XOR_SPEC_TMP_TMP_HANDLER,
36911: ZEND_BOOL_XOR_SPEC_TMP_VAR_HANDLER,
36912: ZEND_NULL_HANDLER,
36913: ZEND_BOOL_XOR_SPEC_TMP_CV_HANDLER,
36914: ZEND_BOOL_XOR_SPEC_VAR_CONST_HANDLER,
36915: ZEND_BOOL_XOR_SPEC_VAR_TMP_HANDLER,
36916: ZEND_BOOL_XOR_SPEC_VAR_VAR_HANDLER,
36917: ZEND_NULL_HANDLER,
36918: ZEND_BOOL_XOR_SPEC_VAR_CV_HANDLER,
36919: ZEND_NULL_HANDLER,
36920: ZEND_NULL_HANDLER,
36921: ZEND_NULL_HANDLER,
36922: ZEND_NULL_HANDLER,
36923: ZEND_NULL_HANDLER,
36924: ZEND_BOOL_XOR_SPEC_CV_CONST_HANDLER,
36925: ZEND_BOOL_XOR_SPEC_CV_TMP_HANDLER,
36926: ZEND_BOOL_XOR_SPEC_CV_VAR_HANDLER,
36927: ZEND_NULL_HANDLER,
36928: ZEND_BOOL_XOR_SPEC_CV_CV_HANDLER,
36929: ZEND_IS_IDENTICAL_SPEC_CONST_CONST_HANDLER,
36930: ZEND_IS_IDENTICAL_SPEC_CONST_TMP_HANDLER,
36931: ZEND_IS_IDENTICAL_SPEC_CONST_VAR_HANDLER,
36932: ZEND_NULL_HANDLER,
36933: ZEND_IS_IDENTICAL_SPEC_CONST_CV_HANDLER,
36934: ZEND_IS_IDENTICAL_SPEC_TMP_CONST_HANDLER,
36935: ZEND_IS_IDENTICAL_SPEC_TMP_TMP_HANDLER,
36936: ZEND_IS_IDENTICAL_SPEC_TMP_VAR_HANDLER,
36937: ZEND_NULL_HANDLER,
36938: ZEND_IS_IDENTICAL_SPEC_TMP_CV_HANDLER,
36939: ZEND_IS_IDENTICAL_SPEC_VAR_CONST_HANDLER,
36940: ZEND_IS_IDENTICAL_SPEC_VAR_TMP_HANDLER,
36941: ZEND_IS_IDENTICAL_SPEC_VAR_VAR_HANDLER,
36942: ZEND_NULL_HANDLER,
36943: ZEND_IS_IDENTICAL_SPEC_VAR_CV_HANDLER,
36944: ZEND_NULL_HANDLER,
36945: ZEND_NULL_HANDLER,
36946: ZEND_NULL_HANDLER,
36947: ZEND_NULL_HANDLER,
36948: ZEND_NULL_HANDLER,
36949: ZEND_IS_IDENTICAL_SPEC_CV_CONST_HANDLER,
36950: ZEND_IS_IDENTICAL_SPEC_CV_TMP_HANDLER,
36951: ZEND_IS_IDENTICAL_SPEC_CV_VAR_HANDLER,
36952: ZEND_NULL_HANDLER,
36953: ZEND_IS_IDENTICAL_SPEC_CV_CV_HANDLER,
36954: ZEND_IS_NOT_IDENTICAL_SPEC_CONST_CONST_HANDLER,
36955: ZEND_IS_NOT_IDENTICAL_SPEC_CONST_TMP_HANDLER,
36956: ZEND_IS_NOT_IDENTICAL_SPEC_CONST_VAR_HANDLER,
36957: ZEND_NULL_HANDLER,
36958: ZEND_IS_NOT_IDENTICAL_SPEC_CONST_CV_HANDLER,
36959: ZEND_IS_NOT_IDENTICAL_SPEC_TMP_CONST_HANDLER,
36960: ZEND_IS_NOT_IDENTICAL_SPEC_TMP_TMP_HANDLER,
36961: ZEND_IS_NOT_IDENTICAL_SPEC_TMP_VAR_HANDLER,
36962: ZEND_NULL_HANDLER,
36963: ZEND_IS_NOT_IDENTICAL_SPEC_TMP_CV_HANDLER,
36964: ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CONST_HANDLER,
36965: ZEND_IS_NOT_IDENTICAL_SPEC_VAR_TMP_HANDLER,
36966: ZEND_IS_NOT_IDENTICAL_SPEC_VAR_VAR_HANDLER,
36967: ZEND_NULL_HANDLER,
36968: ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CV_HANDLER,
36969: ZEND_NULL_HANDLER,
36970: ZEND_NULL_HANDLER,
36971: ZEND_NULL_HANDLER,
36972: ZEND_NULL_HANDLER,
36973: ZEND_NULL_HANDLER,
36974: ZEND_IS_NOT_IDENTICAL_SPEC_CV_CONST_HANDLER,
36975: ZEND_IS_NOT_IDENTICAL_SPEC_CV_TMP_HANDLER,
36976: ZEND_IS_NOT_IDENTICAL_SPEC_CV_VAR_HANDLER,
36977: ZEND_NULL_HANDLER,
36978: ZEND_IS_NOT_IDENTICAL_SPEC_CV_CV_HANDLER,
36979: ZEND_IS_EQUAL_SPEC_CONST_CONST_HANDLER,
36980: ZEND_IS_EQUAL_SPEC_CONST_TMP_HANDLER,
36981: ZEND_IS_EQUAL_SPEC_CONST_VAR_HANDLER,
36982: ZEND_NULL_HANDLER,
36983: ZEND_IS_EQUAL_SPEC_CONST_CV_HANDLER,
36984: ZEND_IS_EQUAL_SPEC_TMP_CONST_HANDLER,
36985: ZEND_IS_EQUAL_SPEC_TMP_TMP_HANDLER,
36986: ZEND_IS_EQUAL_SPEC_TMP_VAR_HANDLER,
36987: ZEND_NULL_HANDLER,
36988: ZEND_IS_EQUAL_SPEC_TMP_CV_HANDLER,
36989: ZEND_IS_EQUAL_SPEC_VAR_CONST_HANDLER,
36990: ZEND_IS_EQUAL_SPEC_VAR_TMP_HANDLER,
36991: ZEND_IS_EQUAL_SPEC_VAR_VAR_HANDLER,
36992: ZEND_NULL_HANDLER,
36993: ZEND_IS_EQUAL_SPEC_VAR_CV_HANDLER,
36994: ZEND_NULL_HANDLER,
36995: ZEND_NULL_HANDLER,
36996: ZEND_NULL_HANDLER,
36997: ZEND_NULL_HANDLER,
36998: ZEND_NULL_HANDLER,
36999: ZEND_IS_EQUAL_SPEC_CV_CONST_HANDLER,
37000: ZEND_IS_EQUAL_SPEC_CV_TMP_HANDLER,
37001: ZEND_IS_EQUAL_SPEC_CV_VAR_HANDLER,
37002: ZEND_NULL_HANDLER,
37003: ZEND_IS_EQUAL_SPEC_CV_CV_HANDLER,
37004: ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST_HANDLER,
37005: ZEND_IS_NOT_EQUAL_SPEC_CONST_TMP_HANDLER,
37006: ZEND_IS_NOT_EQUAL_SPEC_CONST_VAR_HANDLER,
37007: ZEND_NULL_HANDLER,
37008: ZEND_IS_NOT_EQUAL_SPEC_CONST_CV_HANDLER,
37009: ZEND_IS_NOT_EQUAL_SPEC_TMP_CONST_HANDLER,
37010: ZEND_IS_NOT_EQUAL_SPEC_TMP_TMP_HANDLER,
37011: ZEND_IS_NOT_EQUAL_SPEC_TMP_VAR_HANDLER,
37012: ZEND_NULL_HANDLER,
37013: ZEND_IS_NOT_EQUAL_SPEC_TMP_CV_HANDLER,
37014: ZEND_IS_NOT_EQUAL_SPEC_VAR_CONST_HANDLER,
37015: ZEND_IS_NOT_EQUAL_SPEC_VAR_TMP_HANDLER,
37016: ZEND_IS_NOT_EQUAL_SPEC_VAR_VAR_HANDLER,
37017: ZEND_NULL_HANDLER,
37018: ZEND_IS_NOT_EQUAL_SPEC_VAR_CV_HANDLER,
37019: ZEND_NULL_HANDLER,
37020: ZEND_NULL_HANDLER,
37021: ZEND_NULL_HANDLER,
37022: ZEND_NULL_HANDLER,
37023: ZEND_NULL_HANDLER,
37024: ZEND_IS_NOT_EQUAL_SPEC_CV_CONST_HANDLER,
37025: ZEND_IS_NOT_EQUAL_SPEC_CV_TMP_HANDLER,
37026: ZEND_IS_NOT_EQUAL_SPEC_CV_VAR_HANDLER,
37027: ZEND_NULL_HANDLER,
37028: ZEND_IS_NOT_EQUAL_SPEC_CV_CV_HANDLER,
37029: ZEND_IS_SMALLER_SPEC_CONST_CONST_HANDLER,
37030: ZEND_IS_SMALLER_SPEC_CONST_TMP_HANDLER,
37031: ZEND_IS_SMALLER_SPEC_CONST_VAR_HANDLER,
37032: ZEND_NULL_HANDLER,
37033: ZEND_IS_SMALLER_SPEC_CONST_CV_HANDLER,
37034: ZEND_IS_SMALLER_SPEC_TMP_CONST_HANDLER,
37035: ZEND_IS_SMALLER_SPEC_TMP_TMP_HANDLER,
37036: ZEND_IS_SMALLER_SPEC_TMP_VAR_HANDLER,
37037: ZEND_NULL_HANDLER,
37038: ZEND_IS_SMALLER_SPEC_TMP_CV_HANDLER,
37039: ZEND_IS_SMALLER_SPEC_VAR_CONST_HANDLER,
37040: ZEND_IS_SMALLER_SPEC_VAR_TMP_HANDLER,
37041: ZEND_IS_SMALLER_SPEC_VAR_VAR_HANDLER,
37042: ZEND_NULL_HANDLER,
37043: ZEND_IS_SMALLER_SPEC_VAR_CV_HANDLER,
37044: ZEND_NULL_HANDLER,
37045: ZEND_NULL_HANDLER,
37046: ZEND_NULL_HANDLER,
37047: ZEND_NULL_HANDLER,
37048: ZEND_NULL_HANDLER,
37049: ZEND_IS_SMALLER_SPEC_CV_CONST_HANDLER,
37050: ZEND_IS_SMALLER_SPEC_CV_TMP_HANDLER,
37051: ZEND_IS_SMALLER_SPEC_CV_VAR_HANDLER,
37052: ZEND_NULL_HANDLER,
37053: ZEND_IS_SMALLER_SPEC_CV_CV_HANDLER,
37054: ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST_HANDLER,
37055: ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMP_HANDLER,
37056: ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_VAR_HANDLER,
37057: ZEND_NULL_HANDLER,
37058: ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CV_HANDLER,
37059: ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMP_CONST_HANDLER,
37060: ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMP_TMP_HANDLER,
37061: ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMP_VAR_HANDLER,
37062: ZEND_NULL_HANDLER,
37063: ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMP_CV_HANDLER,
37064: ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_CONST_HANDLER,
37065: ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_TMP_HANDLER,
37066: ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_VAR_HANDLER,
37067: ZEND_NULL_HANDLER,
37068: ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_CV_HANDLER,
37069: ZEND_NULL_HANDLER,
37070: ZEND_NULL_HANDLER,
37071: ZEND_NULL_HANDLER,
37072: ZEND_NULL_HANDLER,
37073: ZEND_NULL_HANDLER,
37074: ZEND_IS_SMALLER_OR_EQUAL_SPEC_CV_CONST_HANDLER,
37075: ZEND_IS_SMALLER_OR_EQUAL_SPEC_CV_TMP_HANDLER,
37076: ZEND_IS_SMALLER_OR_EQUAL_SPEC_CV_VAR_HANDLER,
37077: ZEND_NULL_HANDLER,
37078: ZEND_IS_SMALLER_OR_EQUAL_SPEC_CV_CV_HANDLER,
37079: ZEND_CAST_SPEC_CONST_HANDLER,
37080: ZEND_CAST_SPEC_CONST_HANDLER,
37081: ZEND_CAST_SPEC_CONST_HANDLER,
37082: ZEND_CAST_SPEC_CONST_HANDLER,
37083: ZEND_CAST_SPEC_CONST_HANDLER,
37084: ZEND_CAST_SPEC_TMP_HANDLER,
37085: ZEND_CAST_SPEC_TMP_HANDLER,
37086: ZEND_CAST_SPEC_TMP_HANDLER,
37087: ZEND_CAST_SPEC_TMP_HANDLER,
37088: ZEND_CAST_SPEC_TMP_HANDLER,
37089: ZEND_CAST_SPEC_VAR_HANDLER,
37090: ZEND_CAST_SPEC_VAR_HANDLER,
37091: ZEND_CAST_SPEC_VAR_HANDLER,
37092: ZEND_CAST_SPEC_VAR_HANDLER,
37093: ZEND_CAST_SPEC_VAR_HANDLER,
37094: ZEND_NULL_HANDLER,
37095: ZEND_NULL_HANDLER,
37096: ZEND_NULL_HANDLER,
37097: ZEND_NULL_HANDLER,
37098: ZEND_NULL_HANDLER,
37099: ZEND_CAST_SPEC_CV_HANDLER,
37100: ZEND_CAST_SPEC_CV_HANDLER,
37101: ZEND_CAST_SPEC_CV_HANDLER,
37102: ZEND_CAST_SPEC_CV_HANDLER,
37103: ZEND_CAST_SPEC_CV_HANDLER,
37104: ZEND_QM_ASSIGN_SPEC_CONST_HANDLER,
37105: ZEND_QM_ASSIGN_SPEC_CONST_HANDLER,
37106: ZEND_QM_ASSIGN_SPEC_CONST_HANDLER,
37107: ZEND_QM_ASSIGN_SPEC_CONST_HANDLER,
37108: ZEND_QM_ASSIGN_SPEC_CONST_HANDLER,
37109: ZEND_QM_ASSIGN_SPEC_TMP_HANDLER,
37110: ZEND_QM_ASSIGN_SPEC_TMP_HANDLER,
37111: ZEND_QM_ASSIGN_SPEC_TMP_HANDLER,
37112: ZEND_QM_ASSIGN_SPEC_TMP_HANDLER,
37113: ZEND_QM_ASSIGN_SPEC_TMP_HANDLER,
37114: ZEND_QM_ASSIGN_SPEC_VAR_HANDLER,
37115: ZEND_QM_ASSIGN_SPEC_VAR_HANDLER,
37116: ZEND_QM_ASSIGN_SPEC_VAR_HANDLER,
37117: ZEND_QM_ASSIGN_SPEC_VAR_HANDLER,
37118: ZEND_QM_ASSIGN_SPEC_VAR_HANDLER,
37119: ZEND_NULL_HANDLER,
37120: ZEND_NULL_HANDLER,
37121: ZEND_NULL_HANDLER,
37122: ZEND_NULL_HANDLER,
37123: ZEND_NULL_HANDLER,
37124: ZEND_QM_ASSIGN_SPEC_CV_HANDLER,
37125: ZEND_QM_ASSIGN_SPEC_CV_HANDLER,
37126: ZEND_QM_ASSIGN_SPEC_CV_HANDLER,
37127: ZEND_QM_ASSIGN_SPEC_CV_HANDLER,
37128: ZEND_QM_ASSIGN_SPEC_CV_HANDLER,
37129: ZEND_NULL_HANDLER,
37130: ZEND_NULL_HANDLER,
37131: ZEND_NULL_HANDLER,
37132: ZEND_NULL_HANDLER,
37133: ZEND_NULL_HANDLER,
37134: ZEND_NULL_HANDLER,
37135: ZEND_NULL_HANDLER,
37136: ZEND_NULL_HANDLER,
37137: ZEND_NULL_HANDLER,
37138: ZEND_NULL_HANDLER,
37139: ZEND_ASSIGN_ADD_SPEC_VAR_CONST_HANDLER,
37140: ZEND_ASSIGN_ADD_SPEC_VAR_TMP_HANDLER,
37141: ZEND_ASSIGN_ADD_SPEC_VAR_VAR_HANDLER,
37142: ZEND_ASSIGN_ADD_SPEC_VAR_UNUSED_HANDLER,
37143: ZEND_ASSIGN_ADD_SPEC_VAR_CV_HANDLER,
37144: ZEND_ASSIGN_ADD_SPEC_UNUSED_CONST_HANDLER,
37145: ZEND_ASSIGN_ADD_SPEC_UNUSED_TMP_HANDLER,
37146: ZEND_ASSIGN_ADD_SPEC_UNUSED_VAR_HANDLER,
37147: ZEND_ASSIGN_ADD_SPEC_UNUSED_UNUSED_HANDLER,
37148: ZEND_ASSIGN_ADD_SPEC_UNUSED_CV_HANDLER,
37149: ZEND_ASSIGN_ADD_SPEC_CV_CONST_HANDLER,
37150: ZEND_ASSIGN_ADD_SPEC_CV_TMP_HANDLER,
37151: ZEND_ASSIGN_ADD_SPEC_CV_VAR_HANDLER,
37152: ZEND_ASSIGN_ADD_SPEC_CV_UNUSED_HANDLER,
37153: ZEND_ASSIGN_ADD_SPEC_CV_CV_HANDLER,
37154: ZEND_NULL_HANDLER,
37155: ZEND_NULL_HANDLER,
37156: ZEND_NULL_HANDLER,
37157: ZEND_NULL_HANDLER,
37158: ZEND_NULL_HANDLER,
37159: ZEND_NULL_HANDLER,
37160: ZEND_NULL_HANDLER,
37161: ZEND_NULL_HANDLER,
37162: ZEND_NULL_HANDLER,
37163: ZEND_NULL_HANDLER,
37164: ZEND_ASSIGN_SUB_SPEC_VAR_CONST_HANDLER,
37165: ZEND_ASSIGN_SUB_SPEC_VAR_TMP_HANDLER,
37166: ZEND_ASSIGN_SUB_SPEC_VAR_VAR_HANDLER,
37167: ZEND_ASSIGN_SUB_SPEC_VAR_UNUSED_HANDLER,
37168: ZEND_ASSIGN_SUB_SPEC_VAR_CV_HANDLER,
37169: ZEND_ASSIGN_SUB_SPEC_UNUSED_CONST_HANDLER,
37170: ZEND_ASSIGN_SUB_SPEC_UNUSED_TMP_HANDLER,
37171: ZEND_ASSIGN_SUB_SPEC_UNUSED_VAR_HANDLER,
37172: ZEND_ASSIGN_SUB_SPEC_UNUSED_UNUSED_HANDLER,
37173: ZEND_ASSIGN_SUB_SPEC_UNUSED_CV_HANDLER,
37174: ZEND_ASSIGN_SUB_SPEC_CV_CONST_HANDLER,
37175: ZEND_ASSIGN_SUB_SPEC_CV_TMP_HANDLER,
37176: ZEND_ASSIGN_SUB_SPEC_CV_VAR_HANDLER,
37177: ZEND_ASSIGN_SUB_SPEC_CV_UNUSED_HANDLER,
37178: ZEND_ASSIGN_SUB_SPEC_CV_CV_HANDLER,
37179: ZEND_NULL_HANDLER,
37180: ZEND_NULL_HANDLER,
37181: ZEND_NULL_HANDLER,
37182: ZEND_NULL_HANDLER,
37183: ZEND_NULL_HANDLER,
37184: ZEND_NULL_HANDLER,
37185: ZEND_NULL_HANDLER,
37186: ZEND_NULL_HANDLER,
37187: ZEND_NULL_HANDLER,
37188: ZEND_NULL_HANDLER,
37189: ZEND_ASSIGN_MUL_SPEC_VAR_CONST_HANDLER,
37190: ZEND_ASSIGN_MUL_SPEC_VAR_TMP_HANDLER,
37191: ZEND_ASSIGN_MUL_SPEC_VAR_VAR_HANDLER,
37192: ZEND_ASSIGN_MUL_SPEC_VAR_UNUSED_HANDLER,
37193: ZEND_ASSIGN_MUL_SPEC_VAR_CV_HANDLER,
37194: ZEND_ASSIGN_MUL_SPEC_UNUSED_CONST_HANDLER,
37195: ZEND_ASSIGN_MUL_SPEC_UNUSED_TMP_HANDLER,
37196: ZEND_ASSIGN_MUL_SPEC_UNUSED_VAR_HANDLER,
37197: ZEND_ASSIGN_MUL_SPEC_UNUSED_UNUSED_HANDLER,
37198: ZEND_ASSIGN_MUL_SPEC_UNUSED_CV_HANDLER,
37199: ZEND_ASSIGN_MUL_SPEC_CV_CONST_HANDLER,
37200: ZEND_ASSIGN_MUL_SPEC_CV_TMP_HANDLER,
37201: ZEND_ASSIGN_MUL_SPEC_CV_VAR_HANDLER,
37202: ZEND_ASSIGN_MUL_SPEC_CV_UNUSED_HANDLER,
37203: ZEND_ASSIGN_MUL_SPEC_CV_CV_HANDLER,
37204: ZEND_NULL_HANDLER,
37205: ZEND_NULL_HANDLER,
37206: ZEND_NULL_HANDLER,
37207: ZEND_NULL_HANDLER,
37208: ZEND_NULL_HANDLER,
37209: ZEND_NULL_HANDLER,
37210: ZEND_NULL_HANDLER,
37211: ZEND_NULL_HANDLER,
37212: ZEND_NULL_HANDLER,
37213: ZEND_NULL_HANDLER,
37214: ZEND_ASSIGN_DIV_SPEC_VAR_CONST_HANDLER,
37215: ZEND_ASSIGN_DIV_SPEC_VAR_TMP_HANDLER,
37216: ZEND_ASSIGN_DIV_SPEC_VAR_VAR_HANDLER,
37217: ZEND_ASSIGN_DIV_SPEC_VAR_UNUSED_HANDLER,
37218: ZEND_ASSIGN_DIV_SPEC_VAR_CV_HANDLER,
37219: ZEND_ASSIGN_DIV_SPEC_UNUSED_CONST_HANDLER,
37220: ZEND_ASSIGN_DIV_SPEC_UNUSED_TMP_HANDLER,
37221: ZEND_ASSIGN_DIV_SPEC_UNUSED_VAR_HANDLER,
37222: ZEND_ASSIGN_DIV_SPEC_UNUSED_UNUSED_HANDLER,
37223: ZEND_ASSIGN_DIV_SPEC_UNUSED_CV_HANDLER,
37224: ZEND_ASSIGN_DIV_SPEC_CV_CONST_HANDLER,
37225: ZEND_ASSIGN_DIV_SPEC_CV_TMP_HANDLER,
37226: ZEND_ASSIGN_DIV_SPEC_CV_VAR_HANDLER,
37227: ZEND_ASSIGN_DIV_SPEC_CV_UNUSED_HANDLER,
37228: ZEND_ASSIGN_DIV_SPEC_CV_CV_HANDLER,
37229: ZEND_NULL_HANDLER,
37230: ZEND_NULL_HANDLER,
37231: ZEND_NULL_HANDLER,
37232: ZEND_NULL_HANDLER,
37233: ZEND_NULL_HANDLER,
37234: ZEND_NULL_HANDLER,
37235: ZEND_NULL_HANDLER,
37236: ZEND_NULL_HANDLER,
37237: ZEND_NULL_HANDLER,
37238: ZEND_NULL_HANDLER,
37239: ZEND_ASSIGN_MOD_SPEC_VAR_CONST_HANDLER,
37240: ZEND_ASSIGN_MOD_SPEC_VAR_TMP_HANDLER,
37241: ZEND_ASSIGN_MOD_SPEC_VAR_VAR_HANDLER,
37242: ZEND_ASSIGN_MOD_SPEC_VAR_UNUSED_HANDLER,
37243: ZEND_ASSIGN_MOD_SPEC_VAR_CV_HANDLER,
37244: ZEND_ASSIGN_MOD_SPEC_UNUSED_CONST_HANDLER,
37245: ZEND_ASSIGN_MOD_SPEC_UNUSED_TMP_HANDLER,
37246: ZEND_ASSIGN_MOD_SPEC_UNUSED_VAR_HANDLER,
37247: ZEND_ASSIGN_MOD_SPEC_UNUSED_UNUSED_HANDLER,
37248: ZEND_ASSIGN_MOD_SPEC_UNUSED_CV_HANDLER,
37249: ZEND_ASSIGN_MOD_SPEC_CV_CONST_HANDLER,
37250: ZEND_ASSIGN_MOD_SPEC_CV_TMP_HANDLER,
37251: ZEND_ASSIGN_MOD_SPEC_CV_VAR_HANDLER,
37252: ZEND_ASSIGN_MOD_SPEC_CV_UNUSED_HANDLER,
37253: ZEND_ASSIGN_MOD_SPEC_CV_CV_HANDLER,
37254: ZEND_NULL_HANDLER,
37255: ZEND_NULL_HANDLER,
37256: ZEND_NULL_HANDLER,
37257: ZEND_NULL_HANDLER,
37258: ZEND_NULL_HANDLER,
37259: ZEND_NULL_HANDLER,
37260: ZEND_NULL_HANDLER,
37261: ZEND_NULL_HANDLER,
37262: ZEND_NULL_HANDLER,
37263: ZEND_NULL_HANDLER,
37264: ZEND_ASSIGN_SL_SPEC_VAR_CONST_HANDLER,
37265: ZEND_ASSIGN_SL_SPEC_VAR_TMP_HANDLER,
37266: ZEND_ASSIGN_SL_SPEC_VAR_VAR_HANDLER,
37267: ZEND_ASSIGN_SL_SPEC_VAR_UNUSED_HANDLER,
37268: ZEND_ASSIGN_SL_SPEC_VAR_CV_HANDLER,
37269: ZEND_ASSIGN_SL_SPEC_UNUSED_CONST_HANDLER,
37270: ZEND_ASSIGN_SL_SPEC_UNUSED_TMP_HANDLER,
37271: ZEND_ASSIGN_SL_SPEC_UNUSED_VAR_HANDLER,
37272: ZEND_ASSIGN_SL_SPEC_UNUSED_UNUSED_HANDLER,
37273: ZEND_ASSIGN_SL_SPEC_UNUSED_CV_HANDLER,
37274: ZEND_ASSIGN_SL_SPEC_CV_CONST_HANDLER,
37275: ZEND_ASSIGN_SL_SPEC_CV_TMP_HANDLER,
37276: ZEND_ASSIGN_SL_SPEC_CV_VAR_HANDLER,
37277: ZEND_ASSIGN_SL_SPEC_CV_UNUSED_HANDLER,
37278: ZEND_ASSIGN_SL_SPEC_CV_CV_HANDLER,
37279: ZEND_NULL_HANDLER,
37280: ZEND_NULL_HANDLER,
37281: ZEND_NULL_HANDLER,
37282: ZEND_NULL_HANDLER,
37283: ZEND_NULL_HANDLER,
37284: ZEND_NULL_HANDLER,
37285: ZEND_NULL_HANDLER,
37286: ZEND_NULL_HANDLER,
37287: ZEND_NULL_HANDLER,
37288: ZEND_NULL_HANDLER,
37289: ZEND_ASSIGN_SR_SPEC_VAR_CONST_HANDLER,
37290: ZEND_ASSIGN_SR_SPEC_VAR_TMP_HANDLER,
37291: ZEND_ASSIGN_SR_SPEC_VAR_VAR_HANDLER,
37292: ZEND_ASSIGN_SR_SPEC_VAR_UNUSED_HANDLER,
37293: ZEND_ASSIGN_SR_SPEC_VAR_CV_HANDLER,
37294: ZEND_ASSIGN_SR_SPEC_UNUSED_CONST_HANDLER,
37295: ZEND_ASSIGN_SR_SPEC_UNUSED_TMP_HANDLER,
37296: ZEND_ASSIGN_SR_SPEC_UNUSED_VAR_HANDLER,
37297: ZEND_ASSIGN_SR_SPEC_UNUSED_UNUSED_HANDLER,
37298: ZEND_ASSIGN_SR_SPEC_UNUSED_CV_HANDLER,
37299: ZEND_ASSIGN_SR_SPEC_CV_CONST_HANDLER,
37300: ZEND_ASSIGN_SR_SPEC_CV_TMP_HANDLER,
37301: ZEND_ASSIGN_SR_SPEC_CV_VAR_HANDLER,
37302: ZEND_ASSIGN_SR_SPEC_CV_UNUSED_HANDLER,
37303: ZEND_ASSIGN_SR_SPEC_CV_CV_HANDLER,
37304: ZEND_NULL_HANDLER,
37305: ZEND_NULL_HANDLER,
37306: ZEND_NULL_HANDLER,
37307: ZEND_NULL_HANDLER,
37308: ZEND_NULL_HANDLER,
37309: ZEND_NULL_HANDLER,
37310: ZEND_NULL_HANDLER,
37311: ZEND_NULL_HANDLER,
37312: ZEND_NULL_HANDLER,
37313: ZEND_NULL_HANDLER,
37314: ZEND_ASSIGN_CONCAT_SPEC_VAR_CONST_HANDLER,
37315: ZEND_ASSIGN_CONCAT_SPEC_VAR_TMP_HANDLER,
37316: ZEND_ASSIGN_CONCAT_SPEC_VAR_VAR_HANDLER,
37317: ZEND_ASSIGN_CONCAT_SPEC_VAR_UNUSED_HANDLER,
37318: ZEND_ASSIGN_CONCAT_SPEC_VAR_CV_HANDLER,
37319: ZEND_ASSIGN_CONCAT_SPEC_UNUSED_CONST_HANDLER,
37320: ZEND_ASSIGN_CONCAT_SPEC_UNUSED_TMP_HANDLER,
37321: ZEND_ASSIGN_CONCAT_SPEC_UNUSED_VAR_HANDLER,
37322: ZEND_ASSIGN_CONCAT_SPEC_UNUSED_UNUSED_HANDLER,
37323: ZEND_ASSIGN_CONCAT_SPEC_UNUSED_CV_HANDLER,
37324: ZEND_ASSIGN_CONCAT_SPEC_CV_CONST_HANDLER,
37325: ZEND_ASSIGN_CONCAT_SPEC_CV_TMP_HANDLER,
37326: ZEND_ASSIGN_CONCAT_SPEC_CV_VAR_HANDLER,
37327: ZEND_ASSIGN_CONCAT_SPEC_CV_UNUSED_HANDLER,
37328: ZEND_ASSIGN_CONCAT_SPEC_CV_CV_HANDLER,
37329: ZEND_NULL_HANDLER,
37330: ZEND_NULL_HANDLER,
37331: ZEND_NULL_HANDLER,
37332: ZEND_NULL_HANDLER,
37333: ZEND_NULL_HANDLER,
37334: ZEND_NULL_HANDLER,
37335: ZEND_NULL_HANDLER,
37336: ZEND_NULL_HANDLER,
37337: ZEND_NULL_HANDLER,
37338: ZEND_NULL_HANDLER,
37339: ZEND_ASSIGN_BW_OR_SPEC_VAR_CONST_HANDLER,
37340: ZEND_ASSIGN_BW_OR_SPEC_VAR_TMP_HANDLER,
37341: ZEND_ASSIGN_BW_OR_SPEC_VAR_VAR_HANDLER,
37342: ZEND_ASSIGN_BW_OR_SPEC_VAR_UNUSED_HANDLER,
37343: ZEND_ASSIGN_BW_OR_SPEC_VAR_CV_HANDLER,
37344: ZEND_ASSIGN_BW_OR_SPEC_UNUSED_CONST_HANDLER,
37345: ZEND_ASSIGN_BW_OR_SPEC_UNUSED_TMP_HANDLER,
37346: ZEND_ASSIGN_BW_OR_SPEC_UNUSED_VAR_HANDLER,
37347: ZEND_ASSIGN_BW_OR_SPEC_UNUSED_UNUSED_HANDLER,
37348: ZEND_ASSIGN_BW_OR_SPEC_UNUSED_CV_HANDLER,
37349: ZEND_ASSIGN_BW_OR_SPEC_CV_CONST_HANDLER,
37350: ZEND_ASSIGN_BW_OR_SPEC_CV_TMP_HANDLER,
37351: ZEND_ASSIGN_BW_OR_SPEC_CV_VAR_HANDLER,
37352: ZEND_ASSIGN_BW_OR_SPEC_CV_UNUSED_HANDLER,
37353: ZEND_ASSIGN_BW_OR_SPEC_CV_CV_HANDLER,
37354: ZEND_NULL_HANDLER,
37355: ZEND_NULL_HANDLER,
37356: ZEND_NULL_HANDLER,
37357: ZEND_NULL_HANDLER,
37358: ZEND_NULL_HANDLER,
37359: ZEND_NULL_HANDLER,
37360: ZEND_NULL_HANDLER,
37361: ZEND_NULL_HANDLER,
37362: ZEND_NULL_HANDLER,
37363: ZEND_NULL_HANDLER,
37364: ZEND_ASSIGN_BW_AND_SPEC_VAR_CONST_HANDLER,
37365: ZEND_ASSIGN_BW_AND_SPEC_VAR_TMP_HANDLER,
37366: ZEND_ASSIGN_BW_AND_SPEC_VAR_VAR_HANDLER,
37367: ZEND_ASSIGN_BW_AND_SPEC_VAR_UNUSED_HANDLER,
37368: ZEND_ASSIGN_BW_AND_SPEC_VAR_CV_HANDLER,
37369: ZEND_ASSIGN_BW_AND_SPEC_UNUSED_CONST_HANDLER,
37370: ZEND_ASSIGN_BW_AND_SPEC_UNUSED_TMP_HANDLER,
37371: ZEND_ASSIGN_BW_AND_SPEC_UNUSED_VAR_HANDLER,
37372: ZEND_ASSIGN_BW_AND_SPEC_UNUSED_UNUSED_HANDLER,
37373: ZEND_ASSIGN_BW_AND_SPEC_UNUSED_CV_HANDLER,
37374: ZEND_ASSIGN_BW_AND_SPEC_CV_CONST_HANDLER,
37375: ZEND_ASSIGN_BW_AND_SPEC_CV_TMP_HANDLER,
37376: ZEND_ASSIGN_BW_AND_SPEC_CV_VAR_HANDLER,
37377: ZEND_ASSIGN_BW_AND_SPEC_CV_UNUSED_HANDLER,
37378: ZEND_ASSIGN_BW_AND_SPEC_CV_CV_HANDLER,
37379: ZEND_NULL_HANDLER,
37380: ZEND_NULL_HANDLER,
37381: ZEND_NULL_HANDLER,
37382: ZEND_NULL_HANDLER,
37383: ZEND_NULL_HANDLER,
37384: ZEND_NULL_HANDLER,
37385: ZEND_NULL_HANDLER,
37386: ZEND_NULL_HANDLER,
37387: ZEND_NULL_HANDLER,
37388: ZEND_NULL_HANDLER,
37389: ZEND_ASSIGN_BW_XOR_SPEC_VAR_CONST_HANDLER,
37390: ZEND_ASSIGN_BW_XOR_SPEC_VAR_TMP_HANDLER,
37391: ZEND_ASSIGN_BW_XOR_SPEC_VAR_VAR_HANDLER,
37392: ZEND_ASSIGN_BW_XOR_SPEC_VAR_UNUSED_HANDLER,
37393: ZEND_ASSIGN_BW_XOR_SPEC_VAR_CV_HANDLER,
37394: ZEND_ASSIGN_BW_XOR_SPEC_UNUSED_CONST_HANDLER,
37395: ZEND_ASSIGN_BW_XOR_SPEC_UNUSED_TMP_HANDLER,
37396: ZEND_ASSIGN_BW_XOR_SPEC_UNUSED_VAR_HANDLER,
37397: ZEND_ASSIGN_BW_XOR_SPEC_UNUSED_UNUSED_HANDLER,
37398: ZEND_ASSIGN_BW_XOR_SPEC_UNUSED_CV_HANDLER,
37399: ZEND_ASSIGN_BW_XOR_SPEC_CV_CONST_HANDLER,
37400: ZEND_ASSIGN_BW_XOR_SPEC_CV_TMP_HANDLER,
37401: ZEND_ASSIGN_BW_XOR_SPEC_CV_VAR_HANDLER,
37402: ZEND_ASSIGN_BW_XOR_SPEC_CV_UNUSED_HANDLER,
37403: ZEND_ASSIGN_BW_XOR_SPEC_CV_CV_HANDLER,
37404: ZEND_NULL_HANDLER,
37405: ZEND_NULL_HANDLER,
37406: ZEND_NULL_HANDLER,
37407: ZEND_NULL_HANDLER,
37408: ZEND_NULL_HANDLER,
37409: ZEND_NULL_HANDLER,
37410: ZEND_NULL_HANDLER,
37411: ZEND_NULL_HANDLER,
37412: ZEND_NULL_HANDLER,
37413: ZEND_NULL_HANDLER,
37414: ZEND_PRE_INC_SPEC_VAR_HANDLER,
37415: ZEND_PRE_INC_SPEC_VAR_HANDLER,
37416: ZEND_PRE_INC_SPEC_VAR_HANDLER,
37417: ZEND_PRE_INC_SPEC_VAR_HANDLER,
37418: ZEND_PRE_INC_SPEC_VAR_HANDLER,
37419: ZEND_NULL_HANDLER,
37420: ZEND_NULL_HANDLER,
37421: ZEND_NULL_HANDLER,
37422: ZEND_NULL_HANDLER,
37423: ZEND_NULL_HANDLER,
37424: ZEND_PRE_INC_SPEC_CV_HANDLER,
37425: ZEND_PRE_INC_SPEC_CV_HANDLER,
37426: ZEND_PRE_INC_SPEC_CV_HANDLER,
37427: ZEND_PRE_INC_SPEC_CV_HANDLER,
37428: ZEND_PRE_INC_SPEC_CV_HANDLER,
37429: ZEND_NULL_HANDLER,
37430: ZEND_NULL_HANDLER,
37431: ZEND_NULL_HANDLER,
37432: ZEND_NULL_HANDLER,
37433: ZEND_NULL_HANDLER,
37434: ZEND_NULL_HANDLER,
37435: ZEND_NULL_HANDLER,
37436: ZEND_NULL_HANDLER,
37437: ZEND_NULL_HANDLER,
37438: ZEND_NULL_HANDLER,
37439: ZEND_PRE_DEC_SPEC_VAR_HANDLER,
37440: ZEND_PRE_DEC_SPEC_VAR_HANDLER,
37441: ZEND_PRE_DEC_SPEC_VAR_HANDLER,
37442: ZEND_PRE_DEC_SPEC_VAR_HANDLER,
37443: ZEND_PRE_DEC_SPEC_VAR_HANDLER,
37444: ZEND_NULL_HANDLER,
37445: ZEND_NULL_HANDLER,
37446: ZEND_NULL_HANDLER,
37447: ZEND_NULL_HANDLER,
37448: ZEND_NULL_HANDLER,
37449: ZEND_PRE_DEC_SPEC_CV_HANDLER,
37450: ZEND_PRE_DEC_SPEC_CV_HANDLER,
37451: ZEND_PRE_DEC_SPEC_CV_HANDLER,
37452: ZEND_PRE_DEC_SPEC_CV_HANDLER,
37453: ZEND_PRE_DEC_SPEC_CV_HANDLER,
37454: ZEND_NULL_HANDLER,
37455: ZEND_NULL_HANDLER,
37456: ZEND_NULL_HANDLER,
37457: ZEND_NULL_HANDLER,
37458: ZEND_NULL_HANDLER,
37459: ZEND_NULL_HANDLER,
37460: ZEND_NULL_HANDLER,
37461: ZEND_NULL_HANDLER,
37462: ZEND_NULL_HANDLER,
37463: ZEND_NULL_HANDLER,
37464: ZEND_POST_INC_SPEC_VAR_HANDLER,
37465: ZEND_POST_INC_SPEC_VAR_HANDLER,
37466: ZEND_POST_INC_SPEC_VAR_HANDLER,
37467: ZEND_POST_INC_SPEC_VAR_HANDLER,
37468: ZEND_POST_INC_SPEC_VAR_HANDLER,
37469: ZEND_NULL_HANDLER,
37470: ZEND_NULL_HANDLER,
37471: ZEND_NULL_HANDLER,
37472: ZEND_NULL_HANDLER,
37473: ZEND_NULL_HANDLER,
37474: ZEND_POST_INC_SPEC_CV_HANDLER,
37475: ZEND_POST_INC_SPEC_CV_HANDLER,
37476: ZEND_POST_INC_SPEC_CV_HANDLER,
37477: ZEND_POST_INC_SPEC_CV_HANDLER,
37478: ZEND_POST_INC_SPEC_CV_HANDLER,
37479: ZEND_NULL_HANDLER,
37480: ZEND_NULL_HANDLER,
37481: ZEND_NULL_HANDLER,
37482: ZEND_NULL_HANDLER,
37483: ZEND_NULL_HANDLER,
37484: ZEND_NULL_HANDLER,
37485: ZEND_NULL_HANDLER,
37486: ZEND_NULL_HANDLER,
37487: ZEND_NULL_HANDLER,
37488: ZEND_NULL_HANDLER,
37489: ZEND_POST_DEC_SPEC_VAR_HANDLER,
37490: ZEND_POST_DEC_SPEC_VAR_HANDLER,
37491: ZEND_POST_DEC_SPEC_VAR_HANDLER,
37492: ZEND_POST_DEC_SPEC_VAR_HANDLER,
37493: ZEND_POST_DEC_SPEC_VAR_HANDLER,
37494: ZEND_NULL_HANDLER,
37495: ZEND_NULL_HANDLER,
37496: ZEND_NULL_HANDLER,
37497: ZEND_NULL_HANDLER,
37498: ZEND_NULL_HANDLER,
37499: ZEND_POST_DEC_SPEC_CV_HANDLER,
37500: ZEND_POST_DEC_SPEC_CV_HANDLER,
37501: ZEND_POST_DEC_SPEC_CV_HANDLER,
37502: ZEND_POST_DEC_SPEC_CV_HANDLER,
37503: ZEND_POST_DEC_SPEC_CV_HANDLER,
37504: ZEND_NULL_HANDLER,
37505: ZEND_NULL_HANDLER,
37506: ZEND_NULL_HANDLER,
37507: ZEND_NULL_HANDLER,
37508: ZEND_NULL_HANDLER,
37509: ZEND_NULL_HANDLER,
37510: ZEND_NULL_HANDLER,
37511: ZEND_NULL_HANDLER,
37512: ZEND_NULL_HANDLER,
37513: ZEND_NULL_HANDLER,
37514: ZEND_ASSIGN_SPEC_VAR_CONST_HANDLER,
37515: ZEND_ASSIGN_SPEC_VAR_TMP_HANDLER,
37516: ZEND_ASSIGN_SPEC_VAR_VAR_HANDLER,
37517: ZEND_NULL_HANDLER,
37518: ZEND_ASSIGN_SPEC_VAR_CV_HANDLER,
37519: ZEND_NULL_HANDLER,
37520: ZEND_NULL_HANDLER,
37521: ZEND_NULL_HANDLER,
37522: ZEND_NULL_HANDLER,
37523: ZEND_NULL_HANDLER,
37524: ZEND_ASSIGN_SPEC_CV_CONST_HANDLER,
37525: ZEND_ASSIGN_SPEC_CV_TMP_HANDLER,
37526: ZEND_ASSIGN_SPEC_CV_VAR_HANDLER,
37527: ZEND_NULL_HANDLER,
37528: ZEND_ASSIGN_SPEC_CV_CV_HANDLER,
37529: ZEND_NULL_HANDLER,
37530: ZEND_NULL_HANDLER,
37531: ZEND_NULL_HANDLER,
37532: ZEND_NULL_HANDLER,
37533: ZEND_NULL_HANDLER,
37534: ZEND_NULL_HANDLER,
37535: ZEND_NULL_HANDLER,
37536: ZEND_NULL_HANDLER,
37537: ZEND_NULL_HANDLER,
37538: ZEND_NULL_HANDLER,
37539: ZEND_NULL_HANDLER,
37540: ZEND_NULL_HANDLER,
37541: ZEND_ASSIGN_REF_SPEC_VAR_VAR_HANDLER,
37542: ZEND_NULL_HANDLER,
37543: ZEND_ASSIGN_REF_SPEC_VAR_CV_HANDLER,
37544: ZEND_NULL_HANDLER,
37545: ZEND_NULL_HANDLER,
37546: ZEND_NULL_HANDLER,
37547: ZEND_NULL_HANDLER,
37548: ZEND_NULL_HANDLER,
37549: ZEND_NULL_HANDLER,
37550: ZEND_NULL_HANDLER,
37551: ZEND_ASSIGN_REF_SPEC_CV_VAR_HANDLER,
37552: ZEND_NULL_HANDLER,
37553: ZEND_ASSIGN_REF_SPEC_CV_CV_HANDLER,
37554: ZEND_ECHO_SPEC_CONST_HANDLER,
37555: ZEND_ECHO_SPEC_CONST_HANDLER,
37556: ZEND_ECHO_SPEC_CONST_HANDLER,
37557: ZEND_ECHO_SPEC_CONST_HANDLER,
37558: ZEND_ECHO_SPEC_CONST_HANDLER,
37559: ZEND_ECHO_SPEC_TMP_HANDLER,
37560: ZEND_ECHO_SPEC_TMP_HANDLER,
37561: ZEND_ECHO_SPEC_TMP_HANDLER,
37562: ZEND_ECHO_SPEC_TMP_HANDLER,
37563: ZEND_ECHO_SPEC_TMP_HANDLER,
37564: ZEND_ECHO_SPEC_VAR_HANDLER,
37565: ZEND_ECHO_SPEC_VAR_HANDLER,
37566: ZEND_ECHO_SPEC_VAR_HANDLER,
37567: ZEND_ECHO_SPEC_VAR_HANDLER,
37568: ZEND_ECHO_SPEC_VAR_HANDLER,
37569: ZEND_NULL_HANDLER,
37570: ZEND_NULL_HANDLER,
37571: ZEND_NULL_HANDLER,
37572: ZEND_NULL_HANDLER,
37573: ZEND_NULL_HANDLER,
37574: ZEND_ECHO_SPEC_CV_HANDLER,
37575: ZEND_ECHO_SPEC_CV_HANDLER,
37576: ZEND_ECHO_SPEC_CV_HANDLER,
37577: ZEND_ECHO_SPEC_CV_HANDLER,
37578: ZEND_ECHO_SPEC_CV_HANDLER,
37579: ZEND_PRINT_SPEC_CONST_HANDLER,
37580: ZEND_PRINT_SPEC_CONST_HANDLER,
37581: ZEND_PRINT_SPEC_CONST_HANDLER,
37582: ZEND_PRINT_SPEC_CONST_HANDLER,
37583: ZEND_PRINT_SPEC_CONST_HANDLER,
37584: ZEND_PRINT_SPEC_TMP_HANDLER,
37585: ZEND_PRINT_SPEC_TMP_HANDLER,
37586: ZEND_PRINT_SPEC_TMP_HANDLER,
37587: ZEND_PRINT_SPEC_TMP_HANDLER,
37588: ZEND_PRINT_SPEC_TMP_HANDLER,
37589: ZEND_PRINT_SPEC_VAR_HANDLER,
37590: ZEND_PRINT_SPEC_VAR_HANDLER,
37591: ZEND_PRINT_SPEC_VAR_HANDLER,
37592: ZEND_PRINT_SPEC_VAR_HANDLER,
37593: ZEND_PRINT_SPEC_VAR_HANDLER,
37594: ZEND_NULL_HANDLER,
37595: ZEND_NULL_HANDLER,
37596: ZEND_NULL_HANDLER,
37597: ZEND_NULL_HANDLER,
37598: ZEND_NULL_HANDLER,
37599: ZEND_PRINT_SPEC_CV_HANDLER,
37600: ZEND_PRINT_SPEC_CV_HANDLER,
37601: ZEND_PRINT_SPEC_CV_HANDLER,
37602: ZEND_PRINT_SPEC_CV_HANDLER,
37603: ZEND_PRINT_SPEC_CV_HANDLER,
37604: ZEND_JMP_SPEC_HANDLER,
37605: ZEND_JMP_SPEC_HANDLER,
37606: ZEND_JMP_SPEC_HANDLER,
37607: ZEND_JMP_SPEC_HANDLER,
37608: ZEND_JMP_SPEC_HANDLER,
37609: ZEND_JMP_SPEC_HANDLER,
37610: ZEND_JMP_SPEC_HANDLER,
37611: ZEND_JMP_SPEC_HANDLER,
37612: ZEND_JMP_SPEC_HANDLER,
37613: ZEND_JMP_SPEC_HANDLER,
37614: ZEND_JMP_SPEC_HANDLER,
37615: ZEND_JMP_SPEC_HANDLER,
37616: ZEND_JMP_SPEC_HANDLER,
37617: ZEND_JMP_SPEC_HANDLER,
37618: ZEND_JMP_SPEC_HANDLER,
37619: ZEND_JMP_SPEC_HANDLER,
37620: ZEND_JMP_SPEC_HANDLER,
37621: ZEND_JMP_SPEC_HANDLER,
37622: ZEND_JMP_SPEC_HANDLER,
37623: ZEND_JMP_SPEC_HANDLER,
37624: ZEND_JMP_SPEC_HANDLER,
37625: ZEND_JMP_SPEC_HANDLER,
37626: ZEND_JMP_SPEC_HANDLER,
37627: ZEND_JMP_SPEC_HANDLER,
37628: ZEND_JMP_SPEC_HANDLER,
37629: ZEND_JMPZ_SPEC_CONST_HANDLER,
37630: ZEND_JMPZ_SPEC_CONST_HANDLER,
37631: ZEND_JMPZ_SPEC_CONST_HANDLER,
37632: ZEND_JMPZ_SPEC_CONST_HANDLER,
37633: ZEND_JMPZ_SPEC_CONST_HANDLER,
37634: ZEND_JMPZ_SPEC_TMP_HANDLER,
37635: ZEND_JMPZ_SPEC_TMP_HANDLER,
37636: ZEND_JMPZ_SPEC_TMP_HANDLER,
37637: ZEND_JMPZ_SPEC_TMP_HANDLER,
37638: ZEND_JMPZ_SPEC_TMP_HANDLER,
37639: ZEND_JMPZ_SPEC_VAR_HANDLER,
37640: ZEND_JMPZ_SPEC_VAR_HANDLER,
37641: ZEND_JMPZ_SPEC_VAR_HANDLER,
37642: ZEND_JMPZ_SPEC_VAR_HANDLER,
37643: ZEND_JMPZ_SPEC_VAR_HANDLER,
37644: ZEND_NULL_HANDLER,
37645: ZEND_NULL_HANDLER,
37646: ZEND_NULL_HANDLER,
37647: ZEND_NULL_HANDLER,
37648: ZEND_NULL_HANDLER,
37649: ZEND_JMPZ_SPEC_CV_HANDLER,
37650: ZEND_JMPZ_SPEC_CV_HANDLER,
37651: ZEND_JMPZ_SPEC_CV_HANDLER,
37652: ZEND_JMPZ_SPEC_CV_HANDLER,
37653: ZEND_JMPZ_SPEC_CV_HANDLER,
37654: ZEND_JMPNZ_SPEC_CONST_HANDLER,
37655: ZEND_JMPNZ_SPEC_CONST_HANDLER,
37656: ZEND_JMPNZ_SPEC_CONST_HANDLER,
37657: ZEND_JMPNZ_SPEC_CONST_HANDLER,
37658: ZEND_JMPNZ_SPEC_CONST_HANDLER,
37659: ZEND_JMPNZ_SPEC_TMP_HANDLER,
37660: ZEND_JMPNZ_SPEC_TMP_HANDLER,
37661: ZEND_JMPNZ_SPEC_TMP_HANDLER,
37662: ZEND_JMPNZ_SPEC_TMP_HANDLER,
37663: ZEND_JMPNZ_SPEC_TMP_HANDLER,
37664: ZEND_JMPNZ_SPEC_VAR_HANDLER,
37665: ZEND_JMPNZ_SPEC_VAR_HANDLER,
37666: ZEND_JMPNZ_SPEC_VAR_HANDLER,
37667: ZEND_JMPNZ_SPEC_VAR_HANDLER,
37668: ZEND_JMPNZ_SPEC_VAR_HANDLER,
37669: ZEND_NULL_HANDLER,
37670: ZEND_NULL_HANDLER,
37671: ZEND_NULL_HANDLER,
37672: ZEND_NULL_HANDLER,
37673: ZEND_NULL_HANDLER,
37674: ZEND_JMPNZ_SPEC_CV_HANDLER,
37675: ZEND_JMPNZ_SPEC_CV_HANDLER,
37676: ZEND_JMPNZ_SPEC_CV_HANDLER,
37677: ZEND_JMPNZ_SPEC_CV_HANDLER,
37678: ZEND_JMPNZ_SPEC_CV_HANDLER,
37679: ZEND_JMPZNZ_SPEC_CONST_HANDLER,
37680: ZEND_JMPZNZ_SPEC_CONST_HANDLER,
37681: ZEND_JMPZNZ_SPEC_CONST_HANDLER,
37682: ZEND_JMPZNZ_SPEC_CONST_HANDLER,
37683: ZEND_JMPZNZ_SPEC_CONST_HANDLER,
37684: ZEND_JMPZNZ_SPEC_TMP_HANDLER,
37685: ZEND_JMPZNZ_SPEC_TMP_HANDLER,
37686: ZEND_JMPZNZ_SPEC_TMP_HANDLER,
37687: ZEND_JMPZNZ_SPEC_TMP_HANDLER,
37688: ZEND_JMPZNZ_SPEC_TMP_HANDLER,
37689: ZEND_JMPZNZ_SPEC_VAR_HANDLER,
37690: ZEND_JMPZNZ_SPEC_VAR_HANDLER,
37691: ZEND_JMPZNZ_SPEC_VAR_HANDLER,
37692: ZEND_JMPZNZ_SPEC_VAR_HANDLER,
37693: ZEND_JMPZNZ_SPEC_VAR_HANDLER,
37694: ZEND_NULL_HANDLER,
37695: ZEND_NULL_HANDLER,
37696: ZEND_NULL_HANDLER,
37697: ZEND_NULL_HANDLER,
37698: ZEND_NULL_HANDLER,
37699: ZEND_JMPZNZ_SPEC_CV_HANDLER,
37700: ZEND_JMPZNZ_SPEC_CV_HANDLER,
37701: ZEND_JMPZNZ_SPEC_CV_HANDLER,
37702: ZEND_JMPZNZ_SPEC_CV_HANDLER,
37703: ZEND_JMPZNZ_SPEC_CV_HANDLER,
37704: ZEND_JMPZ_EX_SPEC_CONST_HANDLER,
37705: ZEND_JMPZ_EX_SPEC_CONST_HANDLER,
37706: ZEND_JMPZ_EX_SPEC_CONST_HANDLER,
37707: ZEND_JMPZ_EX_SPEC_CONST_HANDLER,
37708: ZEND_JMPZ_EX_SPEC_CONST_HANDLER,
37709: ZEND_JMPZ_EX_SPEC_TMP_HANDLER,
37710: ZEND_JMPZ_EX_SPEC_TMP_HANDLER,
37711: ZEND_JMPZ_EX_SPEC_TMP_HANDLER,
37712: ZEND_JMPZ_EX_SPEC_TMP_HANDLER,
37713: ZEND_JMPZ_EX_SPEC_TMP_HANDLER,
37714: ZEND_JMPZ_EX_SPEC_VAR_HANDLER,
37715: ZEND_JMPZ_EX_SPEC_VAR_HANDLER,
37716: ZEND_JMPZ_EX_SPEC_VAR_HANDLER,
37717: ZEND_JMPZ_EX_SPEC_VAR_HANDLER,
37718: ZEND_JMPZ_EX_SPEC_VAR_HANDLER,
37719: ZEND_NULL_HANDLER,
37720: ZEND_NULL_HANDLER,
37721: ZEND_NULL_HANDLER,
37722: ZEND_NULL_HANDLER,
37723: ZEND_NULL_HANDLER,
37724: ZEND_JMPZ_EX_SPEC_CV_HANDLER,
37725: ZEND_JMPZ_EX_SPEC_CV_HANDLER,
37726: ZEND_JMPZ_EX_SPEC_CV_HANDLER,
37727: ZEND_JMPZ_EX_SPEC_CV_HANDLER,
37728: ZEND_JMPZ_EX_SPEC_CV_HANDLER,
37729: ZEND_JMPNZ_EX_SPEC_CONST_HANDLER,
37730: ZEND_JMPNZ_EX_SPEC_CONST_HANDLER,
37731: ZEND_JMPNZ_EX_SPEC_CONST_HANDLER,
37732: ZEND_JMPNZ_EX_SPEC_CONST_HANDLER,
37733: ZEND_JMPNZ_EX_SPEC_CONST_HANDLER,
37734: ZEND_JMPNZ_EX_SPEC_TMP_HANDLER,
37735: ZEND_JMPNZ_EX_SPEC_TMP_HANDLER,
37736: ZEND_JMPNZ_EX_SPEC_TMP_HANDLER,
37737: ZEND_JMPNZ_EX_SPEC_TMP_HANDLER,
37738: ZEND_JMPNZ_EX_SPEC_TMP_HANDLER,
37739: ZEND_JMPNZ_EX_SPEC_VAR_HANDLER,
37740: ZEND_JMPNZ_EX_SPEC_VAR_HANDLER,
37741: ZEND_JMPNZ_EX_SPEC_VAR_HANDLER,
37742: ZEND_JMPNZ_EX_SPEC_VAR_HANDLER,
37743: ZEND_JMPNZ_EX_SPEC_VAR_HANDLER,
37744: ZEND_NULL_HANDLER,
37745: ZEND_NULL_HANDLER,
37746: ZEND_NULL_HANDLER,
37747: ZEND_NULL_HANDLER,
37748: ZEND_NULL_HANDLER,
37749: ZEND_JMPNZ_EX_SPEC_CV_HANDLER,
37750: ZEND_JMPNZ_EX_SPEC_CV_HANDLER,
37751: ZEND_JMPNZ_EX_SPEC_CV_HANDLER,
37752: ZEND_JMPNZ_EX_SPEC_CV_HANDLER,
37753: ZEND_JMPNZ_EX_SPEC_CV_HANDLER,
37754: ZEND_CASE_SPEC_CONST_CONST_HANDLER,
37755: ZEND_CASE_SPEC_CONST_TMP_HANDLER,
37756: ZEND_CASE_SPEC_CONST_VAR_HANDLER,
37757: ZEND_NULL_HANDLER,
37758: ZEND_CASE_SPEC_CONST_CV_HANDLER,
37759: ZEND_CASE_SPEC_TMP_CONST_HANDLER,
37760: ZEND_CASE_SPEC_TMP_TMP_HANDLER,
37761: ZEND_CASE_SPEC_TMP_VAR_HANDLER,
37762: ZEND_NULL_HANDLER,
37763: ZEND_CASE_SPEC_TMP_CV_HANDLER,
37764: ZEND_CASE_SPEC_VAR_CONST_HANDLER,
37765: ZEND_CASE_SPEC_VAR_TMP_HANDLER,
37766: ZEND_CASE_SPEC_VAR_VAR_HANDLER,
37767: ZEND_NULL_HANDLER,
37768: ZEND_CASE_SPEC_VAR_CV_HANDLER,
37769: ZEND_NULL_HANDLER,
37770: ZEND_NULL_HANDLER,
37771: ZEND_NULL_HANDLER,
37772: ZEND_NULL_HANDLER,
37773: ZEND_NULL_HANDLER,
37774: ZEND_CASE_SPEC_CV_CONST_HANDLER,
37775: ZEND_CASE_SPEC_CV_TMP_HANDLER,
37776: ZEND_CASE_SPEC_CV_VAR_HANDLER,
37777: ZEND_NULL_HANDLER,
37778: ZEND_CASE_SPEC_CV_CV_HANDLER,
37779: ZEND_NULL_HANDLER,
37780: ZEND_NULL_HANDLER,
37781: ZEND_NULL_HANDLER,
37782: ZEND_NULL_HANDLER,
37783: ZEND_NULL_HANDLER,
37784: ZEND_NULL_HANDLER,
37785: ZEND_NULL_HANDLER,
37786: ZEND_NULL_HANDLER,
37787: ZEND_NULL_HANDLER,
37788: ZEND_NULL_HANDLER,
37789: ZEND_SWITCH_FREE_SPEC_VAR_HANDLER,
37790: ZEND_SWITCH_FREE_SPEC_VAR_HANDLER,
37791: ZEND_SWITCH_FREE_SPEC_VAR_HANDLER,
37792: ZEND_SWITCH_FREE_SPEC_VAR_HANDLER,
37793: ZEND_SWITCH_FREE_SPEC_VAR_HANDLER,
37794: ZEND_NULL_HANDLER,
37795: ZEND_NULL_HANDLER,
37796: ZEND_NULL_HANDLER,
37797: ZEND_NULL_HANDLER,
37798: ZEND_NULL_HANDLER,
37799: ZEND_NULL_HANDLER,
37800: ZEND_NULL_HANDLER,
37801: ZEND_NULL_HANDLER,
37802: ZEND_NULL_HANDLER,
37803: ZEND_NULL_HANDLER,
37804: ZEND_BRK_SPEC_CONST_HANDLER,
37805: ZEND_NULL_HANDLER,
1.1.1.2 misho 37806: ZEND_NULL_HANDLER,
37807: ZEND_NULL_HANDLER,
37808: ZEND_NULL_HANDLER,
1.1 misho 37809: ZEND_BRK_SPEC_CONST_HANDLER,
37810: ZEND_NULL_HANDLER,
1.1.1.2 misho 37811: ZEND_NULL_HANDLER,
37812: ZEND_NULL_HANDLER,
37813: ZEND_NULL_HANDLER,
1.1 misho 37814: ZEND_BRK_SPEC_CONST_HANDLER,
37815: ZEND_NULL_HANDLER,
1.1.1.2 misho 37816: ZEND_NULL_HANDLER,
37817: ZEND_NULL_HANDLER,
37818: ZEND_NULL_HANDLER,
1.1 misho 37819: ZEND_BRK_SPEC_CONST_HANDLER,
37820: ZEND_NULL_HANDLER,
1.1.1.2 misho 37821: ZEND_NULL_HANDLER,
37822: ZEND_NULL_HANDLER,
37823: ZEND_NULL_HANDLER,
1.1 misho 37824: ZEND_BRK_SPEC_CONST_HANDLER,
37825: ZEND_NULL_HANDLER,
1.1.1.2 misho 37826: ZEND_NULL_HANDLER,
37827: ZEND_NULL_HANDLER,
37828: ZEND_NULL_HANDLER,
1.1 misho 37829: ZEND_CONT_SPEC_CONST_HANDLER,
37830: ZEND_NULL_HANDLER,
1.1.1.2 misho 37831: ZEND_NULL_HANDLER,
37832: ZEND_NULL_HANDLER,
37833: ZEND_NULL_HANDLER,
1.1 misho 37834: ZEND_CONT_SPEC_CONST_HANDLER,
37835: ZEND_NULL_HANDLER,
1.1.1.2 misho 37836: ZEND_NULL_HANDLER,
37837: ZEND_NULL_HANDLER,
37838: ZEND_NULL_HANDLER,
1.1 misho 37839: ZEND_CONT_SPEC_CONST_HANDLER,
37840: ZEND_NULL_HANDLER,
1.1.1.2 misho 37841: ZEND_NULL_HANDLER,
37842: ZEND_NULL_HANDLER,
37843: ZEND_NULL_HANDLER,
1.1 misho 37844: ZEND_CONT_SPEC_CONST_HANDLER,
37845: ZEND_NULL_HANDLER,
1.1.1.2 misho 37846: ZEND_NULL_HANDLER,
37847: ZEND_NULL_HANDLER,
37848: ZEND_NULL_HANDLER,
1.1 misho 37849: ZEND_CONT_SPEC_CONST_HANDLER,
37850: ZEND_NULL_HANDLER,
1.1.1.2 misho 37851: ZEND_NULL_HANDLER,
37852: ZEND_NULL_HANDLER,
37853: ZEND_NULL_HANDLER,
1.1 misho 37854: ZEND_BOOL_SPEC_CONST_HANDLER,
37855: ZEND_BOOL_SPEC_CONST_HANDLER,
37856: ZEND_BOOL_SPEC_CONST_HANDLER,
37857: ZEND_BOOL_SPEC_CONST_HANDLER,
37858: ZEND_BOOL_SPEC_CONST_HANDLER,
37859: ZEND_BOOL_SPEC_TMP_HANDLER,
37860: ZEND_BOOL_SPEC_TMP_HANDLER,
37861: ZEND_BOOL_SPEC_TMP_HANDLER,
37862: ZEND_BOOL_SPEC_TMP_HANDLER,
37863: ZEND_BOOL_SPEC_TMP_HANDLER,
37864: ZEND_BOOL_SPEC_VAR_HANDLER,
37865: ZEND_BOOL_SPEC_VAR_HANDLER,
37866: ZEND_BOOL_SPEC_VAR_HANDLER,
37867: ZEND_BOOL_SPEC_VAR_HANDLER,
37868: ZEND_BOOL_SPEC_VAR_HANDLER,
37869: ZEND_NULL_HANDLER,
37870: ZEND_NULL_HANDLER,
37871: ZEND_NULL_HANDLER,
37872: ZEND_NULL_HANDLER,
37873: ZEND_NULL_HANDLER,
37874: ZEND_BOOL_SPEC_CV_HANDLER,
37875: ZEND_BOOL_SPEC_CV_HANDLER,
37876: ZEND_BOOL_SPEC_CV_HANDLER,
37877: ZEND_BOOL_SPEC_CV_HANDLER,
37878: ZEND_BOOL_SPEC_CV_HANDLER,
37879: ZEND_INIT_STRING_SPEC_HANDLER,
37880: ZEND_INIT_STRING_SPEC_HANDLER,
37881: ZEND_INIT_STRING_SPEC_HANDLER,
37882: ZEND_INIT_STRING_SPEC_HANDLER,
37883: ZEND_INIT_STRING_SPEC_HANDLER,
37884: ZEND_INIT_STRING_SPEC_HANDLER,
37885: ZEND_INIT_STRING_SPEC_HANDLER,
37886: ZEND_INIT_STRING_SPEC_HANDLER,
37887: ZEND_INIT_STRING_SPEC_HANDLER,
37888: ZEND_INIT_STRING_SPEC_HANDLER,
37889: ZEND_INIT_STRING_SPEC_HANDLER,
37890: ZEND_INIT_STRING_SPEC_HANDLER,
37891: ZEND_INIT_STRING_SPEC_HANDLER,
37892: ZEND_INIT_STRING_SPEC_HANDLER,
37893: ZEND_INIT_STRING_SPEC_HANDLER,
37894: ZEND_INIT_STRING_SPEC_HANDLER,
37895: ZEND_INIT_STRING_SPEC_HANDLER,
37896: ZEND_INIT_STRING_SPEC_HANDLER,
37897: ZEND_INIT_STRING_SPEC_HANDLER,
37898: ZEND_INIT_STRING_SPEC_HANDLER,
37899: ZEND_INIT_STRING_SPEC_HANDLER,
37900: ZEND_INIT_STRING_SPEC_HANDLER,
37901: ZEND_INIT_STRING_SPEC_HANDLER,
37902: ZEND_INIT_STRING_SPEC_HANDLER,
37903: ZEND_INIT_STRING_SPEC_HANDLER,
37904: ZEND_NULL_HANDLER,
37905: ZEND_NULL_HANDLER,
37906: ZEND_NULL_HANDLER,
37907: ZEND_NULL_HANDLER,
37908: ZEND_NULL_HANDLER,
37909: ZEND_ADD_CHAR_SPEC_TMP_CONST_HANDLER,
37910: ZEND_NULL_HANDLER,
37911: ZEND_NULL_HANDLER,
37912: ZEND_NULL_HANDLER,
37913: ZEND_NULL_HANDLER,
37914: ZEND_NULL_HANDLER,
37915: ZEND_NULL_HANDLER,
37916: ZEND_NULL_HANDLER,
37917: ZEND_NULL_HANDLER,
37918: ZEND_NULL_HANDLER,
37919: ZEND_ADD_CHAR_SPEC_UNUSED_CONST_HANDLER,
37920: ZEND_NULL_HANDLER,
37921: ZEND_NULL_HANDLER,
37922: ZEND_NULL_HANDLER,
37923: ZEND_NULL_HANDLER,
37924: ZEND_NULL_HANDLER,
37925: ZEND_NULL_HANDLER,
37926: ZEND_NULL_HANDLER,
37927: ZEND_NULL_HANDLER,
37928: ZEND_NULL_HANDLER,
37929: ZEND_NULL_HANDLER,
37930: ZEND_NULL_HANDLER,
37931: ZEND_NULL_HANDLER,
37932: ZEND_NULL_HANDLER,
37933: ZEND_NULL_HANDLER,
37934: ZEND_ADD_STRING_SPEC_TMP_CONST_HANDLER,
37935: ZEND_NULL_HANDLER,
37936: ZEND_NULL_HANDLER,
37937: ZEND_NULL_HANDLER,
37938: ZEND_NULL_HANDLER,
37939: ZEND_NULL_HANDLER,
37940: ZEND_NULL_HANDLER,
37941: ZEND_NULL_HANDLER,
37942: ZEND_NULL_HANDLER,
37943: ZEND_NULL_HANDLER,
37944: ZEND_ADD_STRING_SPEC_UNUSED_CONST_HANDLER,
37945: ZEND_NULL_HANDLER,
37946: ZEND_NULL_HANDLER,
37947: ZEND_NULL_HANDLER,
37948: ZEND_NULL_HANDLER,
37949: ZEND_NULL_HANDLER,
37950: ZEND_NULL_HANDLER,
37951: ZEND_NULL_HANDLER,
37952: ZEND_NULL_HANDLER,
37953: ZEND_NULL_HANDLER,
37954: ZEND_NULL_HANDLER,
37955: ZEND_NULL_HANDLER,
37956: ZEND_NULL_HANDLER,
37957: ZEND_NULL_HANDLER,
37958: ZEND_NULL_HANDLER,
37959: ZEND_NULL_HANDLER,
37960: ZEND_ADD_VAR_SPEC_TMP_TMP_HANDLER,
37961: ZEND_ADD_VAR_SPEC_TMP_VAR_HANDLER,
37962: ZEND_NULL_HANDLER,
37963: ZEND_ADD_VAR_SPEC_TMP_CV_HANDLER,
37964: ZEND_NULL_HANDLER,
37965: ZEND_NULL_HANDLER,
37966: ZEND_NULL_HANDLER,
37967: ZEND_NULL_HANDLER,
37968: ZEND_NULL_HANDLER,
37969: ZEND_NULL_HANDLER,
37970: ZEND_ADD_VAR_SPEC_UNUSED_TMP_HANDLER,
37971: ZEND_ADD_VAR_SPEC_UNUSED_VAR_HANDLER,
37972: ZEND_NULL_HANDLER,
37973: ZEND_ADD_VAR_SPEC_UNUSED_CV_HANDLER,
37974: ZEND_NULL_HANDLER,
37975: ZEND_NULL_HANDLER,
37976: ZEND_NULL_HANDLER,
37977: ZEND_NULL_HANDLER,
37978: ZEND_NULL_HANDLER,
37979: ZEND_BEGIN_SILENCE_SPEC_HANDLER,
37980: ZEND_BEGIN_SILENCE_SPEC_HANDLER,
37981: ZEND_BEGIN_SILENCE_SPEC_HANDLER,
37982: ZEND_BEGIN_SILENCE_SPEC_HANDLER,
37983: ZEND_BEGIN_SILENCE_SPEC_HANDLER,
37984: ZEND_BEGIN_SILENCE_SPEC_HANDLER,
37985: ZEND_BEGIN_SILENCE_SPEC_HANDLER,
37986: ZEND_BEGIN_SILENCE_SPEC_HANDLER,
37987: ZEND_BEGIN_SILENCE_SPEC_HANDLER,
37988: ZEND_BEGIN_SILENCE_SPEC_HANDLER,
37989: ZEND_BEGIN_SILENCE_SPEC_HANDLER,
37990: ZEND_BEGIN_SILENCE_SPEC_HANDLER,
37991: ZEND_BEGIN_SILENCE_SPEC_HANDLER,
37992: ZEND_BEGIN_SILENCE_SPEC_HANDLER,
37993: ZEND_BEGIN_SILENCE_SPEC_HANDLER,
37994: ZEND_BEGIN_SILENCE_SPEC_HANDLER,
37995: ZEND_BEGIN_SILENCE_SPEC_HANDLER,
37996: ZEND_BEGIN_SILENCE_SPEC_HANDLER,
37997: ZEND_BEGIN_SILENCE_SPEC_HANDLER,
37998: ZEND_BEGIN_SILENCE_SPEC_HANDLER,
37999: ZEND_BEGIN_SILENCE_SPEC_HANDLER,
38000: ZEND_BEGIN_SILENCE_SPEC_HANDLER,
38001: ZEND_BEGIN_SILENCE_SPEC_HANDLER,
38002: ZEND_BEGIN_SILENCE_SPEC_HANDLER,
38003: ZEND_BEGIN_SILENCE_SPEC_HANDLER,
38004: ZEND_NULL_HANDLER,
38005: ZEND_NULL_HANDLER,
38006: ZEND_NULL_HANDLER,
38007: ZEND_NULL_HANDLER,
38008: ZEND_NULL_HANDLER,
38009: ZEND_END_SILENCE_SPEC_TMP_HANDLER,
38010: ZEND_END_SILENCE_SPEC_TMP_HANDLER,
38011: ZEND_END_SILENCE_SPEC_TMP_HANDLER,
38012: ZEND_END_SILENCE_SPEC_TMP_HANDLER,
38013: ZEND_END_SILENCE_SPEC_TMP_HANDLER,
38014: ZEND_NULL_HANDLER,
38015: ZEND_NULL_HANDLER,
38016: ZEND_NULL_HANDLER,
38017: ZEND_NULL_HANDLER,
38018: ZEND_NULL_HANDLER,
38019: ZEND_NULL_HANDLER,
38020: ZEND_NULL_HANDLER,
38021: ZEND_NULL_HANDLER,
38022: ZEND_NULL_HANDLER,
38023: ZEND_NULL_HANDLER,
38024: ZEND_NULL_HANDLER,
38025: ZEND_NULL_HANDLER,
38026: ZEND_NULL_HANDLER,
38027: ZEND_NULL_HANDLER,
38028: ZEND_NULL_HANDLER,
38029: ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER,
38030: ZEND_INIT_FCALL_BY_NAME_SPEC_TMP_HANDLER,
38031: ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER,
38032: ZEND_NULL_HANDLER,
38033: ZEND_INIT_FCALL_BY_NAME_SPEC_CV_HANDLER,
38034: ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER,
38035: ZEND_INIT_FCALL_BY_NAME_SPEC_TMP_HANDLER,
38036: ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER,
38037: ZEND_NULL_HANDLER,
38038: ZEND_INIT_FCALL_BY_NAME_SPEC_CV_HANDLER,
38039: ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER,
38040: ZEND_INIT_FCALL_BY_NAME_SPEC_TMP_HANDLER,
38041: ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER,
38042: ZEND_NULL_HANDLER,
38043: ZEND_INIT_FCALL_BY_NAME_SPEC_CV_HANDLER,
38044: ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER,
38045: ZEND_INIT_FCALL_BY_NAME_SPEC_TMP_HANDLER,
38046: ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER,
38047: ZEND_NULL_HANDLER,
38048: ZEND_INIT_FCALL_BY_NAME_SPEC_CV_HANDLER,
38049: ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER,
38050: ZEND_INIT_FCALL_BY_NAME_SPEC_TMP_HANDLER,
38051: ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER,
38052: ZEND_NULL_HANDLER,
38053: ZEND_INIT_FCALL_BY_NAME_SPEC_CV_HANDLER,
38054: ZEND_DO_FCALL_SPEC_CONST_HANDLER,
38055: ZEND_DO_FCALL_SPEC_CONST_HANDLER,
38056: ZEND_DO_FCALL_SPEC_CONST_HANDLER,
38057: ZEND_DO_FCALL_SPEC_CONST_HANDLER,
38058: ZEND_DO_FCALL_SPEC_CONST_HANDLER,
38059: ZEND_NULL_HANDLER,
38060: ZEND_NULL_HANDLER,
38061: ZEND_NULL_HANDLER,
38062: ZEND_NULL_HANDLER,
38063: ZEND_NULL_HANDLER,
38064: ZEND_NULL_HANDLER,
38065: ZEND_NULL_HANDLER,
38066: ZEND_NULL_HANDLER,
38067: ZEND_NULL_HANDLER,
38068: ZEND_NULL_HANDLER,
38069: ZEND_NULL_HANDLER,
38070: ZEND_NULL_HANDLER,
38071: ZEND_NULL_HANDLER,
38072: ZEND_NULL_HANDLER,
38073: ZEND_NULL_HANDLER,
38074: ZEND_NULL_HANDLER,
38075: ZEND_NULL_HANDLER,
38076: ZEND_NULL_HANDLER,
38077: ZEND_NULL_HANDLER,
38078: ZEND_NULL_HANDLER,
38079: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER,
38080: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER,
38081: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER,
38082: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER,
38083: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER,
38084: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER,
38085: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER,
38086: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER,
38087: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER,
38088: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER,
38089: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER,
38090: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER,
38091: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER,
38092: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER,
38093: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER,
38094: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER,
38095: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER,
38096: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER,
38097: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER,
38098: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER,
38099: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER,
38100: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER,
38101: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER,
38102: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER,
38103: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER,
38104: ZEND_RETURN_SPEC_CONST_HANDLER,
38105: ZEND_RETURN_SPEC_CONST_HANDLER,
38106: ZEND_RETURN_SPEC_CONST_HANDLER,
38107: ZEND_RETURN_SPEC_CONST_HANDLER,
38108: ZEND_RETURN_SPEC_CONST_HANDLER,
38109: ZEND_RETURN_SPEC_TMP_HANDLER,
38110: ZEND_RETURN_SPEC_TMP_HANDLER,
38111: ZEND_RETURN_SPEC_TMP_HANDLER,
38112: ZEND_RETURN_SPEC_TMP_HANDLER,
38113: ZEND_RETURN_SPEC_TMP_HANDLER,
38114: ZEND_RETURN_SPEC_VAR_HANDLER,
38115: ZEND_RETURN_SPEC_VAR_HANDLER,
38116: ZEND_RETURN_SPEC_VAR_HANDLER,
38117: ZEND_RETURN_SPEC_VAR_HANDLER,
38118: ZEND_RETURN_SPEC_VAR_HANDLER,
38119: ZEND_NULL_HANDLER,
38120: ZEND_NULL_HANDLER,
38121: ZEND_NULL_HANDLER,
38122: ZEND_NULL_HANDLER,
38123: ZEND_NULL_HANDLER,
38124: ZEND_RETURN_SPEC_CV_HANDLER,
38125: ZEND_RETURN_SPEC_CV_HANDLER,
38126: ZEND_RETURN_SPEC_CV_HANDLER,
38127: ZEND_RETURN_SPEC_CV_HANDLER,
38128: ZEND_RETURN_SPEC_CV_HANDLER,
38129: ZEND_RECV_SPEC_HANDLER,
38130: ZEND_RECV_SPEC_HANDLER,
38131: ZEND_RECV_SPEC_HANDLER,
38132: ZEND_RECV_SPEC_HANDLER,
38133: ZEND_RECV_SPEC_HANDLER,
38134: ZEND_RECV_SPEC_HANDLER,
38135: ZEND_RECV_SPEC_HANDLER,
38136: ZEND_RECV_SPEC_HANDLER,
38137: ZEND_RECV_SPEC_HANDLER,
38138: ZEND_RECV_SPEC_HANDLER,
38139: ZEND_RECV_SPEC_HANDLER,
38140: ZEND_RECV_SPEC_HANDLER,
38141: ZEND_RECV_SPEC_HANDLER,
38142: ZEND_RECV_SPEC_HANDLER,
38143: ZEND_RECV_SPEC_HANDLER,
38144: ZEND_RECV_SPEC_HANDLER,
38145: ZEND_RECV_SPEC_HANDLER,
38146: ZEND_RECV_SPEC_HANDLER,
38147: ZEND_RECV_SPEC_HANDLER,
38148: ZEND_RECV_SPEC_HANDLER,
38149: ZEND_RECV_SPEC_HANDLER,
38150: ZEND_RECV_SPEC_HANDLER,
38151: ZEND_RECV_SPEC_HANDLER,
38152: ZEND_RECV_SPEC_HANDLER,
38153: ZEND_RECV_SPEC_HANDLER,
38154: ZEND_RECV_INIT_SPEC_CONST_HANDLER,
38155: ZEND_NULL_HANDLER,
38156: ZEND_NULL_HANDLER,
38157: ZEND_NULL_HANDLER,
38158: ZEND_NULL_HANDLER,
38159: ZEND_RECV_INIT_SPEC_CONST_HANDLER,
38160: ZEND_NULL_HANDLER,
38161: ZEND_NULL_HANDLER,
38162: ZEND_NULL_HANDLER,
38163: ZEND_NULL_HANDLER,
38164: ZEND_RECV_INIT_SPEC_CONST_HANDLER,
38165: ZEND_NULL_HANDLER,
38166: ZEND_NULL_HANDLER,
38167: ZEND_NULL_HANDLER,
38168: ZEND_NULL_HANDLER,
38169: ZEND_RECV_INIT_SPEC_CONST_HANDLER,
38170: ZEND_NULL_HANDLER,
38171: ZEND_NULL_HANDLER,
38172: ZEND_NULL_HANDLER,
38173: ZEND_NULL_HANDLER,
38174: ZEND_RECV_INIT_SPEC_CONST_HANDLER,
38175: ZEND_NULL_HANDLER,
38176: ZEND_NULL_HANDLER,
38177: ZEND_NULL_HANDLER,
38178: ZEND_NULL_HANDLER,
38179: ZEND_SEND_VAL_SPEC_CONST_HANDLER,
38180: ZEND_SEND_VAL_SPEC_CONST_HANDLER,
38181: ZEND_SEND_VAL_SPEC_CONST_HANDLER,
38182: ZEND_SEND_VAL_SPEC_CONST_HANDLER,
38183: ZEND_SEND_VAL_SPEC_CONST_HANDLER,
38184: ZEND_SEND_VAL_SPEC_TMP_HANDLER,
38185: ZEND_SEND_VAL_SPEC_TMP_HANDLER,
38186: ZEND_SEND_VAL_SPEC_TMP_HANDLER,
38187: ZEND_SEND_VAL_SPEC_TMP_HANDLER,
38188: ZEND_SEND_VAL_SPEC_TMP_HANDLER,
38189: ZEND_NULL_HANDLER,
38190: ZEND_NULL_HANDLER,
38191: ZEND_NULL_HANDLER,
38192: ZEND_NULL_HANDLER,
38193: ZEND_NULL_HANDLER,
1.1.1.2 misho 38194: ZEND_NULL_HANDLER,
38195: ZEND_NULL_HANDLER,
38196: ZEND_NULL_HANDLER,
38197: ZEND_NULL_HANDLER,
38198: ZEND_NULL_HANDLER,
38199: ZEND_NULL_HANDLER,
38200: ZEND_NULL_HANDLER,
38201: ZEND_NULL_HANDLER,
38202: ZEND_NULL_HANDLER,
38203: ZEND_NULL_HANDLER,
1.1 misho 38204: ZEND_NULL_HANDLER,
38205: ZEND_NULL_HANDLER,
38206: ZEND_NULL_HANDLER,
38207: ZEND_NULL_HANDLER,
38208: ZEND_NULL_HANDLER,
38209: ZEND_NULL_HANDLER,
38210: ZEND_NULL_HANDLER,
38211: ZEND_NULL_HANDLER,
38212: ZEND_NULL_HANDLER,
38213: ZEND_NULL_HANDLER,
38214: ZEND_SEND_VAR_SPEC_VAR_HANDLER,
38215: ZEND_SEND_VAR_SPEC_VAR_HANDLER,
38216: ZEND_SEND_VAR_SPEC_VAR_HANDLER,
38217: ZEND_SEND_VAR_SPEC_VAR_HANDLER,
38218: ZEND_SEND_VAR_SPEC_VAR_HANDLER,
38219: ZEND_NULL_HANDLER,
38220: ZEND_NULL_HANDLER,
38221: ZEND_NULL_HANDLER,
38222: ZEND_NULL_HANDLER,
38223: ZEND_NULL_HANDLER,
38224: ZEND_SEND_VAR_SPEC_CV_HANDLER,
38225: ZEND_SEND_VAR_SPEC_CV_HANDLER,
38226: ZEND_SEND_VAR_SPEC_CV_HANDLER,
38227: ZEND_SEND_VAR_SPEC_CV_HANDLER,
38228: ZEND_SEND_VAR_SPEC_CV_HANDLER,
38229: ZEND_NULL_HANDLER,
38230: ZEND_NULL_HANDLER,
38231: ZEND_NULL_HANDLER,
38232: ZEND_NULL_HANDLER,
38233: ZEND_NULL_HANDLER,
38234: ZEND_NULL_HANDLER,
38235: ZEND_NULL_HANDLER,
38236: ZEND_NULL_HANDLER,
38237: ZEND_NULL_HANDLER,
38238: ZEND_NULL_HANDLER,
38239: ZEND_SEND_REF_SPEC_VAR_HANDLER,
38240: ZEND_SEND_REF_SPEC_VAR_HANDLER,
38241: ZEND_SEND_REF_SPEC_VAR_HANDLER,
38242: ZEND_SEND_REF_SPEC_VAR_HANDLER,
38243: ZEND_SEND_REF_SPEC_VAR_HANDLER,
38244: ZEND_NULL_HANDLER,
38245: ZEND_NULL_HANDLER,
38246: ZEND_NULL_HANDLER,
38247: ZEND_NULL_HANDLER,
38248: ZEND_NULL_HANDLER,
38249: ZEND_SEND_REF_SPEC_CV_HANDLER,
38250: ZEND_SEND_REF_SPEC_CV_HANDLER,
38251: ZEND_SEND_REF_SPEC_CV_HANDLER,
38252: ZEND_SEND_REF_SPEC_CV_HANDLER,
38253: ZEND_SEND_REF_SPEC_CV_HANDLER,
38254: ZEND_NEW_SPEC_HANDLER,
38255: ZEND_NEW_SPEC_HANDLER,
38256: ZEND_NEW_SPEC_HANDLER,
38257: ZEND_NEW_SPEC_HANDLER,
38258: ZEND_NEW_SPEC_HANDLER,
38259: ZEND_NEW_SPEC_HANDLER,
38260: ZEND_NEW_SPEC_HANDLER,
38261: ZEND_NEW_SPEC_HANDLER,
38262: ZEND_NEW_SPEC_HANDLER,
38263: ZEND_NEW_SPEC_HANDLER,
38264: ZEND_NEW_SPEC_HANDLER,
38265: ZEND_NEW_SPEC_HANDLER,
38266: ZEND_NEW_SPEC_HANDLER,
38267: ZEND_NEW_SPEC_HANDLER,
38268: ZEND_NEW_SPEC_HANDLER,
38269: ZEND_NEW_SPEC_HANDLER,
38270: ZEND_NEW_SPEC_HANDLER,
38271: ZEND_NEW_SPEC_HANDLER,
38272: ZEND_NEW_SPEC_HANDLER,
38273: ZEND_NEW_SPEC_HANDLER,
38274: ZEND_NEW_SPEC_HANDLER,
38275: ZEND_NEW_SPEC_HANDLER,
38276: ZEND_NEW_SPEC_HANDLER,
38277: ZEND_NEW_SPEC_HANDLER,
38278: ZEND_NEW_SPEC_HANDLER,
38279: ZEND_INIT_NS_FCALL_BY_NAME_SPEC_CONST_HANDLER,
38280: ZEND_NULL_HANDLER,
38281: ZEND_NULL_HANDLER,
38282: ZEND_NULL_HANDLER,
38283: ZEND_NULL_HANDLER,
38284: ZEND_INIT_NS_FCALL_BY_NAME_SPEC_CONST_HANDLER,
38285: ZEND_NULL_HANDLER,
38286: ZEND_NULL_HANDLER,
38287: ZEND_NULL_HANDLER,
38288: ZEND_NULL_HANDLER,
38289: ZEND_INIT_NS_FCALL_BY_NAME_SPEC_CONST_HANDLER,
38290: ZEND_NULL_HANDLER,
38291: ZEND_NULL_HANDLER,
38292: ZEND_NULL_HANDLER,
38293: ZEND_NULL_HANDLER,
38294: ZEND_INIT_NS_FCALL_BY_NAME_SPEC_CONST_HANDLER,
38295: ZEND_NULL_HANDLER,
38296: ZEND_NULL_HANDLER,
38297: ZEND_NULL_HANDLER,
38298: ZEND_NULL_HANDLER,
38299: ZEND_INIT_NS_FCALL_BY_NAME_SPEC_CONST_HANDLER,
38300: ZEND_NULL_HANDLER,
38301: ZEND_NULL_HANDLER,
38302: ZEND_NULL_HANDLER,
38303: ZEND_NULL_HANDLER,
38304: ZEND_NULL_HANDLER,
38305: ZEND_NULL_HANDLER,
38306: ZEND_NULL_HANDLER,
38307: ZEND_NULL_HANDLER,
38308: ZEND_NULL_HANDLER,
38309: ZEND_FREE_SPEC_TMP_HANDLER,
38310: ZEND_FREE_SPEC_TMP_HANDLER,
38311: ZEND_FREE_SPEC_TMP_HANDLER,
38312: ZEND_FREE_SPEC_TMP_HANDLER,
38313: ZEND_FREE_SPEC_TMP_HANDLER,
1.1.1.2 misho 38314: ZEND_FREE_SPEC_VAR_HANDLER,
38315: ZEND_FREE_SPEC_VAR_HANDLER,
38316: ZEND_FREE_SPEC_VAR_HANDLER,
38317: ZEND_FREE_SPEC_VAR_HANDLER,
38318: ZEND_FREE_SPEC_VAR_HANDLER,
1.1 misho 38319: ZEND_NULL_HANDLER,
38320: ZEND_NULL_HANDLER,
38321: ZEND_NULL_HANDLER,
38322: ZEND_NULL_HANDLER,
38323: ZEND_NULL_HANDLER,
38324: ZEND_NULL_HANDLER,
38325: ZEND_NULL_HANDLER,
38326: ZEND_NULL_HANDLER,
38327: ZEND_NULL_HANDLER,
38328: ZEND_NULL_HANDLER,
38329: ZEND_INIT_ARRAY_SPEC_CONST_CONST_HANDLER,
38330: ZEND_INIT_ARRAY_SPEC_CONST_TMP_HANDLER,
38331: ZEND_INIT_ARRAY_SPEC_CONST_VAR_HANDLER,
38332: ZEND_INIT_ARRAY_SPEC_CONST_UNUSED_HANDLER,
38333: ZEND_INIT_ARRAY_SPEC_CONST_CV_HANDLER,
38334: ZEND_INIT_ARRAY_SPEC_TMP_CONST_HANDLER,
38335: ZEND_INIT_ARRAY_SPEC_TMP_TMP_HANDLER,
38336: ZEND_INIT_ARRAY_SPEC_TMP_VAR_HANDLER,
38337: ZEND_INIT_ARRAY_SPEC_TMP_UNUSED_HANDLER,
38338: ZEND_INIT_ARRAY_SPEC_TMP_CV_HANDLER,
38339: ZEND_INIT_ARRAY_SPEC_VAR_CONST_HANDLER,
38340: ZEND_INIT_ARRAY_SPEC_VAR_TMP_HANDLER,
38341: ZEND_INIT_ARRAY_SPEC_VAR_VAR_HANDLER,
38342: ZEND_INIT_ARRAY_SPEC_VAR_UNUSED_HANDLER,
38343: ZEND_INIT_ARRAY_SPEC_VAR_CV_HANDLER,
38344: ZEND_INIT_ARRAY_SPEC_UNUSED_CONST_HANDLER,
38345: ZEND_INIT_ARRAY_SPEC_UNUSED_TMP_HANDLER,
38346: ZEND_INIT_ARRAY_SPEC_UNUSED_VAR_HANDLER,
38347: ZEND_INIT_ARRAY_SPEC_UNUSED_UNUSED_HANDLER,
38348: ZEND_INIT_ARRAY_SPEC_UNUSED_CV_HANDLER,
38349: ZEND_INIT_ARRAY_SPEC_CV_CONST_HANDLER,
38350: ZEND_INIT_ARRAY_SPEC_CV_TMP_HANDLER,
38351: ZEND_INIT_ARRAY_SPEC_CV_VAR_HANDLER,
38352: ZEND_INIT_ARRAY_SPEC_CV_UNUSED_HANDLER,
38353: ZEND_INIT_ARRAY_SPEC_CV_CV_HANDLER,
38354: ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CONST_HANDLER,
38355: ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_TMP_HANDLER,
38356: ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_VAR_HANDLER,
38357: ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_UNUSED_HANDLER,
38358: ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CV_HANDLER,
38359: ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CONST_HANDLER,
38360: ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_TMP_HANDLER,
38361: ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_VAR_HANDLER,
38362: ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_UNUSED_HANDLER,
38363: ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CV_HANDLER,
38364: ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CONST_HANDLER,
38365: ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_TMP_HANDLER,
38366: ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_VAR_HANDLER,
38367: ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_UNUSED_HANDLER,
38368: ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CV_HANDLER,
38369: ZEND_NULL_HANDLER,
38370: ZEND_NULL_HANDLER,
38371: ZEND_NULL_HANDLER,
38372: ZEND_NULL_HANDLER,
38373: ZEND_NULL_HANDLER,
38374: ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CONST_HANDLER,
38375: ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_TMP_HANDLER,
38376: ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_VAR_HANDLER,
38377: ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_UNUSED_HANDLER,
38378: ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CV_HANDLER,
38379: ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER,
38380: ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER,
38381: ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER,
38382: ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER,
38383: ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER,
38384: ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER,
38385: ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER,
38386: ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER,
38387: ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER,
38388: ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER,
38389: ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER,
38390: ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER,
38391: ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER,
38392: ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER,
38393: ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER,
38394: ZEND_NULL_HANDLER,
38395: ZEND_NULL_HANDLER,
38396: ZEND_NULL_HANDLER,
38397: ZEND_NULL_HANDLER,
38398: ZEND_NULL_HANDLER,
38399: ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER,
38400: ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER,
38401: ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER,
38402: ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER,
38403: ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER,
1.1.1.2 misho 38404: ZEND_UNSET_VAR_SPEC_CONST_CONST_HANDLER,
38405: ZEND_NULL_HANDLER,
38406: ZEND_UNSET_VAR_SPEC_CONST_VAR_HANDLER,
38407: ZEND_UNSET_VAR_SPEC_CONST_UNUSED_HANDLER,
38408: ZEND_NULL_HANDLER,
38409: ZEND_UNSET_VAR_SPEC_TMP_CONST_HANDLER,
38410: ZEND_NULL_HANDLER,
38411: ZEND_UNSET_VAR_SPEC_TMP_VAR_HANDLER,
38412: ZEND_UNSET_VAR_SPEC_TMP_UNUSED_HANDLER,
38413: ZEND_NULL_HANDLER,
38414: ZEND_UNSET_VAR_SPEC_VAR_CONST_HANDLER,
38415: ZEND_NULL_HANDLER,
38416: ZEND_UNSET_VAR_SPEC_VAR_VAR_HANDLER,
38417: ZEND_UNSET_VAR_SPEC_VAR_UNUSED_HANDLER,
38418: ZEND_NULL_HANDLER,
1.1 misho 38419: ZEND_NULL_HANDLER,
38420: ZEND_NULL_HANDLER,
38421: ZEND_NULL_HANDLER,
38422: ZEND_NULL_HANDLER,
38423: ZEND_NULL_HANDLER,
1.1.1.2 misho 38424: ZEND_UNSET_VAR_SPEC_CV_CONST_HANDLER,
38425: ZEND_NULL_HANDLER,
38426: ZEND_UNSET_VAR_SPEC_CV_VAR_HANDLER,
38427: ZEND_UNSET_VAR_SPEC_CV_UNUSED_HANDLER,
38428: ZEND_NULL_HANDLER,
1.1 misho 38429: ZEND_NULL_HANDLER,
38430: ZEND_NULL_HANDLER,
38431: ZEND_NULL_HANDLER,
38432: ZEND_NULL_HANDLER,
38433: ZEND_NULL_HANDLER,
38434: ZEND_NULL_HANDLER,
38435: ZEND_NULL_HANDLER,
38436: ZEND_NULL_HANDLER,
38437: ZEND_NULL_HANDLER,
38438: ZEND_NULL_HANDLER,
38439: ZEND_UNSET_DIM_SPEC_VAR_CONST_HANDLER,
38440: ZEND_UNSET_DIM_SPEC_VAR_TMP_HANDLER,
38441: ZEND_UNSET_DIM_SPEC_VAR_VAR_HANDLER,
38442: ZEND_NULL_HANDLER,
38443: ZEND_UNSET_DIM_SPEC_VAR_CV_HANDLER,
38444: ZEND_UNSET_DIM_SPEC_UNUSED_CONST_HANDLER,
38445: ZEND_UNSET_DIM_SPEC_UNUSED_TMP_HANDLER,
38446: ZEND_UNSET_DIM_SPEC_UNUSED_VAR_HANDLER,
38447: ZEND_NULL_HANDLER,
38448: ZEND_UNSET_DIM_SPEC_UNUSED_CV_HANDLER,
38449: ZEND_UNSET_DIM_SPEC_CV_CONST_HANDLER,
38450: ZEND_UNSET_DIM_SPEC_CV_TMP_HANDLER,
38451: ZEND_UNSET_DIM_SPEC_CV_VAR_HANDLER,
38452: ZEND_NULL_HANDLER,
38453: ZEND_UNSET_DIM_SPEC_CV_CV_HANDLER,
38454: ZEND_NULL_HANDLER,
38455: ZEND_NULL_HANDLER,
38456: ZEND_NULL_HANDLER,
38457: ZEND_NULL_HANDLER,
38458: ZEND_NULL_HANDLER,
38459: ZEND_NULL_HANDLER,
38460: ZEND_NULL_HANDLER,
38461: ZEND_NULL_HANDLER,
38462: ZEND_NULL_HANDLER,
38463: ZEND_NULL_HANDLER,
38464: ZEND_UNSET_OBJ_SPEC_VAR_CONST_HANDLER,
38465: ZEND_UNSET_OBJ_SPEC_VAR_TMP_HANDLER,
38466: ZEND_UNSET_OBJ_SPEC_VAR_VAR_HANDLER,
38467: ZEND_NULL_HANDLER,
38468: ZEND_UNSET_OBJ_SPEC_VAR_CV_HANDLER,
38469: ZEND_UNSET_OBJ_SPEC_UNUSED_CONST_HANDLER,
38470: ZEND_UNSET_OBJ_SPEC_UNUSED_TMP_HANDLER,
38471: ZEND_UNSET_OBJ_SPEC_UNUSED_VAR_HANDLER,
38472: ZEND_NULL_HANDLER,
38473: ZEND_UNSET_OBJ_SPEC_UNUSED_CV_HANDLER,
38474: ZEND_UNSET_OBJ_SPEC_CV_CONST_HANDLER,
38475: ZEND_UNSET_OBJ_SPEC_CV_TMP_HANDLER,
38476: ZEND_UNSET_OBJ_SPEC_CV_VAR_HANDLER,
38477: ZEND_NULL_HANDLER,
38478: ZEND_UNSET_OBJ_SPEC_CV_CV_HANDLER,
38479: ZEND_FE_RESET_SPEC_CONST_HANDLER,
38480: ZEND_FE_RESET_SPEC_CONST_HANDLER,
38481: ZEND_FE_RESET_SPEC_CONST_HANDLER,
38482: ZEND_FE_RESET_SPEC_CONST_HANDLER,
38483: ZEND_FE_RESET_SPEC_CONST_HANDLER,
38484: ZEND_FE_RESET_SPEC_TMP_HANDLER,
38485: ZEND_FE_RESET_SPEC_TMP_HANDLER,
38486: ZEND_FE_RESET_SPEC_TMP_HANDLER,
38487: ZEND_FE_RESET_SPEC_TMP_HANDLER,
38488: ZEND_FE_RESET_SPEC_TMP_HANDLER,
38489: ZEND_FE_RESET_SPEC_VAR_HANDLER,
38490: ZEND_FE_RESET_SPEC_VAR_HANDLER,
38491: ZEND_FE_RESET_SPEC_VAR_HANDLER,
38492: ZEND_FE_RESET_SPEC_VAR_HANDLER,
38493: ZEND_FE_RESET_SPEC_VAR_HANDLER,
38494: ZEND_NULL_HANDLER,
38495: ZEND_NULL_HANDLER,
38496: ZEND_NULL_HANDLER,
38497: ZEND_NULL_HANDLER,
38498: ZEND_NULL_HANDLER,
38499: ZEND_FE_RESET_SPEC_CV_HANDLER,
38500: ZEND_FE_RESET_SPEC_CV_HANDLER,
38501: ZEND_FE_RESET_SPEC_CV_HANDLER,
38502: ZEND_FE_RESET_SPEC_CV_HANDLER,
38503: ZEND_FE_RESET_SPEC_CV_HANDLER,
38504: ZEND_NULL_HANDLER,
38505: ZEND_NULL_HANDLER,
38506: ZEND_NULL_HANDLER,
38507: ZEND_NULL_HANDLER,
38508: ZEND_NULL_HANDLER,
38509: ZEND_NULL_HANDLER,
38510: ZEND_NULL_HANDLER,
38511: ZEND_NULL_HANDLER,
38512: ZEND_NULL_HANDLER,
38513: ZEND_NULL_HANDLER,
38514: ZEND_FE_FETCH_SPEC_VAR_HANDLER,
38515: ZEND_FE_FETCH_SPEC_VAR_HANDLER,
38516: ZEND_FE_FETCH_SPEC_VAR_HANDLER,
38517: ZEND_FE_FETCH_SPEC_VAR_HANDLER,
38518: ZEND_FE_FETCH_SPEC_VAR_HANDLER,
38519: ZEND_NULL_HANDLER,
38520: ZEND_NULL_HANDLER,
38521: ZEND_NULL_HANDLER,
38522: ZEND_NULL_HANDLER,
38523: ZEND_NULL_HANDLER,
38524: ZEND_NULL_HANDLER,
38525: ZEND_NULL_HANDLER,
38526: ZEND_NULL_HANDLER,
38527: ZEND_NULL_HANDLER,
38528: ZEND_NULL_HANDLER,
38529: ZEND_EXIT_SPEC_CONST_HANDLER,
38530: ZEND_EXIT_SPEC_CONST_HANDLER,
38531: ZEND_EXIT_SPEC_CONST_HANDLER,
38532: ZEND_EXIT_SPEC_CONST_HANDLER,
38533: ZEND_EXIT_SPEC_CONST_HANDLER,
38534: ZEND_EXIT_SPEC_TMP_HANDLER,
38535: ZEND_EXIT_SPEC_TMP_HANDLER,
38536: ZEND_EXIT_SPEC_TMP_HANDLER,
38537: ZEND_EXIT_SPEC_TMP_HANDLER,
38538: ZEND_EXIT_SPEC_TMP_HANDLER,
38539: ZEND_EXIT_SPEC_VAR_HANDLER,
38540: ZEND_EXIT_SPEC_VAR_HANDLER,
38541: ZEND_EXIT_SPEC_VAR_HANDLER,
38542: ZEND_EXIT_SPEC_VAR_HANDLER,
38543: ZEND_EXIT_SPEC_VAR_HANDLER,
38544: ZEND_EXIT_SPEC_UNUSED_HANDLER,
38545: ZEND_EXIT_SPEC_UNUSED_HANDLER,
38546: ZEND_EXIT_SPEC_UNUSED_HANDLER,
38547: ZEND_EXIT_SPEC_UNUSED_HANDLER,
38548: ZEND_EXIT_SPEC_UNUSED_HANDLER,
38549: ZEND_EXIT_SPEC_CV_HANDLER,
38550: ZEND_EXIT_SPEC_CV_HANDLER,
38551: ZEND_EXIT_SPEC_CV_HANDLER,
38552: ZEND_EXIT_SPEC_CV_HANDLER,
38553: ZEND_EXIT_SPEC_CV_HANDLER,
1.1.1.2 misho 38554: ZEND_FETCH_R_SPEC_CONST_CONST_HANDLER,
38555: ZEND_NULL_HANDLER,
38556: ZEND_FETCH_R_SPEC_CONST_VAR_HANDLER,
38557: ZEND_FETCH_R_SPEC_CONST_UNUSED_HANDLER,
38558: ZEND_NULL_HANDLER,
38559: ZEND_FETCH_R_SPEC_TMP_CONST_HANDLER,
38560: ZEND_NULL_HANDLER,
38561: ZEND_FETCH_R_SPEC_TMP_VAR_HANDLER,
38562: ZEND_FETCH_R_SPEC_TMP_UNUSED_HANDLER,
38563: ZEND_NULL_HANDLER,
38564: ZEND_FETCH_R_SPEC_VAR_CONST_HANDLER,
38565: ZEND_NULL_HANDLER,
38566: ZEND_FETCH_R_SPEC_VAR_VAR_HANDLER,
38567: ZEND_FETCH_R_SPEC_VAR_UNUSED_HANDLER,
38568: ZEND_NULL_HANDLER,
1.1 misho 38569: ZEND_NULL_HANDLER,
38570: ZEND_NULL_HANDLER,
38571: ZEND_NULL_HANDLER,
38572: ZEND_NULL_HANDLER,
38573: ZEND_NULL_HANDLER,
1.1.1.2 misho 38574: ZEND_FETCH_R_SPEC_CV_CONST_HANDLER,
38575: ZEND_NULL_HANDLER,
38576: ZEND_FETCH_R_SPEC_CV_VAR_HANDLER,
38577: ZEND_FETCH_R_SPEC_CV_UNUSED_HANDLER,
38578: ZEND_NULL_HANDLER,
1.1 misho 38579: ZEND_NULL_HANDLER,
38580: ZEND_NULL_HANDLER,
38581: ZEND_NULL_HANDLER,
38582: ZEND_NULL_HANDLER,
38583: ZEND_NULL_HANDLER,
38584: ZEND_NULL_HANDLER,
38585: ZEND_NULL_HANDLER,
38586: ZEND_NULL_HANDLER,
38587: ZEND_NULL_HANDLER,
38588: ZEND_NULL_HANDLER,
38589: ZEND_FETCH_DIM_R_SPEC_VAR_CONST_HANDLER,
38590: ZEND_FETCH_DIM_R_SPEC_VAR_TMP_HANDLER,
38591: ZEND_FETCH_DIM_R_SPEC_VAR_VAR_HANDLER,
38592: ZEND_NULL_HANDLER,
38593: ZEND_FETCH_DIM_R_SPEC_VAR_CV_HANDLER,
38594: ZEND_NULL_HANDLER,
38595: ZEND_NULL_HANDLER,
38596: ZEND_NULL_HANDLER,
38597: ZEND_NULL_HANDLER,
38598: ZEND_NULL_HANDLER,
38599: ZEND_FETCH_DIM_R_SPEC_CV_CONST_HANDLER,
38600: ZEND_FETCH_DIM_R_SPEC_CV_TMP_HANDLER,
38601: ZEND_FETCH_DIM_R_SPEC_CV_VAR_HANDLER,
38602: ZEND_NULL_HANDLER,
38603: ZEND_FETCH_DIM_R_SPEC_CV_CV_HANDLER,
38604: ZEND_NULL_HANDLER,
38605: ZEND_NULL_HANDLER,
38606: ZEND_NULL_HANDLER,
38607: ZEND_NULL_HANDLER,
38608: ZEND_NULL_HANDLER,
38609: ZEND_NULL_HANDLER,
38610: ZEND_NULL_HANDLER,
38611: ZEND_NULL_HANDLER,
38612: ZEND_NULL_HANDLER,
38613: ZEND_NULL_HANDLER,
38614: ZEND_FETCH_OBJ_R_SPEC_VAR_CONST_HANDLER,
38615: ZEND_FETCH_OBJ_R_SPEC_VAR_TMP_HANDLER,
38616: ZEND_FETCH_OBJ_R_SPEC_VAR_VAR_HANDLER,
38617: ZEND_NULL_HANDLER,
38618: ZEND_FETCH_OBJ_R_SPEC_VAR_CV_HANDLER,
38619: ZEND_FETCH_OBJ_R_SPEC_UNUSED_CONST_HANDLER,
38620: ZEND_FETCH_OBJ_R_SPEC_UNUSED_TMP_HANDLER,
38621: ZEND_FETCH_OBJ_R_SPEC_UNUSED_VAR_HANDLER,
38622: ZEND_NULL_HANDLER,
38623: ZEND_FETCH_OBJ_R_SPEC_UNUSED_CV_HANDLER,
38624: ZEND_FETCH_OBJ_R_SPEC_CV_CONST_HANDLER,
38625: ZEND_FETCH_OBJ_R_SPEC_CV_TMP_HANDLER,
38626: ZEND_FETCH_OBJ_R_SPEC_CV_VAR_HANDLER,
38627: ZEND_NULL_HANDLER,
38628: ZEND_FETCH_OBJ_R_SPEC_CV_CV_HANDLER,
1.1.1.2 misho 38629: ZEND_FETCH_W_SPEC_CONST_CONST_HANDLER,
38630: ZEND_NULL_HANDLER,
38631: ZEND_FETCH_W_SPEC_CONST_VAR_HANDLER,
38632: ZEND_FETCH_W_SPEC_CONST_UNUSED_HANDLER,
38633: ZEND_NULL_HANDLER,
38634: ZEND_FETCH_W_SPEC_TMP_CONST_HANDLER,
38635: ZEND_NULL_HANDLER,
38636: ZEND_FETCH_W_SPEC_TMP_VAR_HANDLER,
38637: ZEND_FETCH_W_SPEC_TMP_UNUSED_HANDLER,
38638: ZEND_NULL_HANDLER,
38639: ZEND_FETCH_W_SPEC_VAR_CONST_HANDLER,
38640: ZEND_NULL_HANDLER,
38641: ZEND_FETCH_W_SPEC_VAR_VAR_HANDLER,
38642: ZEND_FETCH_W_SPEC_VAR_UNUSED_HANDLER,
38643: ZEND_NULL_HANDLER,
1.1 misho 38644: ZEND_NULL_HANDLER,
38645: ZEND_NULL_HANDLER,
38646: ZEND_NULL_HANDLER,
38647: ZEND_NULL_HANDLER,
38648: ZEND_NULL_HANDLER,
1.1.1.2 misho 38649: ZEND_FETCH_W_SPEC_CV_CONST_HANDLER,
38650: ZEND_NULL_HANDLER,
38651: ZEND_FETCH_W_SPEC_CV_VAR_HANDLER,
38652: ZEND_FETCH_W_SPEC_CV_UNUSED_HANDLER,
38653: ZEND_NULL_HANDLER,
1.1 misho 38654: ZEND_NULL_HANDLER,
38655: ZEND_NULL_HANDLER,
38656: ZEND_NULL_HANDLER,
38657: ZEND_NULL_HANDLER,
38658: ZEND_NULL_HANDLER,
38659: ZEND_NULL_HANDLER,
38660: ZEND_NULL_HANDLER,
38661: ZEND_NULL_HANDLER,
38662: ZEND_NULL_HANDLER,
38663: ZEND_NULL_HANDLER,
38664: ZEND_FETCH_DIM_W_SPEC_VAR_CONST_HANDLER,
38665: ZEND_FETCH_DIM_W_SPEC_VAR_TMP_HANDLER,
38666: ZEND_FETCH_DIM_W_SPEC_VAR_VAR_HANDLER,
38667: ZEND_FETCH_DIM_W_SPEC_VAR_UNUSED_HANDLER,
38668: ZEND_FETCH_DIM_W_SPEC_VAR_CV_HANDLER,
38669: ZEND_NULL_HANDLER,
38670: ZEND_NULL_HANDLER,
38671: ZEND_NULL_HANDLER,
38672: ZEND_NULL_HANDLER,
38673: ZEND_NULL_HANDLER,
38674: ZEND_FETCH_DIM_W_SPEC_CV_CONST_HANDLER,
38675: ZEND_FETCH_DIM_W_SPEC_CV_TMP_HANDLER,
38676: ZEND_FETCH_DIM_W_SPEC_CV_VAR_HANDLER,
38677: ZEND_FETCH_DIM_W_SPEC_CV_UNUSED_HANDLER,
38678: ZEND_FETCH_DIM_W_SPEC_CV_CV_HANDLER,
38679: ZEND_NULL_HANDLER,
38680: ZEND_NULL_HANDLER,
38681: ZEND_NULL_HANDLER,
38682: ZEND_NULL_HANDLER,
38683: ZEND_NULL_HANDLER,
38684: ZEND_NULL_HANDLER,
38685: ZEND_NULL_HANDLER,
38686: ZEND_NULL_HANDLER,
38687: ZEND_NULL_HANDLER,
38688: ZEND_NULL_HANDLER,
38689: ZEND_FETCH_OBJ_W_SPEC_VAR_CONST_HANDLER,
38690: ZEND_FETCH_OBJ_W_SPEC_VAR_TMP_HANDLER,
38691: ZEND_FETCH_OBJ_W_SPEC_VAR_VAR_HANDLER,
38692: ZEND_NULL_HANDLER,
38693: ZEND_FETCH_OBJ_W_SPEC_VAR_CV_HANDLER,
38694: ZEND_FETCH_OBJ_W_SPEC_UNUSED_CONST_HANDLER,
38695: ZEND_FETCH_OBJ_W_SPEC_UNUSED_TMP_HANDLER,
38696: ZEND_FETCH_OBJ_W_SPEC_UNUSED_VAR_HANDLER,
38697: ZEND_NULL_HANDLER,
38698: ZEND_FETCH_OBJ_W_SPEC_UNUSED_CV_HANDLER,
38699: ZEND_FETCH_OBJ_W_SPEC_CV_CONST_HANDLER,
38700: ZEND_FETCH_OBJ_W_SPEC_CV_TMP_HANDLER,
38701: ZEND_FETCH_OBJ_W_SPEC_CV_VAR_HANDLER,
38702: ZEND_NULL_HANDLER,
38703: ZEND_FETCH_OBJ_W_SPEC_CV_CV_HANDLER,
1.1.1.2 misho 38704: ZEND_FETCH_RW_SPEC_CONST_CONST_HANDLER,
38705: ZEND_NULL_HANDLER,
38706: ZEND_FETCH_RW_SPEC_CONST_VAR_HANDLER,
38707: ZEND_FETCH_RW_SPEC_CONST_UNUSED_HANDLER,
38708: ZEND_NULL_HANDLER,
38709: ZEND_FETCH_RW_SPEC_TMP_CONST_HANDLER,
38710: ZEND_NULL_HANDLER,
38711: ZEND_FETCH_RW_SPEC_TMP_VAR_HANDLER,
38712: ZEND_FETCH_RW_SPEC_TMP_UNUSED_HANDLER,
38713: ZEND_NULL_HANDLER,
38714: ZEND_FETCH_RW_SPEC_VAR_CONST_HANDLER,
38715: ZEND_NULL_HANDLER,
38716: ZEND_FETCH_RW_SPEC_VAR_VAR_HANDLER,
38717: ZEND_FETCH_RW_SPEC_VAR_UNUSED_HANDLER,
38718: ZEND_NULL_HANDLER,
1.1 misho 38719: ZEND_NULL_HANDLER,
38720: ZEND_NULL_HANDLER,
38721: ZEND_NULL_HANDLER,
38722: ZEND_NULL_HANDLER,
38723: ZEND_NULL_HANDLER,
1.1.1.2 misho 38724: ZEND_FETCH_RW_SPEC_CV_CONST_HANDLER,
38725: ZEND_NULL_HANDLER,
38726: ZEND_FETCH_RW_SPEC_CV_VAR_HANDLER,
38727: ZEND_FETCH_RW_SPEC_CV_UNUSED_HANDLER,
38728: ZEND_NULL_HANDLER,
1.1 misho 38729: ZEND_NULL_HANDLER,
38730: ZEND_NULL_HANDLER,
38731: ZEND_NULL_HANDLER,
38732: ZEND_NULL_HANDLER,
38733: ZEND_NULL_HANDLER,
38734: ZEND_NULL_HANDLER,
38735: ZEND_NULL_HANDLER,
38736: ZEND_NULL_HANDLER,
38737: ZEND_NULL_HANDLER,
38738: ZEND_NULL_HANDLER,
38739: ZEND_FETCH_DIM_RW_SPEC_VAR_CONST_HANDLER,
38740: ZEND_FETCH_DIM_RW_SPEC_VAR_TMP_HANDLER,
38741: ZEND_FETCH_DIM_RW_SPEC_VAR_VAR_HANDLER,
38742: ZEND_FETCH_DIM_RW_SPEC_VAR_UNUSED_HANDLER,
38743: ZEND_FETCH_DIM_RW_SPEC_VAR_CV_HANDLER,
38744: ZEND_NULL_HANDLER,
38745: ZEND_NULL_HANDLER,
38746: ZEND_NULL_HANDLER,
38747: ZEND_NULL_HANDLER,
38748: ZEND_NULL_HANDLER,
38749: ZEND_FETCH_DIM_RW_SPEC_CV_CONST_HANDLER,
38750: ZEND_FETCH_DIM_RW_SPEC_CV_TMP_HANDLER,
38751: ZEND_FETCH_DIM_RW_SPEC_CV_VAR_HANDLER,
38752: ZEND_FETCH_DIM_RW_SPEC_CV_UNUSED_HANDLER,
38753: ZEND_FETCH_DIM_RW_SPEC_CV_CV_HANDLER,
38754: ZEND_NULL_HANDLER,
38755: ZEND_NULL_HANDLER,
38756: ZEND_NULL_HANDLER,
38757: ZEND_NULL_HANDLER,
38758: ZEND_NULL_HANDLER,
38759: ZEND_NULL_HANDLER,
38760: ZEND_NULL_HANDLER,
38761: ZEND_NULL_HANDLER,
38762: ZEND_NULL_HANDLER,
38763: ZEND_NULL_HANDLER,
38764: ZEND_FETCH_OBJ_RW_SPEC_VAR_CONST_HANDLER,
38765: ZEND_FETCH_OBJ_RW_SPEC_VAR_TMP_HANDLER,
38766: ZEND_FETCH_OBJ_RW_SPEC_VAR_VAR_HANDLER,
38767: ZEND_NULL_HANDLER,
38768: ZEND_FETCH_OBJ_RW_SPEC_VAR_CV_HANDLER,
38769: ZEND_FETCH_OBJ_RW_SPEC_UNUSED_CONST_HANDLER,
38770: ZEND_FETCH_OBJ_RW_SPEC_UNUSED_TMP_HANDLER,
38771: ZEND_FETCH_OBJ_RW_SPEC_UNUSED_VAR_HANDLER,
38772: ZEND_NULL_HANDLER,
38773: ZEND_FETCH_OBJ_RW_SPEC_UNUSED_CV_HANDLER,
38774: ZEND_FETCH_OBJ_RW_SPEC_CV_CONST_HANDLER,
38775: ZEND_FETCH_OBJ_RW_SPEC_CV_TMP_HANDLER,
38776: ZEND_FETCH_OBJ_RW_SPEC_CV_VAR_HANDLER,
38777: ZEND_NULL_HANDLER,
38778: ZEND_FETCH_OBJ_RW_SPEC_CV_CV_HANDLER,
1.1.1.2 misho 38779: ZEND_FETCH_IS_SPEC_CONST_CONST_HANDLER,
38780: ZEND_NULL_HANDLER,
38781: ZEND_FETCH_IS_SPEC_CONST_VAR_HANDLER,
38782: ZEND_FETCH_IS_SPEC_CONST_UNUSED_HANDLER,
38783: ZEND_NULL_HANDLER,
38784: ZEND_FETCH_IS_SPEC_TMP_CONST_HANDLER,
38785: ZEND_NULL_HANDLER,
38786: ZEND_FETCH_IS_SPEC_TMP_VAR_HANDLER,
38787: ZEND_FETCH_IS_SPEC_TMP_UNUSED_HANDLER,
38788: ZEND_NULL_HANDLER,
38789: ZEND_FETCH_IS_SPEC_VAR_CONST_HANDLER,
38790: ZEND_NULL_HANDLER,
38791: ZEND_FETCH_IS_SPEC_VAR_VAR_HANDLER,
38792: ZEND_FETCH_IS_SPEC_VAR_UNUSED_HANDLER,
38793: ZEND_NULL_HANDLER,
1.1 misho 38794: ZEND_NULL_HANDLER,
38795: ZEND_NULL_HANDLER,
38796: ZEND_NULL_HANDLER,
38797: ZEND_NULL_HANDLER,
38798: ZEND_NULL_HANDLER,
1.1.1.2 misho 38799: ZEND_FETCH_IS_SPEC_CV_CONST_HANDLER,
38800: ZEND_NULL_HANDLER,
38801: ZEND_FETCH_IS_SPEC_CV_VAR_HANDLER,
38802: ZEND_FETCH_IS_SPEC_CV_UNUSED_HANDLER,
38803: ZEND_NULL_HANDLER,
1.1 misho 38804: ZEND_NULL_HANDLER,
38805: ZEND_NULL_HANDLER,
38806: ZEND_NULL_HANDLER,
38807: ZEND_NULL_HANDLER,
38808: ZEND_NULL_HANDLER,
38809: ZEND_NULL_HANDLER,
38810: ZEND_NULL_HANDLER,
38811: ZEND_NULL_HANDLER,
38812: ZEND_NULL_HANDLER,
38813: ZEND_NULL_HANDLER,
38814: ZEND_FETCH_DIM_IS_SPEC_VAR_CONST_HANDLER,
38815: ZEND_FETCH_DIM_IS_SPEC_VAR_TMP_HANDLER,
38816: ZEND_FETCH_DIM_IS_SPEC_VAR_VAR_HANDLER,
38817: ZEND_NULL_HANDLER,
38818: ZEND_FETCH_DIM_IS_SPEC_VAR_CV_HANDLER,
38819: ZEND_NULL_HANDLER,
38820: ZEND_NULL_HANDLER,
38821: ZEND_NULL_HANDLER,
38822: ZEND_NULL_HANDLER,
38823: ZEND_NULL_HANDLER,
38824: ZEND_FETCH_DIM_IS_SPEC_CV_CONST_HANDLER,
38825: ZEND_FETCH_DIM_IS_SPEC_CV_TMP_HANDLER,
38826: ZEND_FETCH_DIM_IS_SPEC_CV_VAR_HANDLER,
38827: ZEND_NULL_HANDLER,
38828: ZEND_FETCH_DIM_IS_SPEC_CV_CV_HANDLER,
38829: ZEND_NULL_HANDLER,
38830: ZEND_NULL_HANDLER,
38831: ZEND_NULL_HANDLER,
38832: ZEND_NULL_HANDLER,
38833: ZEND_NULL_HANDLER,
38834: ZEND_NULL_HANDLER,
38835: ZEND_NULL_HANDLER,
38836: ZEND_NULL_HANDLER,
38837: ZEND_NULL_HANDLER,
38838: ZEND_NULL_HANDLER,
38839: ZEND_FETCH_OBJ_IS_SPEC_VAR_CONST_HANDLER,
38840: ZEND_FETCH_OBJ_IS_SPEC_VAR_TMP_HANDLER,
38841: ZEND_FETCH_OBJ_IS_SPEC_VAR_VAR_HANDLER,
38842: ZEND_NULL_HANDLER,
38843: ZEND_FETCH_OBJ_IS_SPEC_VAR_CV_HANDLER,
38844: ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CONST_HANDLER,
38845: ZEND_FETCH_OBJ_IS_SPEC_UNUSED_TMP_HANDLER,
38846: ZEND_FETCH_OBJ_IS_SPEC_UNUSED_VAR_HANDLER,
38847: ZEND_NULL_HANDLER,
38848: ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CV_HANDLER,
38849: ZEND_FETCH_OBJ_IS_SPEC_CV_CONST_HANDLER,
38850: ZEND_FETCH_OBJ_IS_SPEC_CV_TMP_HANDLER,
38851: ZEND_FETCH_OBJ_IS_SPEC_CV_VAR_HANDLER,
38852: ZEND_NULL_HANDLER,
38853: ZEND_FETCH_OBJ_IS_SPEC_CV_CV_HANDLER,
1.1.1.2 misho 38854: ZEND_FETCH_FUNC_ARG_SPEC_CONST_CONST_HANDLER,
38855: ZEND_NULL_HANDLER,
38856: ZEND_FETCH_FUNC_ARG_SPEC_CONST_VAR_HANDLER,
38857: ZEND_FETCH_FUNC_ARG_SPEC_CONST_UNUSED_HANDLER,
38858: ZEND_NULL_HANDLER,
38859: ZEND_FETCH_FUNC_ARG_SPEC_TMP_CONST_HANDLER,
38860: ZEND_NULL_HANDLER,
38861: ZEND_FETCH_FUNC_ARG_SPEC_TMP_VAR_HANDLER,
38862: ZEND_FETCH_FUNC_ARG_SPEC_TMP_UNUSED_HANDLER,
38863: ZEND_NULL_HANDLER,
38864: ZEND_FETCH_FUNC_ARG_SPEC_VAR_CONST_HANDLER,
38865: ZEND_NULL_HANDLER,
38866: ZEND_FETCH_FUNC_ARG_SPEC_VAR_VAR_HANDLER,
38867: ZEND_FETCH_FUNC_ARG_SPEC_VAR_UNUSED_HANDLER,
38868: ZEND_NULL_HANDLER,
1.1 misho 38869: ZEND_NULL_HANDLER,
38870: ZEND_NULL_HANDLER,
38871: ZEND_NULL_HANDLER,
38872: ZEND_NULL_HANDLER,
38873: ZEND_NULL_HANDLER,
1.1.1.2 misho 38874: ZEND_FETCH_FUNC_ARG_SPEC_CV_CONST_HANDLER,
38875: ZEND_NULL_HANDLER,
38876: ZEND_FETCH_FUNC_ARG_SPEC_CV_VAR_HANDLER,
38877: ZEND_FETCH_FUNC_ARG_SPEC_CV_UNUSED_HANDLER,
38878: ZEND_NULL_HANDLER,
1.1 misho 38879: ZEND_NULL_HANDLER,
38880: ZEND_NULL_HANDLER,
38881: ZEND_NULL_HANDLER,
38882: ZEND_NULL_HANDLER,
38883: ZEND_NULL_HANDLER,
38884: ZEND_NULL_HANDLER,
38885: ZEND_NULL_HANDLER,
38886: ZEND_NULL_HANDLER,
38887: ZEND_NULL_HANDLER,
38888: ZEND_NULL_HANDLER,
38889: ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CONST_HANDLER,
38890: ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_TMP_HANDLER,
38891: ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_VAR_HANDLER,
38892: ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_UNUSED_HANDLER,
38893: ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CV_HANDLER,
38894: ZEND_NULL_HANDLER,
38895: ZEND_NULL_HANDLER,
38896: ZEND_NULL_HANDLER,
38897: ZEND_NULL_HANDLER,
38898: ZEND_NULL_HANDLER,
38899: ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CONST_HANDLER,
38900: ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_TMP_HANDLER,
38901: ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_VAR_HANDLER,
38902: ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_UNUSED_HANDLER,
38903: ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CV_HANDLER,
38904: ZEND_NULL_HANDLER,
38905: ZEND_NULL_HANDLER,
38906: ZEND_NULL_HANDLER,
38907: ZEND_NULL_HANDLER,
38908: ZEND_NULL_HANDLER,
38909: ZEND_NULL_HANDLER,
38910: ZEND_NULL_HANDLER,
38911: ZEND_NULL_HANDLER,
38912: ZEND_NULL_HANDLER,
38913: ZEND_NULL_HANDLER,
38914: ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CONST_HANDLER,
38915: ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_TMP_HANDLER,
38916: ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_VAR_HANDLER,
38917: ZEND_NULL_HANDLER,
38918: ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CV_HANDLER,
38919: ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CONST_HANDLER,
38920: ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_TMP_HANDLER,
38921: ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_VAR_HANDLER,
38922: ZEND_NULL_HANDLER,
38923: ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CV_HANDLER,
38924: ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CONST_HANDLER,
38925: ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_TMP_HANDLER,
38926: ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_VAR_HANDLER,
38927: ZEND_NULL_HANDLER,
38928: ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CV_HANDLER,
1.1.1.2 misho 38929: ZEND_FETCH_UNSET_SPEC_CONST_CONST_HANDLER,
38930: ZEND_NULL_HANDLER,
38931: ZEND_FETCH_UNSET_SPEC_CONST_VAR_HANDLER,
38932: ZEND_FETCH_UNSET_SPEC_CONST_UNUSED_HANDLER,
38933: ZEND_NULL_HANDLER,
38934: ZEND_FETCH_UNSET_SPEC_TMP_CONST_HANDLER,
38935: ZEND_NULL_HANDLER,
38936: ZEND_FETCH_UNSET_SPEC_TMP_VAR_HANDLER,
38937: ZEND_FETCH_UNSET_SPEC_TMP_UNUSED_HANDLER,
38938: ZEND_NULL_HANDLER,
38939: ZEND_FETCH_UNSET_SPEC_VAR_CONST_HANDLER,
38940: ZEND_NULL_HANDLER,
38941: ZEND_FETCH_UNSET_SPEC_VAR_VAR_HANDLER,
38942: ZEND_FETCH_UNSET_SPEC_VAR_UNUSED_HANDLER,
38943: ZEND_NULL_HANDLER,
1.1 misho 38944: ZEND_NULL_HANDLER,
38945: ZEND_NULL_HANDLER,
38946: ZEND_NULL_HANDLER,
38947: ZEND_NULL_HANDLER,
38948: ZEND_NULL_HANDLER,
1.1.1.2 misho 38949: ZEND_FETCH_UNSET_SPEC_CV_CONST_HANDLER,
38950: ZEND_NULL_HANDLER,
38951: ZEND_FETCH_UNSET_SPEC_CV_VAR_HANDLER,
38952: ZEND_FETCH_UNSET_SPEC_CV_UNUSED_HANDLER,
38953: ZEND_NULL_HANDLER,
1.1 misho 38954: ZEND_NULL_HANDLER,
38955: ZEND_NULL_HANDLER,
38956: ZEND_NULL_HANDLER,
38957: ZEND_NULL_HANDLER,
38958: ZEND_NULL_HANDLER,
38959: ZEND_NULL_HANDLER,
38960: ZEND_NULL_HANDLER,
38961: ZEND_NULL_HANDLER,
38962: ZEND_NULL_HANDLER,
38963: ZEND_NULL_HANDLER,
38964: ZEND_FETCH_DIM_UNSET_SPEC_VAR_CONST_HANDLER,
38965: ZEND_FETCH_DIM_UNSET_SPEC_VAR_TMP_HANDLER,
38966: ZEND_FETCH_DIM_UNSET_SPEC_VAR_VAR_HANDLER,
38967: ZEND_NULL_HANDLER,
38968: ZEND_FETCH_DIM_UNSET_SPEC_VAR_CV_HANDLER,
38969: ZEND_NULL_HANDLER,
38970: ZEND_NULL_HANDLER,
38971: ZEND_NULL_HANDLER,
38972: ZEND_NULL_HANDLER,
38973: ZEND_NULL_HANDLER,
38974: ZEND_FETCH_DIM_UNSET_SPEC_CV_CONST_HANDLER,
38975: ZEND_FETCH_DIM_UNSET_SPEC_CV_TMP_HANDLER,
38976: ZEND_FETCH_DIM_UNSET_SPEC_CV_VAR_HANDLER,
38977: ZEND_NULL_HANDLER,
38978: ZEND_FETCH_DIM_UNSET_SPEC_CV_CV_HANDLER,
38979: ZEND_NULL_HANDLER,
38980: ZEND_NULL_HANDLER,
38981: ZEND_NULL_HANDLER,
38982: ZEND_NULL_HANDLER,
38983: ZEND_NULL_HANDLER,
38984: ZEND_NULL_HANDLER,
38985: ZEND_NULL_HANDLER,
38986: ZEND_NULL_HANDLER,
38987: ZEND_NULL_HANDLER,
38988: ZEND_NULL_HANDLER,
38989: ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CONST_HANDLER,
38990: ZEND_FETCH_OBJ_UNSET_SPEC_VAR_TMP_HANDLER,
38991: ZEND_FETCH_OBJ_UNSET_SPEC_VAR_VAR_HANDLER,
38992: ZEND_NULL_HANDLER,
38993: ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CV_HANDLER,
38994: ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CONST_HANDLER,
38995: ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_TMP_HANDLER,
38996: ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_VAR_HANDLER,
38997: ZEND_NULL_HANDLER,
38998: ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CV_HANDLER,
38999: ZEND_FETCH_OBJ_UNSET_SPEC_CV_CONST_HANDLER,
39000: ZEND_FETCH_OBJ_UNSET_SPEC_CV_TMP_HANDLER,
39001: ZEND_FETCH_OBJ_UNSET_SPEC_CV_VAR_HANDLER,
39002: ZEND_NULL_HANDLER,
39003: ZEND_FETCH_OBJ_UNSET_SPEC_CV_CV_HANDLER,
39004: ZEND_FETCH_DIM_TMP_VAR_SPEC_CONST_CONST_HANDLER,
39005: ZEND_NULL_HANDLER,
39006: ZEND_NULL_HANDLER,
39007: ZEND_NULL_HANDLER,
39008: ZEND_NULL_HANDLER,
39009: ZEND_FETCH_DIM_TMP_VAR_SPEC_TMP_CONST_HANDLER,
39010: ZEND_NULL_HANDLER,
39011: ZEND_NULL_HANDLER,
39012: ZEND_NULL_HANDLER,
39013: ZEND_NULL_HANDLER,
39014: ZEND_NULL_HANDLER,
39015: ZEND_NULL_HANDLER,
39016: ZEND_NULL_HANDLER,
39017: ZEND_NULL_HANDLER,
39018: ZEND_NULL_HANDLER,
39019: ZEND_NULL_HANDLER,
39020: ZEND_NULL_HANDLER,
39021: ZEND_NULL_HANDLER,
39022: ZEND_NULL_HANDLER,
39023: ZEND_NULL_HANDLER,
39024: ZEND_NULL_HANDLER,
39025: ZEND_NULL_HANDLER,
39026: ZEND_NULL_HANDLER,
39027: ZEND_NULL_HANDLER,
39028: ZEND_NULL_HANDLER,
39029: ZEND_FETCH_CONSTANT_SPEC_CONST_CONST_HANDLER,
39030: ZEND_NULL_HANDLER,
39031: ZEND_NULL_HANDLER,
39032: ZEND_NULL_HANDLER,
39033: ZEND_NULL_HANDLER,
39034: ZEND_NULL_HANDLER,
39035: ZEND_NULL_HANDLER,
39036: ZEND_NULL_HANDLER,
39037: ZEND_NULL_HANDLER,
39038: ZEND_NULL_HANDLER,
39039: ZEND_FETCH_CONSTANT_SPEC_VAR_CONST_HANDLER,
39040: ZEND_NULL_HANDLER,
39041: ZEND_NULL_HANDLER,
39042: ZEND_NULL_HANDLER,
39043: ZEND_NULL_HANDLER,
39044: ZEND_FETCH_CONSTANT_SPEC_UNUSED_CONST_HANDLER,
39045: ZEND_NULL_HANDLER,
39046: ZEND_NULL_HANDLER,
39047: ZEND_NULL_HANDLER,
39048: ZEND_NULL_HANDLER,
39049: ZEND_NULL_HANDLER,
39050: ZEND_NULL_HANDLER,
39051: ZEND_NULL_HANDLER,
39052: ZEND_NULL_HANDLER,
39053: ZEND_NULL_HANDLER,
39054: ZEND_GOTO_SPEC_CONST_HANDLER,
39055: ZEND_NULL_HANDLER,
39056: ZEND_NULL_HANDLER,
39057: ZEND_NULL_HANDLER,
39058: ZEND_NULL_HANDLER,
39059: ZEND_GOTO_SPEC_CONST_HANDLER,
39060: ZEND_NULL_HANDLER,
39061: ZEND_NULL_HANDLER,
39062: ZEND_NULL_HANDLER,
39063: ZEND_NULL_HANDLER,
39064: ZEND_GOTO_SPEC_CONST_HANDLER,
39065: ZEND_NULL_HANDLER,
39066: ZEND_NULL_HANDLER,
39067: ZEND_NULL_HANDLER,
39068: ZEND_NULL_HANDLER,
39069: ZEND_GOTO_SPEC_CONST_HANDLER,
39070: ZEND_NULL_HANDLER,
39071: ZEND_NULL_HANDLER,
39072: ZEND_NULL_HANDLER,
39073: ZEND_NULL_HANDLER,
39074: ZEND_GOTO_SPEC_CONST_HANDLER,
39075: ZEND_NULL_HANDLER,
39076: ZEND_NULL_HANDLER,
39077: ZEND_NULL_HANDLER,
39078: ZEND_NULL_HANDLER,
39079: ZEND_EXT_STMT_SPEC_HANDLER,
39080: ZEND_EXT_STMT_SPEC_HANDLER,
39081: ZEND_EXT_STMT_SPEC_HANDLER,
39082: ZEND_EXT_STMT_SPEC_HANDLER,
39083: ZEND_EXT_STMT_SPEC_HANDLER,
39084: ZEND_EXT_STMT_SPEC_HANDLER,
39085: ZEND_EXT_STMT_SPEC_HANDLER,
39086: ZEND_EXT_STMT_SPEC_HANDLER,
39087: ZEND_EXT_STMT_SPEC_HANDLER,
39088: ZEND_EXT_STMT_SPEC_HANDLER,
39089: ZEND_EXT_STMT_SPEC_HANDLER,
39090: ZEND_EXT_STMT_SPEC_HANDLER,
39091: ZEND_EXT_STMT_SPEC_HANDLER,
39092: ZEND_EXT_STMT_SPEC_HANDLER,
39093: ZEND_EXT_STMT_SPEC_HANDLER,
39094: ZEND_EXT_STMT_SPEC_HANDLER,
39095: ZEND_EXT_STMT_SPEC_HANDLER,
39096: ZEND_EXT_STMT_SPEC_HANDLER,
39097: ZEND_EXT_STMT_SPEC_HANDLER,
39098: ZEND_EXT_STMT_SPEC_HANDLER,
39099: ZEND_EXT_STMT_SPEC_HANDLER,
39100: ZEND_EXT_STMT_SPEC_HANDLER,
39101: ZEND_EXT_STMT_SPEC_HANDLER,
39102: ZEND_EXT_STMT_SPEC_HANDLER,
39103: ZEND_EXT_STMT_SPEC_HANDLER,
39104: ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER,
39105: ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER,
39106: ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER,
39107: ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER,
39108: ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER,
39109: ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER,
39110: ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER,
39111: ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER,
39112: ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER,
39113: ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER,
39114: ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER,
39115: ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER,
39116: ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER,
39117: ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER,
39118: ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER,
39119: ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER,
39120: ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER,
39121: ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER,
39122: ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER,
39123: ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER,
39124: ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER,
39125: ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER,
39126: ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER,
39127: ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER,
39128: ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER,
39129: ZEND_EXT_FCALL_END_SPEC_HANDLER,
39130: ZEND_EXT_FCALL_END_SPEC_HANDLER,
39131: ZEND_EXT_FCALL_END_SPEC_HANDLER,
39132: ZEND_EXT_FCALL_END_SPEC_HANDLER,
39133: ZEND_EXT_FCALL_END_SPEC_HANDLER,
39134: ZEND_EXT_FCALL_END_SPEC_HANDLER,
39135: ZEND_EXT_FCALL_END_SPEC_HANDLER,
39136: ZEND_EXT_FCALL_END_SPEC_HANDLER,
39137: ZEND_EXT_FCALL_END_SPEC_HANDLER,
39138: ZEND_EXT_FCALL_END_SPEC_HANDLER,
39139: ZEND_EXT_FCALL_END_SPEC_HANDLER,
39140: ZEND_EXT_FCALL_END_SPEC_HANDLER,
39141: ZEND_EXT_FCALL_END_SPEC_HANDLER,
39142: ZEND_EXT_FCALL_END_SPEC_HANDLER,
39143: ZEND_EXT_FCALL_END_SPEC_HANDLER,
39144: ZEND_EXT_FCALL_END_SPEC_HANDLER,
39145: ZEND_EXT_FCALL_END_SPEC_HANDLER,
39146: ZEND_EXT_FCALL_END_SPEC_HANDLER,
39147: ZEND_EXT_FCALL_END_SPEC_HANDLER,
39148: ZEND_EXT_FCALL_END_SPEC_HANDLER,
39149: ZEND_EXT_FCALL_END_SPEC_HANDLER,
39150: ZEND_EXT_FCALL_END_SPEC_HANDLER,
39151: ZEND_EXT_FCALL_END_SPEC_HANDLER,
39152: ZEND_EXT_FCALL_END_SPEC_HANDLER,
39153: ZEND_EXT_FCALL_END_SPEC_HANDLER,
39154: ZEND_EXT_NOP_SPEC_HANDLER,
39155: ZEND_EXT_NOP_SPEC_HANDLER,
39156: ZEND_EXT_NOP_SPEC_HANDLER,
39157: ZEND_EXT_NOP_SPEC_HANDLER,
39158: ZEND_EXT_NOP_SPEC_HANDLER,
39159: ZEND_EXT_NOP_SPEC_HANDLER,
39160: ZEND_EXT_NOP_SPEC_HANDLER,
39161: ZEND_EXT_NOP_SPEC_HANDLER,
39162: ZEND_EXT_NOP_SPEC_HANDLER,
39163: ZEND_EXT_NOP_SPEC_HANDLER,
39164: ZEND_EXT_NOP_SPEC_HANDLER,
39165: ZEND_EXT_NOP_SPEC_HANDLER,
39166: ZEND_EXT_NOP_SPEC_HANDLER,
39167: ZEND_EXT_NOP_SPEC_HANDLER,
39168: ZEND_EXT_NOP_SPEC_HANDLER,
39169: ZEND_EXT_NOP_SPEC_HANDLER,
39170: ZEND_EXT_NOP_SPEC_HANDLER,
39171: ZEND_EXT_NOP_SPEC_HANDLER,
39172: ZEND_EXT_NOP_SPEC_HANDLER,
39173: ZEND_EXT_NOP_SPEC_HANDLER,
39174: ZEND_EXT_NOP_SPEC_HANDLER,
39175: ZEND_EXT_NOP_SPEC_HANDLER,
39176: ZEND_EXT_NOP_SPEC_HANDLER,
39177: ZEND_EXT_NOP_SPEC_HANDLER,
39178: ZEND_EXT_NOP_SPEC_HANDLER,
1.1.1.2 misho 39179: ZEND_TICKS_SPEC_HANDLER,
39180: ZEND_TICKS_SPEC_HANDLER,
39181: ZEND_TICKS_SPEC_HANDLER,
39182: ZEND_TICKS_SPEC_HANDLER,
39183: ZEND_TICKS_SPEC_HANDLER,
39184: ZEND_TICKS_SPEC_HANDLER,
39185: ZEND_TICKS_SPEC_HANDLER,
39186: ZEND_TICKS_SPEC_HANDLER,
39187: ZEND_TICKS_SPEC_HANDLER,
39188: ZEND_TICKS_SPEC_HANDLER,
39189: ZEND_TICKS_SPEC_HANDLER,
39190: ZEND_TICKS_SPEC_HANDLER,
39191: ZEND_TICKS_SPEC_HANDLER,
39192: ZEND_TICKS_SPEC_HANDLER,
39193: ZEND_TICKS_SPEC_HANDLER,
39194: ZEND_TICKS_SPEC_HANDLER,
39195: ZEND_TICKS_SPEC_HANDLER,
39196: ZEND_TICKS_SPEC_HANDLER,
39197: ZEND_TICKS_SPEC_HANDLER,
39198: ZEND_TICKS_SPEC_HANDLER,
39199: ZEND_TICKS_SPEC_HANDLER,
39200: ZEND_TICKS_SPEC_HANDLER,
39201: ZEND_TICKS_SPEC_HANDLER,
39202: ZEND_TICKS_SPEC_HANDLER,
39203: ZEND_TICKS_SPEC_HANDLER,
1.1 misho 39204: ZEND_NULL_HANDLER,
39205: ZEND_NULL_HANDLER,
39206: ZEND_NULL_HANDLER,
39207: ZEND_NULL_HANDLER,
39208: ZEND_NULL_HANDLER,
39209: ZEND_NULL_HANDLER,
39210: ZEND_NULL_HANDLER,
39211: ZEND_NULL_HANDLER,
39212: ZEND_NULL_HANDLER,
39213: ZEND_NULL_HANDLER,
39214: ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER,
39215: ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER,
39216: ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER,
39217: ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER,
39218: ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER,
39219: ZEND_NULL_HANDLER,
39220: ZEND_NULL_HANDLER,
39221: ZEND_NULL_HANDLER,
39222: ZEND_NULL_HANDLER,
39223: ZEND_NULL_HANDLER,
39224: ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER,
39225: ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER,
39226: ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER,
39227: ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER,
39228: ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER,
39229: ZEND_NULL_HANDLER,
39230: ZEND_NULL_HANDLER,
39231: ZEND_NULL_HANDLER,
39232: ZEND_NULL_HANDLER,
1.1.1.2 misho 39233: ZEND_CATCH_SPEC_CONST_CV_HANDLER,
39234: ZEND_NULL_HANDLER,
39235: ZEND_NULL_HANDLER,
39236: ZEND_NULL_HANDLER,
39237: ZEND_NULL_HANDLER,
1.1 misho 39238: ZEND_NULL_HANDLER,
39239: ZEND_NULL_HANDLER,
39240: ZEND_NULL_HANDLER,
39241: ZEND_NULL_HANDLER,
39242: ZEND_NULL_HANDLER,
39243: ZEND_NULL_HANDLER,
39244: ZEND_NULL_HANDLER,
39245: ZEND_NULL_HANDLER,
39246: ZEND_NULL_HANDLER,
39247: ZEND_NULL_HANDLER,
39248: ZEND_NULL_HANDLER,
39249: ZEND_NULL_HANDLER,
39250: ZEND_NULL_HANDLER,
39251: ZEND_NULL_HANDLER,
39252: ZEND_NULL_HANDLER,
39253: ZEND_NULL_HANDLER,
39254: ZEND_THROW_SPEC_CONST_HANDLER,
39255: ZEND_THROW_SPEC_CONST_HANDLER,
39256: ZEND_THROW_SPEC_CONST_HANDLER,
39257: ZEND_THROW_SPEC_CONST_HANDLER,
39258: ZEND_THROW_SPEC_CONST_HANDLER,
39259: ZEND_THROW_SPEC_TMP_HANDLER,
39260: ZEND_THROW_SPEC_TMP_HANDLER,
39261: ZEND_THROW_SPEC_TMP_HANDLER,
39262: ZEND_THROW_SPEC_TMP_HANDLER,
39263: ZEND_THROW_SPEC_TMP_HANDLER,
39264: ZEND_THROW_SPEC_VAR_HANDLER,
39265: ZEND_THROW_SPEC_VAR_HANDLER,
39266: ZEND_THROW_SPEC_VAR_HANDLER,
39267: ZEND_THROW_SPEC_VAR_HANDLER,
39268: ZEND_THROW_SPEC_VAR_HANDLER,
39269: ZEND_NULL_HANDLER,
39270: ZEND_NULL_HANDLER,
39271: ZEND_NULL_HANDLER,
39272: ZEND_NULL_HANDLER,
39273: ZEND_NULL_HANDLER,
39274: ZEND_THROW_SPEC_CV_HANDLER,
39275: ZEND_THROW_SPEC_CV_HANDLER,
39276: ZEND_THROW_SPEC_CV_HANDLER,
39277: ZEND_THROW_SPEC_CV_HANDLER,
39278: ZEND_THROW_SPEC_CV_HANDLER,
39279: ZEND_FETCH_CLASS_SPEC_CONST_HANDLER,
39280: ZEND_FETCH_CLASS_SPEC_TMP_HANDLER,
39281: ZEND_FETCH_CLASS_SPEC_VAR_HANDLER,
39282: ZEND_FETCH_CLASS_SPEC_UNUSED_HANDLER,
39283: ZEND_FETCH_CLASS_SPEC_CV_HANDLER,
39284: ZEND_FETCH_CLASS_SPEC_CONST_HANDLER,
39285: ZEND_FETCH_CLASS_SPEC_TMP_HANDLER,
39286: ZEND_FETCH_CLASS_SPEC_VAR_HANDLER,
39287: ZEND_FETCH_CLASS_SPEC_UNUSED_HANDLER,
39288: ZEND_FETCH_CLASS_SPEC_CV_HANDLER,
39289: ZEND_FETCH_CLASS_SPEC_CONST_HANDLER,
39290: ZEND_FETCH_CLASS_SPEC_TMP_HANDLER,
39291: ZEND_FETCH_CLASS_SPEC_VAR_HANDLER,
39292: ZEND_FETCH_CLASS_SPEC_UNUSED_HANDLER,
39293: ZEND_FETCH_CLASS_SPEC_CV_HANDLER,
39294: ZEND_FETCH_CLASS_SPEC_CONST_HANDLER,
39295: ZEND_FETCH_CLASS_SPEC_TMP_HANDLER,
39296: ZEND_FETCH_CLASS_SPEC_VAR_HANDLER,
39297: ZEND_FETCH_CLASS_SPEC_UNUSED_HANDLER,
39298: ZEND_FETCH_CLASS_SPEC_CV_HANDLER,
39299: ZEND_FETCH_CLASS_SPEC_CONST_HANDLER,
39300: ZEND_FETCH_CLASS_SPEC_TMP_HANDLER,
39301: ZEND_FETCH_CLASS_SPEC_VAR_HANDLER,
39302: ZEND_FETCH_CLASS_SPEC_UNUSED_HANDLER,
39303: ZEND_FETCH_CLASS_SPEC_CV_HANDLER,
39304: ZEND_CLONE_SPEC_CONST_HANDLER,
39305: ZEND_CLONE_SPEC_CONST_HANDLER,
39306: ZEND_CLONE_SPEC_CONST_HANDLER,
39307: ZEND_CLONE_SPEC_CONST_HANDLER,
39308: ZEND_CLONE_SPEC_CONST_HANDLER,
39309: ZEND_CLONE_SPEC_TMP_HANDLER,
39310: ZEND_CLONE_SPEC_TMP_HANDLER,
39311: ZEND_CLONE_SPEC_TMP_HANDLER,
39312: ZEND_CLONE_SPEC_TMP_HANDLER,
39313: ZEND_CLONE_SPEC_TMP_HANDLER,
39314: ZEND_CLONE_SPEC_VAR_HANDLER,
39315: ZEND_CLONE_SPEC_VAR_HANDLER,
39316: ZEND_CLONE_SPEC_VAR_HANDLER,
39317: ZEND_CLONE_SPEC_VAR_HANDLER,
39318: ZEND_CLONE_SPEC_VAR_HANDLER,
39319: ZEND_CLONE_SPEC_UNUSED_HANDLER,
39320: ZEND_CLONE_SPEC_UNUSED_HANDLER,
39321: ZEND_CLONE_SPEC_UNUSED_HANDLER,
39322: ZEND_CLONE_SPEC_UNUSED_HANDLER,
39323: ZEND_CLONE_SPEC_UNUSED_HANDLER,
39324: ZEND_CLONE_SPEC_CV_HANDLER,
39325: ZEND_CLONE_SPEC_CV_HANDLER,
39326: ZEND_CLONE_SPEC_CV_HANDLER,
39327: ZEND_CLONE_SPEC_CV_HANDLER,
39328: ZEND_CLONE_SPEC_CV_HANDLER,
1.1.1.2 misho 39329: ZEND_RETURN_BY_REF_SPEC_CONST_HANDLER,
39330: ZEND_RETURN_BY_REF_SPEC_CONST_HANDLER,
39331: ZEND_RETURN_BY_REF_SPEC_CONST_HANDLER,
39332: ZEND_RETURN_BY_REF_SPEC_CONST_HANDLER,
39333: ZEND_RETURN_BY_REF_SPEC_CONST_HANDLER,
39334: ZEND_RETURN_BY_REF_SPEC_TMP_HANDLER,
39335: ZEND_RETURN_BY_REF_SPEC_TMP_HANDLER,
39336: ZEND_RETURN_BY_REF_SPEC_TMP_HANDLER,
39337: ZEND_RETURN_BY_REF_SPEC_TMP_HANDLER,
39338: ZEND_RETURN_BY_REF_SPEC_TMP_HANDLER,
39339: ZEND_RETURN_BY_REF_SPEC_VAR_HANDLER,
39340: ZEND_RETURN_BY_REF_SPEC_VAR_HANDLER,
39341: ZEND_RETURN_BY_REF_SPEC_VAR_HANDLER,
39342: ZEND_RETURN_BY_REF_SPEC_VAR_HANDLER,
39343: ZEND_RETURN_BY_REF_SPEC_VAR_HANDLER,
1.1 misho 39344: ZEND_NULL_HANDLER,
39345: ZEND_NULL_HANDLER,
39346: ZEND_NULL_HANDLER,
39347: ZEND_NULL_HANDLER,
39348: ZEND_NULL_HANDLER,
1.1.1.2 misho 39349: ZEND_RETURN_BY_REF_SPEC_CV_HANDLER,
39350: ZEND_RETURN_BY_REF_SPEC_CV_HANDLER,
39351: ZEND_RETURN_BY_REF_SPEC_CV_HANDLER,
39352: ZEND_RETURN_BY_REF_SPEC_CV_HANDLER,
39353: ZEND_RETURN_BY_REF_SPEC_CV_HANDLER,
1.1 misho 39354: ZEND_NULL_HANDLER,
39355: ZEND_NULL_HANDLER,
39356: ZEND_NULL_HANDLER,
39357: ZEND_NULL_HANDLER,
39358: ZEND_NULL_HANDLER,
39359: ZEND_INIT_METHOD_CALL_SPEC_TMP_CONST_HANDLER,
39360: ZEND_INIT_METHOD_CALL_SPEC_TMP_TMP_HANDLER,
39361: ZEND_INIT_METHOD_CALL_SPEC_TMP_VAR_HANDLER,
39362: ZEND_NULL_HANDLER,
39363: ZEND_INIT_METHOD_CALL_SPEC_TMP_CV_HANDLER,
39364: ZEND_INIT_METHOD_CALL_SPEC_VAR_CONST_HANDLER,
39365: ZEND_INIT_METHOD_CALL_SPEC_VAR_TMP_HANDLER,
39366: ZEND_INIT_METHOD_CALL_SPEC_VAR_VAR_HANDLER,
39367: ZEND_NULL_HANDLER,
39368: ZEND_INIT_METHOD_CALL_SPEC_VAR_CV_HANDLER,
39369: ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CONST_HANDLER,
39370: ZEND_INIT_METHOD_CALL_SPEC_UNUSED_TMP_HANDLER,
39371: ZEND_INIT_METHOD_CALL_SPEC_UNUSED_VAR_HANDLER,
39372: ZEND_NULL_HANDLER,
39373: ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CV_HANDLER,
39374: ZEND_INIT_METHOD_CALL_SPEC_CV_CONST_HANDLER,
39375: ZEND_INIT_METHOD_CALL_SPEC_CV_TMP_HANDLER,
39376: ZEND_INIT_METHOD_CALL_SPEC_CV_VAR_HANDLER,
39377: ZEND_NULL_HANDLER,
39378: ZEND_INIT_METHOD_CALL_SPEC_CV_CV_HANDLER,
39379: ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CONST_HANDLER,
39380: ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_TMP_HANDLER,
39381: ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_VAR_HANDLER,
39382: ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_UNUSED_HANDLER,
39383: ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CV_HANDLER,
39384: ZEND_NULL_HANDLER,
39385: ZEND_NULL_HANDLER,
39386: ZEND_NULL_HANDLER,
39387: ZEND_NULL_HANDLER,
39388: ZEND_NULL_HANDLER,
39389: ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CONST_HANDLER,
39390: ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_TMP_HANDLER,
39391: ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_VAR_HANDLER,
39392: ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_UNUSED_HANDLER,
39393: ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CV_HANDLER,
39394: ZEND_NULL_HANDLER,
39395: ZEND_NULL_HANDLER,
39396: ZEND_NULL_HANDLER,
39397: ZEND_NULL_HANDLER,
39398: ZEND_NULL_HANDLER,
39399: ZEND_NULL_HANDLER,
39400: ZEND_NULL_HANDLER,
39401: ZEND_NULL_HANDLER,
39402: ZEND_NULL_HANDLER,
39403: ZEND_NULL_HANDLER,
1.1.1.2 misho 39404: ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_CONST_HANDLER,
39405: ZEND_NULL_HANDLER,
39406: ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_VAR_HANDLER,
39407: ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_UNUSED_HANDLER,
39408: ZEND_NULL_HANDLER,
39409: ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_CONST_HANDLER,
1.1 misho 39410: ZEND_NULL_HANDLER,
1.1.1.2 misho 39411: ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_VAR_HANDLER,
39412: ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_UNUSED_HANDLER,
1.1 misho 39413: ZEND_NULL_HANDLER,
1.1.1.2 misho 39414: ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_CONST_HANDLER,
1.1 misho 39415: ZEND_NULL_HANDLER,
1.1.1.2 misho 39416: ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_VAR_HANDLER,
39417: ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_UNUSED_HANDLER,
1.1 misho 39418: ZEND_NULL_HANDLER,
39419: ZEND_NULL_HANDLER,
1.1.1.2 misho 39420: ZEND_NULL_HANDLER,
39421: ZEND_NULL_HANDLER,
39422: ZEND_NULL_HANDLER,
39423: ZEND_NULL_HANDLER,
39424: ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_CONST_HANDLER,
39425: ZEND_NULL_HANDLER,
39426: ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_VAR_HANDLER,
39427: ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_UNUSED_HANDLER,
39428: ZEND_NULL_HANDLER,
1.1 misho 39429: ZEND_NULL_HANDLER,
39430: ZEND_NULL_HANDLER,
39431: ZEND_NULL_HANDLER,
39432: ZEND_NULL_HANDLER,
39433: ZEND_NULL_HANDLER,
39434: ZEND_NULL_HANDLER,
39435: ZEND_NULL_HANDLER,
39436: ZEND_NULL_HANDLER,
39437: ZEND_NULL_HANDLER,
39438: ZEND_NULL_HANDLER,
39439: ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_VAR_CONST_HANDLER,
39440: ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_VAR_TMP_HANDLER,
39441: ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_VAR_VAR_HANDLER,
39442: ZEND_NULL_HANDLER,
39443: ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_VAR_CV_HANDLER,
39444: ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_UNUSED_CONST_HANDLER,
39445: ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_UNUSED_TMP_HANDLER,
39446: ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_UNUSED_VAR_HANDLER,
39447: ZEND_NULL_HANDLER,
39448: ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_UNUSED_CV_HANDLER,
39449: ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_CONST_HANDLER,
39450: ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_TMP_HANDLER,
39451: ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_VAR_HANDLER,
39452: ZEND_NULL_HANDLER,
39453: ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_CV_HANDLER,
39454: ZEND_NULL_HANDLER,
39455: ZEND_NULL_HANDLER,
39456: ZEND_NULL_HANDLER,
39457: ZEND_NULL_HANDLER,
39458: ZEND_NULL_HANDLER,
39459: ZEND_NULL_HANDLER,
39460: ZEND_NULL_HANDLER,
39461: ZEND_NULL_HANDLER,
39462: ZEND_NULL_HANDLER,
39463: ZEND_NULL_HANDLER,
39464: ZEND_NULL_HANDLER,
39465: ZEND_NULL_HANDLER,
39466: ZEND_NULL_HANDLER,
39467: ZEND_NULL_HANDLER,
39468: ZEND_NULL_HANDLER,
39469: ZEND_NULL_HANDLER,
39470: ZEND_NULL_HANDLER,
39471: ZEND_NULL_HANDLER,
39472: ZEND_NULL_HANDLER,
39473: ZEND_NULL_HANDLER,
39474: ZEND_NULL_HANDLER,
39475: ZEND_NULL_HANDLER,
39476: ZEND_NULL_HANDLER,
39477: ZEND_NULL_HANDLER,
39478: ZEND_NULL_HANDLER,
39479: ZEND_NULL_HANDLER,
39480: ZEND_NULL_HANDLER,
39481: ZEND_NULL_HANDLER,
39482: ZEND_NULL_HANDLER,
39483: ZEND_NULL_HANDLER,
39484: ZEND_NULL_HANDLER,
39485: ZEND_NULL_HANDLER,
39486: ZEND_NULL_HANDLER,
39487: ZEND_NULL_HANDLER,
39488: ZEND_NULL_HANDLER,
39489: ZEND_NULL_HANDLER,
39490: ZEND_NULL_HANDLER,
39491: ZEND_NULL_HANDLER,
39492: ZEND_NULL_HANDLER,
39493: ZEND_NULL_HANDLER,
39494: ZEND_NULL_HANDLER,
39495: ZEND_NULL_HANDLER,
39496: ZEND_NULL_HANDLER,
39497: ZEND_NULL_HANDLER,
39498: ZEND_NULL_HANDLER,
39499: ZEND_NULL_HANDLER,
39500: ZEND_NULL_HANDLER,
39501: ZEND_NULL_HANDLER,
39502: ZEND_NULL_HANDLER,
39503: ZEND_NULL_HANDLER,
39504: ZEND_NULL_HANDLER,
39505: ZEND_NULL_HANDLER,
39506: ZEND_NULL_HANDLER,
39507: ZEND_NULL_HANDLER,
39508: ZEND_NULL_HANDLER,
39509: ZEND_NULL_HANDLER,
39510: ZEND_NULL_HANDLER,
39511: ZEND_NULL_HANDLER,
39512: ZEND_NULL_HANDLER,
39513: ZEND_NULL_HANDLER,
39514: ZEND_NULL_HANDLER,
39515: ZEND_NULL_HANDLER,
39516: ZEND_NULL_HANDLER,
39517: ZEND_NULL_HANDLER,
39518: ZEND_NULL_HANDLER,
39519: ZEND_NULL_HANDLER,
39520: ZEND_NULL_HANDLER,
39521: ZEND_NULL_HANDLER,
39522: ZEND_NULL_HANDLER,
39523: ZEND_NULL_HANDLER,
39524: ZEND_NULL_HANDLER,
39525: ZEND_NULL_HANDLER,
39526: ZEND_NULL_HANDLER,
39527: ZEND_NULL_HANDLER,
39528: ZEND_NULL_HANDLER,
39529: ZEND_NULL_HANDLER,
39530: ZEND_NULL_HANDLER,
39531: ZEND_NULL_HANDLER,
39532: ZEND_NULL_HANDLER,
39533: ZEND_NULL_HANDLER,
39534: ZEND_NULL_HANDLER,
39535: ZEND_NULL_HANDLER,
39536: ZEND_NULL_HANDLER,
39537: ZEND_NULL_HANDLER,
39538: ZEND_NULL_HANDLER,
39539: ZEND_NULL_HANDLER,
39540: ZEND_NULL_HANDLER,
39541: ZEND_NULL_HANDLER,
39542: ZEND_NULL_HANDLER,
39543: ZEND_NULL_HANDLER,
39544: ZEND_NULL_HANDLER,
39545: ZEND_NULL_HANDLER,
39546: ZEND_NULL_HANDLER,
39547: ZEND_NULL_HANDLER,
39548: ZEND_NULL_HANDLER,
39549: ZEND_NULL_HANDLER,
39550: ZEND_NULL_HANDLER,
39551: ZEND_NULL_HANDLER,
39552: ZEND_NULL_HANDLER,
39553: ZEND_NULL_HANDLER,
39554: ZEND_NULL_HANDLER,
39555: ZEND_NULL_HANDLER,
39556: ZEND_NULL_HANDLER,
39557: ZEND_NULL_HANDLER,
39558: ZEND_NULL_HANDLER,
39559: ZEND_NULL_HANDLER,
39560: ZEND_NULL_HANDLER,
39561: ZEND_NULL_HANDLER,
39562: ZEND_NULL_HANDLER,
39563: ZEND_NULL_HANDLER,
39564: ZEND_NULL_HANDLER,
39565: ZEND_NULL_HANDLER,
39566: ZEND_NULL_HANDLER,
39567: ZEND_NULL_HANDLER,
39568: ZEND_NULL_HANDLER,
39569: ZEND_NULL_HANDLER,
39570: ZEND_NULL_HANDLER,
39571: ZEND_NULL_HANDLER,
39572: ZEND_NULL_HANDLER,
39573: ZEND_NULL_HANDLER,
39574: ZEND_NULL_HANDLER,
39575: ZEND_NULL_HANDLER,
39576: ZEND_NULL_HANDLER,
39577: ZEND_NULL_HANDLER,
39578: ZEND_NULL_HANDLER,
39579: ZEND_NULL_HANDLER,
39580: ZEND_NULL_HANDLER,
39581: ZEND_NULL_HANDLER,
39582: ZEND_NULL_HANDLER,
39583: ZEND_NULL_HANDLER,
39584: ZEND_NULL_HANDLER,
39585: ZEND_NULL_HANDLER,
39586: ZEND_NULL_HANDLER,
39587: ZEND_NULL_HANDLER,
39588: ZEND_NULL_HANDLER,
39589: ZEND_NULL_HANDLER,
39590: ZEND_NULL_HANDLER,
39591: ZEND_NULL_HANDLER,
39592: ZEND_NULL_HANDLER,
39593: ZEND_NULL_HANDLER,
39594: ZEND_NULL_HANDLER,
39595: ZEND_NULL_HANDLER,
39596: ZEND_NULL_HANDLER,
39597: ZEND_NULL_HANDLER,
39598: ZEND_NULL_HANDLER,
39599: ZEND_NULL_HANDLER,
39600: ZEND_NULL_HANDLER,
39601: ZEND_NULL_HANDLER,
39602: ZEND_NULL_HANDLER,
39603: ZEND_NULL_HANDLER,
39604: ZEND_NULL_HANDLER,
39605: ZEND_NULL_HANDLER,
39606: ZEND_NULL_HANDLER,
39607: ZEND_NULL_HANDLER,
39608: ZEND_NULL_HANDLER,
39609: ZEND_NULL_HANDLER,
39610: ZEND_NULL_HANDLER,
39611: ZEND_NULL_HANDLER,
39612: ZEND_NULL_HANDLER,
39613: ZEND_NULL_HANDLER,
39614: ZEND_NULL_HANDLER,
39615: ZEND_NULL_HANDLER,
39616: ZEND_NULL_HANDLER,
39617: ZEND_NULL_HANDLER,
39618: ZEND_NULL_HANDLER,
39619: ZEND_NULL_HANDLER,
39620: ZEND_NULL_HANDLER,
39621: ZEND_NULL_HANDLER,
39622: ZEND_NULL_HANDLER,
39623: ZEND_NULL_HANDLER,
39624: ZEND_NULL_HANDLER,
39625: ZEND_NULL_HANDLER,
39626: ZEND_NULL_HANDLER,
39627: ZEND_NULL_HANDLER,
39628: ZEND_NULL_HANDLER,
39629: ZEND_NULL_HANDLER,
39630: ZEND_NULL_HANDLER,
39631: ZEND_NULL_HANDLER,
39632: ZEND_NULL_HANDLER,
39633: ZEND_NULL_HANDLER,
39634: ZEND_NULL_HANDLER,
39635: ZEND_NULL_HANDLER,
39636: ZEND_NULL_HANDLER,
39637: ZEND_NULL_HANDLER,
39638: ZEND_NULL_HANDLER,
39639: ZEND_NULL_HANDLER,
39640: ZEND_NULL_HANDLER,
39641: ZEND_NULL_HANDLER,
39642: ZEND_NULL_HANDLER,
39643: ZEND_NULL_HANDLER,
39644: ZEND_NULL_HANDLER,
39645: ZEND_NULL_HANDLER,
39646: ZEND_NULL_HANDLER,
39647: ZEND_NULL_HANDLER,
39648: ZEND_NULL_HANDLER,
39649: ZEND_NULL_HANDLER,
39650: ZEND_NULL_HANDLER,
39651: ZEND_NULL_HANDLER,
39652: ZEND_NULL_HANDLER,
39653: ZEND_NULL_HANDLER,
39654: ZEND_NULL_HANDLER,
39655: ZEND_NULL_HANDLER,
39656: ZEND_NULL_HANDLER,
39657: ZEND_NULL_HANDLER,
39658: ZEND_NULL_HANDLER,
39659: ZEND_NULL_HANDLER,
39660: ZEND_NULL_HANDLER,
39661: ZEND_NULL_HANDLER,
39662: ZEND_NULL_HANDLER,
39663: ZEND_NULL_HANDLER,
39664: ZEND_NULL_HANDLER,
39665: ZEND_NULL_HANDLER,
39666: ZEND_NULL_HANDLER,
39667: ZEND_NULL_HANDLER,
39668: ZEND_NULL_HANDLER,
39669: ZEND_NULL_HANDLER,
39670: ZEND_NULL_HANDLER,
39671: ZEND_NULL_HANDLER,
39672: ZEND_NULL_HANDLER,
39673: ZEND_NULL_HANDLER,
39674: ZEND_NULL_HANDLER,
39675: ZEND_NULL_HANDLER,
39676: ZEND_NULL_HANDLER,
39677: ZEND_NULL_HANDLER,
39678: ZEND_NULL_HANDLER,
39679: ZEND_NULL_HANDLER,
39680: ZEND_NULL_HANDLER,
39681: ZEND_NULL_HANDLER,
39682: ZEND_NULL_HANDLER,
39683: ZEND_NULL_HANDLER,
39684: ZEND_NULL_HANDLER,
39685: ZEND_NULL_HANDLER,
39686: ZEND_NULL_HANDLER,
39687: ZEND_NULL_HANDLER,
39688: ZEND_NULL_HANDLER,
39689: ZEND_NULL_HANDLER,
39690: ZEND_NULL_HANDLER,
39691: ZEND_NULL_HANDLER,
39692: ZEND_NULL_HANDLER,
39693: ZEND_NULL_HANDLER,
39694: ZEND_NULL_HANDLER,
39695: ZEND_NULL_HANDLER,
39696: ZEND_NULL_HANDLER,
39697: ZEND_NULL_HANDLER,
39698: ZEND_NULL_HANDLER,
39699: ZEND_NULL_HANDLER,
39700: ZEND_NULL_HANDLER,
39701: ZEND_NULL_HANDLER,
39702: ZEND_NULL_HANDLER,
39703: ZEND_NULL_HANDLER,
39704: ZEND_NULL_HANDLER,
39705: ZEND_NULL_HANDLER,
39706: ZEND_NULL_HANDLER,
39707: ZEND_NULL_HANDLER,
39708: ZEND_NULL_HANDLER,
39709: ZEND_NULL_HANDLER,
39710: ZEND_NULL_HANDLER,
39711: ZEND_NULL_HANDLER,
39712: ZEND_NULL_HANDLER,
39713: ZEND_NULL_HANDLER,
39714: ZEND_NULL_HANDLER,
39715: ZEND_NULL_HANDLER,
39716: ZEND_NULL_HANDLER,
39717: ZEND_NULL_HANDLER,
39718: ZEND_NULL_HANDLER,
39719: ZEND_NULL_HANDLER,
39720: ZEND_NULL_HANDLER,
39721: ZEND_NULL_HANDLER,
39722: ZEND_NULL_HANDLER,
39723: ZEND_NULL_HANDLER,
39724: ZEND_NULL_HANDLER,
39725: ZEND_NULL_HANDLER,
39726: ZEND_NULL_HANDLER,
39727: ZEND_NULL_HANDLER,
39728: ZEND_NULL_HANDLER,
39729: ZEND_NULL_HANDLER,
39730: ZEND_NULL_HANDLER,
39731: ZEND_NULL_HANDLER,
39732: ZEND_NULL_HANDLER,
39733: ZEND_NULL_HANDLER,
39734: ZEND_NULL_HANDLER,
39735: ZEND_NULL_HANDLER,
39736: ZEND_NULL_HANDLER,
39737: ZEND_NULL_HANDLER,
39738: ZEND_NULL_HANDLER,
39739: ZEND_NULL_HANDLER,
39740: ZEND_NULL_HANDLER,
39741: ZEND_NULL_HANDLER,
39742: ZEND_NULL_HANDLER,
39743: ZEND_NULL_HANDLER,
39744: ZEND_NULL_HANDLER,
39745: ZEND_NULL_HANDLER,
39746: ZEND_NULL_HANDLER,
39747: ZEND_NULL_HANDLER,
39748: ZEND_NULL_HANDLER,
39749: ZEND_NULL_HANDLER,
39750: ZEND_NULL_HANDLER,
39751: ZEND_NULL_HANDLER,
39752: ZEND_NULL_HANDLER,
39753: ZEND_NULL_HANDLER,
39754: ZEND_NULL_HANDLER,
39755: ZEND_NULL_HANDLER,
39756: ZEND_NULL_HANDLER,
39757: ZEND_NULL_HANDLER,
39758: ZEND_NULL_HANDLER,
39759: ZEND_NULL_HANDLER,
39760: ZEND_NULL_HANDLER,
39761: ZEND_NULL_HANDLER,
39762: ZEND_NULL_HANDLER,
39763: ZEND_NULL_HANDLER,
39764: ZEND_NULL_HANDLER,
39765: ZEND_NULL_HANDLER,
39766: ZEND_NULL_HANDLER,
39767: ZEND_NULL_HANDLER,
39768: ZEND_NULL_HANDLER,
39769: ZEND_NULL_HANDLER,
39770: ZEND_NULL_HANDLER,
39771: ZEND_NULL_HANDLER,
39772: ZEND_NULL_HANDLER,
39773: ZEND_NULL_HANDLER,
39774: ZEND_NULL_HANDLER,
39775: ZEND_NULL_HANDLER,
39776: ZEND_NULL_HANDLER,
39777: ZEND_NULL_HANDLER,
39778: ZEND_NULL_HANDLER,
39779: ZEND_NULL_HANDLER,
39780: ZEND_NULL_HANDLER,
39781: ZEND_NULL_HANDLER,
39782: ZEND_NULL_HANDLER,
39783: ZEND_NULL_HANDLER,
39784: ZEND_NULL_HANDLER,
39785: ZEND_NULL_HANDLER,
39786: ZEND_NULL_HANDLER,
39787: ZEND_NULL_HANDLER,
39788: ZEND_NULL_HANDLER,
39789: ZEND_NULL_HANDLER,
39790: ZEND_NULL_HANDLER,
39791: ZEND_NULL_HANDLER,
39792: ZEND_NULL_HANDLER,
39793: ZEND_NULL_HANDLER,
39794: ZEND_NULL_HANDLER,
39795: ZEND_NULL_HANDLER,
39796: ZEND_NULL_HANDLER,
39797: ZEND_NULL_HANDLER,
39798: ZEND_NULL_HANDLER,
39799: ZEND_NULL_HANDLER,
39800: ZEND_NULL_HANDLER,
39801: ZEND_NULL_HANDLER,
39802: ZEND_NULL_HANDLER,
39803: ZEND_NULL_HANDLER,
39804: ZEND_NULL_HANDLER,
39805: ZEND_NULL_HANDLER,
39806: ZEND_NULL_HANDLER,
39807: ZEND_NULL_HANDLER,
39808: ZEND_NULL_HANDLER,
39809: ZEND_NULL_HANDLER,
39810: ZEND_NULL_HANDLER,
39811: ZEND_NULL_HANDLER,
39812: ZEND_NULL_HANDLER,
39813: ZEND_NULL_HANDLER,
39814: ZEND_NULL_HANDLER,
39815: ZEND_NULL_HANDLER,
39816: ZEND_NULL_HANDLER,
39817: ZEND_NULL_HANDLER,
39818: ZEND_NULL_HANDLER,
39819: ZEND_NULL_HANDLER,
39820: ZEND_NULL_HANDLER,
39821: ZEND_NULL_HANDLER,
39822: ZEND_NULL_HANDLER,
39823: ZEND_NULL_HANDLER,
39824: ZEND_NULL_HANDLER,
39825: ZEND_NULL_HANDLER,
39826: ZEND_NULL_HANDLER,
39827: ZEND_NULL_HANDLER,
39828: ZEND_NULL_HANDLER,
39829: ZEND_NULL_HANDLER,
39830: ZEND_NULL_HANDLER,
39831: ZEND_NULL_HANDLER,
39832: ZEND_NULL_HANDLER,
39833: ZEND_NULL_HANDLER,
39834: ZEND_NULL_HANDLER,
39835: ZEND_NULL_HANDLER,
39836: ZEND_NULL_HANDLER,
39837: ZEND_NULL_HANDLER,
39838: ZEND_NULL_HANDLER,
39839: ZEND_NULL_HANDLER,
39840: ZEND_NULL_HANDLER,
39841: ZEND_NULL_HANDLER,
39842: ZEND_NULL_HANDLER,
39843: ZEND_NULL_HANDLER,
39844: ZEND_NULL_HANDLER,
39845: ZEND_NULL_HANDLER,
39846: ZEND_NULL_HANDLER,
39847: ZEND_NULL_HANDLER,
39848: ZEND_NULL_HANDLER,
39849: ZEND_NULL_HANDLER,
39850: ZEND_NULL_HANDLER,
39851: ZEND_NULL_HANDLER,
39852: ZEND_NULL_HANDLER,
39853: ZEND_NULL_HANDLER,
39854: ZEND_NULL_HANDLER,
39855: ZEND_NULL_HANDLER,
39856: ZEND_NULL_HANDLER,
39857: ZEND_NULL_HANDLER,
39858: ZEND_NULL_HANDLER,
39859: ZEND_NULL_HANDLER,
39860: ZEND_NULL_HANDLER,
39861: ZEND_NULL_HANDLER,
39862: ZEND_NULL_HANDLER,
39863: ZEND_NULL_HANDLER,
39864: ZEND_PRE_INC_OBJ_SPEC_VAR_CONST_HANDLER,
39865: ZEND_PRE_INC_OBJ_SPEC_VAR_TMP_HANDLER,
39866: ZEND_PRE_INC_OBJ_SPEC_VAR_VAR_HANDLER,
39867: ZEND_NULL_HANDLER,
39868: ZEND_PRE_INC_OBJ_SPEC_VAR_CV_HANDLER,
39869: ZEND_PRE_INC_OBJ_SPEC_UNUSED_CONST_HANDLER,
39870: ZEND_PRE_INC_OBJ_SPEC_UNUSED_TMP_HANDLER,
39871: ZEND_PRE_INC_OBJ_SPEC_UNUSED_VAR_HANDLER,
39872: ZEND_NULL_HANDLER,
39873: ZEND_PRE_INC_OBJ_SPEC_UNUSED_CV_HANDLER,
39874: ZEND_PRE_INC_OBJ_SPEC_CV_CONST_HANDLER,
39875: ZEND_PRE_INC_OBJ_SPEC_CV_TMP_HANDLER,
39876: ZEND_PRE_INC_OBJ_SPEC_CV_VAR_HANDLER,
39877: ZEND_NULL_HANDLER,
39878: ZEND_PRE_INC_OBJ_SPEC_CV_CV_HANDLER,
39879: ZEND_NULL_HANDLER,
39880: ZEND_NULL_HANDLER,
39881: ZEND_NULL_HANDLER,
39882: ZEND_NULL_HANDLER,
39883: ZEND_NULL_HANDLER,
39884: ZEND_NULL_HANDLER,
39885: ZEND_NULL_HANDLER,
39886: ZEND_NULL_HANDLER,
39887: ZEND_NULL_HANDLER,
39888: ZEND_NULL_HANDLER,
39889: ZEND_PRE_DEC_OBJ_SPEC_VAR_CONST_HANDLER,
39890: ZEND_PRE_DEC_OBJ_SPEC_VAR_TMP_HANDLER,
39891: ZEND_PRE_DEC_OBJ_SPEC_VAR_VAR_HANDLER,
39892: ZEND_NULL_HANDLER,
39893: ZEND_PRE_DEC_OBJ_SPEC_VAR_CV_HANDLER,
39894: ZEND_PRE_DEC_OBJ_SPEC_UNUSED_CONST_HANDLER,
39895: ZEND_PRE_DEC_OBJ_SPEC_UNUSED_TMP_HANDLER,
39896: ZEND_PRE_DEC_OBJ_SPEC_UNUSED_VAR_HANDLER,
39897: ZEND_NULL_HANDLER,
39898: ZEND_PRE_DEC_OBJ_SPEC_UNUSED_CV_HANDLER,
39899: ZEND_PRE_DEC_OBJ_SPEC_CV_CONST_HANDLER,
39900: ZEND_PRE_DEC_OBJ_SPEC_CV_TMP_HANDLER,
39901: ZEND_PRE_DEC_OBJ_SPEC_CV_VAR_HANDLER,
39902: ZEND_NULL_HANDLER,
39903: ZEND_PRE_DEC_OBJ_SPEC_CV_CV_HANDLER,
39904: ZEND_NULL_HANDLER,
39905: ZEND_NULL_HANDLER,
39906: ZEND_NULL_HANDLER,
39907: ZEND_NULL_HANDLER,
39908: ZEND_NULL_HANDLER,
39909: ZEND_NULL_HANDLER,
39910: ZEND_NULL_HANDLER,
39911: ZEND_NULL_HANDLER,
39912: ZEND_NULL_HANDLER,
39913: ZEND_NULL_HANDLER,
39914: ZEND_POST_INC_OBJ_SPEC_VAR_CONST_HANDLER,
39915: ZEND_POST_INC_OBJ_SPEC_VAR_TMP_HANDLER,
39916: ZEND_POST_INC_OBJ_SPEC_VAR_VAR_HANDLER,
39917: ZEND_NULL_HANDLER,
39918: ZEND_POST_INC_OBJ_SPEC_VAR_CV_HANDLER,
39919: ZEND_POST_INC_OBJ_SPEC_UNUSED_CONST_HANDLER,
39920: ZEND_POST_INC_OBJ_SPEC_UNUSED_TMP_HANDLER,
39921: ZEND_POST_INC_OBJ_SPEC_UNUSED_VAR_HANDLER,
39922: ZEND_NULL_HANDLER,
39923: ZEND_POST_INC_OBJ_SPEC_UNUSED_CV_HANDLER,
39924: ZEND_POST_INC_OBJ_SPEC_CV_CONST_HANDLER,
39925: ZEND_POST_INC_OBJ_SPEC_CV_TMP_HANDLER,
39926: ZEND_POST_INC_OBJ_SPEC_CV_VAR_HANDLER,
39927: ZEND_NULL_HANDLER,
39928: ZEND_POST_INC_OBJ_SPEC_CV_CV_HANDLER,
39929: ZEND_NULL_HANDLER,
39930: ZEND_NULL_HANDLER,
39931: ZEND_NULL_HANDLER,
39932: ZEND_NULL_HANDLER,
39933: ZEND_NULL_HANDLER,
39934: ZEND_NULL_HANDLER,
39935: ZEND_NULL_HANDLER,
39936: ZEND_NULL_HANDLER,
39937: ZEND_NULL_HANDLER,
39938: ZEND_NULL_HANDLER,
39939: ZEND_POST_DEC_OBJ_SPEC_VAR_CONST_HANDLER,
39940: ZEND_POST_DEC_OBJ_SPEC_VAR_TMP_HANDLER,
39941: ZEND_POST_DEC_OBJ_SPEC_VAR_VAR_HANDLER,
39942: ZEND_NULL_HANDLER,
39943: ZEND_POST_DEC_OBJ_SPEC_VAR_CV_HANDLER,
39944: ZEND_POST_DEC_OBJ_SPEC_UNUSED_CONST_HANDLER,
39945: ZEND_POST_DEC_OBJ_SPEC_UNUSED_TMP_HANDLER,
39946: ZEND_POST_DEC_OBJ_SPEC_UNUSED_VAR_HANDLER,
39947: ZEND_NULL_HANDLER,
39948: ZEND_POST_DEC_OBJ_SPEC_UNUSED_CV_HANDLER,
39949: ZEND_POST_DEC_OBJ_SPEC_CV_CONST_HANDLER,
39950: ZEND_POST_DEC_OBJ_SPEC_CV_TMP_HANDLER,
39951: ZEND_POST_DEC_OBJ_SPEC_CV_VAR_HANDLER,
39952: ZEND_NULL_HANDLER,
39953: ZEND_POST_DEC_OBJ_SPEC_CV_CV_HANDLER,
39954: ZEND_NULL_HANDLER,
39955: ZEND_NULL_HANDLER,
39956: ZEND_NULL_HANDLER,
39957: ZEND_NULL_HANDLER,
39958: ZEND_NULL_HANDLER,
39959: ZEND_NULL_HANDLER,
39960: ZEND_NULL_HANDLER,
39961: ZEND_NULL_HANDLER,
39962: ZEND_NULL_HANDLER,
39963: ZEND_NULL_HANDLER,
39964: ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_HANDLER,
39965: ZEND_ASSIGN_OBJ_SPEC_VAR_TMP_HANDLER,
39966: ZEND_ASSIGN_OBJ_SPEC_VAR_VAR_HANDLER,
39967: ZEND_NULL_HANDLER,
39968: ZEND_ASSIGN_OBJ_SPEC_VAR_CV_HANDLER,
39969: ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_HANDLER,
39970: ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMP_HANDLER,
39971: ZEND_ASSIGN_OBJ_SPEC_UNUSED_VAR_HANDLER,
39972: ZEND_NULL_HANDLER,
39973: ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_HANDLER,
39974: ZEND_ASSIGN_OBJ_SPEC_CV_CONST_HANDLER,
39975: ZEND_ASSIGN_OBJ_SPEC_CV_TMP_HANDLER,
39976: ZEND_ASSIGN_OBJ_SPEC_CV_VAR_HANDLER,
39977: ZEND_NULL_HANDLER,
39978: ZEND_ASSIGN_OBJ_SPEC_CV_CV_HANDLER,
39979: ZEND_NULL_HANDLER,
39980: ZEND_NULL_HANDLER,
39981: ZEND_NULL_HANDLER,
39982: ZEND_NULL_HANDLER,
39983: ZEND_NULL_HANDLER,
39984: ZEND_NULL_HANDLER,
39985: ZEND_NULL_HANDLER,
39986: ZEND_NULL_HANDLER,
39987: ZEND_NULL_HANDLER,
39988: ZEND_NULL_HANDLER,
39989: ZEND_NULL_HANDLER,
39990: ZEND_NULL_HANDLER,
39991: ZEND_NULL_HANDLER,
39992: ZEND_NULL_HANDLER,
39993: ZEND_NULL_HANDLER,
39994: ZEND_NULL_HANDLER,
39995: ZEND_NULL_HANDLER,
39996: ZEND_NULL_HANDLER,
39997: ZEND_NULL_HANDLER,
39998: ZEND_NULL_HANDLER,
39999: ZEND_NULL_HANDLER,
40000: ZEND_NULL_HANDLER,
40001: ZEND_NULL_HANDLER,
40002: ZEND_NULL_HANDLER,
40003: ZEND_NULL_HANDLER,
40004: ZEND_NULL_HANDLER,
40005: ZEND_NULL_HANDLER,
40006: ZEND_NULL_HANDLER,
40007: ZEND_NULL_HANDLER,
40008: ZEND_NULL_HANDLER,
40009: ZEND_INSTANCEOF_SPEC_TMP_HANDLER,
40010: ZEND_INSTANCEOF_SPEC_TMP_HANDLER,
40011: ZEND_INSTANCEOF_SPEC_TMP_HANDLER,
40012: ZEND_INSTANCEOF_SPEC_TMP_HANDLER,
40013: ZEND_INSTANCEOF_SPEC_TMP_HANDLER,
40014: ZEND_INSTANCEOF_SPEC_VAR_HANDLER,
40015: ZEND_INSTANCEOF_SPEC_VAR_HANDLER,
40016: ZEND_INSTANCEOF_SPEC_VAR_HANDLER,
40017: ZEND_INSTANCEOF_SPEC_VAR_HANDLER,
40018: ZEND_INSTANCEOF_SPEC_VAR_HANDLER,
40019: ZEND_NULL_HANDLER,
40020: ZEND_NULL_HANDLER,
40021: ZEND_NULL_HANDLER,
40022: ZEND_NULL_HANDLER,
40023: ZEND_NULL_HANDLER,
40024: ZEND_INSTANCEOF_SPEC_CV_HANDLER,
40025: ZEND_INSTANCEOF_SPEC_CV_HANDLER,
40026: ZEND_INSTANCEOF_SPEC_CV_HANDLER,
40027: ZEND_INSTANCEOF_SPEC_CV_HANDLER,
40028: ZEND_INSTANCEOF_SPEC_CV_HANDLER,
40029: ZEND_DECLARE_CLASS_SPEC_HANDLER,
40030: ZEND_DECLARE_CLASS_SPEC_HANDLER,
40031: ZEND_DECLARE_CLASS_SPEC_HANDLER,
40032: ZEND_DECLARE_CLASS_SPEC_HANDLER,
40033: ZEND_DECLARE_CLASS_SPEC_HANDLER,
40034: ZEND_DECLARE_CLASS_SPEC_HANDLER,
40035: ZEND_DECLARE_CLASS_SPEC_HANDLER,
40036: ZEND_DECLARE_CLASS_SPEC_HANDLER,
40037: ZEND_DECLARE_CLASS_SPEC_HANDLER,
40038: ZEND_DECLARE_CLASS_SPEC_HANDLER,
40039: ZEND_DECLARE_CLASS_SPEC_HANDLER,
40040: ZEND_DECLARE_CLASS_SPEC_HANDLER,
40041: ZEND_DECLARE_CLASS_SPEC_HANDLER,
40042: ZEND_DECLARE_CLASS_SPEC_HANDLER,
40043: ZEND_DECLARE_CLASS_SPEC_HANDLER,
40044: ZEND_DECLARE_CLASS_SPEC_HANDLER,
40045: ZEND_DECLARE_CLASS_SPEC_HANDLER,
40046: ZEND_DECLARE_CLASS_SPEC_HANDLER,
40047: ZEND_DECLARE_CLASS_SPEC_HANDLER,
40048: ZEND_DECLARE_CLASS_SPEC_HANDLER,
40049: ZEND_DECLARE_CLASS_SPEC_HANDLER,
40050: ZEND_DECLARE_CLASS_SPEC_HANDLER,
40051: ZEND_DECLARE_CLASS_SPEC_HANDLER,
40052: ZEND_DECLARE_CLASS_SPEC_HANDLER,
40053: ZEND_DECLARE_CLASS_SPEC_HANDLER,
40054: ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER,
40055: ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER,
40056: ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER,
40057: ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER,
40058: ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER,
40059: ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER,
40060: ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER,
40061: ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER,
40062: ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER,
40063: ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER,
40064: ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER,
40065: ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER,
40066: ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER,
40067: ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER,
40068: ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER,
40069: ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER,
40070: ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER,
40071: ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER,
40072: ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER,
40073: ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER,
40074: ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER,
40075: ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER,
40076: ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER,
40077: ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER,
40078: ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER,
40079: ZEND_DECLARE_FUNCTION_SPEC_HANDLER,
40080: ZEND_DECLARE_FUNCTION_SPEC_HANDLER,
40081: ZEND_DECLARE_FUNCTION_SPEC_HANDLER,
40082: ZEND_DECLARE_FUNCTION_SPEC_HANDLER,
40083: ZEND_DECLARE_FUNCTION_SPEC_HANDLER,
40084: ZEND_DECLARE_FUNCTION_SPEC_HANDLER,
40085: ZEND_DECLARE_FUNCTION_SPEC_HANDLER,
40086: ZEND_DECLARE_FUNCTION_SPEC_HANDLER,
40087: ZEND_DECLARE_FUNCTION_SPEC_HANDLER,
40088: ZEND_DECLARE_FUNCTION_SPEC_HANDLER,
40089: ZEND_DECLARE_FUNCTION_SPEC_HANDLER,
40090: ZEND_DECLARE_FUNCTION_SPEC_HANDLER,
40091: ZEND_DECLARE_FUNCTION_SPEC_HANDLER,
40092: ZEND_DECLARE_FUNCTION_SPEC_HANDLER,
40093: ZEND_DECLARE_FUNCTION_SPEC_HANDLER,
40094: ZEND_DECLARE_FUNCTION_SPEC_HANDLER,
40095: ZEND_DECLARE_FUNCTION_SPEC_HANDLER,
40096: ZEND_DECLARE_FUNCTION_SPEC_HANDLER,
40097: ZEND_DECLARE_FUNCTION_SPEC_HANDLER,
40098: ZEND_DECLARE_FUNCTION_SPEC_HANDLER,
40099: ZEND_DECLARE_FUNCTION_SPEC_HANDLER,
40100: ZEND_DECLARE_FUNCTION_SPEC_HANDLER,
40101: ZEND_DECLARE_FUNCTION_SPEC_HANDLER,
40102: ZEND_DECLARE_FUNCTION_SPEC_HANDLER,
40103: ZEND_DECLARE_FUNCTION_SPEC_HANDLER,
40104: ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER,
40105: ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER,
40106: ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER,
40107: ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER,
40108: ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER,
40109: ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER,
40110: ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER,
40111: ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER,
40112: ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER,
40113: ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER,
40114: ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER,
40115: ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER,
40116: ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER,
40117: ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER,
40118: ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER,
40119: ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER,
40120: ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER,
40121: ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER,
40122: ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER,
40123: ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER,
40124: ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER,
40125: ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER,
40126: ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER,
40127: ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER,
40128: ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER,
40129: ZEND_DECLARE_CONST_SPEC_CONST_CONST_HANDLER,
40130: ZEND_NULL_HANDLER,
40131: ZEND_NULL_HANDLER,
40132: ZEND_NULL_HANDLER,
40133: ZEND_NULL_HANDLER,
40134: ZEND_NULL_HANDLER,
40135: ZEND_NULL_HANDLER,
40136: ZEND_NULL_HANDLER,
40137: ZEND_NULL_HANDLER,
40138: ZEND_NULL_HANDLER,
40139: ZEND_NULL_HANDLER,
40140: ZEND_NULL_HANDLER,
40141: ZEND_NULL_HANDLER,
40142: ZEND_NULL_HANDLER,
40143: ZEND_NULL_HANDLER,
40144: ZEND_NULL_HANDLER,
40145: ZEND_NULL_HANDLER,
40146: ZEND_NULL_HANDLER,
40147: ZEND_NULL_HANDLER,
40148: ZEND_NULL_HANDLER,
40149: ZEND_NULL_HANDLER,
40150: ZEND_NULL_HANDLER,
40151: ZEND_NULL_HANDLER,
40152: ZEND_NULL_HANDLER,
40153: ZEND_NULL_HANDLER,
40154: ZEND_ADD_INTERFACE_SPEC_CONST_HANDLER,
40155: ZEND_NULL_HANDLER,
40156: ZEND_NULL_HANDLER,
40157: ZEND_NULL_HANDLER,
40158: ZEND_NULL_HANDLER,
40159: ZEND_ADD_INTERFACE_SPEC_CONST_HANDLER,
40160: ZEND_NULL_HANDLER,
40161: ZEND_NULL_HANDLER,
40162: ZEND_NULL_HANDLER,
40163: ZEND_NULL_HANDLER,
40164: ZEND_ADD_INTERFACE_SPEC_CONST_HANDLER,
40165: ZEND_NULL_HANDLER,
40166: ZEND_NULL_HANDLER,
40167: ZEND_NULL_HANDLER,
40168: ZEND_NULL_HANDLER,
40169: ZEND_ADD_INTERFACE_SPEC_CONST_HANDLER,
40170: ZEND_NULL_HANDLER,
40171: ZEND_NULL_HANDLER,
40172: ZEND_NULL_HANDLER,
40173: ZEND_NULL_HANDLER,
40174: ZEND_ADD_INTERFACE_SPEC_CONST_HANDLER,
40175: ZEND_NULL_HANDLER,
40176: ZEND_NULL_HANDLER,
40177: ZEND_NULL_HANDLER,
40178: ZEND_NULL_HANDLER,
40179: ZEND_DECLARE_INHERITED_CLASS_DELAYED_SPEC_HANDLER,
40180: ZEND_DECLARE_INHERITED_CLASS_DELAYED_SPEC_HANDLER,
40181: ZEND_DECLARE_INHERITED_CLASS_DELAYED_SPEC_HANDLER,
40182: ZEND_DECLARE_INHERITED_CLASS_DELAYED_SPEC_HANDLER,
40183: ZEND_DECLARE_INHERITED_CLASS_DELAYED_SPEC_HANDLER,
40184: ZEND_DECLARE_INHERITED_CLASS_DELAYED_SPEC_HANDLER,
40185: ZEND_DECLARE_INHERITED_CLASS_DELAYED_SPEC_HANDLER,
40186: ZEND_DECLARE_INHERITED_CLASS_DELAYED_SPEC_HANDLER,
40187: ZEND_DECLARE_INHERITED_CLASS_DELAYED_SPEC_HANDLER,
40188: ZEND_DECLARE_INHERITED_CLASS_DELAYED_SPEC_HANDLER,
40189: ZEND_DECLARE_INHERITED_CLASS_DELAYED_SPEC_HANDLER,
40190: ZEND_DECLARE_INHERITED_CLASS_DELAYED_SPEC_HANDLER,
40191: ZEND_DECLARE_INHERITED_CLASS_DELAYED_SPEC_HANDLER,
40192: ZEND_DECLARE_INHERITED_CLASS_DELAYED_SPEC_HANDLER,
40193: ZEND_DECLARE_INHERITED_CLASS_DELAYED_SPEC_HANDLER,
40194: ZEND_DECLARE_INHERITED_CLASS_DELAYED_SPEC_HANDLER,
40195: ZEND_DECLARE_INHERITED_CLASS_DELAYED_SPEC_HANDLER,
40196: ZEND_DECLARE_INHERITED_CLASS_DELAYED_SPEC_HANDLER,
40197: ZEND_DECLARE_INHERITED_CLASS_DELAYED_SPEC_HANDLER,
40198: ZEND_DECLARE_INHERITED_CLASS_DELAYED_SPEC_HANDLER,
40199: ZEND_DECLARE_INHERITED_CLASS_DELAYED_SPEC_HANDLER,
40200: ZEND_DECLARE_INHERITED_CLASS_DELAYED_SPEC_HANDLER,
40201: ZEND_DECLARE_INHERITED_CLASS_DELAYED_SPEC_HANDLER,
40202: ZEND_DECLARE_INHERITED_CLASS_DELAYED_SPEC_HANDLER,
40203: ZEND_DECLARE_INHERITED_CLASS_DELAYED_SPEC_HANDLER,
40204: ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER,
40205: ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER,
40206: ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER,
40207: ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER,
40208: ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER,
40209: ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER,
40210: ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER,
40211: ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER,
40212: ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER,
40213: ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER,
40214: ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER,
40215: ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER,
40216: ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER,
40217: ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER,
40218: ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER,
40219: ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER,
40220: ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER,
40221: ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER,
40222: ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER,
40223: ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER,
40224: ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER,
40225: ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER,
40226: ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER,
40227: ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER,
40228: ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER,
40229: ZEND_NULL_HANDLER,
40230: ZEND_NULL_HANDLER,
40231: ZEND_NULL_HANDLER,
40232: ZEND_NULL_HANDLER,
40233: ZEND_NULL_HANDLER,
40234: ZEND_NULL_HANDLER,
40235: ZEND_NULL_HANDLER,
40236: ZEND_NULL_HANDLER,
40237: ZEND_NULL_HANDLER,
40238: ZEND_NULL_HANDLER,
40239: ZEND_ASSIGN_DIM_SPEC_VAR_CONST_HANDLER,
40240: ZEND_ASSIGN_DIM_SPEC_VAR_TMP_HANDLER,
40241: ZEND_ASSIGN_DIM_SPEC_VAR_VAR_HANDLER,
40242: ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_HANDLER,
40243: ZEND_ASSIGN_DIM_SPEC_VAR_CV_HANDLER,
40244: ZEND_NULL_HANDLER,
40245: ZEND_NULL_HANDLER,
40246: ZEND_NULL_HANDLER,
40247: ZEND_NULL_HANDLER,
40248: ZEND_NULL_HANDLER,
40249: ZEND_ASSIGN_DIM_SPEC_CV_CONST_HANDLER,
40250: ZEND_ASSIGN_DIM_SPEC_CV_TMP_HANDLER,
40251: ZEND_ASSIGN_DIM_SPEC_CV_VAR_HANDLER,
40252: ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_HANDLER,
40253: ZEND_ASSIGN_DIM_SPEC_CV_CV_HANDLER,
40254: ZEND_NULL_HANDLER,
40255: ZEND_NULL_HANDLER,
40256: ZEND_NULL_HANDLER,
40257: ZEND_NULL_HANDLER,
40258: ZEND_NULL_HANDLER,
40259: ZEND_NULL_HANDLER,
40260: ZEND_NULL_HANDLER,
40261: ZEND_NULL_HANDLER,
40262: ZEND_NULL_HANDLER,
40263: ZEND_NULL_HANDLER,
40264: ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_VAR_CONST_HANDLER,
40265: ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_VAR_TMP_HANDLER,
40266: ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_VAR_VAR_HANDLER,
40267: ZEND_NULL_HANDLER,
40268: ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_VAR_CV_HANDLER,
40269: ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_CONST_HANDLER,
40270: ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_TMP_HANDLER,
40271: ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_VAR_HANDLER,
40272: ZEND_NULL_HANDLER,
40273: ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_CV_HANDLER,
40274: ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_CONST_HANDLER,
40275: ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_TMP_HANDLER,
40276: ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_VAR_HANDLER,
40277: ZEND_NULL_HANDLER,
40278: ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_CV_HANDLER,
40279: ZEND_HANDLE_EXCEPTION_SPEC_HANDLER,
40280: ZEND_HANDLE_EXCEPTION_SPEC_HANDLER,
40281: ZEND_HANDLE_EXCEPTION_SPEC_HANDLER,
40282: ZEND_HANDLE_EXCEPTION_SPEC_HANDLER,
40283: ZEND_HANDLE_EXCEPTION_SPEC_HANDLER,
40284: ZEND_HANDLE_EXCEPTION_SPEC_HANDLER,
40285: ZEND_HANDLE_EXCEPTION_SPEC_HANDLER,
40286: ZEND_HANDLE_EXCEPTION_SPEC_HANDLER,
40287: ZEND_HANDLE_EXCEPTION_SPEC_HANDLER,
40288: ZEND_HANDLE_EXCEPTION_SPEC_HANDLER,
40289: ZEND_HANDLE_EXCEPTION_SPEC_HANDLER,
40290: ZEND_HANDLE_EXCEPTION_SPEC_HANDLER,
40291: ZEND_HANDLE_EXCEPTION_SPEC_HANDLER,
40292: ZEND_HANDLE_EXCEPTION_SPEC_HANDLER,
40293: ZEND_HANDLE_EXCEPTION_SPEC_HANDLER,
40294: ZEND_HANDLE_EXCEPTION_SPEC_HANDLER,
40295: ZEND_HANDLE_EXCEPTION_SPEC_HANDLER,
40296: ZEND_HANDLE_EXCEPTION_SPEC_HANDLER,
40297: ZEND_HANDLE_EXCEPTION_SPEC_HANDLER,
40298: ZEND_HANDLE_EXCEPTION_SPEC_HANDLER,
40299: ZEND_HANDLE_EXCEPTION_SPEC_HANDLER,
40300: ZEND_HANDLE_EXCEPTION_SPEC_HANDLER,
40301: ZEND_HANDLE_EXCEPTION_SPEC_HANDLER,
40302: ZEND_HANDLE_EXCEPTION_SPEC_HANDLER,
40303: ZEND_HANDLE_EXCEPTION_SPEC_HANDLER,
40304: ZEND_USER_OPCODE_SPEC_HANDLER,
40305: ZEND_USER_OPCODE_SPEC_HANDLER,
40306: ZEND_USER_OPCODE_SPEC_HANDLER,
40307: ZEND_USER_OPCODE_SPEC_HANDLER,
40308: ZEND_USER_OPCODE_SPEC_HANDLER,
40309: ZEND_USER_OPCODE_SPEC_HANDLER,
40310: ZEND_USER_OPCODE_SPEC_HANDLER,
40311: ZEND_USER_OPCODE_SPEC_HANDLER,
40312: ZEND_USER_OPCODE_SPEC_HANDLER,
40313: ZEND_USER_OPCODE_SPEC_HANDLER,
40314: ZEND_USER_OPCODE_SPEC_HANDLER,
40315: ZEND_USER_OPCODE_SPEC_HANDLER,
40316: ZEND_USER_OPCODE_SPEC_HANDLER,
40317: ZEND_USER_OPCODE_SPEC_HANDLER,
40318: ZEND_USER_OPCODE_SPEC_HANDLER,
40319: ZEND_USER_OPCODE_SPEC_HANDLER,
40320: ZEND_USER_OPCODE_SPEC_HANDLER,
40321: ZEND_USER_OPCODE_SPEC_HANDLER,
40322: ZEND_USER_OPCODE_SPEC_HANDLER,
40323: ZEND_USER_OPCODE_SPEC_HANDLER,
40324: ZEND_USER_OPCODE_SPEC_HANDLER,
40325: ZEND_USER_OPCODE_SPEC_HANDLER,
40326: ZEND_USER_OPCODE_SPEC_HANDLER,
40327: ZEND_USER_OPCODE_SPEC_HANDLER,
40328: ZEND_USER_OPCODE_SPEC_HANDLER,
40329: ZEND_NULL_HANDLER,
40330: ZEND_NULL_HANDLER,
40331: ZEND_NULL_HANDLER,
40332: ZEND_NULL_HANDLER,
40333: ZEND_NULL_HANDLER,
40334: ZEND_NULL_HANDLER,
40335: ZEND_NULL_HANDLER,
40336: ZEND_NULL_HANDLER,
40337: ZEND_NULL_HANDLER,
40338: ZEND_NULL_HANDLER,
40339: ZEND_NULL_HANDLER,
40340: ZEND_NULL_HANDLER,
40341: ZEND_NULL_HANDLER,
40342: ZEND_NULL_HANDLER,
40343: ZEND_NULL_HANDLER,
40344: ZEND_NULL_HANDLER,
40345: ZEND_NULL_HANDLER,
40346: ZEND_NULL_HANDLER,
40347: ZEND_NULL_HANDLER,
40348: ZEND_NULL_HANDLER,
40349: ZEND_NULL_HANDLER,
40350: ZEND_NULL_HANDLER,
40351: ZEND_NULL_HANDLER,
40352: ZEND_NULL_HANDLER,
40353: ZEND_NULL_HANDLER,
40354: ZEND_JMP_SET_SPEC_CONST_HANDLER,
40355: ZEND_JMP_SET_SPEC_CONST_HANDLER,
40356: ZEND_JMP_SET_SPEC_CONST_HANDLER,
40357: ZEND_JMP_SET_SPEC_CONST_HANDLER,
40358: ZEND_JMP_SET_SPEC_CONST_HANDLER,
40359: ZEND_JMP_SET_SPEC_TMP_HANDLER,
40360: ZEND_JMP_SET_SPEC_TMP_HANDLER,
40361: ZEND_JMP_SET_SPEC_TMP_HANDLER,
40362: ZEND_JMP_SET_SPEC_TMP_HANDLER,
40363: ZEND_JMP_SET_SPEC_TMP_HANDLER,
40364: ZEND_JMP_SET_SPEC_VAR_HANDLER,
40365: ZEND_JMP_SET_SPEC_VAR_HANDLER,
40366: ZEND_JMP_SET_SPEC_VAR_HANDLER,
40367: ZEND_JMP_SET_SPEC_VAR_HANDLER,
40368: ZEND_JMP_SET_SPEC_VAR_HANDLER,
40369: ZEND_NULL_HANDLER,
40370: ZEND_NULL_HANDLER,
40371: ZEND_NULL_HANDLER,
40372: ZEND_NULL_HANDLER,
40373: ZEND_NULL_HANDLER,
40374: ZEND_JMP_SET_SPEC_CV_HANDLER,
40375: ZEND_JMP_SET_SPEC_CV_HANDLER,
40376: ZEND_JMP_SET_SPEC_CV_HANDLER,
40377: ZEND_JMP_SET_SPEC_CV_HANDLER,
40378: ZEND_JMP_SET_SPEC_CV_HANDLER,
40379: ZEND_NULL_HANDLER,
40380: ZEND_NULL_HANDLER,
40381: ZEND_NULL_HANDLER,
1.1.1.2 misho 40382: ZEND_DECLARE_LAMBDA_FUNCTION_SPEC_CONST_UNUSED_HANDLER,
40383: ZEND_NULL_HANDLER,
40384: ZEND_NULL_HANDLER,
40385: ZEND_NULL_HANDLER,
40386: ZEND_NULL_HANDLER,
40387: ZEND_NULL_HANDLER,
40388: ZEND_NULL_HANDLER,
40389: ZEND_NULL_HANDLER,
40390: ZEND_NULL_HANDLER,
40391: ZEND_NULL_HANDLER,
40392: ZEND_NULL_HANDLER,
40393: ZEND_NULL_HANDLER,
40394: ZEND_NULL_HANDLER,
40395: ZEND_NULL_HANDLER,
40396: ZEND_NULL_HANDLER,
40397: ZEND_NULL_HANDLER,
40398: ZEND_NULL_HANDLER,
40399: ZEND_NULL_HANDLER,
40400: ZEND_NULL_HANDLER,
40401: ZEND_NULL_HANDLER,
40402: ZEND_NULL_HANDLER,
40403: ZEND_NULL_HANDLER,
40404: ZEND_ADD_TRAIT_SPEC_HANDLER,
40405: ZEND_ADD_TRAIT_SPEC_HANDLER,
40406: ZEND_ADD_TRAIT_SPEC_HANDLER,
40407: ZEND_ADD_TRAIT_SPEC_HANDLER,
40408: ZEND_ADD_TRAIT_SPEC_HANDLER,
40409: ZEND_ADD_TRAIT_SPEC_HANDLER,
40410: ZEND_ADD_TRAIT_SPEC_HANDLER,
40411: ZEND_ADD_TRAIT_SPEC_HANDLER,
40412: ZEND_ADD_TRAIT_SPEC_HANDLER,
40413: ZEND_ADD_TRAIT_SPEC_HANDLER,
40414: ZEND_ADD_TRAIT_SPEC_HANDLER,
40415: ZEND_ADD_TRAIT_SPEC_HANDLER,
40416: ZEND_ADD_TRAIT_SPEC_HANDLER,
40417: ZEND_ADD_TRAIT_SPEC_HANDLER,
40418: ZEND_ADD_TRAIT_SPEC_HANDLER,
40419: ZEND_ADD_TRAIT_SPEC_HANDLER,
40420: ZEND_ADD_TRAIT_SPEC_HANDLER,
40421: ZEND_ADD_TRAIT_SPEC_HANDLER,
40422: ZEND_ADD_TRAIT_SPEC_HANDLER,
40423: ZEND_ADD_TRAIT_SPEC_HANDLER,
40424: ZEND_ADD_TRAIT_SPEC_HANDLER,
40425: ZEND_ADD_TRAIT_SPEC_HANDLER,
40426: ZEND_ADD_TRAIT_SPEC_HANDLER,
40427: ZEND_ADD_TRAIT_SPEC_HANDLER,
40428: ZEND_ADD_TRAIT_SPEC_HANDLER,
40429: ZEND_BIND_TRAITS_SPEC_HANDLER,
40430: ZEND_BIND_TRAITS_SPEC_HANDLER,
40431: ZEND_BIND_TRAITS_SPEC_HANDLER,
40432: ZEND_BIND_TRAITS_SPEC_HANDLER,
40433: ZEND_BIND_TRAITS_SPEC_HANDLER,
40434: ZEND_BIND_TRAITS_SPEC_HANDLER,
40435: ZEND_BIND_TRAITS_SPEC_HANDLER,
40436: ZEND_BIND_TRAITS_SPEC_HANDLER,
40437: ZEND_BIND_TRAITS_SPEC_HANDLER,
40438: ZEND_BIND_TRAITS_SPEC_HANDLER,
40439: ZEND_BIND_TRAITS_SPEC_HANDLER,
40440: ZEND_BIND_TRAITS_SPEC_HANDLER,
40441: ZEND_BIND_TRAITS_SPEC_HANDLER,
40442: ZEND_BIND_TRAITS_SPEC_HANDLER,
40443: ZEND_BIND_TRAITS_SPEC_HANDLER,
40444: ZEND_BIND_TRAITS_SPEC_HANDLER,
40445: ZEND_BIND_TRAITS_SPEC_HANDLER,
40446: ZEND_BIND_TRAITS_SPEC_HANDLER,
40447: ZEND_BIND_TRAITS_SPEC_HANDLER,
40448: ZEND_BIND_TRAITS_SPEC_HANDLER,
40449: ZEND_BIND_TRAITS_SPEC_HANDLER,
40450: ZEND_BIND_TRAITS_SPEC_HANDLER,
40451: ZEND_BIND_TRAITS_SPEC_HANDLER,
40452: ZEND_BIND_TRAITS_SPEC_HANDLER,
40453: ZEND_BIND_TRAITS_SPEC_HANDLER,
40454: ZEND_NULL_HANDLER,
40455: ZEND_NULL_HANDLER,
40456: ZEND_NULL_HANDLER,
40457: ZEND_NULL_HANDLER,
40458: ZEND_NULL_HANDLER,
40459: ZEND_NULL_HANDLER,
40460: ZEND_NULL_HANDLER,
40461: ZEND_NULL_HANDLER,
40462: ZEND_NULL_HANDLER,
40463: ZEND_NULL_HANDLER,
40464: ZEND_NULL_HANDLER,
40465: ZEND_NULL_HANDLER,
40466: ZEND_NULL_HANDLER,
40467: ZEND_SEPARATE_SPEC_VAR_UNUSED_HANDLER,
1.1 misho 40468: ZEND_NULL_HANDLER,
40469: ZEND_NULL_HANDLER,
40470: ZEND_NULL_HANDLER,
40471: ZEND_NULL_HANDLER,
40472: ZEND_NULL_HANDLER,
40473: ZEND_NULL_HANDLER,
40474: ZEND_NULL_HANDLER,
40475: ZEND_NULL_HANDLER,
40476: ZEND_NULL_HANDLER,
40477: ZEND_NULL_HANDLER,
40478: ZEND_NULL_HANDLER,
1.1.1.2 misho 40479: ZEND_QM_ASSIGN_VAR_SPEC_CONST_HANDLER,
40480: ZEND_QM_ASSIGN_VAR_SPEC_CONST_HANDLER,
40481: ZEND_QM_ASSIGN_VAR_SPEC_CONST_HANDLER,
40482: ZEND_QM_ASSIGN_VAR_SPEC_CONST_HANDLER,
40483: ZEND_QM_ASSIGN_VAR_SPEC_CONST_HANDLER,
40484: ZEND_QM_ASSIGN_VAR_SPEC_TMP_HANDLER,
40485: ZEND_QM_ASSIGN_VAR_SPEC_TMP_HANDLER,
40486: ZEND_QM_ASSIGN_VAR_SPEC_TMP_HANDLER,
40487: ZEND_QM_ASSIGN_VAR_SPEC_TMP_HANDLER,
40488: ZEND_QM_ASSIGN_VAR_SPEC_TMP_HANDLER,
40489: ZEND_QM_ASSIGN_VAR_SPEC_VAR_HANDLER,
40490: ZEND_QM_ASSIGN_VAR_SPEC_VAR_HANDLER,
40491: ZEND_QM_ASSIGN_VAR_SPEC_VAR_HANDLER,
40492: ZEND_QM_ASSIGN_VAR_SPEC_VAR_HANDLER,
40493: ZEND_QM_ASSIGN_VAR_SPEC_VAR_HANDLER,
1.1 misho 40494: ZEND_NULL_HANDLER,
40495: ZEND_NULL_HANDLER,
40496: ZEND_NULL_HANDLER,
40497: ZEND_NULL_HANDLER,
40498: ZEND_NULL_HANDLER,
1.1.1.2 misho 40499: ZEND_QM_ASSIGN_VAR_SPEC_CV_HANDLER,
40500: ZEND_QM_ASSIGN_VAR_SPEC_CV_HANDLER,
40501: ZEND_QM_ASSIGN_VAR_SPEC_CV_HANDLER,
40502: ZEND_QM_ASSIGN_VAR_SPEC_CV_HANDLER,
40503: ZEND_QM_ASSIGN_VAR_SPEC_CV_HANDLER,
40504: ZEND_JMP_SET_VAR_SPEC_CONST_HANDLER,
40505: ZEND_JMP_SET_VAR_SPEC_CONST_HANDLER,
40506: ZEND_JMP_SET_VAR_SPEC_CONST_HANDLER,
40507: ZEND_JMP_SET_VAR_SPEC_CONST_HANDLER,
40508: ZEND_JMP_SET_VAR_SPEC_CONST_HANDLER,
40509: ZEND_JMP_SET_VAR_SPEC_TMP_HANDLER,
40510: ZEND_JMP_SET_VAR_SPEC_TMP_HANDLER,
40511: ZEND_JMP_SET_VAR_SPEC_TMP_HANDLER,
40512: ZEND_JMP_SET_VAR_SPEC_TMP_HANDLER,
40513: ZEND_JMP_SET_VAR_SPEC_TMP_HANDLER,
40514: ZEND_JMP_SET_VAR_SPEC_VAR_HANDLER,
40515: ZEND_JMP_SET_VAR_SPEC_VAR_HANDLER,
40516: ZEND_JMP_SET_VAR_SPEC_VAR_HANDLER,
40517: ZEND_JMP_SET_VAR_SPEC_VAR_HANDLER,
40518: ZEND_JMP_SET_VAR_SPEC_VAR_HANDLER,
1.1 misho 40519: ZEND_NULL_HANDLER,
40520: ZEND_NULL_HANDLER,
40521: ZEND_NULL_HANDLER,
40522: ZEND_NULL_HANDLER,
40523: ZEND_NULL_HANDLER,
1.1.1.2 misho 40524: ZEND_JMP_SET_VAR_SPEC_CV_HANDLER,
40525: ZEND_JMP_SET_VAR_SPEC_CV_HANDLER,
40526: ZEND_JMP_SET_VAR_SPEC_CV_HANDLER,
40527: ZEND_JMP_SET_VAR_SPEC_CV_HANDLER,
40528: ZEND_JMP_SET_VAR_SPEC_CV_HANDLER,
1.1 misho 40529: ZEND_NULL_HANDLER
40530: };
40531: zend_opcode_handlers = (opcode_handler_t*)labels;
40532: }
40533: static opcode_handler_t zend_vm_get_opcode_handler(zend_uchar opcode, zend_op* op)
40534: {
40535: static const int zend_vm_decode[] = {
40536: _UNUSED_CODE, /* 0 */
40537: _CONST_CODE, /* 1 = IS_CONST */
40538: _TMP_CODE, /* 2 = IS_TMP_VAR */
40539: _UNUSED_CODE, /* 3 */
40540: _VAR_CODE, /* 4 = IS_VAR */
40541: _UNUSED_CODE, /* 5 */
40542: _UNUSED_CODE, /* 6 */
40543: _UNUSED_CODE, /* 7 */
40544: _UNUSED_CODE, /* 8 = IS_UNUSED */
40545: _UNUSED_CODE, /* 9 */
40546: _UNUSED_CODE, /* 10 */
40547: _UNUSED_CODE, /* 11 */
40548: _UNUSED_CODE, /* 12 */
40549: _UNUSED_CODE, /* 13 */
40550: _UNUSED_CODE, /* 14 */
40551: _UNUSED_CODE, /* 15 */
40552: _CV_CODE /* 16 = IS_CV */
40553: };
1.1.1.2 misho 40554: return zend_opcode_handlers[opcode * 25 + zend_vm_decode[op->op1_type] * 5 + zend_vm_decode[op->op2_type]];
1.1 misho 40555: }
40556:
40557: ZEND_API void zend_vm_set_opcode_handler(zend_op* op)
40558: {
40559: op->handler = zend_vm_get_opcode_handler(zend_user_opcodes[op->opcode], op);
40560: }
40561:
40562: ZEND_API int zend_do_fcall(ZEND_OPCODE_HANDLER_ARGS)
40563: {
40564: return zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
40565: }
40566:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>