@@ -334,120 +334,6 @@ zend_execute_data* nr_get_zend_execute_data(NR_EXECUTE_PROTO TSRMLS_DC) {
334
334
#endif
335
335
}
336
336
337
- /*
338
- * Purpose : Return a pointer to the arguments for the true frame that is
339
- * legitimate_frame_delta frames down from the top.
340
- *
341
- * Params : 1. The number of true frames to walk down. 0 means "top of stack".
342
- * The PHP5.5 half-formed stack top frame (with a null arguments
343
- * block) is ignored.
344
- *
345
- * 2. The execution context supplied by the zend engine; this changes
346
- * from PHP5.4 to PHP5.5, hence the use of macros.
347
- *
348
- * See this web page discussion migrating from 5.4 to 5.5 (July 22, 2013)
349
- * http://www.php.net/manual/en/migration55.internals.php
350
- *
351
- * If the arguments pointer is null, it represents either a half-formed frame
352
- * (or the base of the call stack). Go up one frame, and use the arguments
353
- * vector from there. The two functions appear to be identical.
354
- *
355
- * For PHP 5.4 (and presumably earlier), this additional stack frame isn't
356
- * there.
357
- *
358
- * See the picture near line 1525 of PHP 5.5.3 zend_execute.c
359
- */
360
- #if ZEND_MODULE_API_NO >= ZEND_5_5_X_API_NO && !defined(PHP7 ) \
361
- && !defined(PHP8 ) /* PHP 5.5 and 5.6 */
362
- static void * * nr_php_get_php55_stack_arguments (int legitimate_frame_delta ,
363
- NR_EXECUTE_PROTO TSRMLS_DC ) {
364
- zend_execute_data * ex ;
365
- void * * arguments ;
366
- int i ;
367
-
368
- ex = nr_get_zend_execute_data (NR_EXECUTE_ORIG_ARGS TSRMLS_CC );
369
-
370
- arguments = ex -> function_state .arguments ;
371
- if (NULL == arguments ) {
372
- ex = ex -> prev_execute_data ; /* discard top partially formed frame */
373
- }
374
-
375
- if (NULL == ex ) {
376
- return NULL ;
377
- }
378
-
379
- arguments = ex -> function_state .arguments ;
380
- if (NULL == arguments ) {
381
- return NULL ; /* PHP stack appears to be be malformed */
382
- }
383
-
384
- for (i = 0 ; i < legitimate_frame_delta ; i ++ ) {
385
- ex = ex -> prev_execute_data ;
386
- if (NULL == ex ) {
387
- return NULL ; /* No caller; we're at the bottom of the stack */
388
- }
389
- arguments = ex -> function_state .arguments ;
390
- if (NULL == arguments ) {
391
- return NULL ; /* PHP stack appears to be be malformed */
392
- }
393
- }
394
-
395
- return arguments ;
396
- }
397
- #endif
398
-
399
- #if !defined(PHP7 ) && !defined(PHP8 ) /* PHP 5.5 and 5.6 */
400
- /*
401
- * Use detailed zend specific knowledge of the interpreter stack
402
- * to read the argument vector.
403
- * Here, the 'h' suffix means "hackery".
404
- */
405
- static zval * nr_php_get_user_func_arg_via_h (int requested_arg_index ,
406
- int * arg_count_p ,
407
- NR_EXECUTE_PROTO TSRMLS_DC ) {
408
- void * * p = 0 ;
409
- zval * * argp = 0 ;
410
- zval * arg = 0 ;
411
-
412
- NR_UNUSED_SPECIALFN ;
413
-
414
- if (NULL == arg_count_p ) {
415
- return NULL ;
416
- }
417
- * arg_count_p = -1 ;
418
- if (NULL == nr_get_zend_execute_data (NR_EXECUTE_ORIG_ARGS TSRMLS_CC )) {
419
- return NULL ;
420
- }
421
-
422
- #if ZEND_MODULE_API_NO >= ZEND_5_5_X_API_NO
423
- p = nr_php_get_php55_stack_arguments (0 , NR_EXECUTE_ORIG_ARGS TSRMLS_CC );
424
- if (NULL == p ) {
425
- return NULL ;
426
- }
427
- * arg_count_p = (int )(zend_uintptr_t )* p ;
428
- #else
429
- p = nr_get_zend_execute_data (NR_EXECUTE_ORIG_ARGS TSRMLS_CC )
430
- -> function_state .arguments ;
431
- if (NULL == p ) {
432
- return NULL ;
433
- }
434
- * arg_count_p = (int )(zend_uintptr_t )* p ;
435
- #endif /* PHP >= 5.5 */
436
-
437
- if (requested_arg_index > * arg_count_p ) {
438
- return NULL ;
439
- }
440
-
441
- argp = ((zval * * )p ) - * arg_count_p + requested_arg_index - 1 ;
442
- if (NULL == argp ) {
443
- return NULL ;
444
- }
445
-
446
- arg = * argp ;
447
- return arg ;
448
- }
449
- #endif /* !PHP7 && !PHP8*/
450
-
451
337
/*
452
338
* NOTICE: requested_arg_index is a 1-based value, not a 0-based value!
453
339
*/
0 commit comments