Skip to content

Commit 9676ead

Browse files
committed
Clean up zend_trace_current_function_args_string
Hoist down declaration, remove pointless comment
1 parent d735ead commit 9676ead

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

Zend/zend_exceptions.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -637,18 +637,17 @@ ZEND_API zend_string *zend_trace_function_args_to_string(const HashTable *frame)
637637
ZEND_API zend_string *zend_trace_current_function_args_string(void) {
638638
zend_string *dynamic_params = NULL;
639639
/* get a backtrace to snarf function args */
640-
zval backtrace, *first_frame;
640+
zval backtrace;
641641
zend_fetch_debug_backtrace(&backtrace, /* skip_last */ 0, /* options */ 0, /* limit */ 1);
642642
/* can fail esp if low memory condition */
643643
if (Z_TYPE(backtrace) != IS_ARRAY) {
644-
return NULL; /* don't need to free */
644+
return NULL;
645645
}
646-
first_frame = zend_hash_index_find(Z_ARRVAL(backtrace), 0);
646+
zval *first_frame = zend_hash_index_find(Z_ARRVAL(backtrace), 0);
647647
if (first_frame) {
648648
dynamic_params = zend_trace_function_args_to_string(Z_ARRVAL_P(first_frame));
649649
}
650650
zval_ptr_dtor(&backtrace);
651-
/* free the string after we use it */
652651
return dynamic_params;
653652
}
654653
/* }}} */

0 commit comments

Comments
 (0)