pull/2372/head
alpharush 8 months ago
parent fc9416c3ec
commit db6ff6618f
  1. 2
      slither/slithir/convert.py
  2. 10
      slither/solc_parsing/slither_compilation_unit_solc.py
  3. 2
      tests/unit/core/test_source_mapping.py

@ -1209,7 +1209,7 @@ def extract_tmp_call(ins: TmpCall, contract: Optional[Contract]) -> Union[Call,
internalcall.set_expression(ins.expression)
return internalcall
raise Exception(f"Not extracted {type(ins.called)} {ins}")
raise SlithIRError(f"Not extracted {type(ins.called)} {ins}")
# endregion

@ -480,13 +480,13 @@ Please rename it, this name is reserved for Slither's internals"""
missing_inheritance = i
# Resolve immediate base contracts and attach references.
for (id, src) in contract_parser.baseContracts:
if id in contract_parser.remapping:
target = resolve_remapping_and_renaming(contract_parser, id)
for (i, src) in contract_parser.baseContracts:
if i in contract_parser.remapping:
target = resolve_remapping_and_renaming(contract_parser, i)
fathers.append(target)
target.add_reference_from_raw_source(src, self.compilation_unit)
elif id in self._contracts_by_id:
target = self._contracts_by_id[id]
elif i in self._contracts_by_id:
target = self._contracts_by_id[i]
fathers.append(target)
target.add_reference_from_raw_source(src, self.compilation_unit)
else:

@ -122,7 +122,7 @@ def test_references_user_defined_types_when_casting(solc_binary_path):
assert lines == [12, 18]
def test_source_mapping_inheritance(solc_binary_path):
def test_source_mapping_top_level_defs(solc_binary_path):
solc_path = solc_binary_path("0.8.24")
file = Path(SRC_MAPPING_TEST_ROOT, "inheritance.sol").as_posix()
slither = Slither(file, solc=solc_path)

Loading…
Cancel
Save