Skip to content

Commit d735ead

Browse files
committed
Simplify zend_trace_function_args_to_string
Use smart_str_extract, move variable down, remove pointless comment
1 parent 4d453c8 commit d735ead

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

Zend/zend_exceptions.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -621,18 +621,15 @@ static void _build_trace_string(smart_str *str, const HashTable *ht, uint32_t nu
621621

622622
/* {{{ Gets the function arguments printed as a string from a backtrace frame. */
623623
ZEND_API zend_string *zend_trace_function_args_to_string(const HashTable *frame) {
624-
zval *tmp;
625624
smart_str str = {0};
626-
/* init because ASan will complain */
627625
smart_str_appends(&str, "");
628626

629-
tmp = zend_hash_find_known_hash(frame, ZSTR_KNOWN(ZEND_STR_ARGS));
627+
zval *tmp = zend_hash_find_known_hash(frame, ZSTR_KNOWN(ZEND_STR_ARGS));
630628
if (tmp) {
631629
_build_trace_args_list(tmp, &str);
632630
}
633631

634-
smart_str_0(&str);
635-
return str.s ? str.s : ZSTR_EMPTY_ALLOC();
632+
return smart_str_extract(&str);
636633
}
637634
/* }}} */
638635

0 commit comments

Comments
 (0)