Fix the double forwarding bug in function fusion#168
Merged
TrentHouliston merged 15 commits intomainfrom Jan 2, 2025
Merged
Conversation
…y various platforms
… an lvalue right before the call. The static cast here will fix the types so rvalues become rvalues again. Also remove the exception that watchdog servicer was using and make everything use unique pointers until there is something better
…other than stored as temporaries would be gone)
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.
Function fusion technically runs std::forward on the same arguments multiple times, in theory this could mean that the second time a function gets those arguments they could have been moved away.
This one was interesting as I realised that I wasn't even forwarding the arguments all the way down. At the last level they were left as lvalue. After fixing this issue the actual bug could be fixed so that shared arguments will always be passed through as lvalues, while unique variables will only ever be sent to a single function and thus, forwarding them multiple times is fine as only one function will ever "see" the final value.