Skip to content

Commit 0abe772

Browse files
committed
Fixes issue 2524, Slot Calculation for Variables that Cross 32-Byte Boundaries
1 parent a77738f commit 0abe772

File tree

4 files changed

+36
-2
lines changed

4 files changed

+36
-2
lines changed

slither/tools/read_storage/read_storage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ def _find_struct_var_slot(
582582
var_type = var.type
583583
if isinstance(var_type, ElementaryType):
584584
size = var_type.size
585-
if offset >= 256:
585+
if size > (256 - offset):
586586
slot += 1
587587
offset = 0
588588
if struct_var == var.name:

0 commit comments

Comments
 (0)