-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(neverAccessedVariables): False positive on unused fields
- Loading branch information
1 parent
f237d2c
commit 8618b0c
Showing
14 changed files
with
261 additions
and
175 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"projectName": "never-accessed-2", | ||
"functions": [], | ||
"contracts": [ | ||
{ | ||
"name": "FieldTest", | ||
"methods": [ | ||
{ | ||
"name": "FieldTest.init", | ||
"cfg": { | ||
"nodes": [ | ||
{ | ||
"id": 1263, | ||
"stmtID": 16730, | ||
"srcEdges": [], | ||
"dstEdges": [] | ||
} | ||
], | ||
"edges": [] | ||
} | ||
}, | ||
{ | ||
"name": "FieldTest.use_f1", | ||
"cfg": { | ||
"nodes": [ | ||
{ | ||
"id": 1264, | ||
"stmtID": 16735, | ||
"srcEdges": [], | ||
"dstEdges": [] | ||
} | ||
], | ||
"edges": [] | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
test/contracts/never-accessed-2.tact:3:5: | ||
2 | f1: Address; | ||
> 3 | f2: Int as uint256 = 0; | ||
^ | ||
4 | | ||
Field is never used | ||
Help: Consider removing the field | ||
See: https://nowarp.github.io/docs/misti/docs/detectors/NeverAccessedVariables |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
contract FieldTest { | ||
f1: Address; | ||
f2: Int as uint256 = 0; | ||
|
||
init() { | ||
self.f1 = sender(); | ||
} | ||
|
||
get fun use_f1(): Address { | ||
return self.f1; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.