Skip to content

RFC: Marking return values as important (#[\NoDiscard]) #17599

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Apr 2, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove useless refcounting of message in `get_nodiscard_suffix_from…
…_attribute()`
  • Loading branch information
TimWolla committed Apr 2, 2025
commit 08222df3083301946e01fa205a1faa5164b2682b
3 changes: 1 addition & 2 deletions Zend/zend_execute.c
Original file line number Diff line number Diff line change
Expand Up @@ -1942,7 +1942,7 @@ ZEND_COLD static zend_result ZEND_FASTCALL get_nodiscard_suffix_from_attribute(H
z = zend_read_property_ex(zend_ce_nodiscard, Z_OBJ_P(&obj), ZSTR_KNOWN(ZEND_STR_MESSAGE), false, NULL);
ZEND_ASSERT(z != &EG(uninitialized_zval));
if (Z_TYPE_P(z) == IS_STRING) {
message = zend_string_copy(Z_STR_P(z));
message = Z_STR_P(z);
}

/* Construct the suffix. */
Expand All @@ -1957,7 +1957,6 @@ ZEND_COLD static zend_result ZEND_FASTCALL get_nodiscard_suffix_from_attribute(H

out:

zend_string_release(message);
zval_ptr_dtor(&obj);

return result;
Expand Down