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

Fix slither-read-storage crash when a structure has only other structs as fields #2666

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

smonicas
Copy link
Collaborator

Fix a crash when a struct has only other structs. The size variable would not be initialized.

contract T {
  struct A {
   uint256 value;
  }

  struct T {
   A _inner;
  }

  T _t;
}
  File ".../slither/tools/read_storage/read_storage.py", line 597, in _find_struct_var_slot
    return info, type_to, slot_as_bytes, size, offset
                                         ^^^^
UnboundLocalError: cannot access local variable 'size' where it is not associated with a value

@smonicas smonicas requested a review from montyly as a code owner February 17, 2025 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant