Fix TypeError exception in Python3

`va` can be None and this causes Python 3 to raise a TypeError
exception. This is caused by the following breaking change in Python3:
> The ordering comparison operators (<, <=, >=, >) raise a TypeError
> exception when the operands don’t have a meaningful natural ordering.

This didn't failed in the previously tried vivisect version (master from
one week ago and not the release). This may have been caused by a bug in
vivisect that has been fixed.
This commit is contained in:
Ana Maria Martinez Gomez
2021-02-25 10:15:49 +01:00
parent 186eba7197
commit ec558f377a

View File

@@ -488,7 +488,7 @@ def extract_insn_segment_access_features(f, bb, insn):
def get_section(vw, va): def get_section(vw, va):
for start, length, _, __ in vw.getMemoryMaps(): for start, length, _, __ in vw.getMemoryMaps():
if start <= va < start + length: if va and start <= va < start + length:
return start return start
raise KeyError(va) raise KeyError(va)