> For the complete documentation index, see [llms.txt](https://docs.r.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.r.xyz/glider-ide/api/instruction/instruction.next_instructions.md).

# Instruction.next\_instructions()

`next_instructions() →` [`APISet`](/glider-ide/api/iterables/apiset.md)`[`[`Instruction`](/glider-ide/api/instruction.md)`]`

The difference between the next\_instructions() function and [next\_instruction()](/glider-ide/api/instruction/instruction.next_instruction.md) is that this function will return all instructions following the current instruction in the CFG (control-flow-graph).

*The function is non-recursive (intra-procedural), and thus will not follow function calls; for the recursive (**inter**-procedural) variant of this function, use* [*`extended_next_instructions()`*](/glider-ide/api/instruction/instruction.next_instructions_recursive.md)*.*

For example, in the function:

```solidity
function add(uint256 a, uint256 b) internal pure returns (uint256) {
    uint256 c = a + b;
    require(c >= a, "SafeMath: addition overflow");

    return c;
  }
```

for the instruction:&#x20;

```solidity
uint256 c = a + b;
```

the function will return the instructions:

```solidity
require(c >= a, "SafeMath: addition overflow");
```

```solidity
return c;
```

### Query Example

```python
from glider import *
def query():
  instructions = Functions().with_name("sub").exec(1,1).instructions().exec(1,1)

  return instructions + list(instructions[0].next_instructions())
```

### Output Example

<figure><img src="/files/3JpPfq7O1zdVxSCYPRC0" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
The function returns APISet, instead of APIList, in case the result of the function is used as the return value of the query it must be casted to `list()`
{% endhint %}
