Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracking: imprecision of data dependencies on structures and arrays #365

Open
gakonst opened this issue Nov 10, 2019 · 3 comments
Open

Tracking: imprecision of data dependencies on structures and arrays #365

gakonst opened this issue Nov 10, 2019 · 3 comments
Labels
bug Something isn't working enhancement New feature or request tracking

Comments

@gakonst
Copy link

gakonst commented Nov 10, 2019

echo "pragma solidity ^0.5.3;

contract C {
    struct S { uint x; }

    function x() external pure returns (address) {
        S memory s;
        s.x = 1;
    }
}" > a.sol && slither a.sol

INFO:Detectors:
s in C.x() (a.sol#7) is a local variable never initialiazed
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#uninitialized-local-variables
INFO:Slither:a.sol analyzed (1 contracts with 38 detectors), 1 result(s) found

Returns that s is never initialized, when in fact we populate all of its fields in the following line
Related to #270 and #112 probably

@montyly montyly added the enhancement New feature or request label Nov 11, 2019
@montyly
Copy link
Member

montyly commented Nov 11, 2019

Hi @gakonst,

Thank you for reporting this FP.

I think it is related to the current limitation of our IR, and the way it handles structure/mapping. It should be fixed once our IR refactoring is done (#346)

@jurajpiar
Copy link

Any advance on this?

@0xalpharush 0xalpharush changed the title False positive on uninitialized local variable Tracking: imprecision of data dependencies on structures and arrays Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request tracking
Projects
None yet
Development

No branches or pull requests

4 participants