You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Weird edge case, though this happens with uint256[50] __gap quite often.
If there are instances of shadowed vars, slither-read-storage fails to differentiate them in the storage layout.
Only the first instance of the var is printed, and it uses the last instance's slot for the length holder.
INFO:Slither-read-storage:
Contract 'DerivedContract'
BaseContract.one with type uint256 is located at slot: 0
INFO:Slither-read-storage:
Name: one
Type: uint256
Slot: 0
INFO:Slither-read-storage:
Contract 'DerivedContract'
DerivedContract.__gap with type uint256[50] is located at slot: 53 <-- ** Should be 1 **
INFO:Slither-read-storage:
Name: __gap
Type: uint256[50]
Slot: 53
INFO:Slither-read-storage:
Contract 'DerivedContract'
DerivedContract.__gap with type uint256[50] is located at slot: 53
INFO:Slither-read-storage:
Key: 0
Name: __gap
Type: uint256
Slot: 53
--- snip ---
INFO:Slither-read-storage:
Contract 'DerivedContract'
DerivedContract.__gap with type uint256[50] is located at slot: 53
INFO:Slither-read-storage:
Key: 19
Name: __gap
Type: uint256
Slot: 72
INFO:Slither-read-storage:
Contract 'DerivedContract'
BaseContract.two with type uint256 is located at slot: 51
INFO:Slither-read-storage:
Name: two
Type: uint256
Slot: 51
INFO:Slither-read-storage:
Contract 'DerivedContract'
DerivedContract.three with type uint256 is located at slot: 52
INFO:Slither-read-storage:
Name: three
Type: uint256
Slot: 52
** DerivedContract.__gap should be here with slot 53 **
INFO:Slither-read-storage:
Contract 'DerivedContract'
DerivedContract.four with type uint256 is located at slot: 103
INFO:Slither-read-storage:
Name: four
Type: uint256
Slot: 103
The text was updated successfully, but these errors were encountered:
plotchy
changed the title
[Bug-Candidate]: slither-read-storage: storage array slots miscalculated for in slot layout for shadowed vars
[Bug-Candidate]: slither-read-storage: storage array slots miscalculated in slot layout for shadowed vars
Aug 2, 2022
Describe the issue:
Weird edge case, though this happens with
uint256[50] __gap
quite often.If there are instances of shadowed vars, slither-read-storage fails to differentiate them in the storage layout.
Only the first instance of the var is printed, and it uses the last instance's slot for the length holder.
Code example to reproduce the issue:
Version:
0.8.3
Relevant log output:
The text was updated successfully, but these errors were encountered: