Skip to content

Commit

Permalink
micro optimize hot code in clemory; see #231
Browse files Browse the repository at this point in the history
  • Loading branch information
rhelmot committed Apr 29, 2020
1 parent 4cd8f42 commit 3903726
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cle/memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ def load(self, addr, n):
"""

# concrete memory read
if self.is_concrete_target_set():
if self.concrete_target is not None:
# l.debug("invoked read_bytes %x %x" % (addr, n))
return self.concrete_target.read_memory(addr, n)

Expand All @@ -348,6 +348,8 @@ def load(self, addr, n):
if start > addr:
break
offset = addr - start
if not views and offset + n < len(backer):
return bytes(memoryview(backer)[offset:offset + n])
size = len(backer) - offset
views.append(memoryview(backer)[offset:offset + n])

Expand Down

0 comments on commit 3903726

Please sign in to comment.