Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions dabi/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,21 +82,23 @@ def parse(self):
else:
old_hashes &= set(self.method_to_hash[str(method)])

if old_hashes is not None:
# If interface has explicit by_code selector, do NOT add mappings inferred from getters
has_explicit_code = bool(parsed_i['code_hashes'])
if old_hashes is not None and not has_explicit_code:
for code_hash in old_hashes:
if code_hash not in by_code_hash:
by_code_hash[code_hash] = []

by_code_hash[code_hash].append(name_of_i)
by_get_method_stats[name_of_i] += 1

# Always add explicit selector.by_code when present
for code_hash in parsed_i['code_hashes']:
if code_hash['hash'] not in by_code_hash:
by_code_hash[code_hash['hash']] = []

by_code_hash[code_hash['hash']].append(name_of_i)


by_get_method_stats[name_of_i] += 1

for i in by_code_hash:
Expand Down
Loading