Repository navigation
Conversation
When the handler was NULL or not of the LY_OUT_FILEPATH type, the argument check returned NULL, the documented success value, for a change of the file path. Return ((void *)-1) for both a change and a query.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ly_out_filepath()documents "NULL if changing filepath succeeds and ((void *)-1) otherwise". When the handler is not anLY_OUT_FILEPATHone (or is NULL), the argument check logs "Invalid argument" but returns NULL for a change and(void *)-1for a query, the opposite of the documented values. The caller is told that the change succeeded, while the following output still goes to the previous target and the new file is not created.On devel f45939c:
The same happens for handlers created by
ly_out_new_fd(),ly_out_new_file()andly_out_new_clb(), and with a NULL handler. The documentation does not say which handler typesly_out_filepath()accepts; the function treats other types as an invalid argument, and for that the documented value is(void *)-1.Fix: return
(void *)-1from the argument check in both cases. A query on such a handler already returned it, so only the change case differs. The new cases intest_output_filepathfail on the current tree and pass with the fix.Tested on devel f45939c with clang 21,
-fsanitize=address,undefined,ENABLE_TESTS=ON:ctestpasses (71 tests, including the format check).