Description
In BaseRouter, _bundleInternal(...), the tokensToCheck array is updated in tokensToCheck = _addTokenToList(token, tokensToCheck);. In _addTokenToList(...), the token is added to the array if it is not present yet, which modifies the tokensToCheck in the outer scope of the function; there is no need to return it
- when a variable is passed as memory to an internal function, the same memory location is used, solidity does not create a copy.
Recommendation
Change _addTokenToList(...) to not return anything.
Status
Addressed here: Fujicracy/fuji-v2#622