#2586 use enum to track variable location instead of string#2682
#2586 use enum to track variable location instead of string#2682nsiregar wants to merge 10 commits intocrytic:masterfrom
Conversation
smonicas
left a comment
There was a problem hiding this comment.
The way it's done at the moment the location value wouild still be the string that's for example why you have to use the Enum value in the comparisons. You should make the location the actual Enum when it's set which means going where set_location is called and passing the enum's variant as argument. For example myvar.set_location(VariableLocation("memory")) would set myvar's location to VariableLocation.MEMORY not "memory" the string. After that you would need to check all the places where location is used and if it's used in a comparison (like myvar.location == "memory") you need to change it to compare it against the enum variant (myvar.location == VariableLocation.MEMORY). This for both LocalVariable and StateVariable.
9ecc744 to
cc754af
Compare
cc754af to
87f2e28
Compare
# Conflicts: # slither/core/variables/variable.py
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Code reviewFound 2 issues:
Fix: Change to
slither/slither/solc_parsing/variables/state_variable.py Lines 23 to 24 in 8bc6e07 Fix: Change to Note: The correct pattern is shown in 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
No description provided.