Skip to content

Commit

Permalink
fix: mapping to type value lookup with top-level constant
Browse files Browse the repository at this point in the history
  • Loading branch information
0xalpharush committed Sep 26, 2024
1 parent 29ca19a commit fedfa6b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion slither/solc_parsing/solidity_types/type_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,9 @@ def parse_type(
t: Union[Dict, UnknownType],
caller_context: Union[CallerContextExpression, "SlitherCompilationUnitSolc"],
) -> Type:
print("parse_type")
print(t)
print(type(caller_context))
"""
caller_context can be a SlitherCompilationUnitSolc because we recursively call the function
and go up in the context's scope. If we are really lost we just go over the SlitherCompilationUnitSolc
Expand Down Expand Up @@ -293,7 +296,7 @@ def parse_type(
scope = custom_error.contract.file_scope

sl = caller_context.compilation_unit
next_context = caller_context.slither_parser
next_context = caller_context
structures_direct_access = list(scope.structures.values())
all_structuress = [c.structures for c in scope.contracts.values()]
all_structures = [item for sublist in all_structuress for item in sublist]
Expand Down Expand Up @@ -450,6 +453,7 @@ def parse_type(

if is_compact_ast:
mappingFrom = parse_type(t["keyType"], next_context)
print(type(caller_context))
mappingTo = parse_type(t["valueType"], next_context)
else:
assert len(t["children"]) == 2
Expand Down

0 comments on commit fedfa6b

Please sign in to comment.