For the complete documentation index, see llms.txt. This page is also available as Markdown.

Value.forward_df()

Returns a list of all instructions following the current point in the current data flow graph

forward_df() -> APISet[Point]

The function works similarly to Instruction.forward_df(); the main difference is that in case of Instruction.forward_df() the function will return forward-dataflow point for every point in the instruction, while Value.forward_df() returns only those connected with the current Value.

Query Example

Consider the following Solidity function:

function registerDatasetProfile(string memory contributor,string memory coverage,string memory creator,string memory date,string memory description,string memory format,string memory identifier,string memory language,string memory publisher,string memory relation,string memory rights,string memory source,string memory subject,string memory title,string memory dtype)
    public returns (uint)
    {
        lastDatasetId = lastDatasetId + 1;
        datasetOwners[lastDatasetId] = msg.sender;
        emit AssignDatasetId(lastDatasetId,msg.sender);
        metadata[lastDatasetId]['contributor'] = contributor;
        metadata[lastDatasetId]['coverage'] = coverage;
         metadata[lastDatasetId]['creator'] = creator;
         metadata[lastDatasetId]['date'] = date;
         metadata[lastDatasetId]['description'] = description;
         metadata[lastDatasetId]['format'] = format;
         metadata[lastDatasetId]['identifier'] = identifier;
         metadata[lastDatasetId]['language'] = language;
         metadata[lastDatasetId]['publisher'] = publisher;
         metadata[lastDatasetId]['relation'] = relation;
         metadata[lastDatasetId]['rights'] = rights;
         metadata[lastDatasetId]['source'] = source;
         metadata[lastDatasetId]['subject'] = subject;
         metadata[lastDatasetId]['title'] = title;
         metadata[lastDatasetId]['type'] = dtype;
         
         return lastDatasetId;
    }

In this Solidity example, we want to identify where the lastDatasetId variable flows to.

To do this, we first query for the instruction that assigns the lastDatasetId variable:

We then select the lastDatasetId component, and call forward_df() to identify every point the lastDatasetId flows to.

Example Output

Last updated