Open leonardoalt opened 2 years ago
This should be fixed in ControlFlowBuilder
(in libsolidity/analysis
) - it currently doesn't properly consider control flow for assembly functions.
It'd probably need a yul::Block
visit, that scans for function definitions first, registering control flow nodes for them (which entails implementing the yul::FunctionDefinition
visitor at least in a bogus manner at first, i.e. ignoring the flow, but adding a pseudo-node that covers the source range), and then connecting calls to user-defined yul functions to those nodes in the yul::FunctionCall
visit.
That way, I'd expect the regular control flow analysis to properly consider these used without any changes.
For the record: this is merely an analysis step that won't affect optimization or codegen, so it's annoying, but harmless.
The code in [1] issues the warning in [2], which is not true since the function is called.
[1]
[2]