Skip to content

Commit e3a6eb4

Browse files
committed
Merge branch 'dev' of github.com:crytic/slither into dev
2 parents 1301923 + 806ce71 commit e3a6eb4

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

slither/detectors/compiler_bugs/public_mapping_nested.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ def _detect(self):
7272
"""
7373
results = []
7474

75-
for p in self.compilation_unit.pragma_directives:
76-
if "0.5.0" in p.version and not "<0.5.0" in p.version:
77-
return []
75+
if self.compilation_unit.solc_version >= "0.5.0":
76+
return []
77+
7878
if self.compilation_unit.solc_version and self.compilation_unit.solc_version.startswith(
7979
"0.5."
8080
):

slither/slithir/convert.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -772,6 +772,17 @@ def extract_tmp_call(ins, contract): # pylint: disable=too-many-locals
772772
op.set_expression(ins.expression)
773773
op.call_id = ins.call_id
774774
return op
775+
776+
# For event emit through library
777+
# lib L { event E()}
778+
# ...
779+
# emit L.E();
780+
if str(ins.ori.variable_right) in [f.name for f in ins.ori.variable_left.events]:
781+
eventcall = EventCall(ins.ori.variable_right)
782+
eventcall.set_expression(ins.expression)
783+
eventcall.call_id = ins.call_id
784+
return eventcall
785+
775786
libcall = LibraryCall(
776787
ins.ori.variable_left,
777788
ins.ori.variable_right,

slither/solc_parsing/expressions/expression_parsing.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -892,7 +892,12 @@ def parse_expression(expression: Dict, caller_context: CallerContext) -> "Expres
892892
array_type = ElementaryType(type_name["attributes"]["name"])
893893
elif type_name[caller_context.get_key()] == "UserDefinedTypeName":
894894
if is_compact_ast:
895-
array_type = parse_type(UnknownType(type_name["name"]), caller_context)
895+
if "name" not in type_name:
896+
name_type = type_name["pathNode"]["name"]
897+
else:
898+
name_type = type_name["name"]
899+
900+
array_type = parse_type(UnknownType(name_type), caller_context)
896901
else:
897902
array_type = parse_type(
898903
UnknownType(type_name["attributes"]["name"]), caller_context

0 commit comments

Comments
 (0)