You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
function test() external view returns (uint named) {
named = 1;
// name in return parameter list indicates implicit return
}
The AST does not contain a ReturnStatement so we never create a RETURN node. We can enhance slithIR with this implicit return and change the node's type.
The text was updated successfully, but these errors were encountered:
We can enhance slithIR with this implicit return and change the node's type.
You mean change the type of the node containing the AssignmentOperation from EXPRESSION to RETURN, right?
Would this be done after parsing the function's CFG? And is it necessary that the node with the AssignmentOperation have no children?
Fix/model named returns:
Resolves issues #1450 and #1719, and includes the previously failing test from #1818, which now passes.
Creates an artificial return node iff a function has a named return variable declared in its signature. Finds all leaf nodes in the CFG which are not return nodes, and links them to the artificial return node. The return node is given an Identifier expression with a referencedDeclaration pointing to the variable declaration in the signature.
Once this return node is in place and correctly linked, subsequent analyses resolve the data dependency issue for named variables without any further changes, i.e., to Slither's IR generation. The goal being to implement the simplest solution to that problem.
The AST does not contain a
ReturnStatement
so we never create aRETURN
node. We can enhance slithIR with this implicit return and change the node's type.The text was updated successfully, but these errors were encountered: