crytic / crytic/slither

[Bug]: Impossible to generate IR 'NoneType' object has no attribute 'type'

Open
#1,966 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
6.4k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

### Describe the issue:

When trying to access the result of `abi.decode` without storing it in a local variable, an exception is caught and the generated IR is empty.

### Code example to reproduce the issue:
```
library A {
struct S {
int x;
}
}

contract Test {
struct T {
bytes payload;
}

function test(T calldata t) external {
int z = abi.decode(t.payload, (A.S)).x + 3;
}
}
```
### Version:

0.9.3

### Relevant log output:

```shell
ERROR:ContractSolcParsing:Impossible to generate IR for Test.test (test2.sol#13-15):
'NoneType' object has no attribute 'type'
ERROR:ContractSolcParsing:Impossible to generate IR for Test.test (test2.sol#13-15):
'NoneType' object has no attribute 'type'
INFO:Printers:Contract A
Contract Test
Function Test.test(Test.T) (*)
Expression: z = abi.decode(t.payload,(A.S)).x + 3
IRs:
Expression: ()
IRs:
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.